Subversion Repositories shark

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
local struct pci_bus pci_root;
2
struct pci_dev *pci_devices = NULL;
3
 
4
void pci_init(void))
5
{
6
        pcibios_init();
7
 
8
        if (!pci_present()) {
9
                printk("PCI: No PCI bus detected\n");
10
                return;
11
        }
12
 
13
        printk("PCI: Probing PCI hardware\n");
14
        memset(&pci_root, 0, sizeof(pci_root));
15
        pci_root.subordinate = pci_scan_bus(&pci_root);
16
}
17
 
18
 
19
 
20
 
21
struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, struct pci_dev *from)
22
{
23
        if (!from)
24
                from = pci_devices;
25
        else
26
                from = from->next;
27
        while (from && (from->vendor != vendor || from->device != device))
28
                from = from->next;
29
        return from;
30
}
31
 
32
struct pci_dev *pci_find_class(unsigned int class, struct pci_dev *from)
33
{
34
        if (!from)
35
                from = pci_devices;
36
        else
37
                from = from->next;
38
        while (from && from->class != class)
39
                from = from->next;
40
        return from;
41
}