summaryrefslogtreecommitdiffstats
path: root/usb.c
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-03-27 18:11:40 +0000
committerOlivier Blin <oblin@mandriva.com>2009-03-27 18:11:40 +0000
commit0586405abbeb51b5e427e766e8e599e3045f102b (patch)
treeb93132cdc12cdd9c2a950aaf9c9516f125425f00 /usb.c
parentd5330a61866c21575f074423a382d33642ff3adb (diff)
downloadldetect-0586405abbeb51b5e427e766e8e599e3045f102b.tar
ldetect-0586405abbeb51b5e427e766e8e599e3045f102b.tar.gz
ldetect-0586405abbeb51b5e427e766e8e599e3045f102b.tar.bz2
ldetect-0586405abbeb51b5e427e766e8e599e3045f102b.tar.xz
ldetect-0586405abbeb51b5e427e766e8e599e3045f102b.zip
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)
Diffstat (limited to 'usb.c')
-rw-r--r--usb.c5
1 files changed, 3 insertions, 2 deletions
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;
}