1.Dd August 27, 1993 2.Dt SD 4 3.Os FreeBSD 4.Sh NAME 5.Nm scsi 6.Nd scsi system 7.Sh SYNOPSIS 8.Nm controller scbus0
| 1.Dd August 27, 1993 2.Dt SD 4 3.Os FreeBSD 4.Sh NAME 5.Nm scsi 6.Nd scsi system 7.Sh SYNOPSIS 8.Nm controller scbus0
|
| 9.Nm controller scbus1 at ahc0 10.Nm controller scbus3 at ahc1 bus 0 11.Nm controller scbus2 at ahc1 bus 1
|
9.Nm device cd0 10.Nm device ch0 11.Nm disk sd0 12.Nm tape st0 13.Nm device ch1 at scbus0 target 4 unit 0 14.Sh DESCRIPTION 15The 16.Em scsi 17system provides a uniform and modular system for the implementation 18of drivers to control various scsi devices, and to utilise different 19scsi host adapters through host adapter drivers. When the system probes the 20.Em SCSI 21busses, it attaches any devices it finds to the appropriate 22drivers. If no driver seems appropriate, then it attaches the device to the 23uk (unknown) driver so that user level scsi ioctls may 24still be performed against the device. 25.Sh KERNEL CONFIGURATION 26The option SCSIDEBUG enables the debug ioctl. 27.Pp 28All devices and the SCSI busses support boot time allocation so that 29an upper number of devices and controllers does not need to be configured; 30.Em "device sd0" 31will suffice for any number of disk drivers. 32.Pp 33The devices are either 34.Em wired 35so they appear as a particular device unit or 36.Em counted 37so that they appear as the next available unused unit. 38.Pp 39To configure a driver in the kernel without wiring down the device use a 40config line similar to 41.Em "device ch0" 42to include the changer driver. 43.Pp
| 12.Nm device cd0 13.Nm device ch0 14.Nm disk sd0 15.Nm tape st0 16.Nm device ch1 at scbus0 target 4 unit 0 17.Sh DESCRIPTION 18The 19.Em scsi 20system provides a uniform and modular system for the implementation 21of drivers to control various scsi devices, and to utilise different 22scsi host adapters through host adapter drivers. When the system probes the 23.Em SCSI 24busses, it attaches any devices it finds to the appropriate 25drivers. If no driver seems appropriate, then it attaches the device to the 26uk (unknown) driver so that user level scsi ioctls may 27still be performed against the device. 28.Sh KERNEL CONFIGURATION 29The option SCSIDEBUG enables the debug ioctl. 30.Pp 31All devices and the SCSI busses support boot time allocation so that 32an upper number of devices and controllers does not need to be configured; 33.Em "device sd0" 34will suffice for any number of disk drivers. 35.Pp 36The devices are either 37.Em wired 38so they appear as a particular device unit or 39.Em counted 40so that they appear as the next available unused unit. 41.Pp 42To configure a driver in the kernel without wiring down the device use a 43config line similar to 44.Em "device ch0" 45to include the changer driver. 46.Pp
|
44To wire down a 45unit use a config line similar to
| 47To wire down a unit use a config line similar to
|
46.Em "device ch1 at scbus0 target 4 unit 0"
| 48.Em "device ch1 at scbus0 target 4 unit 0"
|
47to assign changer 1 as the changer with SCSI ID 4 SCSI logical unit 0 on 48SCSI bus 0.
| 49to assign changer 1 as the changer with SCSI ID 4, 50SCSI logical unit 0 on SCSI bus 0. 51Individual scbuses can be wired down to specific controllers with 52a config line similar to 53.Em "controller scbus0 at ahc0" 54which assigns scsi bus 0 to the first unit using the ahc driver. 55For controllers supporting more than one bus, 56the particualar bus can be specified as in 57.Em "controller scbus3 at ahc1 bus 1" 58which assigns scbus 1 to the second bus probled on the ahc1 device.
|
49.Pp 50When you have a mixture of wired down and counted devices then the 51counting begins with the first non-wired down unit for a particular 52type. That is, if you have a disk wired down as 53.Em "disk sd1" , 54then the first non-wired disk shall come on line as 55.Em sd2 . 56.Sh IOCTLS 57There are a number of ioctls that work on any 58.Em SCSI 59device. They are defined in 60.Em sys/scsiio.h 61and can be applied against any scsi device that permits them. 62For the tape, it must be applied against the control 63device. See the manual page for each device type for more information about 64how generic scsi ioctls may be applied to a specific device. 65.Bl -tag -width DIOCSDINFO____ 66.It Dv SCIOCRESET* 67reset a device. 68.It Dv SCIOCDEBUG 69Turn on debugging.. All scsi operations originating from this device's driver 70will be traced to the console, along with other information. Debugging is 71controlled by four bits, described in the header file. If no debugging is 72configured into the kernel, debugging will have no effect. 73.Em SCSI 74debugging is controlled by the configuration option 75.Em SCSIDEBUG. 76.It Dv SCIOCCOMMAND 77Take a scsi command and data from a user process and apply them to the scsi 78device. Return all status information and return data to the process. The 79ioctl will return a successful status even if the device rejected the 80command. As all status is returned to the user, it is up to the user 81process to examine this information to decide the success of the command. 82.It Dv SCIOCREPROBE 83Ask the system to probe the scsi busses for any new devices. If it finds 84any, they will be attached to the appropriate drivers. The search can be 85narrowed to a specific bus, target or lun. The new device may or may not 86be related to the device on which the ioctl was performed. 87.It Dv SCIOCIDENTIFY 88Ask the driver what it's bus, target and lun are. 89.It Dv SCIOCDECONFIG 90Ask the device to dissappear. This may not happen if the device is in use. 91.El 92.Sh NOTES 93the generic scsi part of the system is still being mapped out. 94Watch this space for changes. 95.Pp 96 A device by the name of su (scsi_user) 97(e.g su0-0-0) will map bus, target and lun to minor numbers. I have not 98yet decided yet whether this device will be able to open a device that is 99already controlled by an explicit driver. 100.Sh ADAPTERS 101The system allows common device drivers to work through many different 102types of adapters. The adapters take requests from the upper layers and do 103all IO between the 104.Em SCSI 105bus and the system. The maximum size of a transfer is governed by the 106adapter. Most adapters can transfer 64KB in a single operation, however 107many can transfer larger amounts. 108.Sh TARGET MODE 109Some adapters support 110.Em Target mode 111in which the system is capable of operating as a device, responding to 112operations initioated by another system. Target mode will be supported for 113some adapters, but is not yet complete for this version of the scsi system. 114.Sh FILES 115see other scsi device entries. 116.Sh DIAGNOSTICS 117When the kernel is compiled with option SCSIDEBUG, the SCIOCDEBUG ioctl 118can be used to enable various amounts of tracing information on any 119specific device. Devices not being traced will not produce trace information. 120The four bits that make up the debug level, each control certain types 121of debugging information. 122.Bl -tag -width THIS_WIDE_PLEASE 123.It Dv Bit 0 124Bit 0 shows all scsi bus operations including scsi commands, 125error information and the first 48 bytes of any data transferred. 126.It Dv Bit 1 127Bit 1 shows routines called. 128.It Dv Bit 2 129Bit 2 shows information about what branches are taken and often some 130of the return values of functions. 131.It Dv Bit 3 132Bit 3 shows more detailed information including DMA scatter-gather logs. 133.El 134.Sh SEE ALSO 135.Xr ch 4 136.Xr cd 4 137.Xr sd 4 138.Xr st 4 139.Xr uk 4 140.Xr su 4 141.Xr aha 4 142.Xr ahb 4 143.Xr bt 4 144.Xr uha 4 145.Sh HISTORY 146This 147.Nm 148system appeared in MACH 2.5 at TRW. 149
| 59.Pp 60When you have a mixture of wired down and counted devices then the 61counting begins with the first non-wired down unit for a particular 62type. That is, if you have a disk wired down as 63.Em "disk sd1" , 64then the first non-wired disk shall come on line as 65.Em sd2 . 66.Sh IOCTLS 67There are a number of ioctls that work on any 68.Em SCSI 69device. They are defined in 70.Em sys/scsiio.h 71and can be applied against any scsi device that permits them. 72For the tape, it must be applied against the control 73device. See the manual page for each device type for more information about 74how generic scsi ioctls may be applied to a specific device. 75.Bl -tag -width DIOCSDINFO____ 76.It Dv SCIOCRESET* 77reset a device. 78.It Dv SCIOCDEBUG 79Turn on debugging.. All scsi operations originating from this device's driver 80will be traced to the console, along with other information. Debugging is 81controlled by four bits, described in the header file. If no debugging is 82configured into the kernel, debugging will have no effect. 83.Em SCSI 84debugging is controlled by the configuration option 85.Em SCSIDEBUG. 86.It Dv SCIOCCOMMAND 87Take a scsi command and data from a user process and apply them to the scsi 88device. Return all status information and return data to the process. The 89ioctl will return a successful status even if the device rejected the 90command. As all status is returned to the user, it is up to the user 91process to examine this information to decide the success of the command. 92.It Dv SCIOCREPROBE 93Ask the system to probe the scsi busses for any new devices. If it finds 94any, they will be attached to the appropriate drivers. The search can be 95narrowed to a specific bus, target or lun. The new device may or may not 96be related to the device on which the ioctl was performed. 97.It Dv SCIOCIDENTIFY 98Ask the driver what it's bus, target and lun are. 99.It Dv SCIOCDECONFIG 100Ask the device to dissappear. This may not happen if the device is in use. 101.El 102.Sh NOTES 103the generic scsi part of the system is still being mapped out. 104Watch this space for changes. 105.Pp 106 A device by the name of su (scsi_user) 107(e.g su0-0-0) will map bus, target and lun to minor numbers. I have not 108yet decided yet whether this device will be able to open a device that is 109already controlled by an explicit driver. 110.Sh ADAPTERS 111The system allows common device drivers to work through many different 112types of adapters. The adapters take requests from the upper layers and do 113all IO between the 114.Em SCSI 115bus and the system. The maximum size of a transfer is governed by the 116adapter. Most adapters can transfer 64KB in a single operation, however 117many can transfer larger amounts. 118.Sh TARGET MODE 119Some adapters support 120.Em Target mode 121in which the system is capable of operating as a device, responding to 122operations initioated by another system. Target mode will be supported for 123some adapters, but is not yet complete for this version of the scsi system. 124.Sh FILES 125see other scsi device entries. 126.Sh DIAGNOSTICS 127When the kernel is compiled with option SCSIDEBUG, the SCIOCDEBUG ioctl 128can be used to enable various amounts of tracing information on any 129specific device. Devices not being traced will not produce trace information. 130The four bits that make up the debug level, each control certain types 131of debugging information. 132.Bl -tag -width THIS_WIDE_PLEASE 133.It Dv Bit 0 134Bit 0 shows all scsi bus operations including scsi commands, 135error information and the first 48 bytes of any data transferred. 136.It Dv Bit 1 137Bit 1 shows routines called. 138.It Dv Bit 2 139Bit 2 shows information about what branches are taken and often some 140of the return values of functions. 141.It Dv Bit 3 142Bit 3 shows more detailed information including DMA scatter-gather logs. 143.El 144.Sh SEE ALSO 145.Xr ch 4 146.Xr cd 4 147.Xr sd 4 148.Xr st 4 149.Xr uk 4 150.Xr su 4 151.Xr aha 4 152.Xr ahb 4 153.Xr bt 4 154.Xr uha 4 155.Sh HISTORY 156This 157.Nm 158system appeared in MACH 2.5 at TRW. 159
|