summaryrefslogtreecommitdiffstats
path: root/pci.c
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-02-26 13:51:51 +0000
committerThierry Vignaud <tv@mandriva.org>2007-02-26 13:51:51 +0000
commit4e1611fe90987717abd274b626ddbd1c40944995 (patch)
treeb3001ff80c9b4ecf50f7f813ae15cbef98bc5d3e /pci.c
parent4e11cb0e758fe22f04ca218dd8b97e7e3523578a (diff)
downloadldetect-4e1611fe90987717abd274b626ddbd1c40944995.tar
ldetect-4e1611fe90987717abd274b626ddbd1c40944995.tar.gz
ldetect-4e1611fe90987717abd274b626ddbd1c40944995.tar.bz2
ldetect-4e1611fe90987717abd274b626ddbd1c40944995.tar.xz
ldetect-4e1611fe90987717abd274b626ddbd1c40944995.zip
(pci_probe) replace a couple magic valyes by constants from pciutils
Diffstat (limited to 'pci.c')
-rw-r--r--pci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pci.c b/pci.c
index 911afc6..2bbb165 100644
--- a/pci.c
+++ b/pci.c
@@ -82,15 +82,16 @@ extern struct pciusb_entries pci_probe(void) {
}
read(devf, &buf, 0x30); /* these files're 256 bytes but we only need first 48 bytes*/
e->class_ = dev->device_class;
- e->subvendor = bufi[0x16];
- e->subdevice = bufi[0x17];
+ /* 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];
if ((e->subvendor == 0 && e->subdevice == 0) ||
(e->subvendor == e->vendor && e->subdevice == e->device)) {
e->subvendor = 0xffff;
e->subdevice = 0xffff;
}
- class_prog = buf[0x9];
+ class_prog = buf[PCI_CLASS_PROG];
/* special rules below must be in sync with gi/mdk-stage1/probing.c */