Subversion Repositories HelenOS-historic

Rev

Rev 1301 | Rev 1335 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1301 Rev 1324
Line 35... Line 35...
35
 
35
 
36
    pacc = pci_alloc();           /* Get the pci_access structure */
36
    pacc = pci_alloc();           /* Get the pci_access structure */
37
    pci_init(pacc);               /* Initialize the PCI library */
37
    pci_init(pacc);               /* Initialize the PCI library */
38
    pci_scan_bus(pacc);           /* We want to get the list of devices */
38
    pci_scan_bus(pacc);           /* We want to get the list of devices */
39
    for(dev=pacc->devices; dev; dev=dev->next) {   /* Iterate over all devices */
39
    for(dev=pacc->devices; dev; dev=dev->next) {   /* Iterate over all devices */
40
        pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES);      /* Fill in header info we need */
40
        pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_IRQ);
41
        c = pci_read_word(dev, PCI_CLASS_DEVICE); /* Read config register directly */
41
        c = pci_read_word(dev, PCI_CLASS_DEVICE); /* Read config register directly */
42
        printf("%02x:%02x.%d vendor=%04x device=%04x class=%04x irq=%d base0=%lx\n",
42
        printf("%02x:%02x.%d vendor=%04x device=%04x class=%04x irq=%d base0=%lx\n",
43
            dev->bus, dev->dev, dev->func, dev->vendor_id, dev->device_id,
43
            dev->bus, dev->dev, dev->func, dev->vendor_id, dev->device_id,
44
            c, dev->irq, dev->base_addr[0]);
44
            c, dev->irq, dev->base_addr[0]);
45
        printf("\t%s\n", pci_lookup_name(pacc, buf, sizeof(buf), PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
45
        printf("\t%s\n", pci_lookup_name(pacc, buf, sizeof(buf), PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,