summaryrefslogtreecommitdiff
path: root/src/sys/io/pci
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-19 17:57:08 -0400
committerIan Moffett <ian@osmora.org>2025-09-19 17:57:08 -0400
commitbfe26529fc77755dc5dd9e41473ebbe84044c5f3 (patch)
tree833c7e2b7ca5b6e027f5728e1e038759749ca9b7 /src/sys/io/pci
parent6e6bedc20e99c2602b30856592b25d6d2a3bf13f (diff)
kern: pci: Add 'class' and 'subclass' to device
This commit adds the PCI class and revion (subclass) IDs to the PCI device descriptor provided by L5. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/io/pci')
-rw-r--r--src/sys/io/pci/pci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sys/io/pci/pci.c b/src/sys/io/pci/pci.c
index 49046c8..6385c6e 100644
--- a/src/sys/io/pci/pci.c
+++ b/src/sys/io/pci/pci.c
@@ -59,6 +59,8 @@ pci_register_dev(struct pci_device *dev)
{
struct pci_device *devp;
pcireg_t vend_dev;
+ uint32_t classrev;
+ uint8_t class, subclass;
uint16_t device_id;
uint16_t vendor_id;
@@ -71,6 +73,11 @@ pci_register_dev(struct pci_device *dev)
vendor_id = vend_dev & 0xFFFF;
device_id = (vend_dev >> 16) & 0xFFFF;
+ /* Get the class and revision */
+ classrev = pci_readl(dev, PCIREG_CLASSREV);
+ class = PCIREG_CLASS(classrev);
+ subclass = PCIREG_SUBCLASS(classrev);
+
/* Does this device exist? */
if (vendor_id == 0xFFFF) {
return;
@@ -78,6 +85,8 @@ pci_register_dev(struct pci_device *dev)
dev->vendor = vendor_id;
dev->device = device_id;
+ dev->class = class;
+ dev->subclass = subclass;
/*
* Log out the BDF notation as well as vendor,