Re: Handling SCSI commands in USB simulator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 14 May 2009, Madhukar G wrote:

> Thanks for the reply.
> 
> My device is implementing a new Mass Storage Protocol UAS (USB
> Attached SCSI). So, i do not think existing usb-storage would work for
> this device.

No, it won't.

> Moreover in my stack with simulator i'm directly redirecting the
> submission of URB to simulator.

This is absolutely the wrong thing to do.  You've just said that 
usb-storage won't work with your device.  It follows that usb-storage 
won't work with your simulator (assuming you simulate the device's 
bevahior accurately).  Since the URB is created by usb-storage, you 
shouldn't send the URB to your simulator.

Or let's put it another way.  Since usb-storage won't work with your
device, it also won't work with your simulator.  So you can redirect
the submission of URBs to your simulator if you like, but in the end
this won't work.

> I had removed usbcore and host from
> the stack for testing simulator.
> 
> Also, I'll look to gadget device for any details.
> 
> I would like to know what is needed to be handled in simulator so that
> SCSI layer sends SCSI commands to storage and then to my simulator.

The commands have to be carried out.  That is, data has to be
transferred either to or from the buffer, and srb->result and the
residue have to be set.  Finally, you have to call srb->scsi_done (or
you have to let usb-storage call it for you).

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux