Connecting to several interrupts

Hello,

In my device driver I have to connect to several interrupts.
I’m using:

NTSTATUS status;
WDF_INTERRUPT_CONFIG interruptConfig;
WDF_OBJECT_ATTRIBUTES interruptAttributes;

WDF_INTERRUPT_CONFIG_INIT(
&interruptConfig,
MyEvtInterruptIsr,
MyEvtInterruptDpc
);
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(
&interruptAttributes,
INTERRUPT_DATA
);

status = WdfInterruptCreate(
device,
&interruptConfig,
&interruptAttributes,
&devExt->WdfInterrupt
);

How can I specify the interrupt to which I’m connecting ?
Should I set InterruptRaw in WDF_INTERRUPT_CONFIG ?

Thank you,
Zvika

@zvivered said:
Hello,

In my device driver I have to connect to several interrupts.

Why? What sort of device is this?

The WDFINTERRUPTs are connected in the order you create them, connected in order of the assigned translated interrupts resources. You can have more control over this by creating the interrupts in preparehw() instead of adddevice().

d

Bent from my phone


From: Mark_Roddy
Sent: Monday, December 31, 2018 12:49:38 PM
To: Doron Holan
Subject: Re: [NTDEV] Connecting to several interrupts

OSR https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.osr.com%2F&data=02|01|doron.holan%40microsoft.com|be44ad923f144e73bc8408d66f617b74|72f988bf86f141af91ab2d7cd011db47|1|1|636818861809606119&sdata=IuoZzuaugcM0SIylbLDWbhxdMsrrLFx0PFBJ6u5UQ8A%3D&reserved=0
Mark_Roddy commented on Connecting to several interrupts

> @zvivered said:
>
> Hello,
>
> In my device driver I have to connect to several interrupts.

Why? What sort of device is this?

What Doron said, plus:

Should I set InterruptRaw in WDF_INTERRUPT_CONFIG

Yes… and do it in PrepareHardware.

Peter

In my device driver I have to connect to several interrupts.

How can I specify the interrupt to which I’m connecting ?

Do you understand that you can only connect to interrupts that have been assigned to your driver? You can’t just say “I’d like to hook into IRQ 9”.

Hello Doron, Peter, Time and Mark,

Thank you very much for your quick response.

My FPGA is set to create multiple MSI-X interrupts. Each signals a different event.
Is it possible that handling multiple MSI-X is not supported in version “WDK 7.1.0” ?

Best regards,
Zvika

Multiple MSI interrupts are supported with that WDK and the corresponding OS, plus later versions of both. Are you enabling the MSI interrupts in your INF file see https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/enabling-message-signaled-interrupts-in-the-registry

Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com

Is it possible that handling multiple MSI-X is not supported in version “WDK 7.1.0” ?

Why on earth would you be using an eight year old version of the WDK?

Peter

Hello,

I built the sys with WDK for windows 10 (1809).
The fields:
PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptRaw;
PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptTranslated;

were set properly in prepare hardware.

Thank you,
Zvika

were set properly in prepare hardware.

And now you’re all set?

It’s not clear from your last post if that fixed things, or if you still have an issue…

Peter

Hi Peter,

Now it works.

Thank you,
Zvika