Lines Matching defs:pIns

206 int vboxPciOsDevRegisterWithIommu(PVBOXRAWPCIINS pIns)
211 struct pci_dev *pPciDev = pIns->pPciDev;
212 PVBOXRAWPCIDRVVM pData = VBOX_DRV_VMDATA(pIns);
223 vbpci_printk(KERN_DEBUG, pIns->pPciDev,
232 pIns->fIommuUsed = true;
252 int vboxPciOsDevUnregisterWithIommu(PVBOXRAWPCIINS pIns)
256 struct pci_dev *pPciDev = pIns->pPciDev;
257 PVBOXRAWPCIDRVVM pData = VBOX_DRV_VMDATA(pIns);
273 if (pIns->fIommuUsed)
275 iommu_detach_device(pData->pIommuDomain, &pIns->pPciDev->dev);
277 pIns->fIommuUsed = false;
286 int vboxPciOsDevReset(PVBOXRAWPCIINS pIns)
290 if (pIns->pPciDev)
293 if (pci_reset_function(pIns->pPciDev))
295 vbpci_printk(KERN_DEBUG, pIns->pPciDev,
366 int vboxPciOsDevDetachHostDriver(PVBOXRAWPCIINS pIns)
369 uint8_t uBus = (pIns->HostPciAddress) >> 8;
370 uint8_t uDevFn = (pIns->HostPciAddress) & 0xff;
403 pIns->szPrevDriver[0] = '\0';
414 strncpy(pIns->szPrevDriver, currentDriver, sizeof(pIns->szPrevDriver));
480 if (pIns->szPrevDriver[0])
484 pIns->szPrevDriver);
523 int vboxPciOsDevReattachHostDriver(PVBOXRAWPCIINS pIns)
525 struct pci_dev *pPciDev = pIns->pPciDev;
530 if (pIns->szPrevDriver[0])
539 uint8_t uBus = (pIns->HostPciAddress) >> 8;
540 uint8_t uDevFn = (pIns->HostPciAddress) & 0xff;
543 "reattaching old host driver %s\n", pIns->szPrevDriver);
589 pIns->szPrevDriver);
597 pIns->szPrevDriver[0] = '\0';
615 int vboxPciOsDevInit(PVBOXRAWPCIINS pIns, uint32_t fFlags)
622 rc = vboxPciOsDevDetachHostDriver(pIns);
626 pIns->HostPciAddress, rc);
632 pPciDev = PCI_DEV_GET_SLOT((pIns->HostPciAddress) >> 8,
633 (pIns->HostPciAddress) & 0xff);
638 pIns->pPciDev = pPciDev;
646 pIns->fMsiUsed = true;
659 int vboxPciOsDevDeinit(PVBOXRAWPCIINS pIns, uint32_t fFlags)
661 struct pci_dev *pPciDev = pIns->pPciDev;
670 if (pIns->aRegionR0Mapping[iRegion])
672 iounmap(pIns->aRegionR0Mapping[iRegion]);
673 pIns->aRegionR0Mapping[iRegion] = 0;
678 vboxPciOsDevUnregisterWithIommu(pIns);
681 if (pIns->fMsiUsed)
686 vboxPciOsDevReattachHostDriver(pIns);
689 pIns->pPciDev = NULL;
695 int vboxPciOsDevDestroy(PVBOXRAWPCIINS pIns)
700 int vboxPciOsDevGetRegionInfo(PVBOXRAWPCIINS pIns,
708 struct pci_dev *pPciDev = pIns->pPciDev;
755 int vboxPciOsDevMapRegion(PVBOXRAWPCIINS pIns,
762 struct pci_dev *pPciDev = pIns->pPciDev;
791 if (pIns->aRegionR0Mapping[iRegion])
793 *pRegionBase = pIns->aRegionR0Mapping[iRegion];
813 *pRegionBase = pIns->aRegionR0Mapping[iRegion] = result;
818 int vboxPciOsDevUnmapRegion(PVBOXRAWPCIINS pIns,
828 int vboxPciOsDevPciCfgWrite(PVBOXRAWPCIINS pIns, uint32_t Register, PCIRAWMEMLOC *pValue)
830 struct pci_dev *pPciDev = pIns->pPciDev;
851 int vboxPciOsDevPciCfgRead (PVBOXRAWPCIINS pIns, uint32_t Register, PCIRAWMEMLOC *pValue)
853 struct pci_dev *pPciDev = pIns->pPciDev;
889 PVBOXRAWPCIINS pIns = (PVBOXRAWPCIINS)pvDevId;
892 if (pIns && pIns->IrqHandler.pfnIrqHandler)
893 fTaken = pIns->IrqHandler.pfnIrqHandler(pIns->IrqHandler.pIrqContext, iIrq);
902 int vboxPciOsDevRegisterIrqHandler(PVBOXRAWPCIINS pIns, PFNRAWPCIISR pfnHandler, void* pIrqContext, int32_t *piHostIrq)
905 int32_t iIrq = pIns->pPciDev->irq;
909 vbpci_printk(KERN_NOTICE, pIns->pPciDev, "no irq assigned\n");
933 pIns);
936 vbpci_printk(KERN_DEBUG, pIns->pPciDev,
941 vbpci_printk(KERN_DEBUG, pIns->pPciDev, "got irq %d\n", iIrq);
946 int vboxPciOsDevUnregisterIrqHandler(PVBOXRAWPCIINS pIns, int32_t iHostIrq)
948 vbpci_printk(KERN_DEBUG, pIns->pPciDev, "freeing irq %d\n", iHostIrq);
949 free_irq(iHostIrq, pIns);
953 int vboxPciOsDevPowerStateChange(PVBOXRAWPCIINS pIns, PCIRAWPOWERSTATE aState)
960 vbpci_printk(KERN_DEBUG, pIns->pPciDev, "PCIRAW_POWER_ON\n");
962 vboxPciOsDevReset(pIns);
964 rc = vboxPciOsDevRegisterWithIommu(pIns);
967 vbpci_printk(KERN_DEBUG, pIns->pPciDev, "PCIRAW_POWER_RESET\n");
968 rc = vboxPciOsDevReset(pIns);
971 vbpci_printk(KERN_DEBUG, pIns->pPciDev, "PCIRAW_POWER_OFF\n");
973 rc = vboxPciOsDevUnregisterWithIommu(pIns);
976 vbpci_printk(KERN_DEBUG, pIns->pPciDev, "PCIRAW_POWER_SUSPEND\n");
981 vbpci_printk(KERN_DEBUG, pIns->pPciDev, "PCIRAW_POWER_RESUME\n");
986 vbpci_printk(KERN_DEBUG, pIns->pPciDev, "unknown power state %u\n", aState);