summaryrefslogtreecommitdiffstats
path: root/pci.c
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-03-15 14:00:07 +0000
committerFrancois Pons <fpons@mandriva.com>2001-03-15 14:00:07 +0000
commit24ed984500c0fc56a4c3460b719115a89665a707 (patch)
treefe90d97863d9da33a82916f69e5d9737699c7d65 /pci.c
parent8689a6a4250656cddb28f836ec09dffcffbb0f2c (diff)
downloadldetect-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pci.c b/pci.c
index 94be8ef..0ad3960 100644
--- a/pci.c
+++ b/pci.c
@@ -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);