Enabling MSI-X interrupts in WDF

Hello everyone,

I’m trying to implement MSI-X interrupts in a USB bus driver I’m writing in WDF / KMDF. I’ve read the MSDN documentation here: (http://msdn.microsoft.com/en-us/library/windows/hardware/ff565424(v=vs.85).aspx), and there’s not really a lot of helpful info there. Having read the documentation, I feel like what I’m doing should just work, but it does not.

I’ve changed our driver’s INF file to add the registry keys as described on MSDN (under “Enabling Message-Signaled Interrupts in the Registry”) and confirmed that they are being set properly when I install the driver. When the driver loads, I’m querying the PCI-e config space and determining whether MSI-X interrupts are supported or not.

The problem is that once I have this information, I don’t know how to change my interrupt set-up code to specifically set up the interrupt to be MSI-X. I do the standard calls to configure a WDF_INTERRUPT_CONFIG_INIT stuct and call WdfInterruptCreate, but the interrupt that is created is not message-signaled, and I don’t know what needs to be done to actually make it so.

Is there a WDF version of the steps here?
http://msdn.microsoft.com/en-us/library/windows/hardware/ff548079(v=vs.85).aspx

Should I just be doing the standard WDFINTERRUPT creation steps here, with something extra maybe?
http://msdn.microsoft.com/en-ca/library/windows/hardware/ff547345(v=vs.85).aspx

Does anyone have any experience doing this? Can anyone provide a source example?

xxxxx@gmail.com wrote:

I’m trying to implement MSI-X interrupts in a USB bus driver I’m writing in WDF / KMDF.

That sentence doesn’t make sense. MSI-X is a PCI concept, not a USB
concept. The only way that sentence might make sense is if you were
creating a host controller driver, but nobody does that. Was the word
“USB” just a mistake there?

I’ve changed our driver’s INF file to add the registry keys as described on MSDN (under “Enabling Message-Signaled Interrupts in the Registry”) and confirmed that they are being set properly when I install the driver. When the driver loads, I’m querying the PCI-e config space and determining whether MSI-X interrupts are supported or not.

The problem is that once I have this information, I don’t know how to change my interrupt set-up code to specifically set up the interrupt to be MSI-X.

You don’t. If your device supports MSI-X, and the registry is properly
configured, and the operating system supports MSI-X, then the resource
descriptors passed to AddDevice handler will already be set up for
MSI-X. If they aren’t, there’s nothing you can do to change that.

I do the standard calls to configure a WDF_INTERRUPT_CONFIG_INIT stuct and call WdfInterruptCreate, but the interrupt that is created is not message-signaled, and I don’t know what needs to be done to actually make it so.

How do you know the interrupt is not MSI? Does your device support both
MSI and legacy interrupts? Which operating systems are you supporting?
Windows XP doesn’t do MSI at all.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.