xref: /freebsd/share/man/man4/scsi.4 (revision 2460bdf04b0eb93f70841c7063e443fdf5f31adb)
1db35f309SDavid Greenman.Dd August 27, 1993
2db35f309SDavid Greenman.Dt SD 4
3db35f309SDavid Greenman.Os FreeBSD
4db35f309SDavid Greenman.Sh NAME
5db35f309SDavid Greenman.Nm scsi
6db35f309SDavid Greenman.Nd scsi system
7db35f309SDavid Greenman.Sh SYNOPSIS
82460bdf0SPeter Dufault.Nm controller scbus0
92460bdf0SPeter Dufault.Nm device cd0
102460bdf0SPeter Dufault.Nm device ch0
112460bdf0SPeter Dufault.Nm disk sd0
122460bdf0SPeter Dufault.Nm tape st0
132460bdf0SPeter Dufault.Nm device ch1 at scbus0 target 4 unit 0
14db35f309SDavid Greenman.Sh DESCRIPTION
15db35f309SDavid GreenmanThe
16db35f309SDavid Greenman.Em scsi
172460bdf0SPeter Dufaultsystem provides a uniform and modular system for the implementation
18db35f309SDavid Greenmanof drivers to control various scsi devices, and to utilise different
192460bdf0SPeter Dufaultscsi host adapters through host adapter drivers. When the system probes the
20db35f309SDavid Greenman.Em SCSI
21db35f309SDavid Greenmanbusses, it attaches any devices it finds to the appropriate
222460bdf0SPeter Dufaultdrivers. If no driver seems appropriate, then it attaches the device to the
232460bdf0SPeter Dufaultuk (unknown) driver so that user level scsi ioctls may
24db35f309SDavid Greenmanstill be performed against the device.
25db35f309SDavid Greenman.Sh KERNEL CONFIGURATION
26db35f309SDavid GreenmanThe option SCSIDEBUG enables the debug ioctl.
272460bdf0SPeter Dufault.Pp
282460bdf0SPeter DufaultAll devices and the SCSI busses support boot time allocation so that
292460bdf0SPeter Dufaultan upper number of devices and controllers does not need to be configured;
302460bdf0SPeter Dufault.Em "device sd0"
312460bdf0SPeter Dufaultwill suffice for any number of disk drivers.
322460bdf0SPeter Dufault.Pp
332460bdf0SPeter DufaultThe devices are either
342460bdf0SPeter Dufault.Em wired
352460bdf0SPeter Dufaultso they appear as a particular device unit or
362460bdf0SPeter Dufault.Em counted
372460bdf0SPeter Dufaultso that they appear as the next available unused unit.
382460bdf0SPeter Dufault.Pp
392460bdf0SPeter DufaultTo configure a driver in the kernel without wiring down the device use a
402460bdf0SPeter Dufaultconfig line similar to
412460bdf0SPeter Dufault.Em "device ch0"
422460bdf0SPeter Dufaultto include the changer driver.
432460bdf0SPeter Dufault.Pp
442460bdf0SPeter DufaultTo wire down a
452460bdf0SPeter Dufaultunit use a config line similar to
462460bdf0SPeter Dufault.Em "device ch1 at scbus0 target 4 unit 0"
472460bdf0SPeter Dufaultto assign changer 1 as the changer with SCSI ID 4 SCSI logical unit 0 on
482460bdf0SPeter DufaultSCSI bus 0.
492460bdf0SPeter Dufault.Pp
502460bdf0SPeter DufaultWhen you have a mixture of wired down and counted devices then the
512460bdf0SPeter Dufaultcounting begins with the first non-wired down unit for a particular
522460bdf0SPeter Dufaulttype.  That is, if you have a disk wired down as
532460bdf0SPeter Dufault.Em "disk sd1" ,
542460bdf0SPeter Dufaultthen the first non-wired disk shall come on line as
552460bdf0SPeter Dufault.Em sd2 .
56db35f309SDavid Greenman.Sh IOCTLS
572460bdf0SPeter DufaultThere are a number of ioctls that work on any
58db35f309SDavid Greenman.Em SCSI
59db35f309SDavid Greenmandevice. They are defined in
60db35f309SDavid Greenman.Em sys/scsiio.h
612460bdf0SPeter Dufaultand can be applied against any scsi device that permits them.
622460bdf0SPeter DufaultFor the tape, it must be applied against the control
63db35f309SDavid Greenmandevice. See the manual page for each device type for more information about
64db35f309SDavid Greenmanhow generic scsi ioctls may be applied to a specific device.
65db35f309SDavid Greenman.Bl -tag -width DIOCSDINFO____
66db35f309SDavid Greenman.It Dv SCIOCRESET*
67db35f309SDavid Greenmanreset a device.
68db35f309SDavid Greenman.It Dv SCIOCDEBUG
69db35f309SDavid GreenmanTurn on debugging.. All scsi operations originating from this device's driver
70db35f309SDavid Greenmanwill be traced to the console, along with other information. Debugging is
71db35f309SDavid Greenmancontrolled by four bits, described in the header file. If no debugging is
72db35f309SDavid Greenmanconfigured into the kernel, debugging will have no effect.
73db35f309SDavid Greenman.Em SCSI
74db35f309SDavid Greenmandebugging is controlled by the configuration option
75db35f309SDavid Greenman.Em SCSIDEBUG.
76db35f309SDavid Greenman.It Dv SCIOCCOMMAND
77db35f309SDavid GreenmanTake a scsi command and data from a user process and apply them to the scsi
78db35f309SDavid Greenmandevice. Return all status information and return data to the process. The
79db35f309SDavid Greenmanioctl will return a successful status even if the device rejected the
80db35f309SDavid Greenmancommand. As all status is returned to the user, it is up to the user
81db35f309SDavid Greenmanprocess to examine this information to decide the success of the command.
82db35f309SDavid Greenman.It Dv SCIOCREPROBE
83db35f309SDavid GreenmanAsk the system to probe the scsi busses for any new devices. If it finds
84db35f309SDavid Greenmanany, they will be attached to the appropriate drivers. The search can be
85db35f309SDavid Greenmannarrowed to a specific bus, target or lun. The new device may or may not
86db35f309SDavid Greenmanbe related to the device on which the ioctl was performed.
87db35f309SDavid Greenman.It Dv SCIOCIDENTIFY
88db35f309SDavid GreenmanAsk the driver what it's bus, target and lun are.
89db35f309SDavid Greenman.It Dv SCIOCDECONFIG
90db35f309SDavid GreenmanAsk the device to dissappear. This may not happen if the device is in use.
91db35f309SDavid Greenman.El
92db35f309SDavid Greenman.Sh NOTES
93db35f309SDavid Greenmanthe generic scsi part of the system is still being mapped out.
94db35f309SDavid GreenmanWatch this space for changes.
95db35f309SDavid Greenman.Pp
96db35f309SDavid Greenman A device by the name of su (scsi_user)
97db35f309SDavid Greenman(e.g  su0-0-0) will map bus, target and lun to  minor numbers. I have not
98db35f309SDavid Greenmanyet decided yet whether this device will be able to open a device that is
99db35f309SDavid Greenmanalready controlled by an explicit driver.
100db35f309SDavid Greenman.Sh ADAPTERS
101db35f309SDavid GreenmanThe system allows common device drivers to work through many different
102db35f309SDavid Greenmantypes of adapters. The adapters take requests from the upper layers and do
103db35f309SDavid Greenmanall IO between the
104db35f309SDavid Greenman.Em SCSI
105db35f309SDavid Greenmanbus and the system. The maximum size of a transfer is governed by the
106db35f309SDavid Greenmanadapter. Most adapters can transfer 64KB in a single operation, however
107db35f309SDavid Greenmanmany can transfer larger amounts.
108db35f309SDavid Greenman.Sh TARGET MODE
109db35f309SDavid GreenmanSome adapters support
110db35f309SDavid Greenman.Em Target mode
111db35f309SDavid Greenmanin which the system is capable of operating as a device, responding to
112db35f309SDavid Greenmanoperations initioated by another system. Target mode will be supported for
113db35f309SDavid Greenmansome adapters, but is not yet complete for this version of the scsi system.
114db35f309SDavid Greenman.Sh FILES
115db35f309SDavid Greenmansee other scsi device entries.
116db35f309SDavid Greenman.Sh DIAGNOSTICS
117db35f309SDavid GreenmanWhen the kernel is compiled with option SCSIDEBUG, the SCIOCDEBUG ioctl
118db35f309SDavid Greenmancan be used to enable various amounts of tracing information on any
119db35f309SDavid Greenmanspecific device. Devices not being traced will not produce trace information.
120db35f309SDavid GreenmanThe four bits that make up the debug level, each control certain types
121db35f309SDavid Greenmanof debugging information.
122db35f309SDavid Greenman.Bl -tag -width THIS_WIDE_PLEASE
123db35f309SDavid Greenman.It Dv Bit 0
124db35f309SDavid GreenmanBit 0  shows all scsi bus operations including scsi commands,
125db35f309SDavid Greenmanerror information and the first 48 bytes of any data transferred.
126db35f309SDavid Greenman.It Dv Bit 1
127db35f309SDavid GreenmanBit 1 shows routines called.
128db35f309SDavid Greenman.It Dv Bit 2
129db35f309SDavid GreenmanBit 2 shows information about what branches are taken and often some
130db35f309SDavid Greenmanof the return values of functions.
131db35f309SDavid Greenman.It Dv Bit 3
132db35f309SDavid GreenmanBit 3 shows more detailed information including DMA scatter-gather logs.
133db35f309SDavid Greenman.El
134db35f309SDavid Greenman.Sh SEE ALSO
135db35f309SDavid Greenman.Xr ch 4
136db35f309SDavid Greenman.Xr cd 4
137db35f309SDavid Greenman.Xr sd 4
138db35f309SDavid Greenman.Xr st 4
139db35f309SDavid Greenman.Xr uk 4
140db35f309SDavid Greenman.Xr su 4
141db35f309SDavid Greenman.Xr aha 4
142db35f309SDavid Greenman.Xr ahb 4
143db35f309SDavid Greenman.Xr bt 4
144db35f309SDavid Greenman.Xr uha 4
145db35f309SDavid Greenman.Sh HISTORY
146db35f309SDavid GreenmanThis
147db35f309SDavid Greenman.Nm
148db35f309SDavid Greenmansystem appeared in MACH 2.5 at TRW.
149db35f309SDavid Greenman
150