Ignore:
Timestamp:
Mar 9, 2017, 1:01:06 AM (8 years ago)
Author:
David Azarewicz
Message:

Remove dead code. update build system. Fix api interrupt defect.

File:
1 edited

Legend:

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

    r576 r592  
    4747//struct pci_bus pci_busses[MAX_PCI_BUSSES] = {0};
    4848
    49 BOOL    fRewired = FALSE;
    5049extern int nrCardsDetected;
    5150
     
    5554#define PCI_CONFIG_DATA                 0xCFC
    5655
    57 #ifdef ACPI
    58 APIRET APIENTRY ACPIFindPCIDevice(ULONG Bus, ULONG Dev, ULONG Fun, ULONG *PicIRQ, ULONG *ApicIRQ, ULONG *Hdl, char *Component);
    59 #endif
    60 
    6156//******************************************************************************
    6257#define CONFIG_CMD(dev, where)  \
     
    140135        int             resNo, addr;
    141136        u32 devNr, busNr, funcNr, detectedId, cfgaddrreg, ulPciAdr, ulTmp1, ulTmp2;
    142 #ifdef ACPI
    143         APIRET                   rc;
    144         ULONG                    PicIRQ, ApicIRQ;
    145 #endif
    146137        u8              headerType;
    147138
     
    239230                                pci_read_config_dword(pcidev, PCI_INTERRUPT_LINE, &ulTmp1);
    240231                                rprintf(("pci_query_device: PCI config IRQ=%d", ulTmp1&0xff));
    241 #ifdef ACPI
    242                                 rc = ACPIFindPCIDevice( (ULONG)busNr,                                            // Bus
    243                                                                                 (ULONG)devNr,                                            // Dev
    244                                                                                 (ULONG)(pcidev->devfn >> 8) & 7,         // Function
    245                                                                                 &PicIRQ,                                                         // PIC IRQ
    246                                                                                 &ApicIRQ,                                                        // APIC IRQ
    247                                                                                 NULL,                                                            // ACPI handle to finding device
    248                                                                                 "Uniaud32");                                             // Name for acpi log
    249                                 if (!rc) {
    250                                         if (PicIRQ) ulTmp1 = (ulTmp1 & (~0xff)) | (PicIRQ & 0xff); // Choose Pic interrupt for init time processing
    251                                         else if (ApicIRQ) ulTmp1 = (ulTmp1 & (~0xff)) | (ApicIRQ & 0xff);
    252                                         rprintf(("pci_query_device: IRQs ACPI PIC=%ld APIC=%ld chosen=%d", PicIRQ, ApicIRQ, ulTmp1&0xff));
    253                                         pcidev->picirq = PicIRQ;   // Save the Pic and
    254                                         pcidev->apicirq = ApicIRQ; // Save the Apic interrupt for switching later
    255                                 }
    256 #endif /* ACPI */
    257232                                if( (u8)ulTmp1 && (u8)ulTmp1 != 0xff ) {
    258233                                        pcidev->irq_resource[0].flags = IORESOURCE_IRQ;
     
    972947}
    973948
    974 #ifdef ACPI
    975 void PciAdjustInterrupts() {
    976         int i;
    977         struct pci_dev *pcidev;
    978         struct pci_driver *driver;
    979         ULONG ulTmp1, rc;
    980 
    981         for (i=0; i<MAX_PCI_DEVICES; i++) {
    982                 if (!pci_devices[i].devfn) continue;
    983                 pcidev = &pci_devices[i];
    984                 ulTmp1 = pcidev->irq;
    985                 if (pcidev->apicirq) ulTmp1 = pcidev->apicirq;
    986                 else if (pcidev->picirq) ulTmp1 = pcidev->picirq;
    987                 rprintf(("PciAdjustInterrupts: IRQs ACPI PIC=%ld APIC=%ld was=%d chosen=%ld", pcidev->picirq, pcidev->apicirq, pcidev->irq, ulTmp1));
    988                 if( (u8)ulTmp1 && ((u8)ulTmp1 != 0xff) && ((u8)ulTmp1 != pcidev->irq) ) {
    989                         RMSetHandles(pcidev->hAdapter, pcidev->hDevice); /* DAZ - dirty hack */
    990                         driver = pcidev->pcidriver;
    991                         if(driver && driver->suspend) driver->suspend(pcidev, SNDRV_CTL_POWER_D0);
    992 
    993                         pcidev->irq_resource[0].flags = IORESOURCE_IRQ;
    994                         pcidev->irq_resource[0].start = pcidev->irq_resource[0].end   = ulTmp1 & 0xffff;
    995                         pcidev->irq = (u8)ulTmp1;
    996 
    997                         fRewired = TRUE;
    998                         // if(driver && driver->resume) driver->resume(pcidev);
    999                 }
    1000         } /* for loop */
    1001 }
    1002 #endif
Note: See TracChangeset for help on using the changeset viewer.