The Ftape Installation Guide - Ioctls
MTIOCGET
, query the tape drive status
Please read also the man page of the contributed mt
program
(`mt 1 ftmt
'). The following is from the standard Linux include
file /usr/src/linux/include/linux/mtio.h:
/* structure for MTIOCGET - mag tape get status command */
struct mtget { long mt_type; /* type of magtape device */ long mt_resid; /* residual count: (not sure) * number of bytes ignored, or * number of files not skipped, or * number of records not skipped. */ /* the following registers are device dependent */ long mt_dsreg; /* status register */ long mt_gstat; /* generic (device independent) status */ long mt_erreg; /* error register */ /* The next two fields are not always used */ __kernel_daddr_t mt_fileno; /* number of current file on tape */ __kernel_daddr_t mt_blkno; /* current block number */ };
The fields mt_dsreg
and mt_erreg
were unused by ftape-2.x and
sftape whereas zftape uses them to store the last queried hardware
tape drive status and error code. ftape defines for this purpose the
following two unions in ftape.h. The meaning should be quite
clear. The components contain the bits returned by the respective QIC
report commands (see QIC-117 standard, http://www.qic.org):
/* the following two may be reported when MTIOCGET is requested ... */ typedef union { struct { __u8 error; __u8 command; } error; long space; } ft_drive_error;
typedef union { struct { __u8 drive_status; __u8 drive_config; __u8 tape_status; } status; long space; } ft_drive_status;
Use these buttons to jump to the top menu