On Tue, Jan 04, 2005 at 09:52:49AM -0500, Alan Stern wrote:
> 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.

He'll also have a problem guaranteeing that his code runs before the
INQUIRY commands, as he wants.

Matt

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

I think the problem is there's a nut loose on your keyboard.
                                        -- Greg to Customer
User Friendly, 1/5/1999 

Attachment: pgp8RxsKhNB5F.pgp
Description: PGP signature

Reply via email to