1scsi_hba_attach_setup(9F)Kernel Functions for Driversscsi_hba_attach_setup(9F)
2
3
4

NAME

6       scsi_hba_attach_setup,  scsi_hba_attach,  scsi_hba_detach  -  SCSI  HBA
7       attach and detach routines
8

SYNOPSIS

10       #include <sys/scsi/scsi.h>
11
12
13
14       int scsi_hba_attach_setup(dev_info_t *dip, ddi_dma_attr_t *hba_dma_attr,
15            scsi_hba_tran_t *hba_tran, int hba_flags);
16
17
18       int scsi_hba_attach(dev_info_t *dip, ddi_dma_lim_t *hba_lim,
19            scsi_hba_tran_t *hba_tran, int hba_flags, void *hba_options);
20
21
22       int scsi_hba_detach(dev_info_t *dip);
23
24

INTERFACE LEVEL

26       Solaris architecture specific (Solaris DDI).
27

PARAMETERS

29       dip             Pointer to the dev_info_t structure that refers to  the
30                       instance of the HBA device.
31
32
33       hba_lim         Pointer to a ddi_dma_lim(9S) structure.
34
35
36       hba_tran        Pointer to a scsi_hba_tran(9S) structure.
37
38
39       hba_flags       Flag   modifiers.   The   defined   flag   values   are
40                       SCSI_HBA_TRAN_CLONE,       SCSI_HBA_TRAN_SCB,       and
41                       SCSI_HBA_TRAN_CDB.
42
43
44       hba_options     Optional features provided by the HBA driver for future
45                       extensions; must be NULL.
46
47
48       hba_dma_attr    Pointer to a ddi_dma_attr(9S) structure.
49
50

DESCRIPTION

52       The scsi_hba_attach_setup() function is the recommended interface  over
53       the scsi_hba_attach() function.
54
55   scsi_hba_attach_setup() scsi_hba_attach()
56       The scsi_hba_attach() function registers the hba_lim DMA limits and the
57       hba_tran transport vectors of each instance of the HBA  device  defined
58       by dip. The scsi_hba_attach_setup() function registers the hba_dma_attr
59       DMA attributes and the hba_tran transport vectors of each  instance  of
60       the  HBA  device  defined by dip. The HBA driver can pass different DMA
61       limits or DMA attributes and the transport vectors for each instance of
62       the device to support any constraints imposed by the  HBA itself.
63
64
65       The  scsi_hba_attach()  and  scsi_hba_attach_setup()  functions use the
66       dev_bus_ops field in the dev_ops(9S) structure. The HBA  driver  should
67       initialize  this  field  to  NULL  before  calling scsi_hba_attach() or
68       scsi_hba_attach_setup().
69
70
71       If SCSI_HBA_TRAN_CLONE is requested in hba_flags, the  hba_tran  struc‐
72       ture  is  cloned  once for each target that is attached to the HBA. The
73       structure is cloned before the tran_tgt_init(9E) entry point is  called
74       to  initialize  a target. At all subsequent HBA entry points, including
75       tran_tgt_init(9E), the scsi_hba_tran_t structure passed as an  argument
76       or  found  in  a  scsi_address  structure is the cloned scsi_hba_tran_t
77       structure,which allows the HBA to use the tran_tgt_private field in the
78       scsi_hba_tran_t  structure  to point to per-target data. The HBA should
79       free only the same scsi_hba_tran_t structure  allocated  when  the  HBA
80       detaches.  All  cloned scsi_hba_tran_t structures that are allocated by
81       the system are freed by the system.
82
83
84       The flags SCSI_HBA_TRAN_CDB and SCSI_HBA_TRAN_SCB are only  valid  when
85       tran_setup_pkt()  is  used.  See  tran_setup_pkt(9E) for information on
86       using these flags.
87
88
89       The scsi_hba_attach() and scsi_hba_attach_setup()  functions  attach  a
90       number  of  integer-valued  properties to dip, unless properties of the
91       same name are already attached  to  the  node.  An  HBA  driver  should
92       retrieve  these  configuration parameters via ddi_prop_get_int(9F), and
93       respect any settings for features provided the HBA.
94
95       scsi-options              Optional SCSI configuration bits
96
97
98       SCSI_OPTIONS_DR           If not set, the HBA should not grant  Discon‐
99                                 nect privileges to target devices.
100
101
102       SCSI_OPTIONS_TAG          If  not  set,  the  HBA should not operate in
103                                 Command Tagged Queueing mode.
104
105
106       SCSI_OPTIONS_PARITY       If not set, the HBA  should  not  operate  in
107                                 parity mode.
108
109
110       SCSI_OPTIONS_QAS          If  not  set,  the HBA should not make use of
111                                 the Quick Arbitration Select feature. Consult
112                                 your  Sun hardware documentation to determine
113                                 whether your machine supports QAS.
114
115
116       SCSI_OPTIONS_FAST         If not set, the HBA should  not  operate  the
117                                 bus in FAST SCSI mode.
118
119
120       SCSI_OPTIONS_FAST20       If  not  set,  the HBA should not operate the
121                                 bus in FAST20 SCSI mode.
122
123
124       SCSI_OPTIONS_FAST40       If not set, the HBA should  not  operate  the
125                                 bus in FAST40 SCSI mode.
126
127
128       SCSI_OPTIONS_FAST80       If  not  set,  the HBA should not operate the
129                                 bus in FAST80 SCSI mode.
130
131
132       SCSI_OPTIONS_FAST160      If not set, the HBA should  not  operate  the
133                                 bus in FAST160 SCSI mode.
134
135
136       SCSI_OPTIONS_FAST320      If  not  set,  the HBA should not operate the
137                                 bus in FAST320 SCSI mode.
138
139
140       SCSI_OPTIONS_WIDE         If not set, the HBA should  not  operate  the
141                                 bus in WIDE SCSI mode.
142
143
144       SCSI_OPTIONS_SYNC         If  not  set,  the HBA should not operate the
145                                 bus in synchronous transfer mode.
146
147
148       scsi-reset-delay          SCSI bus or device reset  recovery  time,  in
149                                 milliseconds.
150
151
152       scsi-selection-timeout    Default  SCSI  selection phase timeout value,
153                                 in milliseconds. Please refer  to  individual
154                                 HBA  man  pages for any HBA-specific informa‐
155                                 tion
156
157
158   scsi_hba_detach()
159       The scsi_hba_detach() function removes the reference to the DMA  limits
160       or attributes structure and the transport vector for the given instance
161       of an HBA driver.
162

RETURN VALUES

164       The scsi_hba_attach(), scsi_hba_attach_setup(),  and  scsi_hba_detach()
165       functions  return DDI_SUCCESS if the function call succeeds, and return
166       DDI_FAILURE on failure.
167

CONTEXT

169       The scsi_hba_attach() and scsi_hba_attach_setup() functions  should  be
170       called from attach(9E). The scsi_hba_detach() function should be called
171       from detach(9E).
172

SEE ALSO

174       attach(9E),    detach(9E),    tran_setup_pkt(9E),    tran_tgt_init(9E),
175       ddi_prop_get_int(9F),  ddi_dma_attr(9S),  ddi_dma_lim(9S), dev_ops(9S),
176       scsi_address(9S), scsi_hba_tran(9S)
177
178
179       Writing Device Drivers
180

NOTES

182       It is the HBA driver's responsibility to ensure that no more  transport
183       requests will be taken on behalf of any SCSI target device driver after
184       scsi_hba_detach() is called.
185
186
187       The scsi_hba_attach() function is obsolete and will be discontinued  in
188       a future release. This function is replaced by scsi_hba_attach_setup().
189
190
191
192SunOS 5.11                        30 May 2006        scsi_hba_attach_setup(9F)
Impressum