From 6e91301e61b1173d3b8a0405991f70449680784a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 28 Dec 2001 12:04:05 +0000 Subject: in probe_type=1, recognize usb controllers (is either usb-uhci or usb-ohci) --- ldetect.spec | 9 ++++++--- pci.c | 11 +++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ldetect.spec b/ldetect.spec index 46ef6e4..7528dab 100644 --- a/ldetect.spec +++ b/ldetect.spec @@ -1,7 +1,7 @@ # !! DON'T MODIFY HERE, MODIFY IN THE CVS !! %define name ldetect -%define version 0.2.4 -%define release 2mdk +%define version 0.2.5 +%define release 1mdk Name: %{name} Version: %{version} @@ -10,7 +10,7 @@ Summary: Light hardware detection library Source: %{name}.tar.bz2 Group: System/Libraries BuildRoot: %{_tmppath}/%{name}-buildroot -BuildRequires: usbutils +BuildRequires: usbutils pciutils-devel Requires: ldetect-lst License: GPL Prefix: %{_prefix} @@ -53,6 +53,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/* %changelog +* Fri Dec 28 2001 Pixel 0.2.5-1mdk +- in probe_type=1, recognize usb controllers (is either usb-uhci or usb-ohci) + * Thu Sep 13 2001 Pixel 0.2.4-2mdk - use the sub-category for usb probing diff --git a/pci.c b/pci.c index d0027eb..2726b63 100644 --- a/pci.c +++ b/pci.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "libldetect.h" #include "libldetect-private.h" #include "common.h" @@ -44,6 +45,16 @@ extern struct pciusb_entries pci_probe(int probe_type) { e.subvendor = 0xffff; e.subdevice = 0xffff; } + + if (fseek(f, 9, SEEK_SET) == 0) { + unsigned char class_prog = 0; + fread(&class_prog, 1, 1, f); + if (e.class == PCI_CLASS_SERIAL_USB) { + /* taken from kudzu's pci.c */ + e.module = strdup(class_prog == 0 ? "usb-uhci" : "usb-ohci"); + } + } + fclose(f); } } -- cgit v1.2.1