How to implement and handle MSI-X in KMDF

Hi experts…
I am new to windows development

I need to know how MSI-X is initialized and handled in KMDF bus driver my PCI hardware support only MSI-X so need to know in and out of it. I need any document link or code reference in KMDF so I can analyse and get a grip about MSI-X through KMDF API (not in NDIS)

I googled it and MSDN only has elaborate it in NDIS, as of now following this method but the link for MSI, but I need it for MSI-X
https://msdn.microsoft.com/en-us/library/windows/hardware/ff544246(v=vs.85).aspx

  1. As of gathered details about MSI/MSI-X came to know about vector and message ID how it differ in both?

  2. It?s says MSI max interrupt 32 and only be alocated in power of 2 and MSI-X support 2048, these numbers are message ID for vector or separate vector, as of my understanding MSI-X has advanced masking and handling but I need more details about MSI-X how it is handled in bus driver…?
    https://msdn.microsoft.com/en-us/library/windows/hardware/ff544219(v=vs.85).aspx

3.Does MSI-X also need any Registry edit in INF…?

Please elaborate me with some examples and links

MSI and MSI-X are treated equivalently in WDF. there are no differences in implementing a function driver.

Peter
OSR
@OSRDrivers

xxxxx@gmail.com wrote:

I need to know how MSI-X is initialized and handled in KMDF bus driver my PCI hardware support only MSI-X so need to know in and out of it. I need any document link or code reference in KMDF so I can analyse and get a grip about MSI-X through KMDF API (not in NDIS)

I googled it and MSDN only has elaborate it in NDIS, as of now following this method but the link for MSI, but I need it for MSI-X
https://msdn.microsoft.com/en-us/library/windows/hardware/ff544246(v=vs.85).aspx

  1. As of gathered details about MSI/MSI-X came to know about vector and message ID how it differ in both?

You don’t need to worry about this. You just call WdfInterruptCreate.
Windows handles the implementation details for traditional, MSI, and
MSI-X interrupts.

  1. It?s says MSI max interrupt 32 and only be alocated in power of 2 and MSI-X support 2048, these numbers are message ID for vector or separate vector, as of my understanding MSI-X has advanced masking and handling but I need more details about MSI-X how it is handled in bus driver…?

As a driver writer, you don’t need to worry about this. It’s an
implementation detail of the bus. When your peripheral sends an
interrupt message, your ISR will be fired. That is essentially all of
the detail you need to know.

As a side note, if your hardware asks for multiple messages, Windows
will not necessarily grant them. Each message requires an interrupt
resource, and those resources are limited. That is allowed by the PCI
spec, and the board has to handle it.

By the way:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff544219.aspx

3.Does MSI-X also need any Registry edit in INF…?

Yes.


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

Thanks Peter and Tim for the clarification, i will do some experiment with this…