Dear USB Experts, I am trying to understand the relative merits of the various programming interfaces to the Linux USB system. As far as I can see, the current or planned options include:
1. The kernel device-driver interface (i.e. usb_register()). This looks like a fairly simple interface, documented in the kerneldocs (though something went wrong when I tried to make a PDF) and also at http://www.lrr.in.tum.de/Par/arch/usb/usbdoc/usbdoc.html, which seems accurate despite being seveal years old. Lots of example drivers to learn from in the kernel source. Seems unlikely to change much anytime soon. Being a kernel interface rather than a user-space interface has obvious advantages and disadvantages. The "future GPL only" issue will matter in some cases. 2. The usbfs interface. Described in Documentation/usb/proc_usb.txt, referring to the lightly-commented header file for details of the ioctls. Can anyone point to any more docs or examples? 3. The "lots of ioctls" design of usbfs seems unpopular with some and searching the lists suggests that there may be other technical problems with the current design, hence a proposed future "usbfs2". This will be more like gadgetfs with one inode per endpoint. So is the current usbfs "not recommended for new designs"? Is waiting for usbfs2 suggested? Is there a useable usbfs2 patch available now? 3. There are numerous usb files in sysfs. Is there any documentation for any of this, apart from the generic notes in Documentation/kobject.txt and Documentation/filesystems/sysfs.txt? The USB FAQ explains the 1-1.3.1:1.0 style of pathnames, but I don't know what the files in the leaf directories do. Can I read and write them to communicate with the device? 4. libusb. Documentation at http://libusb.sourceforge.net/doc. Apparently it is geared towards USB1.1. Doesn't support asynchronous IO. The current v0.1 API will "soon" be obsoleted by a new v1.0. LGPL license. Are there other options? I am currently more concerned about the medium/long term stability of the interface and the quality of documentation than the technical features. (Having said that, the lack of any asynchronous IO in libusb worries me, and I don't think any of the user-space interfaces have a mechanism to get notifications of new devices like the kernel's "probe" callbacks; presumably I need to cooperate with udev to make this work.) Any advice would be much appreciated. Regards, Phil. ------------------------------------------------------------------------- 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 _______________________________________________ Linux-usb-users@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users