SCSI tape stat info

From: Mike A Larson <larz_at_nospam.org>
Date: Thu Nov 10 1994 - 09:53:42 PST

Hi,

Below are some notes on SCSI device names and tape commands. This
information will eventually a part of the SCSI document, but for now
I'm going to use it as a specification for writing the SCSI tape
stat/wstat interface. Please feel free to comment.

                                        Mike Larson

Device Names
------------

Device names composed of an optional device prefix letter followed by a
2 letter device ID followed by address ID followed by an optional '_'
and device specific parameter string.

        device prefix letter - "n" for no-rewind tapes

        device ID - "sd" for hard disks and magneto-
                                  optical disks, "sr" for CDROM drives,
                                  and "st" for tapes.

        device address - BUS/TARGET/LUN identifier (see below).

        device specific - optinal string that encodes
                                  parameters specific to a device or a
                                  mode that the device supports (see
                                  below).

The device ID has the following structure: BBTT[L], where B = BUS, T =
TARGET, L = optional LUN designator (a = LUN 0, b = LUN 1, etc.),
leading 0's are stripped. For example, st4 is the tape unit at BUS 0,
TARGET 4, LUN 0 and st104b is the tape unit at BUS 1, TARGET 4, LUN 1.

The device specific string is used as follows: for "sd" devices, the
device specific string is a partition type name (eg., "dos") followed
by a partition index (0 to number of partitions minus 1). For "st"
devices, device specific string is an optional mode selector (tape
modes are described later). Currently, this is a number that ranges
from 0 - 3. For example, sd2_dos2 is the third disk partition on the
disk at BUS 0, TARGET 2, LUN 0 and st104b_1 the tape unit at BUS 1,
TARGET 4, LUN 1 with parameters described by mode 1.

Tape Device FS_STAT Message Fields
----------------------------------

        size - an attempt at determining the number of
                          bytes on a tape medium.
        type - "s" (for special file, I think)
        owner - "1/1" (sys/sys)
        dev - CAM device number
        id - vendor + product + revision ID fields

Tape Device FS_WSTAT Message Fields
-----------------------------------

Syntax:

        : COMMAND
        | COMMAND '=' PRMNAME
        | COMMAND '=' PRMNAME prmval
        | COMMAND '=' prmval
        ;

where COMMAND and PRMNAME are identifiers and prmval is a literal
(eg., 1, 3.14) or an identifier.

        Command PrmName PrmVal
        ------- ------- ------

        MTIOCTOP mt_op (*1) count

        MTSETMODE mode (*2) value

*1) mt_op = MTWEOF | MTFSF | MTBSF ... Note that the SCSI/CAM tape
driver is currently using the FreeBSD mtio.h.

*2) mode = MTBLKSIZ[0-N] | MTDENSITY[0-N] (where N is
currently 3). Note that the MT*0 names contain default values
determined by the driver. Modes are persistent - they do not go away
when a tape device is closed. Here are the possible values for the
MTSETMODE modes parameters:

        MTBLKSIZ - for fixed-block devices, the
                                  block size in bytes.

        MTDENSITY - SCSI density code.
Received on Thu Nov 10 09:33:58 1994

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:10 PDT