diff options
author | Corey Tabaka <corey.tabaka@gmail.com> | 2013-05-29 01:21:53 -0700 |
---|---|---|
committer | Corey Tabaka <corey.tabaka@gmail.com> | 2013-07-18 02:30:40 -0700 |
commit | 561c6c2df606b90fe5ce3f9bbcbf33826a9726f4 (patch) | |
tree | ec5eaf206e50428c2169fdc70cf1d5deb9d96012 | |
parent | 8354fd3eaf59b35c245ad461e8aba7e69d2f04c2 (diff) | |
download | lk-561c6c2df606b90fe5ce3f9bbcbf33826a9726f4.tar.gz |
[app][pcitests] Add class code to bus dump.
-rw-r--r-- | app/pcitests/pci_tests.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/pcitests/pci_tests.c b/app/pcitests/pci_tests.c index 8178b52b..5acff0c0 100644 --- a/app/pcitests/pci_tests.c +++ b/app/pcitests/pci_tests.c @@ -41,6 +41,7 @@ static void pci_list(void) pci_location_t state; uint16_t device_id, vendor_id; uint8_t header_type; + uint8_t base_class, sub_class, interface; int busses = 0, devices = 0, lines = 0, devfn, ret; int c; @@ -61,9 +62,19 @@ static void pci_list(void) ret = pci_read_config_byte(&state, PCI_CONFIG_HEADER_TYPE, &header_type); if (ret != _PCI_SUCCESSFUL) goto error; + ret = pci_read_config_byte(&state, PCI_CONFIG_CLASS_CODE_BASE, &base_class); + if (ret != _PCI_SUCCESSFUL) goto error; + + ret = pci_read_config_byte(&state, PCI_CONFIG_CLASS_CODE_SUB, &sub_class); + if (ret != _PCI_SUCCESSFUL) goto error; + + ret = pci_read_config_byte(&state, PCI_CONFIG_CLASS_CODE_INTR, &interface); + if (ret != _PCI_SUCCESSFUL) goto error; + if (vendor_id != 0xffff) { - printf("%02x:%02x vendor_id=%04x device_id=%04x, header_type=%02x\n", state.bus, state.dev_fn, - vendor_id, device_id, header_type); + printf("%02x:%02x vendor_id=%04x device_id=%04x, header_type=%02x " + "base_class=%02x, sub_class=%02x, interface=%02x\n", state.bus, state.dev_fn, + vendor_id, device_id, header_type, base_class, sub_class, interface); devices++; lines++; } |