We are in the process of migrating a PCI device KEXT to DEXT and have developed a DriverKit extension using PCIDriverKit which matches with IOPCIDevice as its provider. We are able to match the driver to the device and access registers required to perform command operations. However, we are unable to perform hot reset on the device as per PCI specifications.
The IORegistry structure for the matched driver is as follows,
|-- pci-bridge@1
|-- IOPP
|-- pci@0 (parent/provider to the driver)
|-- myDriver
Hot Reset was earlier implemented in KEXT by setting certain bits of register as per PCI spec from the pci-bridge provider object. We had called IOService->getProvider() iteratively to further retrieve the providers of the driver's provider object. By this process, we were able to retrieve the pci-bridge object necessary to perform hot reset.
However, this method is not available in IOService of DriverKit Framework and performing the same reset operation from the direct provider object of the driver results in an unsuccessful operation.
The IORegistry structure for the matched driver is as follows,
|-- pci-bridge@1
|-- IOPP
|-- pci@0 (parent/provider to the driver)
|-- myDriver
Hot Reset was earlier implemented in KEXT by setting certain bits of register as per PCI spec from the pci-bridge provider object. We had called IOService->getProvider() iteratively to further retrieve the providers of the driver's provider object. By this process, we were able to retrieve the pci-bridge object necessary to perform hot reset.
However, this method is not available in IOService of DriverKit Framework and performing the same reset operation from the direct provider object of the driver results in an unsuccessful operation.
Is there any alternative to getProvider() in DriverKit?
Are there any alternative methods to perform hot reset using PCIDriverKit?
Is there a way of retrieving this pci-bridge object from the application side using IOKitLib APIs, passing it to the driver, casting it to IOPCIDevice and then using it? Is this approach feasible?