On Fri, 5 Jan 2007, Pete Zaitcev wrote:

> On Fri, 5 Jan 2007 10:52:27 -0500 (EST), Alan Stern <[EMAIL PROTECTED]> wrote:
> 
> > We are led to the following reasoning:
> > 
> >     CB and CBI can't pass the LUN value as a control parameter,
> >     but only as part of the CDB.
> > 
> >     If scsi_level is 0 then the LUN value won't be passed in the CDB.
> > 
> >     Hence any device using CB or CBI with scsi_level == 0 _must_
> >     be single-LUN.
> > 
> > Pete, I imagine this will solve your problem better than your proposed 
> > change.
> 
> OK, the patch works, although the /proc/scsi/scs now looks like this:
> 
> Host: scsi1 Channel: 00 Id: 00 Lun: 00
>   Vendor: AMI      Model: Virtual CDROM    Rev: 1.00
>   Type:   CD-ROM                           ANSI SCSI revision: ffffffff
> Host: scsi2 Channel: 00 Id: 00 Lun: 00
>   Vendor: AMI      Model: Virtual Floppy   Rev: 1.00
>   Type:   Direct-Access                    ANSI SCSI revision: ffffffff

That looks like a simple bug in
drivers/scsi/scsi_proc.c:proc_print_scsidevice().  It should be easily
fixable.  Near the end of the routine, make this change:

-                    " SCSI revision: %02x", (sdev->scsi_level > 1) ?
-                    sdev->scsi_level - 1 : 1);
+                    " SCSI revision: %02x",
                     sdev->scsi_level - (sdev->scsi_level > 1));


> > -           sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;
> > +           if (sdev->scsi_level > SCSI_2)
> > +                   sdev->scsi_level = sdev->sdev_target->scsi_level =
> > +                                   SCSI_2;
> 
> This looks a little ugly. Can we have this instead:
> 
>               if (sdev->scsi_level > SCSI_2) {
>                       sdev->scsi_level = SCSI_2;
>                       sdev->sdev_target->scsi_level = SCSI_2;
>               }

How about this:

                        sdev->sdev_target->scsi_level =
                                        sdev->scsi_level = SCSI_2;

This makes it clear that the two values are intended always to be equal.

> The 0x1A is still there. I looked at the code and it seems observing
> use_10_for_ms everywhere. But also both sd and scsi_lib can reset it
> to zero if things go wrong, which is what may be happening. I think
> a couple of printks may clear up the picture.

Or usbmon.  :-)

Speaking of which, and completely OT, I have a request for a usbmon API
change.  When reporting an Isochronous URB, would it be possible to 
present urb->number_of_packets?  It would be useful for debugging.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to