summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-12-28 12:04:05 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-12-28 12:04:05 +0000
commit6e91301e61b1173d3b8a0405991f70449680784a (patch)
tree93885163b4a23bbbec946da29dd15771dee3ea8f
parent58a7b19643a0ab2920b01149251e9d0e5b6a9d8e (diff)
downloadldetect-6e91301e61b1173d3b8a0405991f70449680784a.tar
ldetect-6e91301e61b1173d3b8a0405991f70449680784a.tar.gz
ldetect-6e91301e61b1173d3b8a0405991f70449680784a.tar.bz2
ldetect-6e91301e61b1173d3b8a0405991f70449680784a.tar.xz
ldetect-6e91301e61b1173d3b8a0405991f70449680784a.zip
in probe_type=1, recognize usb controllers (is either usb-uhci or usb-ohci)
-rw-r--r--ldetect.spec9
-rw-r--r--pci.c11
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 <pixel@mandrakesoft.com> 0.2.5-1mdk
+- in probe_type=1, recognize usb controllers (is either usb-uhci or usb-ohci)
+
* Thu Sep 13 2001 Pixel <pixel@mandrakesoft.com> 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <pci/pci.h>
#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);
}
}