EvtDevicePrepareHardware not called, but only with specific BIOS settings

I am having an issue with my KMDF driver. When I run with "Native PCIe Enable" set to OFF, the driver functions without problems. From my research, this function seems to give Windows the ability to control the power of the PCIe device. But I'm not certain on what it does precisely.

When I run with "Native PCIe Enable" set to ON, the driver will run the EvtDeviceAdd, and everything will appear to work OK at that point. However, the EvtDevicePrepareHardware routine will not be called at all whatsoever. Instead, the device will become detached and Device Manager will report a Code 10 error ("The device could not start"). I've tried modifying the PNP configuration options, power configuration options, and so on, but I'm going at this a bit blind here as I'm not sure why it's not even getting past this stage.

Unfortunately, I'm unable to run a kernel debugger on this configuration due to the specific environment that is being used here.

It's REALLY hard to say what the problem might be. We don't even REALLY know what this BIOS parameter does.

You're going to need to check with your BIOS vendor / System Integrator to know for sure what the BIOS parameter actually changes. Believe me, there are a lot of weird BIOSes out there, and they do some of the FUNKIEST things.

Hi, thank you so much for responding.

I think this setting pertains to ACPI PCIe Native Control (of which I found this article on MSDN). The manual for the BIOS does not mention anything about this setting - in fact it lists the entire ACPI control area as beyond the scope of the document.

What is required in terms of a KMDF/WDF driver to have this function work properly? It doesn't appear to affect anything else on the system, just my driver.

I think this setting pertains to ACPI PCIe Native Control

But, the POINT is... you don't KNOW. And you don't know how this parameter interacts with OTHER features/capabilities within the BIOS.

From a driver-developer and WDF perspective, there's nothing special you need to do to make this work. ACPI PCIe Native Control for AER, PME, and Capability Structure Control is up to the ACPI BIOS and the OS.

If turning on this parameter makes your driver not work, then don't turn it on. It probably means the BIOS doesn't properly support any or all of the necessary _OSC method(s) on your platform.

If leaving it off works... then leave it off. Why change the switch when you don't even know what it does, right?

That's fair.

Unfortunately the manufacturer default for this BIOS is to have this setting be ON, which causes problems for us.

However there are other PCI devices/drivers installed on the same system which don't seem to have this issue, so I'm somewhat skeptical that the BIOS itself is at fault...but I could be wrong here.

I do know that toggling this setting on opens up other options in the BIOS. I can try and look next week and see if any specific ones cause problems.

Ah, well... I see why you're concerned now.

And, again, I can tell you this: There is absolutely not anything that you should need to do in WDF to "make this work." So, if it's not working, it's a problem to do with the device or the BIOS or a combination of the device, the BIOS, and the system.

But your driver? It's not at fault.

Strange. Why would it work fine on Linux then and not Windows? That was originally why I suspected that it was something to do with the driver specifically. Could it be an issue with Windows Boot Manager?