/* * file: pci-cfg.h * description: C structure definitions for PCI configuration space. */ struct pci_config_hdr { ushort vendor_id; /* 00 */ ushort dev_id; uint cmd_status; /* 04 */ uchar rev_id; /* 08 */ uchar prog_if; uchar subclass; uchar class; uchar cache_line; /* 0C */ uchar latency; uchar hdr_type : 7; uchar multi_func : 1; uchar bist; } __attribute__((packed)); struct pci_config_bridge { struct pci_config_hdr hdr; /* 00 */ uint BAR0; /* 10 */ uint BAR1; /* 14 */ uchar primary_bus; /* 18 */ uchar secondary_bus; uchar subord_bus; uchar timer; uint pad[8]; /* 1C..3C */ } __attribute__((packed)); struct pci_config_device { struct pci_config_hdr hdr; /* 00 */ uint BAR0; /* 10 */ uint BAR1; /* 14 */ uint BAR2; /* 18 */ uint BAR3; /* 1C */ uint BAR4; /* 20 */ uint BAR5; /* 24 */ uint cardbus; /* 28 */ ushort subsys_vendor_id; /* 2C */ ushort subsys_id; uint rom_addr; /* 30 */ uint pad[2]; /* 34 */ uchar irq; /* 3C */ uchar irq_pin; uchar grant; uchar latency; } __attribute__((packed));