Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
Hi Guys,
I have written a KMDF driver which needs at least three MSIx vectors and can handle up to Max of 32 MSIx vectors. If the driver gets anything less than three vectors, it cannot operate and returns error from "PrepareHardware" Callback. I have tested the driver under QEMU and it works great.
I tried the driver with actual hardware (FPGA) on another machine and for some reason the "PrepareHardware" always gets called with 1 interrupt resource and with only one MSIx message.
I looked at the registry to make sure that the INF file add registry directive is actually creating the MSIx registry entries. I could see that the registry entries are created under
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\PCI\VEN_XXXX&DEV_XXXX&SUBSYS_XXXXXXXX&REV_00\4&36daf17&0&0010\Device Parameters\Interrupt Management\MessageSignaledInterruptProperties
and the entries created are
MessageNumberLimit REG_DWORD 0x20 (32) MSISupported REG_DWORD 0x01
The machine that I am testing the driver on is a intel XEON based machine with Windows 10 Enterprise (640-bit).
Any pointers to debug this problem further are highly appreciated.
Thanks
AJ.
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Writing WDF Drivers | 12 September 2022 | Live, Online |
Internals & Software Drivers | 23 October 2022 | Live, Online |
Kernel Debugging | 14 November 2022 | Live, Online |
Developing Minifilters | 5 December 2022 | Live, Online |
Comments
Assuming all else correct, you get one of below in windows
1) All requested MSI-X vectors (should be power of 2)
2) 1 MSI-x
3) 1 Line interrupt
Driver is supposed to work with any of above given config.
Try #vectors 4 to see if it helps.
Check the Full set of Capability structures, also.
Also, I like to check the requested resources by DbgPrint’ing the resource list(s) at the pre Prepare Hardware callbacks (like Query Resource RequirementsQuery Resource Requirements.
Maybe one of those will help you understand what’s going on.
Be certain you’re requesting MSI-X resources, and not MSI resources. You should be able to get 32 MSI-X resources, but you’re very unlikely to get 32 MSI resources.
Peter
Peter Viscarola
OSR
@OSRDrivers
I figured it out. The device was not requesting the correct resources. The PCIe configuration was not setup properly.
There you go. Examining the capabilities will show that.
Another mystery solved.
Thanks for getting back to us to let us know.
Peter Viscarola
OSR
@OSRDrivers
Thanks for the help @Peter_Viscarola_(OSR) and everyone else , I have been a long long time poster on this list, though disappeared for a few years in between, and I always believed the community created by OSR is nothing short of a blessing for all the windows kernel developers. Its amazing what you guys have done and achieved.
-Aj