Question on WdfInterruptCreate for MSI interrupts

Hi all,
I tried to add the MSI interrupt support in my dirver for PCIe card.
My driver is written using WDF.

I modified the inf file for MSI support and so far so good.

On the coding side, I found from Microsoft some info on IoConnectInterruptEx telling me to set the following params in the IO_CONNECT_INTERRUPT_PARAMETERS to connect MSI interrupt.

params.Version = CONNECT_MESSAGE_BASED;
params.MessageBased.MessageServiceRoutine = OnMessageInterrupt;
params.MessageBased.FallBackServiceRoutine = OnLegacyInterrupt;

How do I do the same with WdfInterruptCreate() ?
WdfInterruptCreate() does not have have neither the FallbackServiceroutine nor the Version = CONNECT_MESSAGE_BASED.

How can I tell WdfInterruptCreate() that I want to use MSI interrupt ?

Thanks for help,

xxxxx@hotmail.com wrote:

On the coding side, I found from Microsoft some info on IoConnectInterruptEx telling me to set the following params in the IO_CONNECT_INTERRUPT_PARAMETERS to connect MSI interrupt.

params.Version = CONNECT_MESSAGE_BASED;
params.MessageBased.MessageServiceRoutine = OnMessageInterrupt;
params.MessageBased.FallBackServiceRoutine = OnLegacyInterrupt;

How do I do the same with WdfInterruptCreate() ?
WdfInterruptCreate() does not have have neither the FallbackServiceroutine nor the Version = CONNECT_MESSAGE_BASED.

How can I tell WdfInterruptCreate() that I want to use MSI interrupt ?

You don’t have to. KMDF will figure that out on its own.


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

… Call WdfInterruptCreate once for each MSI that you expect to receive/connect.

Peter
OSR
@OSRDrivers

Thanks Tim and Peter.

>
… Call WdfInterruptCreate once for each MSI that you expect to receive/connect.
<<

If I need 4 MSI mesages then I should call 4 times WdfInterruptCreate().
Should I specify the same ISR function in all of the 4 calls or they could be different ?

In the case they could be different, how can I associate different message IDs to different ISRs. For example:
Call MyMessageISR_A for Message Id =0
Call MyMessageISR_B for Message Id =1
Call MyMessageISR_C for Message Id =2
Call MyMessageISR_D for Message Id =3

Thanks

Yes. 4 times.

Your choice. But given that you get the message number (zero-based) as a parameter passed into your ISR, you only really NEED one ISR.

Peter
OSR
@OSRDrivers