summaryrefslogtreecommitdiffstats
path: root/src/usbmux.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-05-23 22:11:39 +0200
committerGravatar Nikias Bassen2009-05-23 22:11:39 +0200
commitfca059d76626a18b086e793f9283ee3070e853d8 (patch)
tree9ba606b96836ddadedc020403b36642f5cc30f23 /src/usbmux.c
parent6070107e7c8b27844e7e15d0c7e4ef4f7d0076b0 (diff)
downloadusbmuxd-fca059d76626a18b086e793f9283ee3070e853d8.tar.gz
usbmuxd-fca059d76626a18b086e793f9283ee3070e853d8.tar.bz2
Make usb enumeration work properly.
Diffstat (limited to 'src/usbmux.c')
-rw-r--r--src/usbmux.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/usbmux.c b/src/usbmux.c
index 90aeb84..c64d1a0 100644
--- a/src/usbmux.c
+++ b/src/usbmux.c
@@ -324,18 +324,18 @@ int usbmux_get_specific_device(int bus_n, int dev_n,
// Set the device configuration
for (bus = usb_get_busses(); bus; bus = bus->next)
- //if (bus->location == bus_n)
- for (dev = bus->devices; dev != NULL; dev = dev->next)
- if (dev->devnum == dev_n) {
- newdevice->__device = dev;
- newdevice->usbdev = usb_open(newdevice->__device);
- if (!newdevice->usbdev) {
- fprintf(stderr, "%s: Error: usb_open(): %s\n", __func__, usb_strerror());
+ if (strtoul(bus->dirname, NULL, 10) == bus_n)
+ for (dev = bus->devices; dev != NULL; dev = dev->next)
+ if (strtol(dev->filename, NULL, 10) == dev_n) {
+ newdevice->__device = dev;
+ newdevice->usbdev = usb_open(newdevice->__device);
+ if (!newdevice->usbdev) {
+ fprintf(stderr, "%s: Error: usb_open(): %s\n", __func__, usb_strerror());
+ }
+ if (usbmux_config_usb_device(newdevice) == 0) {
+ goto found;
+ }
}
- if (usbmux_config_usb_device(newdevice) == 0) {
- goto found;
- }
- }
usbmux_free_device(newdevice);