On Wed, Feb 09, 2005 at 02:22:50PM +0100, Aur?lien Jarno wrote: > When an USB device is plugged, the kernel parses all the descriptors of > the device, and make them available in /proc/bus/usb/xxx/xxx. When > parsing all the USB devices, libusb first parses this file in /proc and > then, if some information are missing, is asking the device directly. > The problem is that in some cases with partial information (ie between > no information and full information), libusb doesn't ask the device. >
Perhaps my kernel is slightly lame. I'm using a modified 2.4.26 kernel because it has some specialized support for an oddball arm platform I'm running on. The correct data shows in /proc/bus/usb/devices, so it's suprisingly lame that the kernel isn't sending it in the little burst that comes out when reading from a freshly opened /proc/bus/usb/xxx/xxx. If I have a chance, I'll try to compare the usb code in this kernel version with the code in the 2.4.27 arm kernels in sarge to see if they have the same problem. > It is not working on your arm computer because the kernel, for an > unknown reason, returns partial descriptor. > Ok... And in some version of libusb, looking at the upstream CVS changelogs, they implemented some logic to not interrogate devices on Linux since the kernel usually provides this information. That would also explain older tools working and newer ones not. According to the libusb CVS changelog, the change to not interrogate devices for descriptors was added not just as an efficiency improvement, but also to avoid tickling borderline compliant USB devices into failure. I haven't reviewed the source, but assuming you've been careful to interrogate devices only when the kernel doesn't provide the required information, I'd say the package is in good shape. > To answer Steve, the problem it's also in Sarge as this part hasn't > changed since version 0.1.7 (sarge has 0.1.8 and sid 0.1.9). > > To confirm all what I said, I have produced a test version, which is > available on http://temp.aurel32.net/libusb . Could you please test it? > Note that the -dev package for arm doesn't include the doc as jade was > not available on the host where I built libusb. Anyway that should not > be a problem for the test. > Thanks for producing a test package. No worries about the docs - I have that part commented out in my tests involving rebuilding libusb anyway, since it takes an age to build on my arm machine and I read the docs on my x86 PC anyway. At any rate, your experimental code seems to allow interoperability with kernels that don't pass back all of the descriptor info. The lsusb -v output is now plausible and rudimentary testing with various userspace programs requiring libusb is successful. Well done. -- Brian Ristuccia [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]