Changeset 532 for GPL/branches/uniaud32-2.1.x/lib32/pci.c
- Timestamp:
- Jul 28, 2010, 8:05:20 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-2.1.x/lib32/pci.c
r523 r532 41 41 #include <osspci.h> 42 42 43 #define MAX_PCI_BUSSES 1643 #define MAX_PCI_BUSSES 256 44 44 #define MAX_PCI_DEVICES 16 45 45 46 46 struct pci_dev pci_devices[MAX_PCI_DEVICES] = {0}; 47 struct pci_bus pci_busses[MAX_PCI_BUSSES] = {0};47 //struct pci_bus pci_busses[MAX_PCI_BUSSES] = {0}; 48 48 49 49 BOOL fSuspended = FALSE; … … 158 158 u8 headerType; 159 159 160 busNr = (ulLast >> 8) & 0x 1f;160 busNr = (ulLast >> 8) & 0xff; 161 161 devNr = PCI_SLOT(ulLast); 162 162 funcNr = PCI_FUNC(ulLast); … … 200 200 pcidev->vendor = detectedId & 0xffff; 201 201 pcidev->device = detectedId >> 16; 202 pcidev->bus = &pci_busses[busNr]; 202 //pcidev->bus = &pci_busses[busNr]; 203 pcidev->bus = kmalloc(sizeof(struct pci_bus), GFP_KERNEL); 204 if (pcidev->bus == NULL) return 0; 205 memset (pcidev->bus, 0, sizeof(struct pci_bus)); 203 206 pcidev->bus->number = busNr; 204 207 pcidev->devfn = PCI_DEVFN(devNr, funcNr); … … 507 510 while( (ulLast = pci_query_device(&driver->id_table[iTableIx], pcidev, ulLast)) ) { 508 511 509 510 512 RMInit(); 511 513 dprintf(("pci_register_driver: found=%x:%x searching for %x:%x\n", … … 526 528 if (iTmp >= MAX_PCI_DEVICES) break; 527 529 pcidev = &pci_devices[iTmp]; 528 } else pcidev->devfn = 0; 530 } else { 531 kfree(pcidev->bus); 532 pcidev->devfn = 0; 533 } 529 534 530 535 RMDone(0); … … 553 558 pcidev = &pci_devices[j]; 554 559 if (pcidev->devfn == 0) continue; 555 if (pcidev->vendor != driver->id_table[i].vendor) continue;560 if (pcidev->vendor != driver->id_table[i].vendor) continue; 556 561 if ( (driver->id_table[i].device != PCI_ANY_ID) && (pcidev->device != driver->id_table[i].device) ) continue; 557 562 dprintf(("pci unreg match: %x:%x %x:%x", pci_devices[j].vendor, pci_devices[j].device, driver->id_table[i].vendor, driver->id_table[i].device)); 558 if(!driver->remove) continue; 559 driver->remove(pcidev); 563 if (driver->remove) driver->remove(pcidev); 564 kfree(pcidev->bus); 565 pcidev->devfn = 0; 560 566 } 561 567 }
Note:
See TracChangeset
for help on using the changeset viewer.