|SCSI_HBA_ATTACH_SETUP(9F)||Kernel Functions for Drivers||SCSI_HBA_ATTACH_SETUP(9F)|
*dip, ddi_dma_attr_t *hba_dma_attr,
scsi_hba_tran_t *hba_tran, int
scsi_hba_attach_setup() function registers the hba_dma_attr DMA attributes and the hba_tran transport vectors of each instance of the HBA device defined by dip. The HBA driver can pass different DMA attributes and the transport vectors for each instance of the device to support any constraints imposed by the HBA itself.
scsi_hba_attach_setup() function uses
the dev_bus_ops field in the
dev_ops(9S) structure. The HBA
driver should initialize this field to
SCSI_HBA_TRAN_CLONE is requested in
hba_flags, the hba_tran
structure is cloned once for each target that is attached to the HBA. The
use of this flag is deprecated, drivers should instead use
SCSI_HBA_ADDR_COMPLEX for per-target data.
The structure is cloned before the tran_tgt_init(9E) entry point is called to initialize a target. At all subsequent HBA entry points, including tran_tgt_init(9E), the scsi_hba_tran_t structure passed as an argument or found in a scsi_address(9S) structure is the cloned scsi_hba_tran_t structure, which allows the HBA to use the tran_tgt_private field in the scsi_hba_tran_t structure to point to per-target data. The HBA should free only the same scsi_hba_tran_t structure allocated when the HBA detaches. All cloned scsi_hba_tran_t structures that are allocated by the system are freed by the system.
SCSI_HBA_TRAN_SCB are only valid when
tran_setup_pkt() is used. See
information on using these flags.
to the system that this device handles more complex SCSI topologies, such as
SAS. When this flag is set, the
becomes opaque. The driver must not check it for the traditional target and
LUN values. Instead, a target and LUN are identified by a unit address which
can be retrieved using the
When operating with the flag
SCSI_HBA_ADDR_COMPLEX, the driver may associate
private data with the
scsi_device(9S) structure. This
obviates the need and complexity around using
SCSI_HBA_TRAN_CLONE flag. To get and set private
data, the driver can use the
functions. Notably, the
scsi_device_hba_private_set() function should be
used during the
tran_tgt_init(9E) entry point.
scsi_device_hba_private_get() function should
then be used during other SCSI HBA entry points. In addition, the
function now becomes available to the driver to map between the
SCSI_HBA_HBA flag indicates that the
HBA driver will only enumerate direct children which are
iport(9) instances. This mode of
operation is recommended for device drivers as it simplifies the management
of discovered devices. This flag is often used in tandem with
SCSI_HBA_ADDR_COMPLEX and is recommended for all new
SAS-based HBA drivers. For more information on the management of iports and
the use of target maps, please see
attaches a number of integer-valued properties to dip,
unless properties of the same name are already attached to the node. An HBA
driver should retrieve these configuration parameters via
respect any settings for features provided the HBA.
scsi_hba_detach() function removes the reference to the DMA attributes structure and the transport vector for the given instance of an HBA driver.
scsi_hba_attach_setup() function should be called from attach(9E). The
scsi_hba_detach() function should be called from detach(9E).
scsi_hba_detach() functions return
DDI_SUCCESSif the function call succeeds, and return
Writing Device Drivers.
scsi_hba_detach() is called.
|July 31, 2021||OmniOS|