表示系统中的每个PCI设备,包括PCI-PCI和PCI-PCI桥接器。
[i]/*
* There is one pci_dev structure for each slot-number/function-number
* combination:
*/[/i]
[b]struct pci_dev {
struct pci_bus *bus;[/b] [i] /* bus this device is on */[/i]
[b]struct pci_dev *sibling;[/b] [i]/* next device on this bus */[/i]
[b] struct pci_dev *next; [/b] [i]/* chain of all devices */[/i]
[b]void *sysdata;[/b] [i]/* hook for sys-specific extension */[/i]
[b]unsigned int devfn;[/b] [i]/* encoded device & function index */[/i]
[b] unsigned short vendor;
unsigned short device;
unsigned int class; [/b] [i]/* 3 bytes: (base,sub,prog-if) */[/i]
[b]unsigned int master : 1;[/b] [i]/* set if device is master capable */[/i]
[i] /*
* In theory, the irq level can be read from configuration
* space and all would be fine. However, old PCI chips don't
* support these registers and return 0 instead. For example,
* the Vision864-P rev 0 chip can uses INTA, but returns 0 in
* the interrupt line and pin registers. pci_init()
* initializes this field with the value at PCI_INTERRUPT_LINE
* and it is the job of pcibios_fixup() to change it if
* necessary. The field must not be 0 unless the device
* cannot generate interrupts at all.
*/[/i]
[b]unsigned char irq;[/b] [i]/* irq generated by this device */[/i]
[b]
};[/b]
[i]/*
* There is one pci_dev structure for each slot-number/function-number
* combination:
*/[/i]
[b]struct pci_dev {
struct pci_bus *bus;[/b] [i] /* bus this device is on */[/i]
[b]struct pci_dev *sibling;[/b] [i]/* next device on this bus */[/i]
[b] struct pci_dev *next; [/b] [i]/* chain of all devices */[/i]
[b]void *sysdata;[/b] [i]/* hook for sys-specific extension */[/i]
[b]unsigned int devfn;[/b] [i]/* encoded device & function index */[/i]
[b] unsigned short vendor;
unsigned short device;
unsigned int class; [/b] [i]/* 3 bytes: (base,sub,prog-if) */[/i]
[b]unsigned int master : 1;[/b] [i]/* set if device is master capable */[/i]
[i] /*
* In theory, the irq level can be read from configuration
* space and all would be fine. However, old PCI chips don't
* support these registers and return 0 instead. For example,
* the Vision864-P rev 0 chip can uses INTA, but returns 0 in
* the interrupt line and pin registers. pci_init()
* initializes this field with the value at PCI_INTERRUPT_LINE
* and it is the job of pcibios_fixup() to change it if
* necessary. The field must not be 0 unless the device
* cannot generate interrupts at all.
*/[/i]
[b]unsigned char irq;[/b] [i]/* irq generated by this device */[/i]
[b]
};[/b]