On Wed, Dec 13, 2006 at 03:23:31PM +0000, Phil Endecott wrote:
> 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.

What cases would it matter?

> 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?

The header file is the best example.  It's not a very complex interface.

> 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?

It's being slowly worked on.  Right now it is a senior project for a
college student, so it might be a while before it shows up in the tree.
Or you are more than welcome to help out with the effort to get it
moving faster.

> 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?

No.  You can only read the different attributes of the device, and in
some cases, change some of the different configuation values of the
device.  You don't have "raw" USB data access through sysfs.

> 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.

It works just fine for 2.0 devices too.
If you have questions about this, please ask it on the libusb mailing
list.

> 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.

Why?

If you are interested in that, I would suggest the usbfs interface, it's
not going away any year soon.

> (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.)

Why, what exactly are you trying to do?  Perhaps explaining what you are
trying to accomplish would help us out in suggesting what you should use

> Any advice would be much appreciated.

try posting follow-up stuff on the linux-usb-devel mailing list, not the
-user list.

thanks,

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
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to