|SCSI_ADDRESS(9S)||Data Structures for Drivers||SCSI_ADDRESS(9S)|
In the case where only the target component is used to address the device, the logical unit should be set to 0. If the SCSI target device supports logical units, then the HBA must interpret the logical units field of the data structure.
SCSI_HBA_ADDR_COMPLEXin the hba_flags argument to scsi_hba_attach_setup(9F). When the flag is set, the way this structure is used changes. While the a_hba_tran member is still accessible for accessing the scsi_hba_tran(9S) structure, the nature of addressing changes.
When using complex addressing, a particular device is addressed through a unit address which takes the shape of a string. When using complex addressing, the target and lun fields are inaccessible and instead a device driver can obtain the scsi_device(9S) structure that this address corresponds to. In the complex addressing world, this is generally a direct mapping. To obtain this structure, a driver would call the scsi_address_device(9F) function.
scsi_hba_tran_t *a_hba_tran; /* Transport vectors for the SCSI bus */ ushort_t a_target; /* SCSI target id */ uchar_t a_lun; /* SCSI logical unit */
a_hba_tran is a pointer to the controlling HBA's transport vector structure. The SCSA interface uses this field to pass any transport requests from the SCSI target device drivers to the HBA driver. This member is accessible regardless of whether the device driver uses complex addressing or not.
a_target is the target component of the SCSI address. This member is not accessible when the device driver uses complex addressing.
a_lun is the logical unit component of the SCSI address. The logical unit is used to further distinguish a SCSI target device that supports multiple logical units from one that does not. This member is not accessible when the device driver uses complex addressing.
Writing Device Drivers.
|January 29, 2022||OmniOS|