Re: IRQ Sharing with PCI Device

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



bbartson wrote:
already5chosen@xxxxxxxxx wrote:
bbartson wrote:
Hello,

I've inherited a windows driver that was designed for the NT4 style
architecture (non-PNP and non-WDM).
<snip>
My problem is this old NT4 style driver fails when it tries to allocate interrupts.
The interrupt allocation fails with STATUS_CONFLICTING_ADDRESSES. This error code comes from
IoAssignResources.



Nt4-style PCI drivers must use HalAssignSlotResources(). All other
approaches are conflict-prone.

Of course, if backward compatibility is not required you could just
convert everything to WDM. Then instead of being at mercy of BIOS
vendor you end up at mercy of Microsoft. I'm not sure which one is
worse :(

Thanks for the reply. So I've started using HalAssignSlotResources
however now I get an error from IoConnectInterrupt
(STATUS_INVALID_PARAMETER = 0xC000000D). Is there some other call I
should be using instead of this?

IoConnectInterrupt() is o.k. but you should map interrupt vector
obtained from HalAssignSlotResources via HalGetInterruptVector().
Something like that:

KIRQL mapped_system_Irql = pPartialDescriptor->u.Interrupt.Level,
KAFFINITY mapped_system_Affinity =
pPartialDescriptor->u.Interrupt.Affinity;
ULONG mapped_system_vector = HalGetInterruptVector(PCIBus,
BusNumber,
pPartialDescriptor->u.Interrupt.Level,
pPartialDescriptor->u.Interrupt.Vector,
&mapped_system_Irql,
&mapped_system_Affinity);

status = IoConnectInterrupt(
&m_InterruptObject,
Isr,
context,
NULL,
mapped_system_vector,
mapped_system_Irql,
mapped_system_Irql,
LevelSensitive,
TRUE,
mapped_system_Affinity,
FALSE);

.



Relevant Pages

  • Re: IoConnectInterrupt and surprise-removal
    ... Have your ISR check the register contents for 0xFFFFFFFF. ... > I've written a PCI function driver for a 32-bit pccard device. ... The driver calls IoConnectInterrupt() ...
    (microsoft.public.development.device.drivers)
  • Re: PCI interrupt
    ... HalAssignSlotResources is obsolete since year 2000. ... Write a WDM PnP driver, ... Vector, // Bus interrupt vector ... &irql, // IRQ level ...
    (microsoft.public.development.device.drivers)
  • Filter Hook
    ... I have tried to set up a Filter Hook driver. ... sure these are the only scenarios that cause a crash). ... since I didn't set up an interrupt call back function, ... "IoConnectInterrupt" from the isrStack). ...
    (microsoft.public.development.device.drivers)
  • IoConnectInterrupt and surprise-removal
    ... I've written a PCI function driver for a 32-bit pccard device. ... The driver calls IoConnectInterrupt() ... whenever the device generates an interrupt, ...
    (microsoft.public.development.device.drivers)
  • Re: PCI interrupt
    ... Why are you using HalAssignSlotResources? ... You should write a WDM PNP driver, ... Vector, // Bus interrupt vector ... &irql, // IRQ level ...
    (microsoft.public.development.device.drivers)