> -----Original Message----- > From: Alan Stern [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 04, 2005 10:53 PM > To: Hou Xiang ZHU > Cc: USB development list > Subject: Re: [linux-usb-devel] Re: Add UFI command to Mass > storage device driver > > > 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 > I think for just unlock the stick using a few extra command, this approach is ok, but what if I also want to encrypt every single byte of data on this stick(using some encrypt algorithm)? I think I have to write a special driver for it . Even if I use the unusual_devs device for Mass storage by adding one entry of special device , It is hard to implement it. Am I right?
Houxiang Zhu ------------------------------------------------------- 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