Hi Everyone,
I am new to windows driver and am writing a KMDF Bus driver for a PCI Express card.I have referred msdn sites.In that they described inorder to use msi-x,it should be enabled in the INF file.I have done that thing.After that how i should proceed,so that i can confirm that i enabled msi-x in my driver.
Please , let anyone clear my doubts.It will be very helpful.
Thanks in advance
Your writing a BUS driver for a PCIe card? Can you clarify what you’re child devices are, please?
Peter
OSR
@OSRDrivers
In my case, virtual network devices are the child devices.
OK. So it’s not the CHILD device you want to enable MSI-X for… it’s the FUNCTION aspect of your bus driver, right?
You can check PCI configuration space, and read the MSI-X capability to see if it’s enabled. In WinDbg you can use the !PCI 0x100 command for this.
Peter
OSR
@OSRDrivers
How do you know you’re not getting MSI interrupts? What type of interrupt resource are you getting in your START_DEVICE handler?
Right now,I have started to implement MSI-X in my driver. Based on my understanding,first i need to enable msi-x in INF file.Then i have searched for sample drivers so that i can able to get clear picture on codewise.I dont know how to start my coding part on msi-x,that’s what i need right now.
If there is any sample drivers available,in which msi-x feature is implemented,please share it with me.Also please share if there is any related links available
MSI-X is implemented in WDF drivers exactly the same way as MSI.
If your device is both MSI and MSI-X capable, and the system on which you’re running supports MSI-X, your device will be enabled for MSI-X.
Just write your code in your normal way… your driver is no different whether MSI or MSI-X was used.
Peter
OSR
@OSRDrivers
Sorry for asking this silly question.
Where can i get a sample WDF Driver in which MSI or MSI-X feature is implemented.
xxxxx@gmail.com wrote:
Sorry for asking this silly question.
Where can i get a sample WDF Driver in which MSI or MSI-X feature is implemented.
I’m not quite sure what you are expecting to find. MSI and MSI-X are
just hardware method for implementing interrupts. Your HARDWARE has to
know the difference, so it signals the interrupts correctly, but the
driver doesn’t have to know. All PCI drivers connect to their interrupt
and implement their ISRs in the same way, regardless of how they are
implemented in hardware.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
I deal in audio drivers so I don’t use KMDF, but the way I do interrupts is to look at the Flags member of the device’s CM_PARTIAL_RESOURCE_DESCRIPTOR, and if the CM_RESOURCE_INTERRUPT_MESSAGE bit is set then it’s MSI or MSI-X, otherwise it’s using legacy interrupts. Then I use IoConnectInterruptEx with the CONNECT_FULLY_SPECIFIED version and fill out all the IO_CONNECT_INTERRUPT_PARAMETERS members appropriately.
I don’t know how this process translates to KMDF but it might give you a starting point.
Jeff