diff options
author | Francois Pons <fpons@mandriva.com> | 2001-03-15 14:00:07 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-03-15 14:00:07 +0000 |
commit | 24ed984500c0fc56a4c3460b719115a89665a707 (patch) | |
tree | fe90d97863d9da33a82916f69e5d9737699c7d65 /pci.c | |
parent | 8689a6a4250656cddb28f836ec09dffcffbb0f2c (diff) | |
download | ldetect-24ed984500c0fc56a4c3460b719115a89665a707.tar ldetect-24ed984500c0fc56a4c3460b719115a89665a707.tar.gz ldetect-24ed984500c0fc56a4c3460b719115a89665a707.tar.bz2 ldetect-24ed984500c0fc56a4c3460b719115a89665a707.tar.xz ldetect-24ed984500c0fc56a4c3460b719115a89665a707.zip |
added pci(bus,device,function) for DrakX.
Diffstat (limited to 'pci.c')
-rw-r--r-- | pci.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -33,10 +33,13 @@ extern struct pciusb_entries pci_probe(int probe_type) { sscanf(buf, "%hx %x", &devbusfn, &id); e.vendor = id >> 16; e.device = id & 0xffff; + e.pci_bus = devbusfn >> 8; + e.pci_device = (devbusfn & 0xff) >> 3; + e.pci_function = (devbusfn & 0xff) & 0x07; { char file[25]; FILE *f; - snprintf(file, sizeof(file), "/proc/bus/pci/%02x/%02x.%d", devbusfn >> 8, (devbusfn & 0xff) >> 3, (devbusfn & 0xff) & 0x7); + snprintf(file, sizeof(file), "/proc/bus/pci/%02x/%02x.%d", e.pci_bus, e.pci_device, e.pci_function); if (probe_type && (f = fopen(file, "r"))) { if (fseek(f, 10, SEEK_SET) == 0) fread(&e.class, 2, 1, f); |