Subversion Repositories shark

Rev

Blame | Last modification | View Log | RSS feed

local struct pci_bus pci_root;
struct pci_dev *pci_devices = NULL;

void pci_init(void))
{
        pcibios_init();

        if (!pci_present()) {
                printk("PCI: No PCI bus detected\n");
                return;
        }

        printk("PCI: Probing PCI hardware\n");
        memset(&pci_root, 0, sizeof(pci_root));
        pci_root.subordinate = pci_scan_bus(&pci_root);
}




struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, struct pci_dev *from)
{
        if (!from)
                from = pci_devices;
        else
                from = from->next;
        while (from && (from->vendor != vendor || from->device != device))
                from = from->next;
        return from;
}

struct pci_dev *pci_find_class(unsigned int class, struct pci_dev *from)
{
        if (!from)
                from = pci_devices;
        else
                from = from->next;
        while (from && from->class != class)
                from = from->next;
        return from;
}