|
|
The SCO OpenServer modular SCSI interface provides a number of standard device drivers for SCSI peripheral devices -- CD-ROM, tape, floptical, disk, and media changer devices (juke boxes) -- and for SCSI host adapter cards. The interface establishes a clearly defined protocol between the peripheral driver tier and the host adapter driver tier.
This description is primarily based on the SCSI-1 standard. Later SCSI standards maintain backward compatibility with SCSI-1 while allowing for increased data transfer rates, wider data buses, extended command sets, and a larger number of supported peripherals.
SCO OpenServer Release 5.0.6 supports SCSI-1, 2 and 3 tape devices.
A SCSI host adapter controller provides the interface between the host computer bus and the SCSI bus. It mediates requests from the host computer to access peripheral devices; it sends these in the form of Command Descriptor Blocks (CDBs). The host adapter also passes back data and status messages received from the peripherals. Several host adapters may be present on the same host computer; each adapter is identified by its host adapter number.
Usually, the host adapter acts as an initiator; it requests that a target controller perform an operation. While an initiator and target are communicating, the bus is unavailable to any other device.
A target can temporarily disconnect from an initiator if the operation will take some time (for example, rewinding a tape or moving a disk head). This allows the initiator to connect to a different target. When the first target has completed its task, it tries to reselect the initiator. As soon as the host adapter is free to respond, it arbitrates between the controllers that are requesting service from it. The adapter selects the controller with the highest priority as its new target.
Up to eight controllers can be connected to a SCSI 8-bit wide data bus, and up to sixteen controllers can be connected to a 16-bit bus. Each controller is assigned an ID number in the range 0-7 on an 8-bit data bus, or 0-15 on a 16-bit bus. The ID number is also referred to as a SCSI ID, target ID, or controller number. One of the controllers must be the host adapter which is usually assigned ID 7.
There are two types of controller other than host adapter controllers:
Driver name | Device supported |
---|---|
Sdsk | hard disk |
Sflp | floppy drive |
Srom | CD-ROM |
Stp | tape |
Sjk | media changer device (juke box) |
Any SCSI peripheral that you wish to access must be configured by an entry in the mscsi(F) file; the mkdev(ADM) options cdrom, flopti, hd,, tape and juke provide a means of doing this automatically for each host adapter.
Changes to mscsi, mdevice, and /etc/conf/sdevice.d/xnamex will only take effect if the kernel is relinked using link_unix(ADM) and the machine rebooted.
The minor device numbering scheme for SCSI tape drives is described on scsitape(HW).
The minor device numbering scheme for SCSI CD-ROM drives is described on cdrom(HW).
The minor device numbering scheme for SCSI floptical drives is described on Sflp(HW).
The minor device numbering scheme for SCSI juke boxes is described on jukebox(HW).
SCSIUSERCMD and the scsicmd structure are defined in <sys/scsicmd.h> as follows:
#define SCSIUSERCMD (('D'<<8)|64) /* compare ioctl list in dio.h */ #define SCSICMDLEN 12SCSIUSERCMD requires that an effective user ID of 0 (zero) be set on the user process calling ioctl.struct scsicmd { faddr_t data_ptr; /* pointer to user data read or written */ ulong data_len; /* length of user data at data_ptr or 0 */ ushort is_write; /* data i/o direction: 0 read, 1 write */ uchar_t cdb[SCSICMDLEN];/* command description block (0 padded) */ uchar_t host_sts; /* to be returned upon completion */ uchar_t target_sts; /* to be returned upon completion */ uchar_t cdb_len; /* used for vendor specific commands */ };
SCSIUSERCMD2 is a superset of SCSIUSERCMD; it also allows the user to retrieve sense information. SCSIUSERCMD2 is defined in <sys/scsicmd.h> as follows:
#define SCSIUSERCMD2 (('D'<<8)|65) /* New SCSIUSERCMD + sense */Note that the user must check for zero in the host_sts and target_sts fields for successful completion of the ioctl.struct scsicmd2 { struct scsicmd cmd; /* User-supplied SCSI command (see above) */ int sense_len; /* Length of allocated data for sense info*/ void *sense_ptr; /* Buffer for sense info (user provided) */ };
WARNING: aha: Adapter m detected SCSI reset, status=0xn, intr=0xvectorAn unexpected host adapter reset was detected.
WARNING: aha: Adapter m unexpected MBI status 0xn AHA-1X40 cmd : o AHA-1X40 sense : pThe incoming mailbox is in an unexpected state after an interrupt.
WARNING: aha: Port 0xm failed to go idle, status=0xn, cmd=0xoRegister m on the host adapter indicated that a command had still not been completed after R_LIMIT cycles in a spin loop.
WARNING: aha: Port 0xm internal failure 0xnThe host adapter failed to be recognized on initialization.
CONFIG: No Stype SCSI devices configured (unit n missing)No configuration information existed for a given SCSI device.
CONFIG: Only m Stype SCSI devices configured (unit n missing)No configuration information existed for a given SCSI device.
NOTICE: Stype: Error on [reading|writing] SCSI device_type [ dev major/minor ] (ha=host_adapter id=controller lun=logical_unit) [ block=block_number ] NOTICE: Stype: sensemsg NOTICE: Status: host=host_status target=target_status, : Key: key code qualifierThe output sensemsg is one of the following sense error messages:
Command aborted: Command sent before previous one was completed Command aborted: Drive detected a SCSI parity error Command aborted: Drive received an 'initiator detected' error Command aborted: Drive received an illegal message Command aborted: Host sent abort message Command aborted: Message phase unexpected Command aborted: Phase sequence unexpected Command aborted: SCSI selection/reselection error occurred Command aborted: Unexpected command phase Command aborted: Unexpected data phase -possible DMA errorCopy aborted: Due to error on the source or destination device Copy aborted: Host cannot disconnect
Drive not ready: Being loaded Drive not ready: No media present Drive not ready: Offline
Error rate warning
Hardware error: Failure during write operation Hardware error: Media load/eject failed Hardware error: Moisture detected Hardware error: Track-following Hardware error: Unexpected internal error
Humidity warning
Illegal request: Invalid bits in identify message Illegal request: Invalid command Illegal request: Invalid field in CDB Illegal request: Invalid parameter list Illegal request: Logical unit not supported Illegal request: Parameter length error Illegal request: Parameter page not supported
Medium error: Append error during write Medium error: Blank tape - use tape erase command Medium error: EOP/M encountered Medium error: Incompatible medium installed Medium error: Positioning error detected Medium error: RAW retry limit exceeded Medium error: Unrecovered read error
Unit attention: Drive failed power-on self test Unit attention: Drive or bus reset Unit attention: Log parameters may have changed Unit attention: Mode parameters may have changed Unit attention: Possible media change - you may need to repeat command
Write error: Media is write protected
NOTICE: Status: host=n target=n, : Key: unknownThe SCSI sense block was found to be empty.
WARNING: SCSI boot option(s) ignored : Invalid host adapter parameters WARNING: SCSI boot option(s) ignored : Invalid id and/or lun WARNING: SCSI boot option(s) ignored : Unknown host adapter driver WARNING: SCSI boot option(s) ignored : Unknown peripheral driverThese errors are reported at I/O initialization when they are read from the SCSI bootstrings.
PANIC: Unacceptable value for Sha_last_registered (n), in SharegisterCould not register a host adapter as a bootable device.
System Administration Guide
Draft proposed ANSI standard X3.131-198X, Small Computer System Interface -- 2 (SCSI-II), 1990.