subsystem provides a uniform and modular system for the implementation
of drivers to control various
devices, and to utilize different
host adapters through host adapter drivers.
When the system probes the
busses, it attaches any devices it finds to the appropriate
driver, if it is configured in the kernel, will attach to all
There are a number of generic kernel configuration options for the
This option enables the CAM debugging printf code.
This will not actually
cause any debugging information to be printed out when included by itself.
Enabling printouts requires additional configuration.
See below for details.
This sets the maximum allowable number of concurrent "high power" commands.
A "high power" command is a command that takes more electrical power than
most to complete.
An example of this (and the only command currently
tagged as "high power") is the
START UNIT command.
Starting a SCSI disk often takes significantly more
electrical power than normal operation of the disk.
This option allows the
user to specify how many concurrent high power commands may be outstanding
without overloading the power supply on his computer.
This eliminates text descriptions of each
Additional Sense Code and Additional Sense Code Qualifier pair.
is a fairly large text database, eliminating it reduces the size of the
This is primarily necessary for boot floppies and other
low disk space or low memory space environments.
In most cases, though,
this should be enabled, since it speeds the interpretation of
Do not let the "kernel bloat" zealots get to you -- leave
the sense descriptions in your kernel!
This disables text descriptions of each
This option, like the sense string option above, is primarily
useful for environments like a boot floppy where kernel size is critical.
Enabling this option for normal use is not recommended, since it slows
This is the
"bus settle delay."
In CAM, it is specified in
not seconds like the old
layer used to do.
When the kernel boots, it sends a bus reset to each
bus to tell each device to reset itself to a default set of transfer
negotiations and other settings.
devices need some amount of time to recover from a bus reset.
may need as little as 100ms, while old, slow devices may need much longer.
is not specified, it defaults to 2 seconds.
The minimum allowable value for
is "100", or 100ms.
One special case is that if the
is set to 0, that will be taken to mean the "lowest possible value."
In that case, the
will be reset to 100ms.
All devices and the SCSI busses support boot time allocation so that
an upper number of devices and controllers does not need to be configured;
will suffice for any number of disk drivers.
The devices are either
so they appear as a particular device unit or
so that they appear as the next available unused unit.
Units are wired down by setting kernel environment hints.
This is usually done either interactively from the
or automatically via the
The basic syntax is:
bus numbers can be wired down to specific controllers with
a config line similar to the following:
bus number 0 to the
For controllers supporting more than one bus, a particular bus can be assigned
bus 0 to the bus 1 instance on
Peripheral drivers can be wired to a specific bus, target, and lun as so:
to target 0, unit (lun) 0 of scbus 0.
Omitting the target or unit hints will instruct CAM to treat them as wildcards
and use the first respective counted instances.
These examples can be combined together to allow a peripheral device to be
wired to any particular controller, bus, target, and/or unit instance.
When you have a mixture of wired down and counted devices then the
counting begins with the first non-wired down unit for a particular
That is, if you have a disk wired down as
then the first non-wired disk shall come on line as
The system allows common device drivers to work through many different
types of adapters.
The adapters take requests from the upper layers and do
all IO between the
bus and the system.
The maximum size of a transfer is governed by the
Most adapters can transfer 64KB in a single operation, however
many can transfer larger amounts.
Some adapters support
in which the system is capable of operating as a device, responding to
operations initiated by another system.
Target mode is supported for
some adapters, but is not yet complete for this version of the CAM
When the kernel is compiled with options CAMDEBUG, an XPT_DEBUG CCB can be
used to enable various amounts of tracing information on any
Devices not being traced will not produce trace information.
There are currently four debugging flags that may be turned on:
This debugging flag enables general informational printfs for the device
or devices in question.
This debugging flag enables function-level command flow tracing.
kernel printfs will happen at the entrance and exit of various functions.
This debugging flag enables debugging output internal to various functions.
This debugging flag will cause the kernel to print out all
commands sent to a particular device or devices.
Some of these flags, most notably
will produce kernel printfs in EXTREME numbers,
and because of that, they are not especially useful.
There are not many things logged at the
level, so it is not especially useful.
The most useful debugging flag is the
Users can enable debugging from their kernel config file, by using
the following kernel config options:
This enables CAM debugging.
Without this option, users will not even be able
to turn on debugging from userland via
This allows the user to set the various debugging flags described above
in a kernel config file.
Flags may be ORed together if the user wishes to
see printfs for multiple debugging levels.
Specify a bus to debug.
To debug all busses, set this to -1.
Specify a target to debug.
To debug all targets, set this to -1.
Specify a lun to debug.
To debug all luns, set this to -1.
When specifying a bus, target or lun to debug, you
specify all three bus/target/lun options above.
Using wildcards, you
should be able to enable debugging on most anything.
Users may also enable debugging printfs on the fly, if the
option is their config file, by using the