2 .\" Julian Elischer <julian@FreeBSD.org>. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd Common Access Method Storage subsystem
42 .Cd "options CAMDEBUG"
43 .Cd "options CAM_DEBUG_BUS=-1"
44 .Cd "options CAM_DEBUG_TARGET=-1"
45 .Cd "options CAM_DEBUG_LUN=-1"
46 .Cd "options CAM_DEBUG_COMPILE=CAM_DEBUG_INFO|CAM_DEBUG_CDB|CAM_DEBUG_PROBE"
47 .Cd "options CAM_DEBUG_FLAGS=CAM_DEBUG_INFO|CAM_DEBUG_CDB"
48 .Cd "options CAM_MAX_HIGHPOWER=4"
49 .Cd "options SCSI_NO_SENSE_STRINGS"
50 .Cd "options SCSI_NO_OP_STRINGS"
51 .Cd "options SCSI_DELAY=8000"
55 subsystem provides a uniform and modular system for the implementation
56 of drivers to control various
62 devices, and to utilize different
68 host adapters through host adapter drivers.
69 When the system probes buses, it attaches any devices it finds to the
73 driver, if it is configured in the kernel, will attach to all devices.
74 .Sh KERNEL CONFIGURATION
75 There are a number of generic kernel configuration options for the
78 .Bl -tag -width SCSI_NO_SENSE_STRINGS
80 This option compiles in all the
82 debugging printf code.
83 This will not actually
84 cause any debugging information to be printed out when included by itself.
85 See below for details.
86 .It Dv "CAM_MAX_HIGHPOWER=4"
87 This sets the maximum allowable number of concurrent "high power" commands.
88 A "high power" command is a command that takes more electrical power than
90 An example of this is the
93 Starting a disk often takes significantly more electrical power than normal
95 This option allows the
96 user to specify how many concurrent high power commands may be outstanding
97 without overloading the power supply on his computer.
98 .It Dv SCSI_NO_SENSE_STRINGS
99 This eliminates text descriptions of each
101 Additional Sense Code and Additional Sense Code Qualifier pair.
103 is a fairly large text database, eliminating it reduces the size of the
105 This is primarily necessary for boot floppies and other
106 low disk space or low memory space environments.
107 In most cases, though,
108 this should be enabled, since it speeds the interpretation of
111 Do not let the "kernel bloat" zealots get to you -- leave
112 the sense descriptions in your kernel!
113 .It Dv SCSI_NO_OP_STRINGS
114 This disables text descriptions of each
117 This option, like the sense string option above, is primarily
118 useful for environments like a boot floppy where kernel size is critical.
119 Enabling this option for normal use is not recommended, since it slows
123 .It Dv SCSI_DELAY=8000
131 not seconds like the old
134 When the kernel boots, it sends a bus reset to each
136 bus to tell each device to reset itself to a default set of transfer
137 negotiations and other settings.
140 devices need some amount of time to recover from a bus reset.
142 may need as little as 100ms, while old, slow devices may need much longer.
145 is not specified, it defaults to 2 seconds.
146 The minimum allowable value for
149 One special case is that if the
151 is set to 0, that will be taken to mean the "lowest possible value."
154 will be reset to 100ms.
157 All devices and buses support dynamic allocation so that
158 an upper number of devices and controllers does not need to be configured;
160 will suffice for any number of disk drivers.
162 The devices are either
164 so they appear as a particular device unit or
166 so that they appear as the next available unused unit.
168 Units are wired down by setting kernel environment hints.
169 This is usually done either interactively from the
171 or automatically via the
172 .Pa /boot/device.hints
175 .Bd -literal -offset indent
176 hint.device.unit.property="value"
181 bus numbers can be wired down to specific controllers with
182 a config line similar to the following:
183 .Bd -literal -offset indent
184 hint.scbus.0.at="ahd1"
192 For controllers supporting more than one bus, a particular bus can be assigned
194 .Bd -literal -offset indent
195 hint.scbus.0.at="ahc1"
201 bus 0 to the bus 1 instance on
203 Peripheral drivers can be wired to a specific bus, target, and lun as so:
204 .Bd -literal -offset indent
205 hint.da.0.at="scbus0"
212 to target 0, unit (lun) 0 of scbus 0.
213 Omitting the target or unit hints will instruct
215 to treat them as wildcards
216 and use the first respective counted instances.
217 These examples can be combined together to allow a peripheral device to be
218 wired to any particular controller, bus, target, and/or unit instance.
223 .Bd -literal -offset indent
224 hint.nvme.4.at="pci7:0:0"
225 hint.scbus.10.at="nvme4"
226 hint.nda.10.at="scbus10"
227 hint.nda.10.target="1"
228 hint.nda.10.unit="12"
229 hint.nda.11.at="scbus10"
230 hint.nda.11.target="1"
234 This assigns the NVMe card living at PCI bus 7 to scbus 10 (in PCIe,
235 slot and function are rarely used and usually 0).
239 The unit is the namespace identifier from the drive.
240 The namespace id 1 is exported as
242 and namespace id 2 is exported as
245 When you have a mixture of wired down and counted devices then the
246 counting begins with the first non-wired down unit for a particular
248 That is, if you have a disk wired down as
250 then the first non-wired disk shall come on line as
253 The system allows common device drivers to work through many different
255 The adapters take requests from the upper layers and do
263 The maximum size of a transfer is governed by the
265 Most adapters can transfer 64KB in a single operation, however
266 many can transfer larger amounts.
268 Some adapters support
270 in which the system is capable of operating as a device, responding to
271 operations initiated by another system.
272 Target mode is supported for
273 some adapters, but is not yet complete for this version of the
282 An XPT_DEBUG CCB can be used to enable various amounts of tracing information
283 on any specific bus/device from the list of options compiled into the kernel.
284 There are currently seven debugging flags that may be compiled in and used:
285 .Bl -tag -width CAM_DEBUG_SUBTRACE
286 .It Dv CAM_DEBUG_INFO
287 This flag enables general informational printfs for the device
288 or devices in question.
289 .It Dv CAM_DEBUG_TRACE
290 This flag enables function-level command flow tracing i.e.,
291 kernel printfs will happen at the entrance and exit of various functions.
292 .It Dv CAM_DEBUG_SUBTRACE
293 This flag enables debugging output internal to various functions.
295 This flag will cause the kernel to print out all
299 commands sent to a particular device or devices.
301 This flag will enable command scheduler tracing.
302 .It Dv CAM_DEBUG_PERIPH
303 This flag will enable peripheral drivers messages.
304 .It Dv CAM_DEBUG_PROBE
305 This flag will enable devices probe process tracing.
308 Some of these flags, most notably
311 .Dv CAM_DEBUG_SUBTRACE ,
312 will produce kernel printfs in EXTREME numbers.
314 Users can enable debugging from their kernel config file, by using
315 the following kernel config options:
316 .Bl -tag -width CAM_DEBUG_COMPILE
318 This builds into the kernel all possible
321 .It Dv CAM_DEBUG_COMPILE
322 This allows to specify support for which debugging flags described above
323 should be built into the kernel.
324 Flags may be ORed together if the user wishes to
325 see printfs for multiple debugging levels.
326 .It Dv CAM_DEBUG_FLAGS
327 This allows to set the various debugging flags from a kernel config file.
329 Specify a bus to debug.
330 To debug all buses, set this to -1.
331 .It Dv CAM_DEBUG_TARGET
332 Specify a target to debug.
333 To debug all targets, set this to -1.
335 Specify a lun to debug.
336 To debug all luns, set this to -1.
339 Users may also enable debugging on the fly by using the
341 utility, if wanted options built into the kernel.
365 subsystem first appeared in
369 ATA support was added in
376 subsystem was written by
384 .An Alexander Motin Aq Mt mav@FreeBSD.org .
389 .An Warner Losh Aq Mt imp@FreeBSD.org .