Hi,
How to change the resource requirement of device in driver?
I am writing a Miniport driver.
After the card inserted, the ResourceRequirementList can be read in
HLM/SYSTEM/CurrentControlSet/ENUM/PCI/VEN... from Registry.
REG_RESOURCE_REQUIREMENTS_LIST is shown as below,
Alternative... Resou... Descrip.. Device..
1 1 1 Memory
1 2 1 Memory
1 3 1 Memory
1 4 1 Intererupt

The third memory is not need, and I want to move it.
As the DDK said, I/O manager gives a chance to change the resource
requirement. When FDO gets IRP_MN_FILTER_RESOURCE_REQUIREMENTS of
IRP_MJ_PnP.
I did this successfully, however, for doing this, I add the AddDevice
routine and IRP_MJ_PnP dispatch routine, as a result, The
MiniportInitialize function is not called.
Who can give me some suggestion?
Thanks!

Re: How to change the resource requirement of device in driver? by Mark

Mark
Mon Apr 10 14:28:43 CDT 2006

BlueCrystal wrote:
> Hi,
> How to change the resource requirement of device in driver?
> I am writing a Miniport driver.
> After the card inserted, the ResourceRequirementList can be read in
> HLM/SYSTEM/CurrentControlSet/ENUM/PCI/VEN... from Registry.
> REG_RESOURCE_REQUIREMENTS_LIST is shown as below,
> Alternative... Resou... Descrip.. Device..
> 1 1 1 Memory
> 1 2 1 Memory
> 1 3 1 Memory
> 1 4 1 Intererupt
>
> The third memory is not need, and I want to move it.

So just don't use it. Don't allocate any virtual address space for it
and ignore it.

> As the DDK said, I/O manager gives a chance to change the resource
> requirement. When FDO gets IRP_MN_FILTER_RESOURCE_REQUIREMENTS of
> IRP_MJ_PnP.
> I did this successfully, however, for doing this, I add the AddDevice
> routine and IRP_MJ_PnP dispatch routine, as a result, The
> MiniportInitialize function is not called.
> Who can give me some suggestion?
> Thanks!
>

Re: How to change the resource requirement of device in driver? by BlueCrystal

BlueCrystal
Mon Apr 10 23:10:31 CDT 2006


Do not use NdisMMapIoSpace for it?

I know that, but the hardware of the NIC has bug, the driver can work
in PC with 512M RAM, however, the MiniportInitialize can be called in
PC with 1G RAM.

It is maybe because of the third memory, read from Registry as below:
Access : Read/Write
Length :0x4000000
Alignment :0x4000000
Minimum Address :0x00000000
Maximum Address:0x3FFFFFFF

The third memory range must be between 0x00000000 and 0x3FFFFFFF, but
the memory range (40000000-FEBFFFFF) of NIC's father PCI bus (1G RAM)
can't fulfill its need.

I think that causes MiniportInitialize can not be called in PC with 1G
RAM, for debug, I want to move the third memory in driver. I move the
third memory, however, MiniportInitialize can not be called in PC with
512M RAM longer. The driver in PC with 512M RAM worked before moving
the third memory.

The hardware of NIC can not be changed, so I only tried to vary the
driver.


Re: How to change the resource requirement of device in driver? by fat_boy

fat_boy
Tue Apr 11 06:12:34 CDT 2006

Hi

You need to add a lowerfilter driver, a WDM driver, that can intercept
IRP_MN_FILTER_RESOURCE_REQUIREMENTS and change the requirements.

You cannot intercept this Irp from the miniportdriver as it is handled
by the Ndis framework.


Re: How to change the resource requirement of device in driver? by BlueCrystal

BlueCrystal
Tue Apr 11 21:57:30 CDT 2006

I will try, thanks in advance!

But, DDK said, the function driver typically handle this IRP
(IRP_MN_FILTER_RESOURCE_REQUIREMENTS). Upper and lower filter drivers
do not handle this IRP.


Re: How to change the resource requirement of device in driver? by BlueCrystal

BlueCrystal
Tue Apr 11 21:57:48 CDT 2006

I will try, thanks in advance!

But, DDK said, the function driver typically handle this IRP
(IRP_MN_FILTER_RESOURCE_REQUIREMENTS). Upper and lower filter drivers
do not handle this IRP.


Re: How to change the resource requirement of device in driver? by Doron

Doron
Tue Apr 11 23:32:29 CDT 2006

correct, but this is to work around the problem that NDIS doesn't give you
access to this irp. you can easily write this driver using KMDF and register
for the EvtDeviceFilterRemoveResourceRequirements callback.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"BlueCrystal" <wangna81@emails.bjut.edu.cn> wrote in message
news:1144810650.448668.306020@i39g2000cwa.googlegroups.com...
>I will try, thanks in advance!
>
> But, DDK said, the function driver typically handle this IRP
> (IRP_MN_FILTER_RESOURCE_REQUIREMENTS). Upper and lower filter drivers
> do not handle this IRP.
>



Re: How to change the resource requirement of device in driver? by Mark

Mark
Tue Apr 11 23:51:34 CDT 2006

On 10 Apr 2006 21:10:31 -0700, "BlueCrystal"
<wangna81@emails.bjut.edu.cn> wrote:

>
>Do not use NdisMMapIoSpace for it?
>
>I know that, but the hardware of the NIC has bug, the driver can work
>in PC with 512M RAM, however, the MiniportInitialize can be called in
>PC with 1G RAM.
>
Your device is not supposed to limit its address range like that. In
fact I don't think it can legally limit its address range, at least
not according to the pci spec. Your device is supposed to have its
BARs mappable either anywhere in 32bit memory space or anywhere in
64bit memory space. In fact I don't quite understand how you are
setting 'Maximum Address'. The PCI spec is pretty clear that there are
exactly three supported address limits - 64bit anywhere, 32bit
anywhere, and 16bit legacy mode.

>It is maybe because of the third memory, read from Registry as below:
> Access : Read/Write
> Length :0x4000000
>Alignment :0x4000000
>Minimum Address :0x00000000
>Maximum Address:0x3FFFFFFF
>
>The third memory range must be between 0x00000000 and 0x3FFFFFFF, but
>the memory range (40000000-FEBFFFFF) of NIC's father PCI bus (1G RAM)
>can't fulfill its need.
>
>I think that causes MiniportInitialize can not be called in PC with 1G
>RAM, for debug, I want to move the third memory in driver. I move the
>third memory, however, MiniportInitialize can not be called in PC with
>512M RAM longer. The driver in PC with 512M RAM worked before moving
>the third memory.
>
>The hardware of NIC can not be changed, so I only tried to vary the
>driver.


=====================
Mark Roddy DDK MVP
Windows Vista/2003/XP/2000 Consulting
Device and Filesystem Drivers
Hollis Technology Solutions 603-321-1032
www.hollistech.com

Re: How to change the resource requirement of device in driver? by Mark

Mark
Tue Apr 11 23:52:46 CDT 2006

On 11 Apr 2006 19:57:48 -0700, "BlueCrystal"
<wangna81@emails.bjut.edu.cn> wrote:

>I will try, thanks in advance!
>
>But, DDK said, the function driver typically handle this IRP
>(IRP_MN_FILTER_RESOURCE_REQUIREMENTS). Upper and lower filter drivers
>do not handle this IRP.

It isn't going to help anyway. Your device couldn't be configured long
before your fdo was going to be enumerated by the PCI bus driver.


=====================
Mark Roddy DDK MVP
Windows Vista/2003/XP/2000 Consulting
Device and Filesystem Drivers
Hollis Technology Solutions 603-321-1032
www.hollistech.com

Re: How to change the resource requirement of device in driver? by Maxim

Maxim
Wed Apr 12 16:56:32 CDT 2006

> Your device is not supposed to limit its address range like that. In
> fact I don't think it can legally limit its address range, at least
> not according to the pci spec. Your device is supposed to have its

At least this violates the PCI hardware design guidelines for Windows.

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