Kernel Functions for Drivers scsihbaattachsetup(9F)
NAME
scsihbaattachsetup, scsihbaattach, scsihbadetach -
SCSI HBA attach and detach routines
SYNOPSIS
#include
int scsihbaattachsetup(devinfot *dip, ddidmaattrt *hbadmaattr,
scsihbatrant *hbatran, int hbaflags);
int scsihbaattach(devinfot *dip, ddidmalimt *hbalim,
scsihbatrant *hbatran, int hbaflags, void *hbaoptions);
int scsihbadetach(devinfot *dip);
INTERFACE LEVEL
Solaris architecture specific (Solaris DI).
PARAMETERS
dip Pointer to the devinfot structure that
refers to the instance of the HBA device.
hbalim Pointer to a ddidmalim(9S) structure.
hbatran Pointer to a scsihbatran(9S) structure.
hbaflags Flag modifiers. The defined flag values are
SCSIHBATRANCLONE, SCSIHBATRANSCB, and
SCSIHBATRANCDB.
hbaoptions Optional features provided by the HBA driver
for future extensions; must be NUL.
hbadmaattr Pointer to a ddidmaattr(9S) structure.
DESCRIPTION
The scsihbaattachsetup() function is the recommended
interface over the scsihbaattach() function.
scsihbaattachsetup() scsihbaattach()
SunOS 5.11 Last change: 30 May 2006 1
Kernel Functions for Drivers scsihbaattachsetup(9F)
The scsihbaattach() function registers the hbalim DMA
limits and the hbatran transport vectors of each instance
of the HBA device defined by dip. The
scsihbaattachsetup() function registers the hbadmaattr
DMA attributes and the hbatran transport vectors of each
instance of the HBA device defined by dip. The HBA driver
can pass different DMA limits or DMA attributes and the
transport vectors for each instance of the device to support
any constraints imposed by the HBA itself.
The scsihbaattach() and scsihbaattachsetup() functions
use the devbusops field in the devops(9S) structure. The
HBA driver should initialize this field to NUL before cal-
ling scsihbaattach() or scsihbaattachsetup().
If SCSIHBATRANCLONE is requested in hbaflags, the
hbatran structure is cloned once for each target that is
attached to the HBA. The structure is cloned before the
trantgtinit(9E) entry point is called to initialize a tar-
get. At all subsequent HBA entry points, including
trantgtinit(9E), the scsihbatrant structure passed as
an argument or found in a scsiaddress structure is the
cloned scsihbatrant structure,which allows the HBA to use
the trantgtprivate field in the scsihbatrant structure
to point to per-target data. The HBA should free only the
same scsihbatrant structure allocated when the HBA
detaches. All cloned scsihbatrant structures that are
allocated by the system are freed by the system.
The flags SCSIHBATRANCDB and SCSIHBATRANSCB are only
valid when transetuppkt() is used. See transetuppkt(9E)
for information on using these flags.
The scsihbaattach() and scsihbaattachsetup() functions
attach 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 ddipropgetint(9F), and respect any set-
tings for features provided the HBA.
scsi-options Optional SCSI configuration bits
SCSIOPTIONSDR If not set, the HBA should not
grant Disconnect privileges to
target devices.
SunOS 5.11 Last change: 30 May 2006 2
Kernel Functions for Drivers scsihbaattachsetup(9F)
SCSIOPTIONSTAG If not set, the HBA should not
operate in Command Tagged Queueing
mode.
SCSIOPTIONSPARITY If not set, the HBA should not
operate in parity mode.
SCSIOPTIONSQAS If not set, the HBA should not
make use of the Quick Arbitration
Select feature. Consult your Sun
hardware documentation to deter-
mine whether your machine supports
QAS.
SCSIOPTIONSFAST If not set, the HBA should not
operate the bus in FAST SCSI mode.
SCSIOPTIONSFAST20 If not set, the HBA should not
operate the bus in FAST20 SCSI
mode.
SCSIOPTIONSFAST40 If not set, the HBA should not
operate the bus in FAST40 SCSI
mode.
SCSIOPTIONSFAST80 If not set, the HBA should not
operate the bus in FAST80 SCSI
mode.
SCSIOPTIONSFAST160 If not set, the HBA should not
operate the bus in FAST160 SCSI
mode.
SCSIOPTIONSFAST320 If not set, the HBA should not
operate the bus in FAST320 SCSI
mode.
SCSIOPTIONSWIDE If not set, the HBA should not
operate the bus in WIDE SCSI mode.
SCSIOPTIONSYNC If not set, the HBA should not
operate the bus in synchronous
SunOS 5.11 Last change: 30 May 2006 3
Kernel Functions for Drivers scsihbaattachsetup(9F)
transfer mode.
scsi-reset-delay SCSI bus or device reset recovery
time, in milliseconds.
scsi-selection-timeout Default SCSI selection phase
timeout value, in milliseconds.
Please refer to individual HBA man
pages for any HBA-specific infor-
mation
scsihbadetach()
The scsihbadetach() function removes the reference to the
DMA limits or attributes structure and the transport vector
for the given instance of an HBA driver.
RETURN VALUES
The scsihbaattach(), scsihbaattachsetup(), and
scsihbadetach() functions return DISUCES if the func-
tion call succeeds, and return DIFAILURE on failure.
CONTEXT
The scsihbaattach() and scsihbaattachsetup() functions
should be called from attach(9E). The scsihbadetach()
function should be called from detach(9E).
SEE ALSO
attach(9E), detach(9E), transetuppkt(9E),
trantgtinit(9E), ddipropgetint(9F), ddidmaattr(9S),
ddidmalim(9S), devops(9S), scsiaddress(9S),
scsihbatran(9S)
Writing Device Drivers
NOTES
It is the HBA driver's responsibility to ensure that no more
transport requests will be taken on behalf of any SCSI tar-
get device driver after scsihbadetach() is called.
The scsihbaattach() function is obsolete and will be dis-
continued in a future release. This function is replaced by
scsihbaattachsetup().
SunOS 5.11 Last change: 30 May 2006 4
|