I am developing a Windows driver for the first time, developing a WDM to study.
For PCI express device developed in xilinx IP, when register an interrupt to the device during IRP_MN_START_DEVICE, and come back in one msi. I use IoConnectInterruptEx.
Do you people understand how anyone?
Test PC
?Windows 7 64bit
?Celeron G1850
?my device PCIe Gen 2.0 (x8 lane) connect to PCIe 3.0 (x8 lane)
Pnp callback
when IRP_MN_FILTER_RESOURCE_REQUIREMENTS,
?receive in the following order:
16 MSIs, 1 MSI, line-based
but IRP_MN_START_DEVICE,
AllocatedResourcesTranslated :
PCM_PARTIAL_RESOURCE_DESCRIPTOR -> Flags is set CM_RESOURCE_INTERRUPT_MESSAGE.
AllocatedResources(Raw) :
u.MessageInterrupt.Raw.MessageCount is 1
my.inf
[xxx_PCIe_Inst.NT.HW]
AddReg=MsiSupportStd
[MsiSupportStd]
HKR,Interrupt Management,0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties,0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties,MSISupported,0x00010001,1
HKR,Interrupt Management\MessageSignaledInterruptProperties,MessageNumberLimit,0x00010001,16
; checked registers, LC_LOCAL_MACHINE/SYSTEM/…/PCI/‘MyDevice’/
IoConnectInterruptEx code
IO_CONNECT_INTERRUPT_PARAMETERS params;
params.Version = CONNECT_MESSAGE_BASED;
params.MessageBased.PhysicalDeviceObject = MyPhysicalObject;
params.MessageBased.MessageServiceRoutine = TestInterruptMessageService;
params.MessageBased.ServiceContext = (PVOID)MyFdo;
params.MessageBased.SpinLock = &MySpinLock;
params.MessageBased.SynchronizeIrql = 0;
params.MessageBased.FloatingSave = FALSE;
params.MessageBased.FallBackServiceRoutine = TestMsiFallbackInterruptService;
params.MessageBased.ConnectionContext.Generic = &MyConnectionContext.Generic;
status = IoConnectInterruptEx(¶ms);
// status is SUCCESS
// params.Version is CONNECT_MESSAGE_BASED
// (*(params.MessageBased.ConnectionContext.InterruptMessageTable))->MessageCount is 1
PCI configuration space
PCIe MSI capability :
Control :
?? MSI Enable : It becomes 1 when call the IoConnectInterruptEx from 0
Multiple Message Capable : 4 (= 16 MSIs)
Multiple Message Enable : 0
Address64bit : 1
PerVectorMaskCapable : 0 ( xilinx IP not supported? )
PCIe capability :
Capabilities :
…
Interrupt Message Number : 1
If the test was set to 4 “PCIe MSI capability.Multiple Message Enable”, InterruptMessageNumber is 16.