On Fri, Dec 01, 2006 at 10:10:15AM -0800, Phil Drain wrote: > Hello: > > I have questions about GNU/Linux USB that I'm having trouble getting > answered ..... looking for some assistance!
(minor nit, the kernel is called "Linux", the GNU project is not involved at all in it. Some people like to call the whole distro "GNU/Linux" but that doesn't pertain to the kernel issues you are talking about here...) > I am an independent consultant specializing in development of USB devices & > their associated host apps. All my work to date has been in the WIN > environment but client requirements and personal interest have lead me into > the GNU/Linux world - "Desktop" and embedded - so I'm very much a newbie to > GNU/Linux but not to OS's in general. > > Using Debian "Sarge"/KDE/KDevelop, LibUSB & ioctl's and loving it! > > So, my questions: > > 1) With regard to USB in general, how does one logically detach a single > device from a built-in driver (that is, NOT physically remove it from the > system) without unloading the driver itself? Specifically, I need to detach > an MSC device from the Kernel driver so I can claim it with a custom user > mode driver (with root privileges) that allows access to a manufacturing > interface for re-configuration and diagnostics. I don't want to shut down > the Kernel driver because I want the other attached MSC devices to continue > to operate. I would need to re-attach the device to the Kernel driver at > the close of the app. Thre are two ways to do it. An ioctl through usbfs (I think there's also a libusb call), or through a write to the sysfs directory for the device. > 2) With regard to HID ..... There are many advantages to designing a USB > device so it binds to the HID driver, even if it's not a "traditional" HID > device. Indeed, since HID is universal across almost all host environments > I develop most custom devices that don't already fall into a pre-defined > USB class as HID class devices with a vendor defined interface so that my > client has access to most platforms without the need to distribute a driver. This is why our HID driver has a large blacklist for devices that should not bind to the HID driver. Feel free to send a patch adding your device to that list to make it easier for your userspace programs. > So, getting to my question ...... If I may use a WIN example, on the device > I define a simple "In" buffer and a simple "Out" buffer in the report > descriptor then in the WIN app, I find the device, open it then use the > readFile() & writeFile() calls. Does the GNU/Linux HID subsystem support > such a mechanism? I prefer not to do as in (1) above .... As described above, you can disconnect a specific device from a specific driver, so you don't have to worry about this. There's also a libhid userspace library that is being worked on that you also might want to look at. hope this helps, greg k-h ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
