overriding device resource

Hi all,

Is it possible to override single resource of a device using logconfig section in installation file?
Rest all resources must be left as it is.

I am facing problem, while overriding IRQ for a device i am missing other resources. Other resources like memory ranges get set to 0 when i override IRQ and when i dont override IRQ i am able to get memory ranges.

Any help will be appreciated.
~Thanks.

IIRC, logconfigs are an all or nothing affair, you cannot pick and choose what to override. You can pick and choose at runtime in your driver though. You can handle IRP_MN_FILTER_RESOURCE_REQUIREMENTS and add an interrupt descriptor to the list (if that is what you mean by overriding IRQ) or modify an existing resource in place.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Friday, February 01, 2008 7:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] overriding device resource

Hi all,

Is it possible to override single resource of a device using logconfig section in installation file?
Rest all resources must be left as it is.

I am facing problem, while overriding IRQ for a device i am missing other resources. Other resources like memory ranges get set to 0 when i override IRQ and when i dont override IRQ i am able to get memory ranges.

Any help will be appreciated.
~Thanks.


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

xxxxx@yahoo.com wrote:

Hi all,

Is it possible to override single resource of a device using logconfig section in installation file?
Rest all resources must be left as it is.

I am facing problem, while overriding IRQ for a device i am missing other resources. Other resources like memory ranges get set to 0 when i override IRQ and when i dont override IRQ i am able to get memory ranges.

What kind of a device is this? The fact that you talk about memory
ranges implies to me that it is a PCI device. In that case, it doesn’t
do any good to override the IRQ in an INF file, because the BIOS already
assigned an IRQ at boot time. You have to use the IRQ it gave you. You
can’t choose your own.


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

Thanks…
Yes it’s a PCI device and i know the fact that BIOS already assigned an IRQ at boot time but in my case i got IRQ values as 0 and that’s the reason i am forcefully assigning IRQ and initialization goes fine.

Assigning/overriding IRQ is not an issue , issue is that when i try to override IRQ, other resources which are constructed by PNP mgr goes to zero (e.g.memory ranges)(A resource requirements list that overrides basic configurations.)

As per Doron’s suggestion (handle IRP_MN_FILTER_RESOURCE_REQUIREMENTS request),
which is not possible because miniport driver fails at initialization time (i.e. in FindAdapter) with status code 10 in case when i don’t override IRQ. So i never reached to PNP request.

So is there a way by which i can override IRQ only?

> Yes it’s a PCI device and i know the fact that BIOS already assigned an IRQ

at boot time but in my case i got IRQ values as 0

Bizarre…

I have a weird feeling that your device does not want to use interrupt pins (which is rather problematic approach on pre-Vista OS versions, because they don’t support MSI) , so that it sets InterruptPin field in Configuration Register to 0, and, at this point, InterruptLine field becomes meaningless…

Anton Bassov

Thanks Anton,
Basically it’s a simmulator for a device and for which assigned interrupt is 10.
I am using o.s. win2k3-r2. When i forcefully assign IRQ 10 to device (Simmulator) i am able to initialize my driver(miniport) but missing out my other resources.
I have idea that override configuration overrides basic config.

What i want, is there any way to override single resource and keep other resources as it is?

If your device is a PCI device, you have a fundamental
misunderstanding. (Doron’s advice was based on the assumption that
you understood, and that your device was attached to ISA or one of its
more modern equivalents, like LPC.)

You cannot “override” its IRQ. A PCI device isn’t directly attached
to the interrupt controller. PCI slots (and PCI-X slots, and
virtually speaking, PCIe slots) have four interrupt pins, INTA#,
INTB#, INTC# and INTD#. Your device indicates which of these pins it
will trigger through its Interrupt Pin register.

From there, it’s up to the motherboard designer how your signal gets
to the interrupt controllers. A typical strategy is to route it
simultaneously to an “IRQ steering device” and to an I/O APIC input.
The IRQ steering device is then connected to the PIC.

The BIOS puts a default value in the IRQ steering device and then
writes that value into your device’s Interrupt Line register.

Now, almost every machine today supports dual-core or multi-threaded
CPUs, which require APIC support. So almost every machine today will
run in APIC mode when you boot Windows. So the value assigned by the
BIOS is irrelevant and ignored, as it only applies to PIC mode.

When the PnP manager looks for resources for your device, it looks in
tables supplied by the BIOS which tell it which I/O APIC and which
input on that I/O APIC the pin on your device is attached to. If
you’re getting no interrupt resources, it’s probably because your BIOS
is missing this information.

  • Jake Oshins
    Windows Kernel Team
    author of much of the code which determines interrupt routing

wrote in message news:xxxxx@ntdev…
> Thanks…
> Yes it’s a PCI device and i know the fact that BIOS already assigned
> an IRQ at boot time but in my case i got IRQ values as 0 and that’s
> the reason i am forcefully assigning IRQ and initialization goes
> fine.
>
> Assigning/overriding IRQ is not an issue , issue is that when i try
> to override IRQ, other resources which are constructed by PNP mgr
> goes to zero (e.g.memory ranges)(A resource requirements list that
> overrides basic configurations.)
>
> As per Doron’s suggestion (handle
> IRP_MN_FILTER_RESOURCE_REQUIREMENTS request),
> which is not possible because miniport driver fails at
> initialization time (i.e. in FindAdapter) with status code 10 in
> case when i don’t override IRQ. So i never reached to PNP request.
>
> So is there a way by which i can override IRQ only?
>

I am going to answer the pnp irp question, the response jake gave in terms of the actual effects (or lack thereof) of changing the resource requirements is completely valid. IRP_MN_FILTER_RESOURCE_REQUIREMENTS is sent to the driver before the pnp start irp. Because you are in a miniport model, you will not see this irp (but that does not mean it is not sent :wink: ). If you truly want to experiment with filtering the resource requirements, you can write a lower filter to your miniport driver that handles this pnp irp. You can write such a lower filter in KMDF with very little code, you would just have to register for EvtDeviceFilterRemoveResourceRequirements (which does not necessarily need to remove anything) and modify the resources in place.

d
The guy who worked with Jake for awhile

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Monday, February 04, 2008 12:43 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] overriding device resource

Thanks…
Yes it’s a PCI device and i know the fact that BIOS already assigned an IRQ at boot time but in my case i got IRQ values as 0 and that’s the reason i am forcefully assigning IRQ and initialization goes fine.

Assigning/overriding IRQ is not an issue , issue is that when i try to override IRQ, other resources which are constructed by PNP mgr goes to zero (e.g.memory ranges)(A resource requirements list that overrides basic configurations.)

As per Doron’s suggestion (handle IRP_MN_FILTER_RESOURCE_REQUIREMENTS request),
which is not possible because miniport driver fails at initialization time (i.e. in FindAdapter) with status code 10 in case when i don’t override IRQ. So i never reached to PNP request.

So is there a way by which i can override IRQ only?


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