Problem with resource assignment

Hi all,
I am writing miniport driver. My device have 1 MB of memory resource(PCI device).
In findadapter routine i am assigning memory resource of 1MB by IoAssignResource to device.

Reason i am assigning this resource explicitly is that i am facing some problem with interrupt so i am overriding interrupt in INF file to install driver Driver installation goes fine with this scenario but memory range get lost.

When i don’t override interrupt resource then i get memory resource of 1MB in accessrange structure in findadapter routine, but my driver installation fails with code 10.

In order to overcome this problem i am assigning 1 MB resource to device explicitly. I am able to assign resource. After assigning resource i am validating that range by storportvalidaterange routine and it is working fine, but when i call storportgetdevicebase routine to map this address to system address space i got NULL as return value from this routine. Whereas when i don’t override IRQ, am able to get device base for 1 MB range.

What might be the reason?

Also is there any other way by which i can do device installation without interrupt resource assigned to the device?

I am not able to understand that when i dont assign any interrupt to device, driver installation fails with code 10, whereas when i override interrupt in INF file i am able to install driver but memory range is lost.

Please elaborate on the same.
Thanks!

xxxxx@yahoo.com/xxxxx@yahoo.com:

so you are in a classic hole digging operation. You have a problem you
need to root cause and resolve: “some problem with an interrupt”. Rather
than investigate and resolve this problem you have instead gotten out
your shovel and attempted to dig your hole deeper by ‘reassigning the
interrupt’, which of course is not actually going to work, but what the
heck. It is also likely that whatever your original interrupt problem
is/was will remain a problem should you actually manage to reassign this
interrupt. And meanwhile a set of new problems have arisen out of your
hole expansion operation.

Here is your clue: PCI devices are pnp devices and their resources are
managed by the PCI bus manager and PnP, not by the function drivers that
use these resources. Storport miniport drivers aren’t even function
drivers, storport is the function driver, your miniport is restricted to
managing your hardware registers in order to shuffle IO requests back
and forth, initialize your firmware, etc.

But you will persist in your hole enlargement operation instead. Good
luck with that.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Thursday, March 20, 2008 12:25 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Problem with resource assignment

Hi all,
I am writing miniport driver. My device have 1 MB of memory resource(PCI
device).
In findadapter routine i am assigning memory resource of 1MB by
IoAssignResource to device.

Reason i am assigning this resource explicitly is that i am facing some
problem with interrupt so i am overriding interrupt in INF file to
install driver Driver installation goes fine with this scenario but
memory range get lost.

When i don’t override interrupt resource then i get memory resource of
1MB in accessrange structure in findadapter routine, but my driver
installation fails with code 10.

In order to overcome this problem i am assigning 1 MB resource to device
explicitly. I am able to assign resource. After assigning resource i am
validating that range by storportvalidaterange routine and it is working
fine, but when i call storportgetdevicebase routine to map this address
to system address space i got NULL as return value from this routine.
Whereas when i don’t override IRQ, am able to get device base for 1 MB
range.

What might be the reason?

Also is there any other way by which i can do device installation
without interrupt resource assigned to the device?

I am not able to understand that when i dont assign any interrupt to
device, driver installation fails with code 10, whereas when i override
interrupt in INF file i am able to install driver but memory range is
lost.

Please elaborate on the same.
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

> Reason i am assigning this resource explicitly is that i am facing some
problem

with interrupt

Deal with it and fix it instead of doing dirty hackery like LogConfigOverride
for a PCI device.

I do not think resource override in the INF was ever supported for PCI devices.
You can, however, try to force the particular IRQ in the Device Manager GUI
after installing the device (as a part of the investigation of the interrupt
bug).


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Check my reply on “Assigning IRQ to device” - it applies here is well, so that I don’t want just to retype a post
that I made on another thread less than a minute ago (the only difference is poster on that thread wants to assign interrupt resource, while you are more interested in memory one)…

Anton Bassov

I think they are they same person using random blind yahoo mailboxes.

On Thu, Mar 20, 2008 at 3:03 PM, wrote:

> Check my reply on “Assigning IRQ to device” - it applies here is well, so
> that I don’t want just to retype a post
> that I made on another thread less than a minute ago (the only difference
> is poster on that thread wants to assign interrupt resource, while you are
> more interested in memory one)…
>
> 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
>


Mark Roddy

Thanks for your reply. It’s not the same person, it’s same problem faced by two different person working on same project. I am sorry, i was not aware that same thing been posted already.
I gone through your reply’s over it.

My problem is:-
PNP manager is assigning IRQ as 0 to our device. With this scenario driver fails to install with code10.
After doing random trials to install driver i came to solution of forcefully assigning some IRQ to device. I am not keen to assign IRQ forcefully.

Is there any specific reason, that when i don’t assign IRQ (forcefully) driver installation fails with code10.?
How can i move ahead without forcing IRQ and install my driver successfully?

Sorry for inconvenience occured.
Thanks !

But you (or maybe “another person who works on the same project”) had asked it around 2 months ago - when you assign IRQ, you are able to install driver but fail to map memory. We explained to you that
PnP Manager does *not* assign IRQ0 to your device, as well as that assigning IRQ to your device manually does not lead you anywhere. Don’t you understand that the machine just does not recognize your device properly because it must be buggy???

Anton Bassov

Is it a PCI device?


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Thanks for your reply. It’s not the same person, it’s same problem faced by
two different person working on same project. I am sorry, i was not aware that
same thing been posted already.
> I gone through your reply’s over it.
>
> My problem is:-
> PNP manager is assigning IRQ as 0 to our device. With this scenario driver
fails to install with code10.
> After doing random trials to install driver i came to solution of forcefully
assigning some IRQ to device. I am not keen to assign IRQ forcefully.
>
> Is there any specific reason, that when i don’t assign IRQ (forcefully)
driver installation fails with code10.?
> How can i move ahead without forcing IRQ and install my driver successfully?
>
> Sorry for inconvenience occured.
> Thanks !
>

> Is it a PCI device?

Yes, and they is assigning IRQ via PCI Configuration Space - check their thread a couple of months ago…

Anton Bassov