On Tue, 4 Jan 2005, Matthew Dharm wrote:

> You can either add them to the SCSI core (which does the bus scanning), or
> to a device-specific initializer (the last parameter in an unusual_devs.h
> entry).
> 
> Matt
> 
> On Tue, Jan 04, 2005 at 01:53:03PM +0800, Hou Xiang ZHU wrote:
> > Hi,
> > 
> > I  use FC2 and kernel is 2.6.8.1.
> > 
> > I want to send 3 extra self-defined UFI command to USB memory stick before 
> > it send the normal command such as INQUIRY, etc.(these extra command used 
> > to unlock the secure USB stick!)
> > 
> > I read the Mass storage device driver code and found that such command are 
> > processed in usb_stor_control_thread() of storage/usb.c,
> > I guess these UFI command are comming from upper layer.  But where do they 
> > exactly coming from?  how can I send my own command to USB stick?
> > 
> > I guess eventually I have to write a special driver for it, but currently I 
> > only want to modify the standard Mass storage driver to unlock it.
> > 
> > thank you for your attention!
> > 
> > Houxiang zhu

Another possibility is to write a userspace program.  Use libusb to send 
the commands you need, and then use the USBDEVFS_CONNECT ioctl to cause 
the usb-storage driver to rebind to the stick.

The advantage of this approach is that it's simpler and easier than 
writing a kernel driver.  The disadvantage is that it won't be get run 
automatically unless you set up special hotplug scripts.

Alan Stern



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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