Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ scsi_hba_attach(9F) — SunOS 5.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

attach(9E)

detach(9E)

tran_tgt_init(9E)

ddi_prop_create(9F)

scsi_address(9S)

scsi_hba_tran(9S)

scsi_hba_attach(9F)

NAME

scsi_hba_attach, scsi_hba_detach − SCSI HBA attach and detach routines

SYNOPSIS

#include <sys/scsi/scsi.h>

int scsi_hba_attach(dev_info_t ∗dip, ddi_dma_lim_t ∗hba_lim,

scsi_hba_tran_t ∗hba_tran, int hba_flags, void ∗hba_options);

int scsi_hba_detach(dev_info_t ∗dip);

INTERFACE LEVEL

Solaris architecture specific (Solaris DDI). 

ARGUMENTS

dip A pointer to the dev_info_t structure, referring to the instance of the HBA device. 

hba_lim A pointer to a ddi_dma_lim(9S) structure. 

hba_tran A pointer to a scsi_hba_tran(9S) structure

hba_flags flag modifiers.  The only defined flag value is SCSI_HBA_TRAN_CLONE.

hba_options optional features provided by the HBA driver for future extensions;  must be NULL. 

DESCRIPTION

scsi_hba_attach()

scsi_hba_attach() registers the DMA limits hba_lim and the transport vectors hba_tran of each instance of the HBA device defined by dip.  The HBA driver can pass different DMA limits and transport vectors for each instance of the device, as necessary, to support any constraints imposed by the HBA itself. 

scsi_hba_attach() uses the dev_bus_ops field in the dev_ops structure. The HBA driver should initialize this field to NULL before calling scsi_hba_attach().

If SCSI_HBA_TRAN_CLONE is requested in hba_flags, the hba_tran structure will be cloned once for each target attached to the HBA.  The cloning of the structure will occur 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 structure will be the ’cloned’ scsi_hba_tran_t structure, thus allowing the HBA to use the tran_tgt_private field in the scsi_hba_tran_t structure to point to per-target data.  The HBA must take care to free only the same scsi_hba_tran_t structure it allocated when detaching; all ’cloned’ scsi_hba_tran_t structures allocated by the system will be freed by the system. 

scsi_hba_attach() attaches a number of integer-valued properties to dip, via ddi_prop_create(9F), unless properties of the same name are already attached to the node.  An HBA driver should retrieve these configuration parameters via ddi_prop_op(9F), and respect any settings for features provided the HBA. 

scsi-options optional SCSI configuration bits

SCSI_OPTIONS_DR if not set, the HBA should not grant Disconnect privileges to target devices. 

SCSI_OPTIONS_LINK if not set, the HBA should not enable Linked Commands. 

SCSI_OPTIONS_TAG if not set, the HBA should not operate in Command Tagged Queueing mode. 

SCSI_OPTIONS_FAST if not set, the HBA should not operate the bus in FAST SCSI mode. 

SCSI_OPTIONS_WIDE if not set, the HBA should not operate the bus in WIDE SCSI mode. 

scsi-reset-delay SCSI bus or device reset recovery time, in milliseconds. 

scsi_hba_detach()

scsi_hba_detach() removes the DMA limits structure and the transport vector for the given instance of an HBA driver. 

RETURN VALUES

scsi_hba_attach() and scsi_hba_detach() return DDI_SUCCESS if the function call succeeds, and returns DDI_FAILURE on failure. 

CONTEXT

scsi_hba_attach() and scsi_hba_detach() should be called from attach(9E) or detach(9E), respectively. 

NOTES

It is the HBAs responsibility to ensure that no more transport requests will be taken on behalf of any SCSI target device driver after scsi_hba_detach() is called. 

SEE ALSO

attach(9E), detach(9E), tran_tgt_init(9E), ddi_prop_create(9F), scsi_address(9S), scsi_hba_tran(9S)

Writing Device Drivers

SunOS 5.4  —  Last change: 1 Nov 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026