On Mon, Jun 18, 2007 at 10:34:03PM -0400, Dave Mielke wrote: > [quoted lines by Greg KH on 2007/06/18 at 18:55 -0700] > > >What specific data do you want to see be being returned here? > > Every USB device has a piece of top-level static data known as a device > descriptor. It's cached by the kernel when the device is connected, and is > returned as the first 18 bytes read from a usbfs file descriptor. It's this > same data which I'd like to read via sysfs so as to avoid resuming any devices > (which is what happens when opening a usbfs file). This device descriptor is, > among other things, what one must inspect in order to find the device you're > looking for as it contains things like vendour and product identifiers.
Yeah, I know a little bit about those things, sorry, was used to calling them "configuration" due to moving between the PCI and USB specs all the time :) > A USB device also has descriptors at lower levels for components such as its > interfaces and endpoints. These, too, are static pieces of data. For > completeness, although we ourselves don't need sysfs support for them, it'd be > logical to provide sysfs files for each of them as well. > > >The USB configuration data? Like you read from the binary usbfs file if > >you open and read from it? > > Yes. What you get when you read a usbfs file is the device descriptor followed > by all of the interface and endpoint descriptors for the currently selected > device configuration. > > >If so, then I have no objection to that, as long as you are taking data > >directly from the device and not parsing it at all in the kernel and passing > >it on to userspace. > > I believe usbfs does a little->native endian conversion on a couple of the > 2-byte device descriptor fields (the vendour and product ids, if my memory is > working correctly today). It'd be okay with me if that weren't done, although > it'd be nice if it were so as to minimize the effort to convert applications > like lsusb. No, the kernel does not do any conversion from little->native anymore, it's up to the different drivers to do that on their own if they want to use those fields. > >Look at the PCI file called "config" in sysfs and see if that is what > >you are looking for. > > It's probably the same in concept, but it doesn't contain the actual data. I'm > not familiar with how PCI works, but the data in that ifle is probably > relevant > for describing and/or accessing the device at the PCI level. > > Perhaps it was in another message wherein you asked if the file could be > called > "configuration" rather than "descriptor". The problem with this is that the > term "configuration" has a very well-defined meaining with respect to USB > devices. The generic USB term for this data really is "descriptor", and, > especially if this information were to be provided at all levels, that would > be > the intuitive term to use. Ok, make it called "descriptor", that's fine with me. Just make sure you document it properly in the Documentation/ABI directory when you send me a patch adding this to the kernel :) 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