From 0586405abbeb51b5e427e766e8e599e3045f102b Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 27 Mar 2009 18:11:40 +0000 Subject: use /sys/bus/usb/devices instead of /sys/class/usb_device (disabled in kernel) to find modalias (this breaks ABI because we now need to keep port number) --- usb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usb.c') diff --git a/usb.c b/usb.c index fe65611..10c512e 100644 --- a/usb.c +++ b/usb.c @@ -38,13 +38,14 @@ extern struct pciusb_entries usb_probe(void) { switch (buf[0]) { case 'T': { - unsigned short pci_bus, pci_device; + unsigned short pci_bus, pci_device, usb_port; e = &r.entries[r.nb++]; pciusb_initialize(e); - if (sscanf(buf, "T: Bus=%02hd Lev=%*02d Prnt=%*04d Port=%*02d Cnt=%*02d Dev#=%3hd Spd=%*3s MxCh=%*2d", &pci_bus, &pci_device) == 2) { + if (sscanf(buf, "T: Bus=%02hd Lev=%*02d Prnt=%*04d Port=%02hd Cnt=%*02d Dev#=%3hd Spd=%*3s MxCh=%*2d", &pci_bus, &usb_port, &pci_device) == 3) { e->pci_bus = pci_bus; e->pci_device = pci_device; + e->usb_port = usb_port; } else fprintf(stderr, "%s %d: unknown ``T'' line\n", proc_usb_path, line); break; } -- cgit v1.2.1