diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-11 16:54:48 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-11 16:54:48 -0400 |
commit | b4ed056d786cd4425ca1696f8bfc524764a870ec (patch) | |
tree | 83530e560d6776a4b0e2b1dd60b40982ed5ffa20 /src/sys/include/io/pci | |
parent | 2692a66b0956434df1411cb9c95aaa5e7a7e4e70 (diff) |
kern: pci: Support lookups via programming iface
Introduce programming interface based lookups for devices with different
kinds of interfaces
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include/io/pci')
-rw-r--r-- | src/sys/include/io/pci/pci.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sys/include/io/pci/pci.h b/src/sys/include/io/pci/pci.h index fbdead1..e6d0a24 100644 --- a/src/sys/include/io/pci/pci.h +++ b/src/sys/include/io/pci/pci.h @@ -49,6 +49,24 @@ .vendor = (VENDOR) \ } +/* + * Use for making instances of the pci_adv + * structure while specifying the programming + * interface + */ +#define PCI_CSI_ID(CLASS, SUBCLASS, IF) \ + { \ + .class = (CLASS), \ + .subclass = (SUBCLASS), \ + .prog_if = (IF) \ + } +#define PCI_DVI_ID(DEVICE, VENDOR, IF) \ + { \ + .device = (DEVICE), \ + .vendor = (VENDOR), \ + .prog_if = (IF) \ + } + /* PCI specific types */ typedef uint32_t pcireg_t; typedef uint32_t pcival_t; @@ -81,6 +99,8 @@ struct pci_device { typedef enum { PCI_LU_VENDEV, /* Vendor / device */ PCI_LU_CLASSREV, /* Class / subclass */ + PCI_LU_IVENDEV, /* Interface + vendor / device */ + PCI_LU_ICLASSREV, /* Interface + class / revision */ } lookup_type_t; /* |