sdi(HW)


sdi -- Storage Device Interface subsystem

Description

The ioctl(S) commands that are supported by various SDI devices are documented in the following sections.

Pass-through ioctl commands

SCSI Device Interface Host Bus Adapters (HBA)s that support the SDI pass-through interface must support the following ioctl(S) commands:

SDI_SEND
Sends a pass-through command (SCSI control block) to a target controller, bypassing the associated target driver.

SDI_BRESET
Resets the SCSI bus.

B_GETTYPE
Returns the bus name and the device driver name of a specific device.

HA_VER
For a 80386-based computer, used to determine the Driver Interface Version supported by the driver. It returns the ver_no structure defined in the /usr/include/sys/sdi.h header file.

Disk ioctl commands

The ioctl(S) calls supported by the sd01(HW) driver to control the reading and writing of data to disk are as follows:

SDI_RESERVE
Reserves for exclusive use a SCSI disk for a processor.

SDI_RESTAT
Returns device reservation status.

The following commands are used to identify a target driver and to get pass-through major and minor numbers for a target device:


B_GETTYPE
See ``Pass-through ioctl commands''.

B_GETDEV
Returns the pass-through major and minor numbers to the calling utility, allowing creation of a pass-through special device file.


NOTE: Starting with Release 7.1, applications should use the SCSI pass-through interface documented on pt_open(S), pt_send(S), and pt_close(S) to send commands to SCSI Device Interface Host Bus Adapters (HBA)s that support the SDI pass-through interface. Application use of the B_GETTYPE and B_GETDEV ioctl commands for this purpose is maintained for compatibility with existing applications only.

Tape ioctl commands

The ioctl(S) calls that are supported by the st01(HW) driver are listed below.

The following commands are used to control tape positioning:


T_SFF and T_SFB
Positions the tape forward or backward arg (see ioctl(S)) number of file marks from the current tape head position toward the End- of-Tape (EOT) or Beginning-of-Tape (BOT). Forward movement of the tape leaves the tape positioned on the EOT side of a file mark or at EOT, and backwards movement leaves the tape positioned on the BOT side of a file mark or at BOT. A backward positioning operation causes the next read to return 0 bytes unless arg is greater than the number of file marks between the current position and BOT. The value of arg must be a positive integer. A value of 0 is not considered an error, but does not result in any tape movement.

T_SBF and T_SBB
Positions the tape forward or backward arg number of blocks from the current tape head position toward the EOT or BOT. Upon command completion, the tape head is positioned in the gap between tape blocks. Thus, skipping a block forward advances to the next block, and skipping a block backward retreats to the last block. The value of arg must be a positive integer. Upon any attempt to skip over a file mark, the tape is positioned on the EOT/BOT side of the file mark for forward or backward movement, and the positioning operation ceases. A value of 0 is not considered an error, but does not result in any tape movement.

T_RWD
Rewinds the tape from the current tape position to the BOT. Two file marks are written before the rewind if the tape has been written. This command does not unload the tape.

T_WRFILEM
Writes file marks to the tape. The value of arg defines the number of consecutive file marks to be written. If an error occurs while writing file marks, the number of file marks that have been successfully written is indeterminate.

T_EOD
Positions the tape just beyond the last file mark.

T_STD
Defines the recording density of the tape media being used. The numeric density code used is as defined in the SCSI-2 specification.

T_PREVMV and T_ALLOMV
Locks or unlocks the tape in the drive. T_PREVMV locks the tape by means of a mechanical lock or an LED to indicate the device is in use.

T_ALLOMV unlocks the tape in the drive locked by T_PREVMV.

These ioctls are supported only on devices that implement appropriate tape lock features. For example, ICT devices are among those which do not support this ioctl.


T_LOAD and T_UNLOAD
T_LOAD loads the tape media and positions the tape BOT.

T_UNLOAD unloads the tape. Most devices rewind the tape before unloading. Devices capable of ejecting the tape will do so in response to this command.


T_ERASE
Erases the tape from BOT to EOT. If the tape is not positioned at BOT, the tape is positioned at BOT before performing the erase function.

T_RDBLKLEN and T_WRBLKLEN
T_RDBLKLEN returns the minimum and maximum block lengths supported by the tape device. T_WRBLKLEN sets the current block length for the device. The value of arg must be of type struct blklen, and max_blen and min_blen set to the desired block length for T_WRBLKLEN. See /usr/include/sys/st01.h for more information.

T_RETENSION
Retensions the tape in the drive, running the tape at high speed from BOT to EOT, and then back again. The retension operation leaves the tape positioned at BOT.
The following commands are used by the st01 driver to control data compression characteristics:

T_GETCOMP and T_SETCOMP
T_GETCOMP returns the data compression characteristics of the tape device. T_SETCOMP sets the data compression characteristics of the tape device. The value of arg is defined as:

0
compression off and decompression off

1
compression on and decompression off

2
compression off and decompression on

3
compression on and decompression on
The following additional ioctls are supported for floppy tape drives using the fdha and cmtrak HBA drivers:

FT_RESET
Resets the drive.

FT_FORMAT
Formats cartridge. The third parameter of the ioctl(S) system call should pass a pointer to the following structure:
struct ft_format {
	char tape_name[44];
	unchar tape_length;
	ulong tape_fmt_time;
};
tape_name is any ASCII string, left-justified and space-filled. tape_length takes the following values::

length code
205 ft 0x01
307.5 ft 0x02
1100 ft 0x04

 length     code
 205 ft     0x01
 307.5 ft   0x02
 1100 ft    0x04

tape_fmt_time is the time at which format is started and is coded as follows:

bits value
31-25 0 - 127 = 1970 - 2097
24-0 month, day, hour, minute, and second

 bits    value
 31-25   0 - 127 = 1970 - 2097
 24-0    month, day, hour, minute, and second

Let MO be the month (0-11), DY the day (0-30), HR the hour (0-23), MN the minute (0-59), and SC the second (0-59). tape_fmt_time then contains:

SC + 60 * (MN + 60 * (HR + 24 * (DY + 31 * MO)))


FT_VTBL_RW
Reads or writes the volume table of contents (VTBL) on a cartridge. The argument expected is a pointer to the structure:
struct ft_vtbl_rw {
	 unchar io_type;
	 caddr_t vtbl_data; 	
	 unsigned num_vtbl_entry;
};

io_type
0x01 for read, 0x02 for write

vtbl_data
should always be 29K

num_vtbl_entries
number of VTBL entries read or written.

CD-ROM ioctl commands

The ioctl(S) commands that are supported by the sc01(HW) driver are listed below. Many of these ioctl commands provide a convenient method for sending one of the preselected SCSI commands directly to the drive. SCSI commands not explicitly supported by the sc01 driver can be sent to the drive using the pass-through facility provided by the SDI host adapter driver. For an example, see adsc(HW).

The following ioctls are used to identify a target driver and to get a pass-through major and minor number for a target device:


B_GETTYPE
See ``Pass-through ioctl commands''.

B_GETDEV
Returns the major and minor number of the pass-through device for the CD-ROM drive (see adsc(HW) for details).


NOTE: Starting with Release 7.1, applications should use the SCSI pass-through interface documented on pt_open(S), pt_send(S), and pt_close(S) to send commands to SCSI Device Interface Host Bus Adapters (HBA)s that support the SDI pass-through interface. Application use of the B_GETTYPE and B_GETDEV ioctl commands for this purpose is maintained for compatibility with existing applications only.

The following ioctls cause the appropriate Group-0, Group-1, or Group-6 SCSI commands to be sent to the device. These commands are defined by the SCSI bus specification and should also be described in the SCSI Interface section of the reference manual supplied with your CD-ROM drive.

The Group-0 ioctls are:


C_TESTUNIT
Sends a Test Unit Ready command to the device.

C_REZERO
Sends a Rezero Device command to the device.

C_SEEK
Sends a Seek command to the device.

C_INQUIR
Sends an Inquiry command to the device and returns the resulting data back to the caller. The passed buffer for C_INQUIR needs to be at least IDENT_SZ (36) bytes. Otherwise, an underflow error occurs and the command fails.

C_STARTUNIT
Sends a Start Unit command to the device.

C_STOPUNIT
Sends a Stop Unit command to the device.

C_PREVMV
Sends a Prevent Media Removal command to the device.

C_ALLOMV
Sends an Allow Media Removal command to the device.

The Group-1 ioctls are:


C_READCAPA
Sends a Read Capacity command to the device and returns the data sent by the drive.

The Group-6 ioctls are:


C_AUDIOSEARCH
Sends an Audio Search command to the device.

C_PLAYAUDIO
Sends a Play Audio command to the device.

C_STILL
Sends a Still command to the device.

C_TRAYOPEN
Sends a Tray Open command to the device.

C_TRAYCLOSE
Sends a Tray Close command to the device.


NOTE: The Group-6 ioctls support only the drives that are software compatible with the Toshiba XM-3201B.

The following ioctl is also supported by the sc01 driver:


B_GET_SUBDEVS
Returns the number of sub-devices supported by this driver.

Media changer ioctl commands

The ioctl(S) calls that are supported by the mc01(HW) driver to control the medium changer operations are as follows:

MC_EXCHANGE
Used to exchange the currently loaded media with media from a specified slot. The currently loaded media is placed back into the magazine slot from which it was loaded. The command used to implement this ioctl is optional; therefore, this command's functionality is medium changer dependent.

MC_INIT_STATUS
Used to initialize the medium changer's status. This operation should be performed whenever a new magazine is inserted, or the medium changer's front panel controls are used to manipulate the mechanism.

MC_MOVE_MEDIUM
Used to move a medium element from one storage element location to another.

MC_POSITION
Used to position the medium changer to a specific storage element location. This is an optional SCSI command. The command used to implement this ioctl is optional; therefore, this command's functionality is medium changer dependent.

MC_ELEMENT_COUNT
Reports the number of storage element locations in the currently loaded magazine.

MC_STATUS
Reports the status of the medium changer device. The report includes the total number of storage element locations, status (Loaded or Empty) of each storage element location, and status (Loaded or Empty) of the data transfer element (drive).

MC_LAST_LOADED
Reports the storage element number that the currently loaded media came from.

MC_PREVMR
Used to prevent media or magazine removal. The command used to implement this ioctl is optional; therefore, this command's functionality is medium changer dependent.

MC_ALLOWMR
Used to allow media or magazine removal. The command used to implement this ioctl is optional; therefore, this command's functionality is medium changer dependent.

SDI_RESERVE
Reserves a SCSI disk for a processor.

SDI_RELEASE
Releases a SCSI disk from a processor.

B_GETTYPE
See ``Pass-through ioctl commands''.

B_GETDEV
Returns the pass-through major and minor numbers to the calling utility, allowing creation of a pass-through special device file.


NOTE: Starting with Release 7.1, applications should use the SCSI pass-through interface documented on pt_open(S), pt_send(S), and pt_close(S) to send commands to SCSI Device Interface Host Bus Adapters (HBA)s that support the SDI pass-through interface. Application use of the B_GETTYPE and B_GETDEV ioctl commands for this purpose is maintained for compatibility with existing applications only.

WORM ioctl commands

The ioctl(S) calls that are supported by the sw01(HW) driver are listed below. Many of the supported ioctl calls provide a convenient method for sending one of the preselected SCSI commands directly to the drive. SCSI commands not explicitly supported by sw01 can be sent to the drive using the pass-through facility provided by the SDI host adapter driver.

The following ioctl calls are defined and required by the SDI interface:


B_GETTYPE
See ``Pass-through ioctl commands''.

B_GETDEV
Returns the major and minor number of the pass-through device for the WORM drive.

SDI_RESERVE
Sends a SCSI Reserve command to the drive.

SDI_RELEASE
Sends a SCSI Release command to the drive.


NOTE: Starting with Release 7.1, applications should use the SCSI pass-through interface documented on pt_open(S), pt_send(S), and pt_close(S) to send commands to SCSI Device Interface Host Bus Adapters (HBA)s that support the SDI pass-through interface. Application use of the B_GETTYPE and B_GETDEV ioctl commands for this purpose is maintained for compatibility with existing applications only.

The following ioctl calls send the appropriate Group-0 SCSI command to the device. These commands are defined by the SCSI bus specification and should also be described in the SCSI interface section of the reference manual supplied with your WORM drive.


W_TESTUNIT
Sends a Test Unit Ready command to the device.

W_REZERO
Sends a Rezero Device command to the device.

W_SEEK
Sends a Seek command to the device.

W_INQUIR
Sends an Inquiry command to the device, and returns the resulting data back to the calling process.

W_STARTUNIT
Sends a Start Unit command to the device.

W_STOPUNIT
Sends a Stop Unit command to the device.

W_PREVMV
Sends a Prevent Media Removal command to the device.

W_ALLOMV
Sends an Allow Media Removal command to the device.

The following ioctl calls send the appropriate Group-1 SCSI command to the device. The Group-1 SCSI commands are defined by the SCSI standard and should be described in the SCSI interface section of the reference manual supplied with your WORM drive.


W_READCAPA
Sends a Read Capacity command to the device, and returns the data sent by the drive.

W_VERIFY
Sends a Verify command to the device.

The following ioctl calls send the appropriate Group-6 SCSI command to the drive. These Group-6 SCSI commands are vendor specific and should be described in the SCSI interface section of the reference manual supplied with your drive. Because the format of these SCSI commands is vendor-specific, these ioctl calls are supported only by products compatible with the Toshiba D070 drive.


W_STNCHECK
Sends a Stand-By Check command to the device.

W_LOADCART
Sends a Load Cartridge command to the device.

W_UNLOADCA
Sends an Unload Cartridge command to the device.

W_READCB
Sends a Read Control Block command to the device.

The following ioctl calls send the appropriate Group-7 SCSI command to the drive. Group-7 SCSI commands are vendor specific and should be described in the SCSI interface section of the reference manual supplied with your drive. Since the format of these SCSI commands is vendor specific, these ioctl calls are supported only by products compatible with the Toshiba D070 drive.


W_CHECK
Sends a Check command to the device.

W_CCHECK
Sends a Contrary Check command to the device.

The following ioctl calls are also supported by the sw01 driver:


B_GET_SUBDEVS
Returns the number of sub-devices supported by this driver.

References

mc01(HW), sc01(HW), sd01(HW), st01(HW), sw01(HW)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 02 June 2005