I hope the scsi list is the place to talk about ioctl() parameters for
tape devices in mtio.h - if not please suggest a better place...
The source _is_ scsi/st.c :-)
Precis of problem:
I've been having trouble getting "ufsrestore" to work between a Solaris 7
box and a Linux 2.0.x system. The error reported was about an incompatible
rmt problem, but tracing the problem further showed that the results
from MTIOCGET was causing the problem.
Diagnosis:
It appears as if the Solaris mtget structure is 24 bytes long, whereas
Linux uses a 28 byte structure.
Solaris 7 /usr/include/sys/mtio.h
struct mtget {
short mt_type; /* type of magtape device */
/* the following two registers are grossly device dependent */
short mt_dsreg; /* ``drive status'' register */
short mt_erreg; /* ``error'' register */
/* optional error info. */
daddr_t mt_resid; /* residual count */
daddr_t mt_fileno; /* file number of current position */
daddr_t mt_blkno; /* block number of current position */
ushort_t mt_flags;
short mt_bf; /* optimum blocking factor */
};
Linux 2.0.x /usr/include/linux/mtio.h
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 */
};
(hmm, just checked a 2.2.12 kernel and it appears the same, I don't
currently have a 2.3 system in working order).
Why Solaris ufsrestore tries to check this value, I don't really know
(SunOS 4 definitely doesn't, and I think Solaris 2.5.1 doesn't either -
my 2.5.x is unplugged on the floor in pieces at present), but it does.
This means that a Linux system can not act as a tape host to a Solaris 7
machine.
Is there any reason for this difference?
Unfortunately, this structure is used in more that one driver in 2.2 :-(
drivers/char/ftape/ftape-ctl.c
drivers/block/ide-tape.c
drivers/char/tpqic02.c
drivers/scsi/st.c
rgds
Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]