Anders,

Try patching your kernel with the attached patch, while your at it
enable USB mass storage debugging in your kernel config.

Steve




On Wed, 2003-03-05 at 23:32, Anders Bruun Olsen wrote:
> Hi,
> 
> I have a QTEC 756C IDE/USB2.0 case
> (http://www.qtec.info/products/product.htm?artnr=13280) in which I have
> put a LiteOn 16x CDRW drive. The case has a Genesys Gl811
> (http://www.genesyslogic.com/GL811.htm) controller as far as I have
> been able to find out. With kernel 2.4.20 I had it accept the drive (the
> drive rejected its given address 4 or 5 times, but eventually accepts
> it) and devfsd makes a /dev device for it, but I can't mount CDs. It
> just claims that there is no media in the drive even when there is a CD
> in it. 
> I have just compiled 2.5.64 and when I turn on the case I can see it
> being registered and accepting the address right away. It shows up in
> /proc but devfsd makes no device in /dev.
> 
> What to do?
> 
> -- 
> Anders

# --------------------------------------------
# Fix SCSI cmd_len for auto-sense commands
# --------------------------------------------
#
diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
--- a/drivers/usb/storage/transport.c   Tue Mar  4 10:03:36 2003
+++ b/drivers/usb/storage/transport.c   Tue Mar  4 10:07:33 2003
@@ -700,20 +700,26 @@
                unsigned short old_sg;
                unsigned old_request_bufflen;
                unsigned char old_sc_data_direction;
+               unsigned char old_cmd_len;
                unsigned char old_cmnd[MAX_COMMAND_SIZE];
 
                US_DEBUGP("Issuing auto-REQUEST_SENSE\n");
 
                /* save the old command */
                memcpy(old_cmnd, srb->cmnd, MAX_COMMAND_SIZE);
+               old_cmd_len = srb->cmd_len;
 
                /* set the command and the LUN */
+               memset(srb->cmnd, 0, MAX_COMMAND_SIZE);
                srb->cmnd[0] = REQUEST_SENSE;
                srb->cmnd[1] = old_cmnd[1] & 0xE0;
-               srb->cmnd[2] = 0;
-               srb->cmnd[3] = 0;
                srb->cmnd[4] = 18;
-               srb->cmnd[5] = 0;
+
+               /* FIXME: we must do the protocol translation here */
+               if (us->subclass == US_SC_RBC || us->subclass == US_SC_SCSI)
+                       srb->cmd_len = 6;
+               else
+                       srb->cmd_len = 12;
 
                /* set the transfer direction */
                old_sc_data_direction = srb->sc_data_direction;
@@ -739,6 +745,7 @@
                srb->request_bufflen = old_request_bufflen;
                srb->use_sg = old_sg;
                srb->sc_data_direction = old_sc_data_direction;
+               srb->cmd_len = old_cmd_len;
                memcpy(srb->cmnd, old_cmnd, MAX_COMMAND_SIZE);
 
                if (temp_result == USB_STOR_TRANSPORT_ABORTED) {

Reply via email to