Subject: Q: about scsi/st.c
To: None <current-users@NetBSD.ORG>
From: VaX#n8 <>
List: current-users
Date: 03/25/1996 08:58:17
Okay, I'm trying to track down my problem reading old tapes.
This is on a Tandberg TDC-3800, a QIC SCSI drive.
The problem is that every time I read an old tape I get this error:
printf("%s: block wrong size, %d blocks residual

It comes from this block of code, which I don't understand because
1) I'm still basically ignorant of the driver structures
2) I don't know SCSI protocol at all

        if (st->flags & ST_FIXEDBLOCKS) {
                if (sense->extended_flags & SSD_ILI) {
                        st->flags |= ST_EIO_PENDING;
                        if (bp)
                                bp->b_resid = xs->resid;
                        if (sense->error_code & SSD_ERRCODE_VALID &&
                            (xs->flags & SCSI_SILENT) == 0)
                                printf("%s: block wrong size, %d blocks residual
                                    st->sc_dev.dv_xname, info);

So let me postulate here:
sense is some kind of "sense data", containing some kind of error code from the
ILI = 0x20 <- what does this mean?  (Illegal Instruction perhaps?)
"residual" is the number of blocks left unread after the first request?

If this is correct, this would lead me to believe I am getting an error
while reading the first block on either tape; what could cause such a thing?
Note: my tape drive is SCSI-1, perhaps it is not responding to the extended
mode sense properly or something?

Someone has to have changed the st code recently which accounts for this new
behavior reading old tapes.  I see julian, thorpej, and charles mentioned in
the file.

I read a Linux SCSI HOWTO which said that the hardware block size varies
from OS to OS, and they set it using a "bsd-based mt" with the "setblksz"
command.  They mention you may need to do this to read tapes written by
other OSes.  I don't see this on our mt, but could this be a factor?

Sorry for such a long mail.  Any suggestions on how to track this down
would be greatly appreciated.