Subject: Re: Illegal SCSI opcodes
To: None <current-users@NetBSD.ORG>
From: Daniel Widenfalk <>
List: current-users
Date: 03/10/1995 11:14:09
> Charles Hannum said:
>>    cd0(bt0:4:0): illegal request, data = 00 00 00 00 20 00 00 00 00 00
>> That's an `illegal opcode' error.  Are you sure that drive supports the
>> SCSI 2 audio commands?
> It turns out I've been seeing this on my Archive tape drive, when it first
> tries to read a tape after I've changed tapes.  (It then complains that it
> cannot set the mode.)  If I try again to read the tape, it works fine,
> going through the usual hunting process to figure out the tape density and
> then reading it.
> [Hmm, maybe it's just the first time after boot; I just tried to reproduce
> it, and it only happened the very first time.]  Is the tape driver attempting
> a SCSI2 mode sense or something like that?  At boot time, the driver declares
> it to be a SCSI1 tape drive, as well as a "rogue" (and since the driver
> purports to have detailed knowledge of the drive's characteristics, I'd think
> that it would know which opcodes would and wouldn't work).
> The specific error message is (gee, it would be nice if it printed the
> SCSI command block, too):
> st0(aha0:5:0): illegal request, data = 00 00 00 00 00 00
> st0: cannot set selected mode

I think I have had the same problem. During my development of a FAS216 based
scsi driver I got multiple "cannot set ..." and I tracked it down to a kernel
bug/miss. It seems that the kernel sends buffers that resides on the stack.
If a process switch occurs the stack is also swaped... This hapends if the
scsi driver is interrupt driven (and may therefore execute at any time).

I made a fix for my driver, but I think that the problem should be fixed in
the sd.c, cd.c, st.c etc.

This is what I know of this. (After I added my fix, my problems evaporated)

/Daniel Widenfalk