|
|
1.1 root 1: typedef struct pci_config_t pci_config_t;
2:
3: struct pci_config_t {
4: char path[256];
5: uint32_t dev; /* bus, dev, fn */
6: uint32_t regions[7];
7: uint32_t assigned[7];
8: uint32_t sizes[7];
9: int irq_pin;
10: int irq_line;
11: u32 primary_bus;
12: u32 secondary_bus;
13: u32 subordinate_bus;
14: };
15:
16: typedef struct pci_dev_t pci_dev_t;
17: struct pci_dev_t {
18: uint16_t vendor;
19: uint16_t product;
20: const char *type;
21: const char *name;
22: const char *model;
23: const char *compat;
24: int acells;
25: int scells;
26: int icells;
27: int (*config_cb)(const pci_config_t *config);
28: const void *private;
29: };
30:
31: extern int ide_config_cb2(const pci_config_t *config);
32: extern int eth_config_cb(const pci_config_t *config);
33: extern int macio_heathrow_config_cb(const pci_config_t *config);
34: extern int macio_keylargo_config_cb(const pci_config_t *config);
35: extern int vga_config_cb(const pci_config_t *config);
36: extern int host_config_cb(const pci_config_t *config);
37: extern int sabre_config_cb(const pci_config_t *config);
38: extern int bridge_config_cb(const pci_config_t *config);
39: extern int ebus_config_cb(const pci_config_t *config);
40:
41: static inline int pci_compat_len(const pci_dev_t *dev)
42: {
43: int len, ret;
44: const char *path = dev->compat;
45: ret = 0;
46: while ((len = strlen(path)) != 0) {
47: ret += len + 1;
48: path += len + 1;
49: }
50: return ret;
51: }
52:
53: extern const pci_dev_t *pci_find_device(uint8_t class, uint8_t subclass,
54: uint8_t iface, uint16_t vendor,
55: uint16_t product);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.