On 8 Dec 2003, Ken Bass wrote:

> Hello all, 
>   I'm digging through the USB mass storage code and am pretty confused.
> Previously we used a Sony AIT-1 tape drive via SCSI. However, we
> recently acquired a new model that supports either firewire / USB.
> Neither works (I think for the same reason). I realize that most people
> do not have such an expensive tape device so little testing happens on
> these units--thats why I'm trying to figure whats going on and hopefully
> fix the problem.
> 
> The device can be read/written to, but I cannot set the block size of
> the device (I/O ERROR). A block size change equates to the issuing of a
> MODE_SELECT command. In looking through the various code (2.4.22
> kernel), I see a whole bunch of mess related to MODE_SELECT(6) vs
> MODE_SELECT(10) translation. There are multiple transports such as: SCSI
> transports, ATAPI, and QIC routines.
> 
> >From my detailed device programming manual - the device is an ATAPI tape
> drive put into a USB 2.0 / Firewire external case. The documentation
> shows that the device ONLY support MODE_SELECT(6) which is command 0x15
> - however that command must be 12 bytes long. It looks just like a SCSI
> MODE_SELECT(6) padded with zeros on the end.
> 
> What is the correct way to support this device with a 2.4 kernel? I'm a
> bit confused when it comes to tracing the flow of the data from the
> original 'mt -f /dev/st0 setblk 0' down to the USB level. I find that
> the scsi mid-level set the command len to 6 based on the MODE_SELECT(6)
> opcode. 
> 
> In looking at the mass storage device driver:
> 
> The device is reporting its protocol as "Transparent SCSI" (0x50) which
> causes the usb_stor_transparent_scsi_command() protocol handler to be
> used. Looking at this handler I don't see where it pads the command to
> 12 ATAPI bytes. I also notice some 'US_FL_MODE_XLATE' flags - however am
> I correct to assume that the 'us->flags' is never set except for devices
> listed in the 'unusual_devices' array with their flags forced?
> 
> 1) How should a device like this be handled? I thought maybe it should
> be considered ATAPI instead of Transparent SCSI since the underlying
> tape drive is an ATAPI version (Sony SDX-420C). However, the ATAPI
> protocol routines translate from MODE_SELECT(6) to MODE_SELECT(10) which
> is not supported by this device.
> 
> It seems like there needs to be a mode simply for padding and nothing
> else. I hope this makes some sense. The archives didn't help on this
> issue, but that might be because I am the first person using one of
> these tape devices - it appears most mass storage issues to date relate
> to DVD, CD, or FLASH devices.

It sounds like you need the protocol changed to QIC-157 (0x03), which does
padding but not mode translation.  The proper way to do this is to add an
entry to the unusual_devs.h file.  See if that helps.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to