1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man9f / scsi_ifgetcap.9f
blob15f921e265c3b2468816466fcf7b98784b5bc5fa
1 '\" te
2 .\"  Copyright (c) 2007, Sun Microsystems, Inc., All Rights Reserved
3 .\" 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 .\" 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 .\" 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 .SH NAME
8 scsi_ifgetcap, scsi_ifsetcap \- get/set SCSI transport capability
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/scsi/scsi.h>
16 \fBint\fR \fBscsi_ifgetcap\fR(\fBstruct scsi_address *\fR\fIap\fR, \fBchar *\fR\fIcap\fR, \fBint\fR \fIwhom\fR);
17 .fi
19 .LP
20 .nf
21 \fBint\fR \fBscsi_ifsetcap\fR(\fBstruct scsi_address *\fR\fIap\fR, \fBchar *\fR\fIcap\fR, \fBint\fR \fIvalue\fR,
22      \fBint\fR \fIwhom\fR);
23 .fi
25 .SH INTERFACE LEVEL
26 .sp
27 .LP
28 Solaris DDI specific (Solaris DDI).
29 .SH PARAMETERS
30 .sp
31 .ne 2
32 .na
33 \fB\fIap\fR\fR
34 .ad
35 .RS 9n
36 Pointer to the \fBscsi_address\fR structure.
37 .RE
39 .sp
40 .ne 2
41 .na
42 \fB\fIcap\fR\fR
43 .ad
44 .RS 9n
45 Pointer to the string capability identifier.
46 .RE
48 .sp
49 .ne 2
50 .na
51 \fB\fIvalue\fR\fR
52 .ad
53 .RS 9n
54 Defines the new state of the capability.
55 .RE
57 .sp
58 .ne 2
59 .na
60 \fB\fIwhom\fR\fR
61 .ad
62 .RS 9n
63 Determines if all targets or only the specified target is affected.
64 .RE
66 .SH DESCRIPTION
67 .sp
68 .LP
69 The \fBscsi_ifsetcap()\fR function is used by target drivers to set the
70 capabilities of the host adapter driver. The \fIcap\fR pointer is a name-value
71 pair identified by a null-terminated character string and the integer value of
72 the \fIcap\fR. The current value of the capability can be retrieved with the
73 \fBscsi_ifgetcap()\fR function. If the \fIwhom\fR value is \fB0\fR, all target
74 drivers are affected. Otherwise, the \fBscsi_address\fR structure pointed to by
75 \fIap\fR is the only target that is affected.
76 .sp
77 .LP
78 The driver should confirm that \fBscsi_ifsetcap()\fR and \fBscsi_ifsetcap()\fR
79 functions are called with a \fIcap\fR that points to a capability which is
80 supported by the device.
81 .sp
82 .LP
83 The following capabilities have been defined:
84 .sp
85 .ne 2
86 .na
87 \fB\fBdma-max\fR\fR
88 .ad
89 .RS 24n
90 Maximum \fBdma\fR transfer size that is supported by the host adapter.
91 .RE
93 .sp
94 .ne 2
95 .na
96 \fB\fBdma-max-arch\fR\fR
97 .ad
98 .RS 24n
99 Maximum \fBdma\fR transfer size that is supported by system. Takes the host
100 adapter and system architecture into account. This is useful for target drivers
101 which do not support partial \fBDMA\fRs on systems which do not have an
102 \fBIOMMU\fR. In this case, the \fBDMA\fR can also be limited by the host
103 adapters "scatter/gather" list constraints.
105 The "\fBdma-max-arch\fR" capability can not be set. It is implemented with this
106 command and does not rely on a \fBtran_getcap\fR(9E) response from the HBA.
110 .ne 2
112 \fB\fBmsg-out\fR\fR
114 .RS 24n
115 Message out capability that is supported by the host adapter: \fB0\fR disables,
116 \fB1\fR enables.
120 .ne 2
122 \fB\fBdisconnect\fR\fR
124 .RS 24n
125 Disconnect capability that is supported by the host adapter: \fB0\fR disables,
126 \fB1\fR enables.
130 .ne 2
132 \fB\fBsynchronous\fR\fR
134 .RS 24n
135 Synchronous data transfer capability that is supported by the host adapter:
136 \fB0\fR disables, \fB1\fR enables.
140 .ne 2
142 \fB\fBwide-xfer\fR\fR
144 .RS 24n
145 Wide transfer capability that is supported by the host adapter: \fB0\fR
146 disables, \fB1\fR enables.
150 .ne 2
152 \fB\fBparity\fR\fR
154 .RS 24n
155 Parity checking capability that is supported by host adapter: \fB0\fR disables,
156 \fB1\fR enables.
160 .ne 2
162 \fB\fBinitiator-id\fR\fR
164 .RS 24n
165 Host bus address that is returned.
169 .ne 2
171 \fB\fBuntagged-qing\fR\fR
173 .RS 24n
174 Host adapter capability that supports internal queueing of commands without
175 tagged queueing: \fB0\fR disables, \fB1\fR enables.
179 .ne 2
181 \fB\fBtagged-qing\fR\fR
183 .RS 24n
184 Host adapter capability that supports queuing: \fB0\fR disables, \fB1\fR
185 enables.
189 .ne 2
191 \fB\fBauto-rqsense\fR\fR
193 .RS 24n
194 Host adapter capability that supports auto request sense on check conditions:
195 \fB0\fR disables, \fB1\fR enables.
199 .ne 2
201 \fB\fBsector-size\fR\fR
203 .RS 24n
204 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
208 should be set to the size of the physical disk sector. The capability defaults
209 to 512 bytes.
213 .ne 2
215 \fB\fBtotal-sectors\fR\fR
217 .RS 24n
218 Capability that is set by the target driver to inform the \fBHBA\fR of the
219 total number of sectors on the device returned by the \fBSCSI\fR \fBget
220 capacity\fR command. This capability must be set before the target driver
221 ``gets'' the \fBgeometry\fR capability.
225 .ne 2
227 \fB\fBgeometry\fR\fR
229 .RS 24n
230 Capability that returns the \fBHBA\fR geometry of a target disk. The target
231 driver sets the \fBtotal-sectors\fR capability before ``getting'' the geometry
232 capability. The geometry is returned as a 32-bit value. The upper 16 bits
233 represent the number of heads per cylinder. The lower 16 bits represent the
234 number of sectors per track. The geometry capability cannot be ``set''.
236 If geometry is not relevant or appropriate for the target disk,
237 \fBscsi_ifgetcap()\fR can return \fB-1\fR to indicate that the geometry is not
238 defined. For example, if the \fBHBA\fR BIOS supports Logical Block Addressing
239 for the target disk, \fBscsi_ifgetcap()\fR returns \fB-1\fR. Attempts to
240 retreive the "virtual geometry" from the target driver, such as the
241 \fBDKIOCG_VIRTGEOM\fR ioctl, will fail. See \fBdkio\fR(7I) for more information
242 about \fBDKIOCG_VIRTGEOM\fR.
246 .ne 2
248 \fB\fBreset-notification\fR\fR
250 .RS 24n
251 Host adapter capability that supports bus reset notification: \fB0\fR disables,
252 \fB1\fR enables. See \fBscsi_reset_notify\fR(9F).
256 .ne 2
258 \fB\fBlinked-cmds\fR\fR
260 .RS 24n
261 Host adapter capability that supports linked commands: \fB0\fR disables,
262 \fB1\fR enables.
266 .ne 2
268 \fB\fBqfull-retries\fR\fR
270 .RS 24n
271 Capability that enables or disables \fBQUEUE\fR \fBFULL\fR handling. If
272 \fB0\fR, the \fBHBA\fR will not retry a command when a \fBQUEUE\fR \fBFULL\fR
273 status is returned. If the value is greater than \fB0\fR, the \fBHBA\fR driver
274 retries the command a specified number of times at an interval determined by
275 the \fBqfull-retry-interval\fR. The range for \fBqfull-retries\fR is
276 \fB0-255\fR.
280 .ne 2
282 \fB\fBqfull-retry-interval\fR\fR
284 .RS 24n
285 Capability that sets the retry interval in milliseconds (\fBms\fR) for commands
286 completed with a \fBQUEUE\fR \fBFULL\fR status. The range for
287 \fBqfull-retry-intervals\fR is \fB0-1000\fR \fBms\fR.
291 .ne 2
293 \fB\fBlun-reset\fR\fR
295 .RS 24n
296 Capability that is created with a value of zero by \fBHBA\fR drivers that
297 support the \fBRESET_LUN\fR flag in the \fBtran_reset\fR(9E) function. If it
298 exists, the \fBlun-reset\fR value can be set to \fB1\fR by target drivers to
299 allow the use of \fBLOGICAL UNIT RESET\fR on a specific target instance. If
300 \fBlun-reset\fR does not exist or has a value of zero, \fBscsi_reset\fR(9F) is
301 prevented from passing the \fBRESET_LUN\fR flag to \fBtran_reset()\fR function
302 of the \fBHBA\fR driver. If \fBlun-reset\fR exists and has a value of \fB1\fR,
303 the \fBtran_reset()\fR function of the \fBHBA\fR driver can be called with the
304 \fBRESET_LUN\fR flag.
308 .ne 2
310 \fBinterconnect-type\fR
312 .RS 24n
313 Capability held in the \fBtran_interconnect_type\fR element of struct
314 \fBscsi_hba_tran\fR that indicates the \fBHBA\fR transport interconnect type .
315 The integer value of the interconnect type of the transport is defined in the
316 \fBservices.h\fR header file.
320 .ne 2
322 \fBmax-cdb-length\fR
324 .RS 24n
325 Host adapter capability of the maximum supported \fBCDB\fR (Command Descriptor
326 Block) length. The target driver asks for the capability at attach time. If the
327 \fBHBA\fR driver supports the capability, the maximum length of the \fBCDB\fR
328 is returned in bytes. The target driver can then use that value to determine
329 which \fBCDB\fR is used for the \fBHBA\fR.
331 If the \fBHBA\fR driver does not support the \fBmax-cdb-length\fR capability,
332 the default value of the target driver is used for the \fBCDB\fR determination.
335 .SH RETURN VALUES
338 The \fBscsi_ifsetcap()\fR function returns:
340 .ne 2
342 \fB\fB1\fR\fR
344 .RS 9n
345 If the capability was successfully set to the new value.
349 .ne 2
351 \fB\fB0\fR\fR
353 .RS 9n
354 If the capability is not variable.
358 .ne 2
360 \fB\fB\(mi1\fR\fR
362 .RS 9n
363 If the capability was not defined, or setting the capability to a new value
364 failed.
369 The \fBscsi_ifgetcap()\fR function returns the current value of a capability,
372 .ne 2
374 \fB\fB\(mi1\fR\fR
376 .RS 9n
377 If the capability was not defined.
380 .SH EXAMPLES
382 \fBExample 1 \fRUsing \fBscsi_ifgetcap()\fR
384 .in +2
386 if (scsi_ifgetcap(&sd->sd_address, "auto-rqsense", 1) == 1) {
387    un->un_arq_enabled = 1;
388 } else {
389    un->un_arq_enabled =
390        ((scsi_ifsetcap(&sd->sd_address, "auto-rqsense", 1, 1) == 1) ?
391              1 : 0);
394 if (scsi_ifsetcap(&devp->sd_address, "tagged-qing", 1, 1) == 1) {
395           un->un_dp->options |= SD_QUEUEING;
396           un->un_throttle = MAX_THROTTLE;
397 } else if (scsi_ifgetcap(&devp->sd_address, "untagged-qing", 0) == 1) {
398           un->un_dp->options |= SD_QUEUEING;
399           un->un_throttle = 3;
400 } else {
401           un->un_dp->options &= ~SD_QUEUEING;
402           un->un_throttle = 1;
405 .in -2
407 .SH CONTEXT
410 These functions can be called from user, interrupt, or kernel context.
411 .SH ATTRIBUTES
414 See \fBattributes\fR(5) for descriptions of the following attributes:
419 box;
420 c | c
421 l | l .
422 ATTRIBUTE TYPE  ATTRIBUTE VALUE
424 Interface Stability     Committed
427 .SH SEE ALSO
430 \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)
435 \fIWriting Device Drivers\fR