TAPEINFO - a Linux utility to dump the inquiry, log, and mode pages of the
Hewlett-Packard C1533A tape drive

Copyright 1995 Eric L. Smith (eric@telebit.com)
$Header: /usr/home/kolwynia/eric/tapeinfo/RCS/README,v 1.2 1995/09/11 01:14:34 eric Exp eric $

TAPEINFO is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License version 2 as published by the Free
Software Foundation.  Note that I am not granting permission to redistribute
or modify TAPEINFO under the terms of any later version of the General Public
License.

This program is distributed in the hope that it will be useful (or at least
amusing), but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Public License for more details.

You should have received a copy of the GNU General Public License along with
this program (in the file "COPYING"); if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

-----------------------------------------------------------------------------

The Hewlett-Packard C1533A DDS 2 tape drive offers a vast amount of status
and log information which may be obtained via the SCSI Inquiry, Mode Sense,
and Log Sense commands.  Some of the most useful information includes error
logs that can be used to assess the quality of your tapes and/or the condition
of your drive, and compression information.  TAPEINFO was written to provide
an easy way to get at the information.

TAPEINFO currently uses the Linux generic SCSI device (such as /dev/sgb).
Unfortunately there is not a direct mapping from the SCSI ID to the device
name, but they get assigned in order.  If you have disks as ID 0 and 1 and
the tape drive as ID 6, the tape drive will be assigned to /dev/sgc.

TAPEINFO needs to have read and write permissions on the generic SCSI device.

The command syntax is:

./tapeinfo device [options]

<device> must be a generic SCSI device (/dev/sgb), not the tape device
(/dev/st0 or /dev/nst0)

Available options:
-i<nn>     display Inquiry page <nn>
-m<nn>     display Mode Sense page <nn>
-l<nn>     display Log Sense page <nn>
--help     display this text
--version  display version number

With no options, a list of available pages will be displayed.  Note that
the page numbers (<nn>) are in hexadecimal.

Currently some of the Log Sense pages are decoded, but all the other pages
are displayed as raw hexadecimal dumps.

To interpret the data, you will probably need a copy of
"The HP C1533A OEM Product Manual", Edition 3, January 1994, Part Number
C1533-90900.  This document seems to be hard to come by, but it has a wealth
of useful technical information.

There seems to be a problem with the generic SCSI driver (at least in
Linux 1.2.11), as read calls seem to always return the size of the buffer
that was provided rather than the actual count of bytes provided by the SCSI
device.  This causes interesting results if you ask for nonexistent pages.

