File: pci_database.h

package info (click to toggle)
qemu 1%3A7.2%2Bdfsg-7%2Bdeb12u13
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 288,192 kB
  • sloc: ansic: 2,701,923; pascal: 112,708; python: 62,697; sh: 50,281; asm: 48,732; makefile: 17,260; cpp: 9,441; perl: 8,084; xml: 2,911; objc: 1,870; php: 1,299; tcl: 1,188; yacc: 604; lex: 363; sql: 71; awk: 35; sed: 11; javascript: 7
file content (65 lines) | stat: -rw-r--r-- 1,983 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
typedef struct pci_config_t pci_config_t;

struct pci_config_t {
	char path[256];
	uint32_t dev;		/* bus, dev, fn */
	uint32_t regions[7];
	uint32_t assigned[7];
	uint32_t sizes[7];
	int irq_pin;
	int irq_line;
	u32 primary_bus;
	u32 secondary_bus;
	u32 subordinate_bus;
};

typedef struct pci_dev_t pci_dev_t;
struct pci_dev_t {
    uint16_t vendor;
    uint16_t product;
    const char *type;
    const char *name;
    const char *model;
    const char *compat;
    int acells;
    int scells;
    int icells;
    int (*config_cb)(const pci_config_t *config);
    const void *private;
};

extern int ide_config_cb2(const pci_config_t *config);
extern int virtio_blk_config_cb(const pci_config_t *config);
extern int eth_config_cb(const pci_config_t *config);
extern int macio_heathrow_config_cb(const pci_config_t *config);
extern int macio_keylargo_config_cb(const pci_config_t *config);
extern int vga_config_cb(const pci_config_t *config);
extern int host_config_cb(const pci_config_t *config);
extern int sabre_config_cb(const pci_config_t *config);
extern int bridge_config_cb(const pci_config_t *config);
extern int simba_config_cb(const pci_config_t *config);
extern int ebus_config_cb(const pci_config_t *config);
extern int i82378_config_cb(const pci_config_t *config);
extern int usb_ohci_config_cb(const pci_config_t *config);
extern int rtl8139_config_cb(const pci_config_t *config);
extern int sungem_config_cb (const pci_config_t *config);
extern int sunhme_config_cb(const pci_config_t *config);
extern int lsi53c810_config_cb(const pci_config_t *config);

static inline int pci_compat_len(const pci_dev_t *dev)
{
	int len, ret;
	const char *path = dev->compat;
	ret = 0;
	while ((len = strlen(path)) != 0) {
		ret += len + 1;
		path += len + 1;
	}
	return ret;
}

extern const pci_dev_t *pci_find_device(uint8_t class, uint8_t subclass,
					uint8_t iface, uint16_t vendor,
					uint16_t product);

extern void ob_pci_enable_bus_master(const pci_config_t *config);