xref: /openbsd-src/share/man/man4/scsi.4 (revision 8500990981f885cbe5e6a4958549cacc238b5ae6)
1.\"	$OpenBSD: scsi.4,v 1.14 2003/04/03 11:02:36 jmc Exp $
2.\"
3.\" Copyright (c) 1996
4.\"	Julian Elischer <julian@freebsd.org>.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\"
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.Dd August 4, 1996
29.Dt SCSI 4
30.Os
31.Sh NAME
32.Nm scsi
33.Nd scsi system
34.Sh SYNOPSIS
35.Cd "scsibus at aac?"
36.Cd "scsibus at adv?"
37.Cd "scsibus at adw?"
38.Cd "scsibus at aha?"
39.Cd "scsibus at ahb?"
40.Cd "scsibus at ahc?"
41.Cd "scsibus at aic?"
42.Cd "scsibus at ami?"
43.Cd "scsibus at atapiscsi?"
44.Cd "scsibus at bha?"
45.Cd "scsibus at cac?"
46.Cd "scsibus at dpt?"
47.Cd "scsibus at gdt?"
48.Cd "scsibus at iha?"
49.Cd "scsibus at ioprbs?"
50.Cd "scsibus at iopsp?"
51.Cd "scsibus at isp?"
52.Cd "scsibus at ncr?"
53.Cd "scsibus at pcscp?"
54.Cd "scsibus at siop?"
55.Cd "scsibus at trm?"
56.Cd "scsibus at twe?"
57.Cd "scsibus at umass?"
58.Cd "scsibus at usscanner?"
59.Pp
60.Cd "cd* at scsibus? target ? lun ?"
61.Cd "ch* at scsibus? target ? lun ?"
62.Cd "sd* at scsibus? target ? lun ?"
63.Cd "st* at scsibus? target ? lun ?"
64.Cd "ss* at scsibus? target ? lun ?"
65.Cd "uk* at scsibus? target ? lun ?"
66.Pp
67.Cd "ses* at scsibus? target ? lun ?"
68.Sh DESCRIPTION
69The
70.Em scsi
71system provides a uniform and modular system for the implementation
72of drivers to control various scsi devices, and to utilize different
73scsi host adapters through host adapter drivers.
74When the system probes the
75.Em SCSI
76busses, it attaches any devices it finds to the appropriate
77drivers.
78If no driver seems appropriate, then it attaches the device to the
79uk (unknown) driver so that user level scsi ioctls may
80still be performed against the device.
81.Sh KERNEL CONFIGURATION
82The option SCSIDEBUG enables the debug ioctl.
83.Pp
84All devices and the SCSI busses support boot time allocation so that
85an upper number of devices and controllers does not need to be configured;
86.Cd "sd* at scsibus? target ? lun ?"
87will suffice for any number of disk drivers.
88.Pp
89The devices are either
90.Em wired
91so they appear as a particular device unit or
92.Em counted
93so that they appear as the next available unused unit.
94.Pp
95To configure a driver in the kernel without wiring down the device use a
96config line similar to
97.Cd "ch* at scsibus? target ? lun ?"
98to include the changer driver.
99.Pp
100To wire down a unit use a config line similar to
101.Cd "ch1 at scsibus0 target 4 lun 0"
102to assign changer 1 as the changer with SCSI ID 4,
103SCSI logical unit 0 on SCSI bus 0.
104Individual scsibuses can be wired down to specific controllers with
105a config line similar to
106.Cd "scsibus0 at ahc0"
107which assigns scsi bus 0 to the first unit using the ahc driver.
108For controllers supporting more than one bus,
109the particular bus can be specified as in
110.Cd "scsibus3 at ahc1 bus 1"
111which assigns scsibus 1 to the second bus probed on the ahc1 device.
112.Pp
113When there is a mixture of wired down and counted devices then the
114counting begins with the first non-wired down unit for a particular
115type.
116That is, if a disk is wired down as
117.Cd "disk sd1 at scsibus? target ? lun ?" ,
118then the first non-wired disk shall come on line as
119.Em sd2 .
120.Sh IOCTLS
121There are a number of ioctls that work on any
122.Em SCSI
123device.
124They are defined in
125.Aq Pa sys/scsiio.h
126and can be applied against any scsi device that permits them.
127For the tape, it must be applied against the control
128device.
129See the manual page for each device type for more information about
130how generic scsi ioctls may be applied to a specific device.
131.Bl -tag -width DIOCSDINFO____
132.It Dv SCIOCRESET*
133Reset a device.
134.It Dv SCIOCDEBUG
135Turn on debugging.
136All scsi operations originating from this device's driver
137will be traced to the console, along with other information.
138Debugging is controlled by four bits, described in the header file.
139If no debugging is configured into the kernel, debugging will have
140no effect.
141.Em SCSI
142debugging is controlled by the configuration option
143.Em SCSIDEBUG .
144.It Dv SCIOCCOMMAND
145Take a scsi command and data from a user process and apply them to the scsi
146device.
147Return all status information and return data to the process.
148The ioctl will return a successful status even if the device rejected the
149command.
150As all status is returned to the user, it is up to the user
151process to examine this information to decide the success of the command.
152.It Dv SCIOCREPROBE
153Ask the system to probe the scsi busses for any new devices.
154If it finds any, they will be attached to the appropriate drivers.
155The search can be narrowed to a specific bus, target or lun.
156The new device may or may not be related to the device on which
157the ioctl was performed.
158.It Dv SCIOCIDENTIFY
159Ask the driver what its bus, target and lun are.
160In addition, the device type, ATAPI or SCSI, is returned.
161.It Dv SCIOCDECONFIG
162Ask the device to disappear.
163This may not happen if the device is in use.
164.El
165.Sh ADAPTERS
166The system allows common device drivers to work through many different
167types of adapters.
168The adapters take requests from the upper layers and do all IO between the
169.Em SCSI
170bus and the system.
171The maximum size of a transfer is governed by the adapter.
172Most adapters can transfer 64KB in a single operation, and many can transfer
173larger amounts.
174.Sh TARGET MODE
175Some adapters support
176.Em target mode
177in which the system is capable of operating as a device, responding to
178operations initiated by another system.
179Target mode will be supported for some adapters, but is not yet complete for
180this version of the scsi system.
181.Sh DIAGNOSTICS
182When the kernel is compiled with option SCSIDEBUG, the SCIOCDEBUG ioctl
183can be used to enable various amounts of tracing information on any
184specific device.
185Devices not being traced will not produce trace information.
186The four bits that make up the debug level each control certain types
187of debugging information.
188.Bl -tag -width "Bit 0"
189.It Dv Bit 0
190shows all scsi bus operations including scsi commands,
191error information and the first 48 bytes of any data transferred.
192.It Dv Bit 1
193shows routines called.
194.It Dv Bit 2
195shows information about what branches are taken and often some
196of the return values of functions.
197.It Dv Bit 3
198shows more detailed information including DMA scatter-gather logs.
199.El
200.Sh SEE ALSO
201.Xr aac 4 ,
202.Xr adv 4 ,
203.Xr adw 4 ,
204.Xr aha 4 ,
205.Xr ahb 4 ,
206.Xr ahc 4 ,
207.Xr aic 4 ,
208.Xr ami 4 ,
209.Xr atapiscsi 4 ,
210.Xr bha 4 ,
211.Xr cac 4 ,
212.Xr cd 4 ,
213.Xr ch 4 ,
214.Xr dpt 4 ,
215.Xr gdt 4 ,
216.Xr iha 4 ,
217.Xr intro 4 ,
218.Xr ioprbs 4 ,
219.Xr iopsp 4 ,
220.Xr isp 4 ,
221.Xr ncr 4 ,
222.Xr pcscp 4 ,
223.Xr sd 4 ,
224.Xr ses 4 ,
225.Xr siop 4 ,
226.Xr ss 4 ,
227.Xr st 4 ,
228.Xr trm 4 ,
229.Xr twe 4 ,
230.Xr uk 4 ,
231.Xr umass 4 ,
232.Xr usscanner 4 ,
233.Xr scsi 8
234.Sh HISTORY
235This
236.Nm
237system appeared in MACH 2.5 at TRW.
238