MSI doesn't work in Windows.

I’m working on a storport driver. But the MSI doesn’t work in Windows. The same device works fine in Linux. I’ve done following things.

  1. Set HwMSInterruptRoutine in HwFindAdapter routine.
  2. Add register as following:
    HKR, Interrupt Management, 0x00000010
    HKR, Interrupt Management\MessageSignaledInterruptProperties, 0x00000010
    HKR, Interrupt Management\MessageSignaledInterruptProperties, MSISupported, %REG_DWORD%, 1
    HKR, Interrupt Management\MessageSignaledInterruptProperties, MessageNumberLimit, %REG_DWORD%, 32
    REG_DWORD = 0x00010001

After driver installed, the resources in the device property shows the right IRQ resources. It’s also right to read from StorPortGetMSIInfo and gets this:
MSI msgId 0, IntVec 144, IntMode 1 .
MSI msgId 1, IntVec 144, IntMode 1 .
MSI msgId 2, IntVec 144, IntMode 1 .
MSI msgId 3, IntVec 128, IntMode 1 .
MSI msgId 4, IntVec 128, IntMode 1 .
MSI msgId 5, IntVec 128, IntMode 1 .
MSI msgId 6, IntVec 128, IntMode 1 .
MSI msgId 7, IntVec 128, IntMode 1 .
MSI msgId 8, IntVec 128, IntMode 1 .
But the IRQ number in the device property is:
0xFFFFFFA0 (-96)
0xFFFFFF9F (-97)

So I have 2 questions:

  1. What else should I do to make MSI work correctly.
  2. Is there any relationship between the numbers returned by StorPortGetMSIInfo and the IRQ value in the resource tab in the device property?

Thanks.

On Nov 3, 2017, at 1:40 AM, xxxxx@gmail.com wrote:
> …
> After driver installed, the resources in the device property shows the right IRQ resources. It’s also right to read from StorPortGetMSIInfo and gets this:
> MSI msgId 0, IntVec 144, IntMode 1 .
> MSI msgId 1, IntVec 144, IntMode 1 .
> MSI msgId 2, IntVec 144, IntMode 1 .
> MSI msgId 3, IntVec 128, IntMode 1 .
> MSI msgId 4, IntVec 128, IntMode 1 .
> MSI msgId 5, IntVec 128, IntMode 1 .
> MSI msgId 6, IntVec 128, IntMode 1 .
> MSI msgId 7, IntVec 128, IntMode 1 .
> MSI msgId 8, IntVec 128, IntMode 1 .
> But the IRQ number in the device property is:
> 0xFFFFFFA0 (-96)
> 0xFFFFFF9F (-97)
> …
>
> So I have 2 questions:
> 1. What else should I do to make MSI work correctly.

Why do you think it is not working correctly? Have you run the hardware to see if your IRQ fires?

> 2. Is there any relationship between the numbers returned by StorPortGetMSIInfo and the IRQ value in the resource tab in the device property?

Nope.

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

I have the device installed, but there’s no interrupt/MSI routine called during the test.

I’ve fixed this problem by setting the MSI registers in the device manually (MSI message data, message address…).
It’s not the same as Linux which is done by Kernel.
I’m not sure I’ve done correctly.