Question on PNPD test for NDIS...

Hello Gurus,
The MiniportFilterResourceRequirements states the following:
“NDIS can call MiniportFilterResourceRequirements several times before NDIS
calls the MiniportRemoveDevice function. But NDIS calls
MiniportFilterResourceRequirements only when a device is in the halted
state.”

But when I run the PNPD tests, I see MiniportFilterResourceRequirements
getting called while in other states as well. Am I missing anything?

Appreciate any insight.

Thanks,
Chakri

That is interesting. What state are you in? If you can, show us a snippet of your log file / debug spew that includes recent state changes, along with the call to MiniportFilterResourceRequirements.

I’m sure you know this information already, but I can’t resist showing off my favorite diagram on MSDN: http://msdn.microsoft.com/en-us/library/ff543701.aspx (which is also available in tabular form here: http://msdn.microsoft.com/en-us/library/ff560490.aspx ). Make sure that the “official” definition of Halted state matches up with your expectations.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Chakri
Sent: Friday, January 07, 2011 6:00 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question on PNPD test for NDIS…

Hello Gurus,
The MiniportFilterResourceRequirements states the following:
“NDIS can call MiniportFilterResourceRequirements several times before NDIS calls the MiniportRemoveDevice function. But NDIS calls MiniportFilterResourceRequirements only when a device is in the halted state.”

But when I run the PNPD tests, I see MiniportFilterResourceRequirements
getting called while in other states as well. Am I missing anything?

Appreciate any insight.

Thanks,
Chakri


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

Thanks for the reply Jeffrey. And sorry for the delay in reply; Friday
evening is not great time to post a query, after all.

My expectation is inline with the state diagram and state table, which is,
it should happen before MiniportInitializeEx happens. That would be after
AddDevice/MiniportHalt and before MiniportInitializeEx. Let me know if I
need to know more about this.

Below is the stack trace and my miniport state listing (some fields are
deliberately but harmlessly edited). This happens during resource PNPD
rebalance tests and my adapter is in running state. Please let me know if
you need more details.

=====
Breakpoint 1 hit
mydrv!mymp_filter_res_req+0x4b:
fffff88002e49d6b 488d153efc0400 lea rdx,[mydrv! ?? ::FNODOBFM::string’ (fffff88002e999b0)] 0: kd\> kb RetAddr : Args to Child : Call Site fffff88000edb664 : fffffa8001fcd028 fffffa800c73d3b0 fffffa800c73d3b0 4646464646783020 : mydrv!mymp_filter_res_req+0x4b
fffff8800193aa4d : 0000000000000010 fffffa800c73d4c8 fffffa8001fa0560
0000000000000000 : NDIS! ?? ::LNCPHCLB::string’+0x79fe
fffff88001940e05 : fffffa8001fa0410 fffffa800c73d3b0 fffffa8001ab7060
000000000000001b : pnpfiltr+0x1a4d fffff880019405c8 : fffffa800c73d3b0 fffffa8001fa0410 0000000000000000 fffff88001fc3a00 : pnpfiltr+0x7e05
fffff80001a83cd5 : fffffa800c73d3b0 fffff88001fc38a0 fffffa8001fa0410
fffff8a005255010 : pnpfiltr+0x75c8 fffff80001a84da3 : fffff8a005255010 fffff8a00526ee30 fffff88001fc39b0 ffffffff80000d64 : nt!IopFilterResourceRequirementsCall+0xc5
fffff80001a85b62 : fffff88001fc3a00 0000000000000000 0000000020207050
0000000000000000 : nt!IopQueryDeviceResources+0x313 fffff80001aa26ea : 0000000000000000 fffffa800181c000 0000000000000000 fffffa8001ab7060 : nt!PnpGetResourceRequirementsForAssignTable+0x192
fffff80001aa2839 : 0000000000000000 0000000000000000 0000000000000000
fffffa800c73d3b0 : nt!PnpQueryRebalanceWorker+0xaa fffff80001aa28ac : fffffa8001ab27e0 fffff8a0052da000 fffff88001fc3ac0 fffffa8001ab27e0 : nt!PnpQueryRebalance+0x99
fffff80001aa29b3 : fffff8a0052da000 0000000000000000 0000000000000000
fffffa8001fa0410 : nt!PnpFindRebalanceCandidates+0x5c fffff80001aaf8cf : fffffa8001ab27e0 fffffa8001ab27e0 fffff88001fc3b00 fffff8000183ee00 : nt!PnpRebalance+0xb3
fffff80001ab24da : fffffa800c29f320 0000000000000000 0000000000000001
0000000000000001 : nt!PnpReallocateResources+0x18f fffff800017c6351 : 0000000000000000 0000000000000000 fffffa8032706e50 0000000000000000 : nt!PiProcessResourceRequirementsChanged+0x7a
fffff800016d3161 : fffff800017c6020 fffff800019bf501 fffffa80018bd000
0000000000000000 : nt!PnpDeviceActionWorker+0x331 fffff80001969166 : 8b44a072ef3b4128 fffffa80018bd040 0000000000000080 fffffa80018b2b30 : nt!ExpWorkerThread+0x111
fffff800016a4486 : fffff88001e5c180 fffffa80018bd040 fffff88001e66fc0
0003ab90058d4cd2 : nt!PspSystemThreadStartup+0x5a 0000000000000000 : fffff88001fc4000 fffff88001fbe000 fffff88001fc39f0 0000000000000000 : nt!KxStartSystemThread+0x16

0: kd> !ndiskd.miniports

mydrv.sys, v2.3
fffffa8001ff11a0 NetLuidIndex 24, IfIndex 23, My Ethernet Adapter #3
fffffa8001fcb1a0 NetLuidIndex 18, IfIndex 20, My Ethernet Adapter <- This
is the one in question.
fffffa8001f9a1a0 NetLuidIndex 21, IfIndex 22, My Ethernet Adapter #2

0: kd> !ndiskd.miniport fffffa8001fcb1a0

MINIPORT

My Ethernet Adapter

Ndis Handle fffffa8001fcb1a0
Ndis API Version v6.20
Adapter Context fffffa8001fcd000
Miniport Driver fffffa8001fa3c70 - mydrv.sys v2.3
Ndis Verifier [No flags set]

Media Type 802.3
Physical Medium 802.3
Device Path
Device Object fffffa8001fcb050
MAC Address

STATE

Miniport Running
Device PnP QUERY_STOPPED
Datapath Normal
Interface Up
Media Connected
Power D0
References 0n10
User Handles 0
Total Resets 0
Pending OID None
Flags 2c452218
? BUS_MASTER, 64BIT_DMA, SG_DMA, DEFAULT_PORT_ACTIVATED,
SUPPORTS_MEDIA_SENSE, DOES_NOT_DO_LOOPBACK, MEDIA_CONNECTED
PnPFlags 00218021
? PM_SUPPORTED, DEVICE_POWER_ENABLED, NO_HALT_ON_SUSPEND,
RECEIVED_START, HARDWARE_DEVICE

BINDINGS

Filter List Filter Filter Driver Context

WFP LightWeight Filter-0000
fffffa8005afda20 fffffa8001f3a540
fffffa80089775c0
QoS Packet Scheduler-0000
fffffa8008243c90 fffffa8001e05840
fffffa80045333a0

Open List Open Protocol Context

RSPNDR fffffa800c1f48d0 fffffa800c1edd00
fffffa800c1f7010
LLTDIO fffffa800c1e6010 fffffa800c1de6e0
fffffa800c1e4d40
TCPIP6 fffffa80089818d0 fffffa8001c594f0
fffffa800897d750
TCPIP fffffa800897d010 fffffa8001c51270
fffffa800897cbb0

MORE INFORMATION

? Driver handlers ? Task offloads
? Power management ? PM protocol offloads
? Pending OIDs ? Timers
? Pending NBLs ? Receive Side Throttling
? Wake-on-LAN (WoL) ? Packet filter
? Receive queues ? Receive filtering
? NDIS ports ? NIC switch

Regards,
Chakri

“Jeffrey Tippet” wrote in message
news:xxxxx@ntdev…
> That is interesting. What state are you in? If you can, show us a
> snippet of your log file / debug spew that includes recent state changes,
> along with the call to MiniportFilterResourceRequirements.
>
> I’m sure you know this information already, but I can’t resist showing off
> my favorite diagram on MSDN:
> http://msdn.microsoft.com/en-us/library/ff543701.aspx (which is also
> available in tabular form here:
> http://msdn.microsoft.com/en-us/library/ff560490.aspx ). Make sure that
> the “official” definition of Halted state matches up with your
> expectations.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Chakri
> Sent: Friday, January 07, 2011 6:00 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Question on PNPD test for NDIS…
>
> Hello Gurus,
> The MiniportFilterResourceRequirements states the following:
> “NDIS can call MiniportFilterResourceRequirements several times before
> NDIS calls the MiniportRemoveDevice function. But NDIS calls
> MiniportFilterResourceRequirements only when a device is in the halted
> state.”
>
> But when I run the PNPD tests, I see MiniportFilterResourceRequirements
> getting called while in other states as well. Am I missing anything?
>
> Appreciate any insight.
>
> Thanks,
> Chakri
>
>
>
> —
> 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
>
>

FWIW, the devnode output is as below.

0: kd> !devnode fffffa8001fcb050
DevNode 0xfffffa8001fcb050 for PDO 0000000000
Parent 0xfffffa8001fa0060 Sibling 0x18600003 Child 0xfffffa8001fa2c70
InterfaceType 0x1406 Bus Number 0
Duplicate PDO 0xfffffa8001fcb1a0 InstancePath is “”
ServiceName is “”
TargetDeviceNotify List - f 0xfffffa800c1f48d0 b 0000000000
State = Unknown State (0x0)
Previous State = Unknown State (0x0)
StateHistory[03] = Unknown State (0x0)
StateHistory[02] = Unknown State (0x0)
StateHistory[01] = Unknown State (0x0)
StateHistory[00] = Unknown State (0x0)
StateHistory[19] = Unknown State (0x0)
StateHistory[18] = Unknown State (0x10000)
StateHistory[17] = Unknown State (0x0)
StateHistory[16] = Unknown State (0x0)
StateHistory[15] = Unknown State (0x0)
StateHistory[14] = Unknown State (0x0)
StateHistory[13] = Unknown State (0x0)
StateHistory[12] = Unknown State (0x0)
StateHistory[11] = Unknown State (0xfffff8a0)
StateHistory[10] = Unknown State (0x7e3f0)
StateHistory[09] = Unknown State (0x0)
StateHistory[08] = Unknown State (0x0)
StateHistory[07] = Unknown State (0x0)
StateHistory[06] = Unknown State (0x0)
StateHistory[05] = Unknown State (0x0)
StateHistory[04] = Unknown State (0x0)
Flags (0000000000)
DisableableDepends = 15021792 (from children)

“Chakri” wrote in message news:xxxxx@ntdev…
> Thanks for the reply Jeffrey. And sorry for the delay in reply; Friday
> evening is not great time to post a query, after all.
>
> My expectation is inline with the state diagram and state table, which is,
> it should happen before MiniportInitializeEx happens. That would be after
> AddDevice/MiniportHalt and before MiniportInitializeEx. Let me know if I
> need to know more about this.
>
> Below is the stack trace and my miniport state listing (some fields are
> deliberately but harmlessly edited). This happens during resource PNPD
> rebalance tests and my adapter is in running state. Please let me know if
> you need more details.
>
> =====
> Breakpoint 1 hit
> mydrv!mymp_filter_res_req+0x4b:
> fffff88002e49d6b 488d153efc0400 lea rdx,[mydrv! ?? <br>&gt; ::FNODOBFM::string’ (fffff88002e999b0)]<br>&gt; 0: kd&gt; kb<br>&gt; RetAddr : Args to Child : Call Site<br>&gt; fffff88000edb664 : fffffa8001fcd028 fffffa800c73d3b0 fffffa800c73d3b0 <br>&gt; 4646464646783020 : mydrv!mymp_filter_res_req+0x4b
> fffff8800193aa4d : 0000000000000010 fffffa800c73d4c8 fffffa8001fa0560
> 0000000000000000 : NDIS! ?? ::LNCPHCLB::string’+0x79fe
> fffff88001940e05 : fffffa8001fa0410 fffffa800c73d3b0 fffffa8001ab7060
> 000000000000001b : pnpfiltr+0x1a4d<br>&gt; fffff880019405c8 : fffffa800c73d3b0 fffffa8001fa0410 0000000000000000 <br>&gt; fffff88001fc3a00 : pnpfiltr+0x7e05
> fffff80001a83cd5 : fffffa800c73d3b0 fffff88001fc38a0 fffffa8001fa0410
> fffff8a005255010 : pnpfiltr+0x75c8<br>&gt; fffff80001a84da3 : fffff8a005255010 fffff8a00526ee30 fffff88001fc39b0 <br>&gt; ffffffff80000d64 : nt!IopFilterResourceRequirementsCall+0xc5
> fffff80001a85b62 : fffff88001fc3a00 0000000000000000 0000000020207050
> 0000000000000000 : nt!IopQueryDeviceResources+0x313<br>&gt; fffff80001aa26ea : 0000000000000000 fffffa800181c000 0000000000000000 <br>&gt; fffffa8001ab7060 : nt!PnpGetResourceRequirementsForAssignTable+0x192
> fffff80001aa2839 : 0000000000000000 0000000000000000 0000000000000000
> fffffa800c73d3b0 : nt!PnpQueryRebalanceWorker+0xaa<br>&gt; fffff80001aa28ac : fffffa8001ab27e0 fffff8a0052da000 fffff88001fc3ac0 <br>&gt; fffffa8001ab27e0 : nt!PnpQueryRebalance+0x99
> fffff80001aa29b3 : fffff8a0052da000 0000000000000000 0000000000000000
> fffffa8001fa0410 : nt!PnpFindRebalanceCandidates+0x5c<br>&gt; fffff80001aaf8cf : fffffa8001ab27e0 fffffa8001ab27e0 fffff88001fc3b00 <br>&gt; fffff8000183ee00 : nt!PnpRebalance+0xb3
> fffff80001ab24da : fffffa800c29f320 0000000000000000 0000000000000001
> 0000000000000001 : nt!PnpReallocateResources+0x18f<br>&gt; fffff800017c6351 : 0000000000000000 0000000000000000 fffffa8032706e50 <br>&gt; 0000000000000000 : nt!PiProcessResourceRequirementsChanged+0x7a
> fffff800016d3161 : fffff800017c6020 fffff800019bf501 fffffa80018bd000
> 0000000000000000 : nt!PnpDeviceActionWorker+0x331<br>&gt; fffff80001969166 : 8b44a072ef3b4128 fffffa80018bd040 0000000000000080 <br>&gt; fffffa80018b2b30 : nt!ExpWorkerThread+0x111
> fffff800016a4486 : fffff88001e5c180 fffffa80018bd040 fffff88001e66fc0
> 0003ab90058d4cd2 : nt!PspSystemThreadStartup+0x5a<br>&gt; 0000000000000000 : fffff88001fc4000 fffff88001fbe000 fffff88001fc39f0 <br>&gt; 0000000000000000 : nt!KxStartSystemThread+0x16
>
> 0: kd> !ndiskd.miniports
>
> …
>
> mydrv.sys, v2.3
> fffffa8001ff11a0 NetLuidIndex 24, IfIndex 23, My Ethernet Adapter #3
> fffffa8001fcb1a0 NetLuidIndex 18, IfIndex 20, My Ethernet Adapter <-
> This is the one in question.
> fffffa8001f9a1a0 NetLuidIndex 21, IfIndex 22, My Ethernet Adapter #2
> …
>
> 0: kd> !ndiskd.miniport fffffa8001fcb1a0
>
>
> MINIPORT
>
> My Ethernet Adapter
>
> Ndis Handle fffffa8001fcb1a0
> Ndis API Version v6.20
> Adapter Context fffffa8001fcd000
> Miniport Driver fffffa8001fa3c70 - mydrv.sys v2.3
> Ndis Verifier [No flags set]
>
> Media Type 802.3
> Physical Medium 802.3
> Device Path
> Device Object fffffa8001fcb050
> MAC Address
>
>
> STATE
>
> Miniport Running
> Device PnP QUERY_STOPPED
> Datapath Normal
> Interface Up
> Media Connected
> Power D0
> References 0n10
> User Handles 0
> Total Resets 0
> Pending OID None
> Flags 2c452218
> ? BUS_MASTER, 64BIT_DMA, SG_DMA, DEFAULT_PORT_ACTIVATED,
> SUPPORTS_MEDIA_SENSE, DOES_NOT_DO_LOOPBACK, MEDIA_CONNECTED
> PnPFlags 00218021
> ? PM_SUPPORTED, DEVICE_POWER_ENABLED, NO_HALT_ON_SUSPEND,
> RECEIVED_START, HARDWARE_DEVICE
>
>
> BINDINGS
>
> Filter List Filter Filter Driver Context _
> WFP LightWeight Filter-0000
> fffffa8005afda20 fffffa8001f3a540
> fffffa80089775c0
> QoS Packet Scheduler-0000
> fffffa8008243c90 fffffa8001e05840
> fffffa80045333a0
>
> Open List Open Protocol Context _
> RSPNDR fffffa800c1f48d0 fffffa800c1edd00
> fffffa800c1f7010
> LLTDIO fffffa800c1e6010 fffffa800c1de6e0
> fffffa800c1e4d40
> TCPIP6 fffffa80089818d0 fffffa8001c594f0
> fffffa800897d750
> TCPIP fffffa800897d010 fffffa8001c51270
> fffffa800897cbb0
>
>
> MORE INFORMATION
>
> ? Driver handlers ? Task offloads
> ? Power management ? PM protocol offloads
> ? Pending OIDs ? Timers
> ? Pending NBLs ? Receive Side Throttling
> ? Wake-on-LAN (WoL) ? Packet filter
> ? Receive queues ? Receive filtering
> ? NDIS ports ? NIC switch
>
> Regards,
> Chakri
>
> “Jeffrey Tippet” wrote in message
> news:xxxxx@ntdev…
>> That is interesting. What state are you in? If you can, show us a
>> snippet of your log file / debug spew that includes recent state changes,
>> along with the call to MiniportFilterResourceRequirements.
>>
>> I’m sure you know this information already, but I can’t resist showing
>> off my favorite diagram on MSDN:
>> http://msdn.microsoft.com/en-us/library/ff543701.aspx (which is also
>> available in tabular form here:
>> http://msdn.microsoft.com/en-us/library/ff560490.aspx ). Make sure that
>> the “official” definition of Halted state matches up with your
>> expectations.
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of Chakri
>> Sent: Friday, January 07, 2011 6:00 AM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] Question on PNPD test for NDIS…
>>
>> Hello Gurus,
>> The MiniportFilterResourceRequirements states the following:
>> “NDIS can call MiniportFilterResourceRequirements several times before
>> NDIS calls the MiniportRemoveDevice function. But NDIS calls
>> MiniportFilterResourceRequirements only when a device is in the halted
>> state.”
>>
>> But when I run the PNPD tests, I see MiniportFilterResourceRequirements
>> getting called while in other states as well. Am I missing anything?
>>
>> Appreciate any insight.
>>
>> Thanks,
>> Chakri
>>
>>
>>
>> —
>> 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
>>
>>
>