From a9d8b25bd82f7bcf3de4e4c10c97cfb1eab2becc Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 31 Jul 2003 13:36:49 +0000 Subject: - detect ohci1394 & ehci-hcd based on the pci class (as done in RedHat's kudzu) --- ldetect.spec | 6 +++++- pci.c | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ldetect.spec b/ldetect.spec index 399c720..5003955 100644 --- a/ldetect.spec +++ b/ldetect.spec @@ -1,6 +1,6 @@ Name: ldetect Version: 0.4.9 -Release: 1mdk +Release: 2mdk Summary: Light hardware detection library Source: %name.tar.bz2 Group: System/Libraries @@ -49,6 +49,10 @@ rm -rf $RPM_BUILD_ROOT %_libdir/* %changelog +* Thu Jul 31 2003 Pixel 0.4.9-2mdk +- detect ohci1394 & ehci-hcd based on the pci class + (as done in RedHat's kudzu) + * Tue Apr 22 2003 Pixel 0.4.9-1mdk - Use read() instead of fread() to read from "/proc/bus/pci/%02x/%02x.%d". Thanks a lot to Tom Cox for finding this bug: diff --git a/pci.c b/pci.c index ff5020f..558b9d6 100644 --- a/pci.c +++ b/pci.c @@ -65,8 +65,19 @@ extern struct pciusb_entries pci_probe(int probe_type) { e->subdevice = 0xffff; } class_prog = buf[0x9]; - if (e->class_ == PCI_CLASS_SERIAL_USB) /* taken from kudzu's pci.c */ - e->module = strdup(class_prog == 0 ? "usb-uhci" : "usb-ohci"); + if (e->class_ == PCI_CLASS_SERIAL_USB) { + /* taken from kudzu's pci.c */ + char *module = + class_prog == 0 ? "usb-uhci" : + class_prog == 0x10 ? "usb-ohci" : + class_prog == 0x20 ? "ehci-hcd" : NULL; + if (module) e->module = strdup(module); + } + if (e->class_ == PCI_CLASS_SERIAL_FIREWIRE) { + /* taken from kudzu's pci.c */ + if (class_prog == 0x10) e->module = strdup("ohci1394"); + } + close(devf); } fclose(f); -- cgit v1.2.1