summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sys/include/io/pci/pci.h14
-rw-r--r--src/sys/io/ic/ahci.c2
-rw-r--r--src/sys/io/pci/pci.c2
3 files changed, 9 insertions, 9 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.
diff --git a/src/sys/io/ic/ahci.c b/src/sys/io/ic/ahci.c
index 725fbcf..95cfbda 100644
--- a/src/sys/io/ic/ahci.c
+++ b/src/sys/io/ic/ahci.c
@@ -536,7 +536,7 @@ ahci_attach(struct pci_adv *adv)
static struct pci_adv driver = {
.lookup = PCI_CS_ID(0x1, 0x06),
.attach = ahci_attach,
- .classrev = 1
+ .idtype = PCI_LU_CLASSREV
};
MODULE_EXPORT("ahci", MODTYPE_PCI, ahci_init);
diff --git a/src/sys/io/pci/pci.c b/src/sys/io/pci/pci.c
index 23aa82c..76ab616 100644
--- a/src/sys/io/pci/pci.c
+++ b/src/sys/io/pci/pci.c
@@ -327,7 +327,7 @@ pci_init_bus(void)
/* Now allocate load the drivers */
TAILQ_FOREACH(advp, &advlist, link) {
dev = advp->lookup;
- lup = advp->classrev ? PCI_LU_CLASSREV : PCI_LU_VENDEV;
+ lup = advp->idtype;
error = pci_bus_lookup(&dev, lup);
if (error == 0) {