Print this page
4888 Undocument dma_req(9s)
4884 EOF scsi_hba_attach
4886 EOF ddi_dmae_getlim
4887 EOF ddi_iomin
4634 undocument scsi_hba_attach() and ddi_dma_lim(9s)
4630 clean stale references to ddi_iopb_alloc and ddi_iopb_free
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man9f/scsi_ifgetcap.9f
+++ new/usr/src/man/man9f/scsi_ifgetcap.9f
1 1 '\" te
2 2 .\" Copyright (c) 2007, Sun Microsystems, Inc., All Rights Reserved
3 +.\" Copyright (c) 2014 Garrett D'Amore <garrett@damore.org>
3 4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 -.TH SCSI_IFGETCAP 9F "Oct 16, 2007"
7 +.TH SCSI_IFGETCAP 9F "May 24, 2014"
7 8 .SH NAME
8 9 scsi_ifgetcap, scsi_ifsetcap \- get/set SCSI transport capability
9 10 .SH SYNOPSIS
10 11 .LP
11 12 .nf
12 13 #include <sys/scsi/scsi.h>
13 14
14 15
15 16
16 17 \fBint\fR \fBscsi_ifgetcap\fR(\fBstruct scsi_address *\fR\fIap\fR, \fBchar *\fR\fIcap\fR, \fBint\fR \fIwhom\fR);
17 18 .fi
18 19
19 20 .LP
20 21 .nf
21 22 \fBint\fR \fBscsi_ifsetcap\fR(\fBstruct scsi_address *\fR\fIap\fR, \fBchar *\fR\fIcap\fR, \fBint\fR \fIvalue\fR,
22 23 \fBint\fR \fIwhom\fR);
23 24 .fi
24 25
25 26 .SH INTERFACE LEVEL
26 27 .sp
27 28 .LP
28 29 Solaris DDI specific (Solaris DDI).
29 30 .SH PARAMETERS
30 31 .sp
31 32 .ne 2
32 33 .na
33 34 \fB\fIap\fR\fR
34 35 .ad
35 36 .RS 9n
36 37 Pointer to the \fBscsi_address\fR structure.
37 38 .RE
38 39
39 40 .sp
40 41 .ne 2
41 42 .na
42 43 \fB\fIcap\fR\fR
43 44 .ad
44 45 .RS 9n
45 46 Pointer to the string capability identifier.
46 47 .RE
47 48
48 49 .sp
49 50 .ne 2
50 51 .na
51 52 \fB\fIvalue\fR\fR
52 53 .ad
53 54 .RS 9n
54 55 Defines the new state of the capability.
55 56 .RE
56 57
57 58 .sp
58 59 .ne 2
59 60 .na
60 61 \fB\fIwhom\fR\fR
61 62 .ad
62 63 .RS 9n
63 64 Determines if all targets or only the specified target is affected.
64 65 .RE
65 66
66 67 .SH DESCRIPTION
67 68 .sp
68 69 .LP
69 70 The \fBscsi_ifsetcap()\fR function is used by target drivers to set the
70 71 capabilities of the host adapter driver. The \fIcap\fR pointer is a name-value
71 72 pair identified by a null-terminated character string and the integer value of
72 73 the \fIcap\fR. The current value of the capability can be retrieved with the
73 74 \fBscsi_ifgetcap()\fR function. If the \fIwhom\fR value is \fB0\fR, all target
74 75 drivers are affected. Otherwise, the \fBscsi_address\fR structure pointed to by
75 76 \fIap\fR is the only target that is affected.
76 77 .sp
77 78 .LP
78 79 The driver should confirm that \fBscsi_ifsetcap()\fR and \fBscsi_ifsetcap()\fR
79 80 functions are called with a \fIcap\fR that points to a capability which is
80 81 supported by the device.
81 82 .sp
82 83 .LP
83 84 The following capabilities have been defined:
84 85 .sp
85 86 .ne 2
86 87 .na
87 88 \fB\fBdma-max\fR\fR
88 89 .ad
89 90 .RS 24n
90 91 Maximum \fBdma\fR transfer size that is supported by the host adapter.
91 92 .RE
92 93
93 94 .sp
94 95 .ne 2
95 96 .na
96 97 \fB\fBdma-max-arch\fR\fR
97 98 .ad
98 99 .RS 24n
99 100 Maximum \fBdma\fR transfer size that is supported by system. Takes the host
100 101 adapter and system architecture into account. This is useful for target drivers
101 102 which do not support partial \fBDMA\fRs on systems which do not have an
102 103 \fBIOMMU\fR. In this case, the \fBDMA\fR can also be limited by the host
103 104 adapters "scatter/gather" list constraints.
104 105 .sp
105 106 The "\fBdma-max-arch\fR" capability can not be set. It is implemented with this
106 107 command and does not rely on a \fBtran_getcap\fR(9E) response from the HBA.
107 108 .RE
108 109
109 110 .sp
110 111 .ne 2
111 112 .na
112 113 \fB\fBmsg-out\fR\fR
113 114 .ad
114 115 .RS 24n
115 116 Message out capability that is supported by the host adapter: \fB0\fR disables,
116 117 \fB1\fR enables.
117 118 .RE
118 119
119 120 .sp
120 121 .ne 2
121 122 .na
122 123 \fB\fBdisconnect\fR\fR
123 124 .ad
124 125 .RS 24n
125 126 Disconnect capability that is supported by the host adapter: \fB0\fR disables,
126 127 \fB1\fR enables.
127 128 .RE
128 129
129 130 .sp
130 131 .ne 2
131 132 .na
132 133 \fB\fBsynchronous\fR\fR
133 134 .ad
134 135 .RS 24n
135 136 Synchronous data transfer capability that is supported by the host adapter:
136 137 \fB0\fR disables, \fB1\fR enables.
137 138 .RE
138 139
139 140 .sp
140 141 .ne 2
141 142 .na
142 143 \fB\fBwide-xfer\fR\fR
143 144 .ad
144 145 .RS 24n
145 146 Wide transfer capability that is supported by the host adapter: \fB0\fR
146 147 disables, \fB1\fR enables.
147 148 .RE
148 149
149 150 .sp
150 151 .ne 2
151 152 .na
152 153 \fB\fBparity\fR\fR
153 154 .ad
154 155 .RS 24n
155 156 Parity checking capability that is supported by host adapter: \fB0\fR disables,
156 157 \fB1\fR enables.
157 158 .RE
158 159
159 160 .sp
160 161 .ne 2
161 162 .na
162 163 \fB\fBinitiator-id\fR\fR
163 164 .ad
164 165 .RS 24n
165 166 Host bus address that is returned.
166 167 .RE
167 168
168 169 .sp
169 170 .ne 2
170 171 .na
171 172 \fB\fBuntagged-qing\fR\fR
172 173 .ad
173 174 .RS 24n
174 175 Host adapter capability that supports internal queueing of commands without
175 176 tagged queueing: \fB0\fR disables, \fB1\fR enables.
176 177 .RE
177 178
178 179 .sp
179 180 .ne 2
180 181 .na
181 182 \fB\fBtagged-qing\fR\fR
182 183 .ad
183 184 .RS 24n
184 185 Host adapter capability that supports queuing: \fB0\fR disables, \fB1\fR
185 186 enables.
186 187 .RE
187 188
188 189 .sp
189 190 .ne 2
190 191 .na
191 192 \fB\fBauto-rqsense\fR\fR
192 193 .ad
193 194 .RS 24n
194 195 Host adapter capability that supports auto request sense on check conditions:
↓ open down ↓ |
178 lines elided |
↑ open up ↑ |
195 196 \fB0\fR disables, \fB1\fR enables.
196 197 .RE
197 198
198 199 .sp
199 200 .ne 2
200 201 .na
201 202 \fB\fBsector-size\fR\fR
202 203 .ad
203 204 .RS 24n
204 205 Capability that is set by the target driver to inform the \fBHBA\fR of the
205 -granularity, in bytes, of the \fBDMA\fR breakup. The \fBHBA\fR \fBDMA\fR limit
206 -structure is set to reflect the byte total of this setting. See
207 -\fBddi_dma_lim_sparc\fR(9S) or \fBddi_dma_lim_x86\fR(9S). The \fBsector-size\fR
206 +granularity, in bytes, of the \fBDMA\fR breakup. The \fBHBA\fR \fBDMA\fR
207 +attributes structure is set to reflect the byte total of this setting. See
208 +\fBddi_dma_attribut\fR(9S). The \fBsector-size\fR
208 209 should be set to the size of the physical disk sector. The capability defaults
209 210 to 512 bytes.
210 211 .RE
211 212
212 213 .sp
213 214 .ne 2
214 215 .na
215 216 \fB\fBtotal-sectors\fR\fR
216 217 .ad
217 218 .RS 24n
218 219 Capability that is set by the target driver to inform the \fBHBA\fR of the
219 220 total number of sectors on the device returned by the \fBSCSI\fR \fBget
220 221 capacity\fR command. This capability must be set before the target driver
221 222 ``gets'' the \fBgeometry\fR capability.
222 223 .RE
223 224
224 225 .sp
225 226 .ne 2
226 227 .na
227 228 \fB\fBgeometry\fR\fR
228 229 .ad
229 230 .RS 24n
230 231 Capability that returns the \fBHBA\fR geometry of a target disk. The target
231 232 driver sets the \fBtotal-sectors\fR capability before ``getting'' the geometry
232 233 capability. The geometry is returned as a 32-bit value. The upper 16 bits
233 234 represent the number of heads per cylinder. The lower 16 bits represent the
234 235 number of sectors per track. The geometry capability cannot be ``set''.
235 236 .sp
236 237 If geometry is not relevant or appropriate for the target disk,
237 238 \fBscsi_ifgetcap()\fR can return \fB-1\fR to indicate that the geometry is not
238 239 defined. For example, if the \fBHBA\fR BIOS supports Logical Block Addressing
239 240 for the target disk, \fBscsi_ifgetcap()\fR returns \fB-1\fR. Attempts to
240 241 retreive the "virtual geometry" from the target driver, such as the
241 242 \fBDKIOCG_VIRTGEOM\fR ioctl, will fail. See \fBdkio\fR(7I) for more information
242 243 about \fBDKIOCG_VIRTGEOM\fR.
243 244 .RE
244 245
245 246 .sp
246 247 .ne 2
247 248 .na
248 249 \fB\fBreset-notification\fR\fR
249 250 .ad
250 251 .RS 24n
251 252 Host adapter capability that supports bus reset notification: \fB0\fR disables,
252 253 \fB1\fR enables. See \fBscsi_reset_notify\fR(9F).
253 254 .RE
254 255
255 256 .sp
256 257 .ne 2
257 258 .na
258 259 \fB\fBlinked-cmds\fR\fR
259 260 .ad
260 261 .RS 24n
261 262 Host adapter capability that supports linked commands: \fB0\fR disables,
262 263 \fB1\fR enables.
263 264 .RE
264 265
265 266 .sp
266 267 .ne 2
267 268 .na
268 269 \fB\fBqfull-retries\fR\fR
269 270 .ad
270 271 .RS 24n
271 272 Capability that enables or disables \fBQUEUE\fR \fBFULL\fR handling. If
272 273 \fB0\fR, the \fBHBA\fR will not retry a command when a \fBQUEUE\fR \fBFULL\fR
273 274 status is returned. If the value is greater than \fB0\fR, the \fBHBA\fR driver
274 275 retries the command a specified number of times at an interval determined by
275 276 the \fBqfull-retry-interval\fR. The range for \fBqfull-retries\fR is
276 277 \fB0-255\fR.
277 278 .RE
278 279
279 280 .sp
280 281 .ne 2
281 282 .na
282 283 \fB\fBqfull-retry-interval\fR\fR
283 284 .ad
284 285 .RS 24n
285 286 Capability that sets the retry interval in milliseconds (\fBms\fR) for commands
286 287 completed with a \fBQUEUE\fR \fBFULL\fR status. The range for
287 288 \fBqfull-retry-intervals\fR is \fB0-1000\fR \fBms\fR.
288 289 .RE
289 290
290 291 .sp
291 292 .ne 2
292 293 .na
293 294 \fB\fBlun-reset\fR\fR
294 295 .ad
295 296 .RS 24n
296 297 Capability that is created with a value of zero by \fBHBA\fR drivers that
297 298 support the \fBRESET_LUN\fR flag in the \fBtran_reset\fR(9E) function. If it
298 299 exists, the \fBlun-reset\fR value can be set to \fB1\fR by target drivers to
299 300 allow the use of \fBLOGICAL UNIT RESET\fR on a specific target instance. If
300 301 \fBlun-reset\fR does not exist or has a value of zero, \fBscsi_reset\fR(9F) is
301 302 prevented from passing the \fBRESET_LUN\fR flag to \fBtran_reset()\fR function
302 303 of the \fBHBA\fR driver. If \fBlun-reset\fR exists and has a value of \fB1\fR,
303 304 the \fBtran_reset()\fR function of the \fBHBA\fR driver can be called with the
304 305 \fBRESET_LUN\fR flag.
305 306 .RE
306 307
307 308 .sp
308 309 .ne 2
309 310 .na
310 311 \fBinterconnect-type\fR
311 312 .ad
312 313 .RS 24n
313 314 Capability held in the \fBtran_interconnect_type\fR element of struct
314 315 \fBscsi_hba_tran\fR that indicates the \fBHBA\fR transport interconnect type .
315 316 The integer value of the interconnect type of the transport is defined in the
316 317 \fBservices.h\fR header file.
317 318 .RE
318 319
319 320 .sp
320 321 .ne 2
321 322 .na
322 323 \fBmax-cdb-length\fR
323 324 .ad
324 325 .RS 24n
325 326 Host adapter capability of the maximum supported \fBCDB\fR (Command Descriptor
326 327 Block) length. The target driver asks for the capability at attach time. If the
327 328 \fBHBA\fR driver supports the capability, the maximum length of the \fBCDB\fR
328 329 is returned in bytes. The target driver can then use that value to determine
329 330 which \fBCDB\fR is used for the \fBHBA\fR.
330 331 .sp
331 332 If the \fBHBA\fR driver does not support the \fBmax-cdb-length\fR capability,
332 333 the default value of the target driver is used for the \fBCDB\fR determination.
333 334 .RE
334 335
335 336 .SH RETURN VALUES
336 337 .sp
337 338 .LP
338 339 The \fBscsi_ifsetcap()\fR function returns:
339 340 .sp
340 341 .ne 2
341 342 .na
342 343 \fB\fB1\fR\fR
343 344 .ad
344 345 .RS 9n
345 346 If the capability was successfully set to the new value.
346 347 .RE
347 348
348 349 .sp
349 350 .ne 2
350 351 .na
351 352 \fB\fB0\fR\fR
352 353 .ad
353 354 .RS 9n
354 355 If the capability is not variable.
355 356 .RE
356 357
357 358 .sp
358 359 .ne 2
359 360 .na
360 361 \fB\fB\(mi1\fR\fR
361 362 .ad
362 363 .RS 9n
363 364 If the capability was not defined, or setting the capability to a new value
364 365 failed.
365 366 .RE
366 367
367 368 .sp
368 369 .LP
369 370 The \fBscsi_ifgetcap()\fR function returns the current value of a capability,
370 371 or:
371 372 .sp
372 373 .ne 2
373 374 .na
374 375 \fB\fB\(mi1\fR\fR
375 376 .ad
376 377 .RS 9n
377 378 If the capability was not defined.
378 379 .RE
379 380
380 381 .SH EXAMPLES
381 382 .LP
382 383 \fBExample 1 \fRUsing \fBscsi_ifgetcap()\fR
383 384 .sp
384 385 .in +2
385 386 .nf
386 387 if (scsi_ifgetcap(&sd->sd_address, "auto-rqsense", 1) == 1) {
387 388 un->un_arq_enabled = 1;
388 389 } else {
389 390 un->un_arq_enabled =
390 391 ((scsi_ifsetcap(&sd->sd_address, "auto-rqsense", 1, 1) == 1) ?
391 392 1 : 0);
392 393 }
393 394
394 395 if (scsi_ifsetcap(&devp->sd_address, "tagged-qing", 1, 1) == 1) {
395 396 un->un_dp->options |= SD_QUEUEING;
396 397 un->un_throttle = MAX_THROTTLE;
397 398 } else if (scsi_ifgetcap(&devp->sd_address, "untagged-qing", 0) == 1) {
398 399 un->un_dp->options |= SD_QUEUEING;
399 400 un->un_throttle = 3;
400 401 } else {
401 402 un->un_dp->options &= ~SD_QUEUEING;
402 403 un->un_throttle = 1;
403 404 }
404 405 .fi
405 406 .in -2
406 407
407 408 .SH CONTEXT
408 409 .sp
409 410 .LP
410 411 These functions can be called from user, interrupt, or kernel context.
411 412 .SH ATTRIBUTES
412 413 .sp
413 414 .LP
414 415 See \fBattributes\fR(5) for descriptions of the following attributes:
415 416 .sp
416 417
417 418 .sp
418 419 .TS
419 420 box;
420 421 c | c
↓ open down ↓ |
203 lines elided |
↑ open up ↑ |
421 422 l | l .
422 423 ATTRIBUTE TYPE ATTRIBUTE VALUE
423 424 _
424 425 Interface Stability Committed
425 426 .TE
426 427
427 428 .SH SEE ALSO
428 429 .sp
429 430 .LP
430 431 \fBtran_reset\fR(9E), \fBscsi_hba_lookup_capstr\fR(9F), \fBscsi_reset\fR(9F),
431 -\fBscsi_reset_notify\fR(9F), \fBddi_dma_lim_sparc\fR(9S),
432 -\fBddi_dma_lim_x86\fR(9S), \fBscsi_address\fR(9S), \fBscsi_arq_status\fR(9S)
432 +\fBscsi_reset_notify\fR(9F), \fBddi_dma_attr\fR(9S),
433 +\fBscsi_address\fR(9S), \fBscsi_arq_status\fR(9S)
433 434 .sp
434 435 .LP
435 436 \fIWriting Device Drivers\fR
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX