aboutsummaryrefslogtreecommitdiffstats
path: root/com32/include/sys
diff options
context:
space:
mode:
authorErwan Velu <erwan@r1.paris>2006-09-07 20:30:09 +0200
committerH. Peter Anvin <hpa@zytor.com>2006-09-12 21:06:55 -0700
commitc1b0bb65b97cde99e4a7be101fa4033833d17243 (patch)
tree77add7aaaa0cdfe9881f4f55dd8fd5fe9ab6261c /com32/include/sys
parent7d5d2f9bb363f95db585092f43fe5a1eefe588f1 (diff)
downloadsyslinux-3.2x.tar.gz
syslinux-3.2x.tar.xz
syslinux-3.2x.zip
Introducing a new com32 module to parse pci devices/busessyslinux-3.2x
The pcitest module implements an example of use the pci module If you like to use the string name just put a pci.ids file in the root directory (cherry picked from 85bb6facf0100592c89d5c3c5c17b25e7b0006b3 commit)
Diffstat (limited to 'com32/include/sys')
-rw-r--r--com32/include/sys/pci.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/com32/include/sys/pci.h b/com32/include/sys/pci.h
index f1c1eb55..b3099584 100644
--- a/com32/include/sys/pci.h
+++ b/com32/include/sys/pci.h
@@ -4,8 +4,39 @@
#include <inttypes.h>
#include <sys/io.h>
+#define MAX_VENDOR_NAME_SIZE 255
+#define MAX_PRODUCT_NAME_SIZE 255
+#define MAX_PCI_DEVICES 32
+#define MAX_PCI_BUSES 255
+
typedef uint32_t pciaddr_t;
+typedef struct {
+ char vendor_name[MAX_VENDOR_NAME_SIZE];
+ uint16_t vendor;
+ char product_name[MAX_PRODUCT_NAME_SIZE];
+ uint16_t product;
+ uint16_t sub_vendor;
+ uint16_t sub_product;
+ uint8_t revision;
+} s_pci_device;
+
+typedef struct {
+ uint16_t id;
+ s_pci_device *pci_device[MAX_PCI_DEVICES];
+ uint8_t pci_device_count;
+} s_pci_bus;
+
+typedef struct {
+ s_pci_device pci_device[MAX_PCI_DEVICES];
+ uint8_t count;
+} s_pci_device_list;
+
+typedef struct {
+ s_pci_bus pci_bus[MAX_PCI_BUSES];
+ uint8_t count;
+} s_pci_bus_list;
+
static inline pciaddr_t pci_mkaddr(uint32_t bus, uint32_t dev,
uint32_t func, uint32_t reg)
{
@@ -30,4 +61,5 @@ void pci_writeb(uint8_t, pciaddr_t);
void pci_writew(uint16_t, pciaddr_t);
void pci_writel(uint32_t, pciaddr_t);
+extern int pci_scan(s_pci_bus_list *pci_bus_list, s_pci_device_list *pci_device_list);
#endif /* _SYS_PCI_H */