Ignore:
Timestamp:
Jul 20, 2010, 5:52:49 PM (15 years ago)
Author:
David Azarewicz
Message:

Changes to PCI bus scan, malloc, cleanup all warnings, misc other changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-2.1.x/lib32/pci.c

    r517 r519  
    477477        u16 pci_command;
    478478
    479         printk("pci_enable_device %x\n", dev);
     479        dprintf(("pci_enable_device %x\n", dev));
    480480
    481481        pci_read_config_word(dev, PCI_COMMAND, &pci_command);
     
    495495
    496496        iNumCards = 0;
    497         ulLast = 0;
    498         pcidev=&pci_devices[0];
     497
     498        /* find an empty slot */
     499        for (iTmp=0; iTmp<MAX_PCI_DEVICES; iTmp++) {
     500                if (pci_devices[iTmp].devfn == 0) break;
     501        }
     502        if (iTmp >= MAX_PCI_DEVICES) return 0;
     503        pcidev = &pci_devices[iTmp];
    499504
    500505        for( iTableIx = 0; driver->id_table[iTableIx].vendor; iTableIx++) {
    501 
    502                 if (pcidev->devfn) { /* find an empty slot */
    503                         for (iTmp=0; iTmp<MAX_PCI_DEVICES; iTmp++) {
    504                                 if (pci_devices[iTmp].devfn == 0) break;
    505                         }
    506                         if (iTmp >= MAX_PCI_DEVICES) break;
    507                         pcidev=&pci_devices[iTmp];
    508                 }
    509 
    510 
     506                ulLast = 0;
    511507                while( (ulLast = pci_query_device(&driver->id_table[iTableIx], pcidev, ulLast)) ) {
     508
     509
    512510                        RMInit();
    513511                        dprintf(("pci_register_driver: found=%x:%x searching for %x:%x\n",
     
    521519                                RMDone((pcidev->device << 16) | pcidev->vendor);
    522520                                iNumCards++;
     521
     522                                /* find another empty slot */
     523                                for (iTmp=0; iTmp<MAX_PCI_DEVICES; iTmp++) {
     524                                        if (pci_devices[iTmp].devfn == 0) break;
     525                                }
     526                                if (iTmp >= MAX_PCI_DEVICES) break;
     527                                pcidev = &pci_devices[iTmp];
    523528                        } else pcidev->devfn = 0;
    524529
     
    612617        int gfp = GFP_ATOMIC;
    613618        int order;
    614 #ifdef DEBUG
    615619        dprintf(("pci_alloc_consistent %d mask %x", size, (hwdev) ? hwdev->dma_mask : 0));
    616 #endif
    617620        if (hwdev == NULL || hwdev->dma_mask != 0xffffffff) {
    618621                //try not to exhaust low memory (< 16mb) so allocate from the high region first
     
    965968        struct pci_driver *driver;
    966969
    967         dprintf(("OSS32_APMSuspend"));
     970        dprintf(("OSS32_APMSuspend 1"));
    968971
    969972        fSuspended = TRUE;
     
    980983        }
    981984
     985        dprintf(("OSS32_APMSuspend 2"));
    982986        return OSSERR_SUCCESS;
    983987}
Note: See TracChangeset for help on using the changeset viewer.