From: David <Do...@gm...> - 2008-07-31 14:58:00
|
It seems a bug in the linux kernel. I found that the function usb_new_device() in hub.c:1559 calls usb_create_sysfs_dev_files which fails for some devices. When I add an output message like this: err = usb_create_sysfs_dev_files(udev); if (err) { dev_err(&udev->dev, "can't create sysfs, error %d\n", err); } err = 0; the following error occur: usb 4-1: can't create sysfs, error -2 usb 4-2: can't create sysfs, error -2 usb 1-4.3: can't create sysfs, error -2 usb 1-4.7: can't create sysfs, error -2 When I look in the folder /sys/bus/usb/devices, the folder 4-1, 4-2, 1-4.3 and 1-4.7 doesn't have the descriptors file. Maybe the kernel want to add the files before the sysfs interface is loaded. For libusb, we could ignore devices which doesn't have the descriptors file and return a partial list of devices to the application. David Engraf -------- Original-Nachricht -------- > Datum: Thu, 31 Jul 2008 13:27:25 +0200 > Von: "David" <Do...@gm...> > An: lib...@li... > Betreff: [Libusb-devel] [libusb-0.9.2] libusb_get_device_list error with linux 2.6.26 > On linux-2.6.26 a call to libusb_get_device_list gives the following error > on the console: > > libusb:error [__open_sysfs_attr] open /sys/bus/usb/devices/4-1/descriptors > failed ret=-1 errno=2 > > and the functions returns -1. The file "descriptors" does not exist in all > usb directories. I searched through the directory /sys/bus/usb/devices > and found out that a few folder contains the "descriptors" file and other > not. > It seems that the new kernel release doesn't create this file for all > devices. I think we have to fall back to usbfs in order to get the descriptor. > > On linux-2.6.23.1 this error doesn't occur. > > -- > GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen! > Jetzt dabei sein: > http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Libusb-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel -- Psssst! Schon das coole Video vom GMX MultiMessenger gesehen? Der Eine für Alle: http://www.gmx.net/de/go/messenger03 |