diff options
-rw-r--r-- | ldetect.spec | 5 | ||||
-rw-r--r-- | libldetect.h | 4 | ||||
-rw-r--r-- | pci.c | 5 | ||||
-rw-r--r-- | pciusb.c | 3 |
4 files changed, 15 insertions, 2 deletions
diff --git a/ldetect.spec b/ldetect.spec index 6f5a46c..8bed15a 100644 --- a/ldetect.spec +++ b/ldetect.spec @@ -1,6 +1,6 @@ %define name ldetect %define version 0.2.3 -%define release 5mdk +%define release 6mdk Name: %{name} Version: %{version} @@ -48,6 +48,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/* %changelog +* Thu Mar 15 2001 François Pons <fpons@mandrakesoft.com> 0.2.3-6mdk +- added pci_bus, pci_device and pci_function for DrakX. + * Tue Mar 6 2001 François Pons <fpons@mandrakesoft.com> 0.2.3-5mdk - added support for SHARE_PATH - add BuildRequires: usbutils diff --git a/libldetect.h b/libldetect.h index 5e43b1a..d61b0ab 100644 --- a/libldetect.h +++ b/libldetect.h @@ -9,6 +9,10 @@ struct pciusb_entry { unsigned short subdevice; /* 0xffff if not probe_type'd or no subid */ unsigned short class; /* 0 if not probe_type'd */ + unsigned short pci_bus; /* pci bus id 8 bits wide */ + unsigned short pci_device; /* pci device id 5 bits wide */ + unsigned short pci_function; /* pci function id 3 bits wide */ + char *module; char *text; }; @@ -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); @@ -49,6 +49,9 @@ extern void pciusb_initialize(struct pciusb_entry *e) { e->subvendor = 0xffff; e->subdevice = 0xffff; e->class = 0; + e->pci_bus = 0xffff; + e->pci_device = 0xffff; + e->pci_function = 0xffff; e->module = NULL; e->text = NULL; } |