summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-09-23 17:16:27 +0000
committerThierry Vignaud <tv@mandriva.org>2009-09-23 17:16:27 +0000
commitf363db54f84558b2ab647386917e5613e7f9e6ac (patch)
treefc4f60bf07772585a816d4448852eb2bc9b90ad4
parentd5610cdddc1133cbefd55ad5ec5d387b1adc3741 (diff)
downloadldetect-f363db54f84558b2ab647386917e5613e7f9e6ac.tar
ldetect-f363db54f84558b2ab647386917e5613e7f9e6ac.tar.gz
ldetect-f363db54f84558b2ab647386917e5613e7f9e6ac.tar.bz2
ldetect-f363db54f84558b2ab647386917e5613e7f9e6ac.tar.xz
ldetect-f363db54f84558b2ab647386917e5613e7f9e6ac.zip
(pci_probe) retrieve PCI revision (#42576)
-rw-r--r--NEWS2
-rw-r--r--libldetect.h1
-rw-r--r--pci.c1
3 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index edfe9a0..5250a80 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- retrieve PCI revision (#42576)
+
Version 0.8.6 - 23 September 2009, Pascal Terjan
- parse only once usb.ids (avoids displaying Duplicate errors)
diff --git a/libldetect.h b/libldetect.h
index b0beffb..5655bfc 100644
--- a/libldetect.h
+++ b/libldetect.h
@@ -17,6 +17,7 @@ struct pciusb_entry {
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 */
+ unsigned short pci_revision:8; /* pci function id 3 bits wide */
unsigned short usb_port; /* pci function id 3 bits wide */
diff --git a/pci.c b/pci.c
index 9d146fd..a9c6e40 100644
--- a/pci.c
+++ b/pci.c
@@ -86,6 +86,7 @@ extern struct pciusb_entries pci_probe(void) {
/* we divide by 2 because we address the array as a word array since we read a word */
e->subvendor = bufi[PCI_SUBSYSTEM_VENDOR_ID/2]; // == (u16)!(buf[PCI_SUBSYSTEM_VENDOR_ID] | (buf[PCI_SUBSYSTEM_VENDOR_ID+1] << 8))
e->subdevice = bufi[PCI_SUBSYSTEM_ID/2];
+ e->pci_revision = buf[PCI_CLASS_REVISION];
if ((e->subvendor == 0 && e->subdevice == 0) ||
(e->subvendor == e->vendor && e->subdevice == e->device)) {