IoConnectInterrupt() failing

Hi all,

I’ve got a HID miniclass driver based on the vhidmini sample.

It connects to some (hard-coded) IO port resources and an interrupt via
the IOConfig & IRQConfig directives in the INF file.

I can find the resources, which look sane, but IoConnectInterrupt fails
with STATUS_INVALID_PARAMETER.

According to device manager, there are no other drivers connected to my
IRQ(12). Sharing is specified in the INF file. Affinity is -1 from the
resource list (I’ve also tried ‘1’).

Any ideas why this call would be failing? I’ve scoured the net but no
answers were forthcoming. Is there any reason why this would fail for a
hid minidriver???

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

Mark McDougall wrote:

Hi all,

I’ve got a HID miniclass driver based on the vhidmini sample.

It connects to some (hard-coded) IO port resources and an interrupt via
the IOConfig & IRQConfig directives in the INF file.

I can find the resources, which look sane, but IoConnectInterrupt fails
with STATUS_INVALID_PARAMETER.

According to device manager, there are no other drivers connected to my
IRQ(12). Sharing is specified in the INF file. Affinity is -1 from the
resource list (I’ve also tried ‘1’).

Any ideas why this call would be failing? I’ve scoured the net but no
answers were forthcoming. Is there any reason why this would fail for a
hid minidriver???

Is this an ISA interrupt or a PCI interrupt? Are you sure the
level/edge state is correct? Can you post the code?


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

Tim Roberts wrote:

Is this an ISA interrupt or a PCI interrupt? Are you sure the
level/edge state is correct? Can you post the code?

The interrupt is generated via LPC bus (on PCI bridge). It uses
bus-relative, edge-triggered (latched) interrupts.

Here’s the extract from the INF file…

IRQConfig=S:11,12

Code extract (straight out of Oney)…

case CmResourceTypeInterrupt:
irql = (KIRQL)resource->u.Interrupt.Level;
vector = resource->u.Interrupt.Vector;
affinity = resource->u.Interrupt.Affinity;
mode = (resource->Flags == CM_RESOURCE_INTERRUPT_LATCHED) ?
Latched : LevelSensitive;
irqshare = resource->ShareDisposition == CmResourceShareShared;


ntStatus = IoConnectInterrupt (&deviceInfo->InterruptObject,
(PKSERVICE_ROUTINE)OnInterrupt, (PVOID)deviceInfo,
NULL, vector, irql, irql, mode, irqshare, affinity, FALSE);

Here’s the TraceView output…

Found Interrupt resource (irql=11, vector=11, affinity=-1, mode=latched,
irqshare=1)
IoConnectInterrupt() failed with 0xc000000d(STATUS_INVALID_PARAMETER)

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

Post the output of “!arbiter 4” and “!acpiirqarb”. Then post the relevant
parts of “!devnode 0 7” where you omit everything except your driver, its
parent and its grandparent.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group

This post implies no warranties and confers no rights.


“Mark McDougall” wrote in message news:xxxxx@ntdev…
> Tim Roberts wrote:
>
>> Is this an ISA interrupt or a PCI interrupt? Are you sure the
>> level/edge state is correct? Can you post the code?
>
> The interrupt is generated via LPC bus (on PCI bridge). It uses
> bus-relative, edge-triggered (latched) interrupts.
>
> Here’s the extract from the INF file…
>
> IRQConfig=S:11,12
>
> Code extract (straight out of Oney)…
>
> case CmResourceTypeInterrupt:
> irql = (KIRQL)resource->u.Interrupt.Level;
> vector = resource->u.Interrupt.Vector;
> affinity = resource->u.Interrupt.Affinity;
> mode = (resource->Flags == CM_RESOURCE_INTERRUPT_LATCHED) ?
> Latched : LevelSensitive;
> irqshare = resource->ShareDisposition == CmResourceShareShared;
>
> …
> ntStatus = IoConnectInterrupt (&deviceInfo->InterruptObject,
> (PKSERVICE_ROUTINE)OnInterrupt, (PVOID)deviceInfo,
> NULL, vector, irql, irql, mode, irqshare, affinity, FALSE);
>
>
> Here’s the TraceView output…
>
> Found Interrupt resource (irql=11, vector=11, affinity=-1, mode=latched,
> irqshare=1)
> IoConnectInterrupt() failed with 0xc000000d(STATUS_INVALID_PARAMETER)
>
> Regards,
>
> –
> Mark McDougall, Engineer
> Virtual Logic Pty Ltd, http:
> 21-25 King St, Rockdale, 2216
> Ph: +612-9599-3255 Fax: +612-9599-3266
></http:>

Jake Oshins wrote:

Post the output of “!arbiter 4” and “!acpiirqarb”. Then post the
relevant parts of “!devnode 0 7” where you omit everything except your
driver, its parent and its grandparent.

lkd> !arbiter 4
Error retrieving address of IopRootDeviceNode
lkd> !acpiirqarb
failed to find address of arbiter
lkd> !devnode 0 7
Error retrieving address of IopRootDeviceNode

:frowning:

Any ideas why?

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

Mark McDougall wrote:

Any ideas why?

OK, it was symbols…


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

Jake Oshins wrote:

Post the output of “!arbiter 4” and “!acpiirqarb”. Then post the
relevant parts of “!devnode 0 7” where you omit everything except your
driver, its parent and its grandparent.

The device in question is s5crdr. Currently it is sharing IRQ11 with
Serial. FWIW there are 6 serial ports on the system, using IRQs 3,4,10 &
11. The physical serial port devices are implemented on the LPC bus in an
FPGA together with the s5crdr device. All the serial ports work.

The serial port devnode listings look the same as s5crdrdr.

I have also tried IRQ12 for s5crdr (nothing else using it) - same result.

The parent of the device is root.

—8<------8<------8<------8<------8<------8<------8<------8<—

DEVNODE 825b0548 (ACPI_HAL\PNP0C08\0)
Interrupt Arbiter “” at f855d380
Allocated ranges:
(snip)
000000000000000b - 000000000000000b S 825b1a90 (Serial)
000000000000000b - 000000000000000b S 825b50e0 (s5crdrdr)
(snip)
Possible allocation:
< none >

—8<------8<------8<------8<------8<------8<------8<------8<—

ACPI IRQ Arbiter: fffffffff855d380 Extension: ffffffff825ed5b0
Link nodes in use: (list head at 825ed5b0825ed5b0 )
IRQ Hash Table (at ffffffffe15702d0 ):
(snip)
000b Count/temp: 00/02 Flags: (edge high) TempFlags(edge high)
(snip)
0013 Count/temp: 00/01 Flags: (level low) TempFlags(level low)

—8<------8<------8<------8<------8<------8<------8<------8<—

lkd> !devnode 0x825ed008 7
DevNode 0x825ed008 for PDO 0x825b50e0
InstancePath is “Root\HIDCLASS\0001”
ServiceName is “s5crdrdr”
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)
CmResourceList at 0xe17a8370 Version 0.0 Interface 0x1 Bus #0
Entry 0 - Port (0x1) Undetermined Sharing (0)
Flags (0x11) - PORT_MEMORY PORT_IO 16_BIT_DECODE
Range starts at 0x4240 for 0x20 bytes
Entry 1 - Interrupt (0x2) Shared (0x3)
Flags (0x01) - LATCHED
Level 0xb, Vector 0xb, Affinity 0xffffffff

BootResourcesList at 0xe156b490 Version 0.0 Interface 0x1 Bus #0
Entry 0 - Port (0x1) Undetermined Sharing (0)
Flags (0x11) - PORT_MEMORY PORT_IO 16_BIT_DECODE
Range starts at 0x4240 for 0x20 bytes
Entry 1 - Interrupt (0x2) Shared (0x3)
Flags (0x01) - LATCHED
Level 0xb, Vector 0xb, Affinity 0xffffffff

IoResList at 0xe18c83b8 : Interface 0x1 Bus 0 Slot 0
Alternative 0 (Version 1.1)
Preferred Descriptor 0 - NonArbitrated/ConfigData (0x80) Shared (0x3)
Flags (0000) -
Data: : 0x0 0x1 0xdff5bc00
Preferred Descriptor 1 - Port (0x1) Undetermined Sharing (0)
Flags (0x11) - PORT_IO 16_BIT_DECODE
0x000020 byte range with alignment 0x000001
4240 - 0x425f
Preferred Descriptor 2 - Interrupt (0x2) Shared (0x3)
Flags (0x01) - LATCHED
0xb - 0xb

DevNode 0x81efc898 for PDO 0x81f17920
InstancePath is “HID\S5CrdRdrDevice\1&4784345&2&0000”
TargetDeviceNotify List - f 0xe1f2bb90 b 0xe1f2bb90
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

You need to fix your symbols before any debugger extensions work.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group

This post implies no warranties and confers no rights.


“Mark McDougall” wrote in message news:xxxxx@ntdev…
> Jake Oshins wrote:
>> Post the output of “!arbiter 4” and “!acpiirqarb”. Then post the
>> relevant parts of “!devnode 0 7” where you omit everything except your
>> driver, its parent and its grandparent.
>>
>
> lkd> !arbiter 4
> Error retrieving address of IopRootDeviceNode
> lkd> !acpiirqarb
> failed to find address of arbiter
> lkd> !devnode 0 7
> Error retrieving address of IopRootDeviceNode
>
> :frowning:
>
> Any ideas why?
>
> Regards,
>
> –
> Mark McDougall, Engineer
> Virtual Logic Pty Ltd, http:
> 21-25 King St, Rockdale, 2216
> Ph: +612-9599-3255 Fax: +612-9599-3266
></http:>

You need to call IoConnectInterrupt with the exact parameters you get handed
in your start IRP. Or you need to call IoConnectInterruptEx (on newer
systems) with your PDO and no other parameters. You can’t change what you
get handed and you can’t do it with a different device object.

You don’t say in your original message where those parameters come from.
But the notion that vector and IRQL were 11 is simply impossible.

I’d guess that you used the raw resources rather than the translated
resources from your start IRP. Use the translated resources.


Jake Oshins
(former interrupt guy)
Windows Kernel Group

This post implies no warranties and confers no rights.


“Mark McDougall” wrote in message news:xxxxx@ntdev…
> Jake Oshins wrote:
>> Post the output of “!arbiter 4” and “!acpiirqarb”. Then post the
>> relevant parts of “!devnode 0 7” where you omit everything except your
>> driver, its parent and its grandparent.
>
> The device in question is s5crdr. Currently it is sharing IRQ11 with
> Serial. FWIW there are 6 serial ports on the system, using IRQs 3,4,10 &
> 11. The physical serial port devices are implemented on the LPC bus in an
> FPGA together with the s5crdr device. All the serial ports work.
>
> The serial port devnode listings look the same as s5crdrdr.
>
> I have also tried IRQ12 for s5crdr (nothing else using it) - same result.
>
> The parent of the device is root.
>
> —8<------8<------8<------8<------8<------8<------8<------8<—
>
> DEVNODE 825b0548 (ACPI_HAL\PNP0C08\0)
> Interrupt Arbiter “” at f855d380
> Allocated ranges:
> (snip)
> 000000000000000b - 000000000000000b S 825b1a90 (Serial)
> 000000000000000b - 000000000000000b S 825b50e0 (s5crdrdr)
> (snip)
> Possible allocation:
> < none >
>
> —8<------8<------8<------8<------8<------8<------8<------8<—
>
> ACPI IRQ Arbiter: fffffffff855d380 Extension: ffffffff825ed5b0
> Link nodes in use: (list head at 825ed5b0825ed5b0 )
> IRQ Hash Table (at ffffffffe15702d0 ):
> (snip)
> 000b Count/temp: 00/02 Flags: (edge high) TempFlags(edge high)
> (snip)
> 0013 Count/temp: 00/01 Flags: (level low) TempFlags(level low)
>
> —8<------8<------8<------8<------8<------8<------8<------8<—
>
> lkd> !devnode 0x825ed008 7
> DevNode 0x825ed008 for PDO 0x825b50e0
> InstancePath is “Root\HIDCLASS\0001”
> ServiceName is “s5crdrdr”
> State = DeviceNodeStarted (0x308)
> Previous State = DeviceNodeEnumerateCompletion (0x30d)
> CmResourceList at 0xe17a8370 Version 0.0 Interface 0x1 Bus #0
> Entry 0 - Port (0x1) Undetermined Sharing (0)
> Flags (0x11) - PORT_MEMORY PORT_IO 16_BIT_DECODE
> Range starts at 0x4240 for 0x20 bytes
> Entry 1 - Interrupt (0x2) Shared (0x3)
> Flags (0x01) - LATCHED
> Level 0xb, Vector 0xb, Affinity 0xffffffff
>
> BootResourcesList at 0xe156b490 Version 0.0 Interface 0x1 Bus #0
> Entry 0 - Port (0x1) Undetermined Sharing (0)
> Flags (0x11) - PORT_MEMORY PORT_IO 16_BIT_DECODE
> Range starts at 0x4240 for 0x20 bytes
> Entry 1 - Interrupt (0x2) Shared (0x3)
> Flags (0x01) - LATCHED
> Level 0xb, Vector 0xb, Affinity 0xffffffff
>
> IoResList at 0xe18c83b8 : Interface 0x1 Bus 0 Slot 0
> Alternative 0 (Version 1.1)
> Preferred Descriptor 0 - NonArbitrated/ConfigData (0x80) Shared (0x3)
> Flags (0000) -
> Data: : 0x0 0x1 0xdff5bc00
> Preferred Descriptor 1 - Port (0x1) Undetermined Sharing (0)
> Flags (0x11) - PORT_IO 16_BIT_DECODE
> 0x000020 byte range with alignment 0x000001
> 4240 - 0x425f
> Preferred Descriptor 2 - Interrupt (0x2) Shared (0x3)
> Flags (0x01) - LATCHED
> 0xb - 0xb
>
> DevNode 0x81efc898 for PDO 0x81f17920
> InstancePath is “HID\S5CrdRdrDevice\1&4784345&2&0000”
> TargetDeviceNotify List - f 0xe1f2bb90 b 0xe1f2bb90
> State = DeviceNodeStarted (0x308)
> Previous State = DeviceNodeEnumerateCompletion (0x30d)
>
> Regards,
>
> –
> Mark McDougall, Engineer
> Virtual Logic Pty Ltd, http:
> 21-25 King St, Rockdale, 2216
> Ph: +612-9599-3255 Fax: +612-9599-3266
></http:>

Jake Oshins wrote:

I’d guess that you used the raw resources rather than the translated
resources from your start IRP. Use the translated resources.

Arrrggghhh!!! Thankyou! It was a typo that I missed completely - I
transcribed incorrectly from Oney’s book! Doh!!!

I can’t test it atm (I’m at home) but I’ve been able to log into work and
check the code, change it to resourceTrans, and re-compile. I’m sure
that’ll be it!

Thanks again!!!

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

Mark McDougall wrote:

Arrrggghhh!!! Thankyou! It was a typo that I missed completely - I
transcribed incorrectly from Oney’s book! Doh!!!

I can’t test it atm (I’m at home) but I’ve been able to log into work and
check the code, change it to resourceTrans, and re-compile. I’m sure
that’ll be it!

Thanks again Jake! Turns out the variable names used in Walt’s example
mapped to resources - not translated resources - in my code! A blind
cut ‘n’ paste problem. :frowning:

It now works, with irql=7, vector=385 reported.

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

> It now works, with irql=7, vector=385 reported.

Actually, there are only 256 possible interrupt vectors under x86, so that vector 385 is just out of IDT limits. Therefore, if vector 385 is, indeed, reported, then the statement “it now works” seems to be a way too optimistic…

Anton Bassov

From: “Mark McDougall”
> Thanks again Jake! Turns out the variable names used in Walt’s example
> mapped to resources - not translated resources - in my code! A blind
> cut ‘n’ paste problem. :frowning:

Hmm. Page 365 is where the skeleton for the StartDevice skeleton begins. The
two resource lists are named “raw” and “translated”. From whence stems the
confusion?

Walter Oney
Consulting and Training
www.oneysoft.com

Iirc, the vector is an emcoded value and the value passed to the api is not the same as the one programmed into the hw

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@hotmail.com
Sent: Monday, April 20, 2009 12:59 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] IoConnectInterrupt() failing

> It now works, with irql=7, vector=385 reported.

Actually, there are only 256 possible interrupt vectors under x86, so that vector 385 is just out of IDT limits. Therefore, if vector 385 is, indeed, reported, then the statement “it now works” seems to be a way too optimistic…

Anton Bassov


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

>the vector is an emcoded value and the value passed to the api is not the same as

the one programmed into the hw

I may be wrong here, but, IIRC, vector from raw and translated interrupt resources correspond to respectively IRQ line and IDT entry (at least under XP). …

Anton Bassov

You should not try to interpret those values as what’s programmed into the hardware. As I recall, they have a symbolic meaning (abstraction) private to the hal in use and are not guaranteed to represent hardware actual vectors. This is thus an implementation detail and subject to change.

  • S

-----Original Message-----
From: xxxxx@hotmail.com
Sent: Monday, April 20, 2009 09:20
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] IoConnectInterrupt() failing

>the vector is an emcoded value and the value passed to the api is not the same as
> the one programmed into the hw

I may be wrong here, but, IIRC, vector from raw and translated interrupt resources correspond to respectively IRQ line and IDT entry (at least under XP). …

Anton Bassov


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Please ignore Anton. That’s a perfectly valid value.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group

This post implies no warranties and confers no rights.


wrote in message news:xxxxx@ntdev…
>> It now works, with irql=7, vector=385 reported.
>
> Actually, there are only 256 possible interrupt vectors under x86, so that
> vector 385 is just out of IDT limits. Therefore, if vector 385 is, indeed,
> reported, then the statement “it now works” seems to be a way too
> optimistic…
>
> Anton Bassov
>

Only with some HALs, Anton. Please don’t confuse people.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group

This post implies no warranties and confers no rights.


wrote in message news:xxxxx@ntdev…
>>the vector is an emcoded value and the value passed to the api is not the
>>same as
>> the one programmed into the hw
>
>
> I may be wrong here, but, IIRC, vector from raw and translated interrupt
> resources correspond to respectively IRQ line and IDT entry (at least
> under XP). …
>
> Anton Bassov
>

Jake,

Only with some HALs, Anton. Please don’t confuse people.

Look at how I put it - I started my statement with " I may be wrong here…". I am not asserting anything in it,
am I???

Anton Bassov

xxxxx@hotmail.com wrote:

Jake,

> Only with some HALs, Anton. Please don’t confuse people.
>

Look at how I put it - I started my statement with " I may be wrong here…". I am not asserting anything in it, am I???

The point, and it is a point that I need to learn as well, is this: when
you find it necessary to say “I may be wrong here”, it is very often a
sign that you should just hit escape, stay silent, and let someone who
is SURE answer the question.


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