STDEVINFO(4) — NEWS-OS Programmer’s Manual
NAME
stdevinfo − SCSI tape drive information table
SYNOPSIS
#define NDENS_CODE 8 /∗ number of density code ∗/
#define MAX_MSEL_LEN 40 /∗ maximum MODE SELECT param length ∗/
struct stinfo {
char si_ninfo; /∗ additional length byte of INQUIRY ∗/
char ∗si_ident; /∗ vender unique parameter string of INQUIRY ∗/
char ∗si_name; /∗ name of device ∗/
char si_fixrec; /∗ device type, fixed or flex record size ∗/
int si_maxbsize; /∗ maximum block size, 0 for automatic ∗/
char si_progio; /∗ data transfer mode, usually use dma ∗/
char si_immediate; /∗ REWIND command returns immediately ∗/
u_short si_flags; /∗ device’s capability flags, see follows ∗/
char si_nrsense; /∗ REQUEST SENSE parameter length ∗/
char si_exerrpos; /∗ position of extended error code ∗/
char si_nerrcode; /∗ number of byte of error code ∗/
char si_nmsense; /∗ MODE SENSE parameter length ∗/
char si_nmselect; /∗ MODE SELECT parameter length ∗/
u_char si_mseldata[MAX_MSEL_LEN]; /∗ MODE SELECT data ∗/
u_char si_denstab[NDENS_CODE]; /∗ density code table ∗/
};
DESCRIPTION
stdevinfo is an information table concerning SCSI tape drives. Drives supported by the device driver st are listed in the in the device information stdevinfo found in the device configuration file /sys/newsiodev/stdefs.c. In addition, it is also possible to use new types of tape drives by making the appropriate additions to this table.
Furthermore, it is also possible to connect tape devices which are not listed in stdevinfo. In such cases, MODE SELECT, used to select the individual functions of the drive, is not performed. Instead all operations are performed using the default settings of the tape drive in question.
si_ninfoThis data is used when probing the drive. It is used to specify the Additional Length (value in the 5th byte of data obtained using the INQUIRY command). However, if a character string representing a Vendor ID or Product ID is found in the Vendor Unique field when using the INQUIRY command, be sure to specify −1 here. In such cases, a search of the information table for the character string in the field si_ident (to be described later) will be performed. If a value of 0 or greater is specified here, the entry will be chosen even if only this non-negative value and the value of the Additional Length match.
si_identUsed to specify the character string set in the Vendor Unique field (beginning from the 6th byte) as obtained using the INQUIRY command. If the drive does not return a character string corresponding to a Vendor ID or Product ID when using this command, specify NULL here.
si_nameUsed to specify the character string to be used as the internal drive name by NEWS−OS. Any character string may be used.
si_fixrecUsed to specify STDR_FIXED (for drives using blocks of fixed length) if the drive is a tu-type (streaming tape unit) drive, or STDR_FLEX (for drives using variable length blocks) if it is an mu-type drive (magnetic tape unit).
si_maxbsizeBe sure to specify a value of 0 here. The maximum block size is found automatically by the device driver st.
si_progioBe sure to specify STDT_DMA here.
si_immediateSpecify a value of 1 here if the drive has a function such that the REWIND command returns immediately without waiting for rewind operations to complete after it has been issued. Otherwise, specify a value of 0 here. If 1 is specified here, the immediate bit (the 2nd LSB of CDB) is set when a REWIND command is issued.
si_flagsDepending on which of the commands SPACE, MODE SELECT, MODE SENSE, and LOAD the drive supports, specify the corresponding macro constants STDF_SPACE, RSTDF_MSELECT, RSTDF_MSENSE, and STDF_LOAD supported separating each with a “|”. For example, if the drive in question only supports the MODE SENSE, MODE SELECT, and LOAD commands, then the specification here will be as follows.
STDF_MSELECT|STDF_MSENSE|STDF_LOAD
Be sure to also specify STDF_UL2EOM for drives which do not rewind the tape media to the BOT (Beginning Of Tape), but instead send it to the EOM (End Of Media) when an UNLOAD command has been executed.
si_nrsenseUsed to specify the sense data length in bytes read out by the REQUEST SENSE command. The length specified must be more than 4 bytes but less than 20.
si_exerrposUsed to specify the position of extended error codes within the sense data data obtained by the REQUEST SENSE command if that data includes such extended error codes specific to the drive. For example, specify 8 here if the 9th byte of sense data is an extended error code. Be sure to specify −1 if there is no extended error code used by the device. Extended error codes set here are displayed on the console along with the sense key when an SCSI error is detected.
si_nerrcodeUsed to specify the number of bytes used for the extended error code previously mentioned. Be sure to specify −1 if there is no extended error code used by the device.
si_nmsenseUsed to specify the parameter length in bytes to be sensed if the drive supports the MODE SENSE command. The length specified must be 40 bytes or less. Be sure to specify −1 if if the drive does not support the MODE SENSE command.
si_nmselectUsed to specify the mode select parameter length in bytes if the drive supports the MODE SELECT command. The length specified must be 40 bytes or less. Be sure to specify −1 if if the drive does not support the MODE SELECT command.
si_mseldataUsed to specify the parameters set by the MODE SELECT command. However, since the three items: Block Descriptor Length, Density Code, and Block Length, are automatically set by the device driver, be sure to specify 0 for each of them. Specify the appropriate data necessary if it is necessary to set a special parameter specific to the drive in this field.
si_denstabThe device driver st switches record formats in accordance with the minor device number of the drive. Specify the density code corresponding to the minor number record format in this field. Errors will occur when trying to open the device using open() if the value TD_INVAL is specified here.
A table search is performed beginning from from the 3rd entry and continuing to the end of the table when the drive is being probed. If there is no matching entry, the drive is probed as an Unknown Drive. In such cases, the device driver st functions using the 1st entry in the table for tu-type drives or the 2nd entry for mt-type drives.
EXAMPLE
/∗
∗ ARCHIVE CARTRIDGE STREAMER
∗ 2060S - 60MB
∗/
{
-1,"ARCHIVE VIPER 60",
"2060S",
STDR_FIXED,
0,
STDT_DMA,
1,
STDF_SPACE|STDF_MSELECT|STDF_MSENSE|STDF_LOAD,
7,-1,-1,
12,
12,
{
0, 0, SCM1_BUFM, 0, 0, 0, 0, 0, 0, 0, 0, 0
},
{TD_DEFLT,TD_INVAL,TD_INVAL,TD_Q24,
TD_INVAL,TD_INVAL,TD_INVAL,TD_INVAL
},
},
FILES
/dev/{r|nr|anr}st∗ device special files
/sys/newsiodev/streg.h stdevinfo structures and ioctl defininitions
/sys/newsiodev/stdefs.c configuration file
SEE ALSO
NEWS-OSRelease 4.2.1R