|
From: Peter S. <stu...@cd...> - 2007-03-29 04:03:47
|
Hi Justin, On Thu, Mar 29, 2007 at 10:37:13AM +0800, ju...@jm... wrote: > Hi, Peter, > > >Mass storage devices are handled by a driver in Linux called > >usb_storage. Because a driver is associated with the mass storage > >device libusb will, and should, report that the device is busy. > > I see, we try to detach driver before libusb claim interface, > It seems working. Aha, yes, that works with Linux, but no other operating systems. I then take it you only have one interface for the combined storage and HID parts of the device. That is unfortunate, at least if users should be able to access the storage at all times. I would suggest maintaining your own usb_storage kernel driver that is able to do your vendor specific communication with the device even while the device is being used for storage. It is a huge inconvenience for your users to have to switch to a special usb_storage driver just to access your hotkey functions, but I would prefer it over not being able to use hotkeys and storage at the same time. Ideally, as I wrote, the USB device descriptors would be recreated to allow two separate drivers handle the two separate functions, but I understand that if your silicon is already finished, this is not really an option. > but some user report libusb not working after kernel 2.6.19 or > above. I am using libusb 0.1.12 with kernel 2.6.20.3 myself, but I have not yet tried to detach a kernel driver with it. I make an effort to avoid solutions that require detaching kernel drivers exactly because it's usually complicated, and it is also not portable. I would even go so far as to say that if detaching the kernel driver is ever neccessary, the descriptors in the device should probably be improved instead. //Peter |