On Fri, 3 Nov 2006, Greg KH wrote: > On Sat, Nov 04, 2006 at 12:38:39AM +0100, Till Harbaum (Lists) wrote: > > Hi, > > > > i am writing a driver for a usb to i2c bridge. The driver is working nicely > > but i can still use my libusb based demo app to access the hardware > > directly while at the same time the kernel driver is active resulting in > > some confusion in both drivers. Since libusb accesses go unnoticed by my > > driver i seem not to be able to prevent them. > > How is this? A libusb application needs to kick the kernel driver off > of the device before it should be able to access it. Or is it doing > this already? If so, no, there's nothing you can do to prevent the > driver from being disconnected from the device. > > If not, please explain more.
Actually a libusb application _is_ allowed to send some kinds of control messages to a device even when a kernel driver is bound to it. Otherwise the lsusb program would hardly work at all. The rule has to do with the USB_RECIP_... field in the bRequestType byte: If the recipient is an interface or an endpoint then the application must have claimed the interface, so there can't be a kernel driver. If not, the application is allowed to send the message regardless. There is no way to prevent libusb from being used to send these kinds of messages. If they interfere with the proper operation of the device, that's an indication the device wasn't designed very carefully. Alan Stern ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel