summaryrefslogtreecommitdiff
path: root/src/sys/include/io/pci/pci.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-10-11 16:31:55 -0400
committerIan Moffett <ian@osmora.org>2025-10-11 16:31:55 -0400
commitf0b15b392130a89b071985bb7ec21a5b4ff8158b (patch)
tree931ea70d6a2d0d736ed04e198dedc0b973db615a /src/sys/include/io/pci/pci.h
parent29428812855bd38cd450315260218c0c27ef08da (diff)
kern: pci: Use LU types instead of classrev field
Instead of using bitfields to say which kind identification we are doing, it is a better idea to just use the lookup type directly as it is more scalable Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include/io/pci/pci.h')
-rw-r--r--src/sys/include/io/pci/pci.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sys/include/io/pci/pci.h b/src/sys/include/io/pci/pci.h
index 81ae87e..cab29aa 100644
--- a/src/sys/include/io/pci/pci.h
+++ b/src/sys/include/io/pci/pci.h
@@ -76,6 +76,11 @@ struct pci_device {
TAILQ_ENTRY(pci_device) link;
};
+typedef enum {
+ PCI_LU_VENDEV, /* Vendor / device */
+ PCI_LU_CLASSREV, /* Class / subclass */
+} lookup_type_t;
+
/*
* Structure that allows a device driver of a PCI
* bus node to advocate for its workings. In other words,
@@ -83,7 +88,7 @@ struct pci_device {
*
* @lookup: Lookup arguments
* @attach: Attach the driver
- * @classrev: IF 1, identified by class/subclass
+ * @idtype: How the device will be identified
*
* XXX: The `lookup` field is used for both input arguments
* as well as output results
@@ -91,15 +96,10 @@ struct pci_device {
struct pci_adv {
struct pci_device lookup;
int(*attach)(struct pci_adv *ap);
- uint8_t classrev : 1;
+ lookup_type_t idtype;
TAILQ_ENTRY(pci_adv) link;
};
-typedef enum {
- PCI_LU_VENDEV, /* Vendor / device */
- PCI_LU_CLASSREV, /* Class / subclass */
-} lookup_type_t;
-
/*
* Lookup a device on the PCI(e) bus by using the pci_descriptor
* as a lookup key.