On Mon, Jun 18, 2007 at 01:00:01PM -0400, Alan Stern wrote:
> On Mon, 18 Jun 2007, Dave Mielke wrote:
> 
> > [quoted lines by Alan Stern on 2007/06/18 at 12:03 -0400]
> > 
> > >I shouldn't think it would be too much harder to read several sysfs
> > >files than a single usbfs file.  
> > 
> > Except that it starts to get messy if each system call is protected with 
> > error
> > checking and each piece of data read in as text is tested for validity. 
> > Perhaps
> > some or all such carefulness isn't necessary, but it does tend to protect
> > against unforeseen problems. It's much simpler to read it all in at once.
> > 
> > >Do you really need anything other than
> > >the vendor ID, the product ID, and perhaps the bcdDevice value?
> > 
> > That's mostly true for device selection. Once we know we have the right 
> > device,
> > though, we do use the string index fields to fetch the strings for logging. 
> > I
> > know the strings teemselves are in sysfs, but to keep that code portable we
> > read the string desccriptors from the selected device.
> > 
> > It was just an idea which would make switching back to a truly passive 
> > device
> > descriptor read (like it has been before autosuspend) easy, not only for us 
> > but
> > also for other applications.
> 
> Greg, what do you think?  Is it reasonable to add a binary sysfs
> attribute file containing the device descriptor?  (And perhaps also one 
> containing the current configuration descriptor, and the interface 
> descriptors in their individual subdirectories.  Maybe even the 
> endpoint descriptors too.)

No, we DO NOT PUT DEVICE NODES IN SYSFS!

Sorry for yelling, but this comes up every 3-4 months or so for the past
4-5 years and it's getting a bit annoying :)

Device nodes go in /dev/  That's what the LSB specifies and to do
something else will just wreck havoc with the system (permissions, acls,
security, etc.)

> Even though the binary descriptors are available in usbfs, when a
> device's usbfs file is opened the device is automatically resumed.  
> This means that a program looking for a particular device will wake up
> a bunch of unrelated devices.  With sysfs there is no such problem.

Then use the device information from sysfs to determine which usbfs file
to open.  Or, help out with the usbfs2 code which uses the device
endpoints and should allow you to have a better mapping from sysfs usb
device to usbfs2 endpoint and device.

thanks,

greg k-h

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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