git://git.onelab.eu
/
pypcilib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c4fb57d
)
Add the progif to the device_class, needed by the pcimap.
author
Daniel Hokka Zakrisson
<dhokka@cs.princeton.edu>
Wed, 21 Nov 2007 03:47:15 +0000
(
03:47
+0000)
committer
Daniel Hokka Zakrisson
<dhokka@cs.princeton.edu>
Wed, 21 Nov 2007 03:47:15 +0000
(
03:47
+0000)
pypciscan.c
patch
|
blob
|
history
diff --git
a/pypciscan.c
b/pypciscan.c
index
f56eb7c
..
24b81a9
100644
(file)
--- a/
pypciscan.c
+++ b/
pypciscan.c
@@
-60,16
+60,18
@@
static PyObject *get_devices(PyObject *self, PyObject *args)
for (dev = pacc->devices; dev; dev = dev->next) {
u16 subvendor = -1, subdevice = -1;
PyObject *value;
for (dev = pacc->devices; dev; dev = dev->next) {
u16 subvendor = -1, subdevice = -1;
PyObject *value;
+ u8 progif = 0;
pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_CLASS);
if (dev->hdrtype == PCI_HEADER_TYPE_NORMAL) {
subvendor = pci_read_word(dev, PCI_SUBSYSTEM_VENDOR_ID);
subdevice = pci_read_word(dev, PCI_SUBSYSTEM_ID);
}
pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_CLASS);
if (dev->hdrtype == PCI_HEADER_TYPE_NORMAL) {
subvendor = pci_read_word(dev, PCI_SUBSYSTEM_VENDOR_ID);
subdevice = pci_read_word(dev, PCI_SUBSYSTEM_ID);
}
+ progif = pci_read_byte(dev, PCI_CLASS_PROG);
snprintf(buf, sizeof(buf), "%04x:%02x:%02x.%02x", dev->domain, dev->bus, dev->dev, dev->func);
value = Py_BuildValue("iiiii", dev->vendor_id, dev->device_id,
snprintf(buf, sizeof(buf), "%04x:%02x:%02x.%02x", dev->domain, dev->bus, dev->dev, dev->func);
value = Py_BuildValue("iiiii", dev->vendor_id, dev->device_id,
- subvendor, subdevice, dev->device_class);
+ subvendor, subdevice, dev->device_class
<< 8 | progif
);
if (!value)
return NULL;
if (PyDict_SetItemString(ret, buf, value) == -1)
if (!value)
return NULL;
if (PyDict_SetItemString(ret, buf, value) == -1)