Ndis Power management Query

Hi Devs,

How does Ndis handle hibernate requests & stand by reuests for NIC Miniport
drivers ? I know these request come as OID_PNP_QUERY_POWER and
OID_PNP_SET_POWER queries. But i’d like tio know in which cases the driver
will get unloded.
Assume the NIC Driver states it supports Lowest power state from which it
can wakeup as D3 in OID_PNP_CAPABILITIES, in this scenario will the NIC
Miniport driver be unloaded or not during Hibernation ? What is the
expected and correct behaviour ?

For Ndis Miniport Driver with WDM lower edge is there any hard & fast rule
about Power management support ?

Regards
AN


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

AN,

Your driver will only get unloaded if NDIS believes that you do not
support power management based on your response to OID_PNP_CAPIBILITIES.
In the scenario that you posed, you should not get unloaded. You will
get an OID_PNP_QUERY_POWER, to which you should always respond with
SUCCESS. No other processing is required at that stage.

You will then receive an OID_PNP_SET_POWER when the system actually
changes power states. Review the functions MPSetPower(), MPSetPowerD0()
and MPSetPowerLow() in mp_req.c of the \ src\network\ndis\e100bex
sample to see how to properly handle OID_PNP_SET_POWER.

If you believe that you are handling this correctly and you’re still
getting unloaded, run your driver on a system with a kernel debugger,
the checked build of NDIS and turn on full NDIS tracing. Set
DebugSystems to 0xffffffff and DebugLevel to 0x00000000. NDIS has
additional debug spew that it will emit if it believes that the system
is going into a lower powerstate than you can wake from (and, therefore,
will unload your driver). It will also emit the results from its call
the lower bus driver (PCI, etc) when it gets the bus’ power
capabilities. That will look like:

==>ndisQueryPowerCapabilities: Miniport C1496A70
ndisQueryPowerCapabilities: Miniport C1496A70, Bus PM capabilities
DeviceD1: 0
DeviceD2: 0
WakeFromD0: 0
WakeFromD1: 0
WakeFromD2: 0
WakeFromD3: 0

SystemState DeviceState
PowerSystemUnspecified D0
S0 D0
S1 D0
S2 D0
S3 D0
S4 D0
S5 D3
SystemWake: S5
DeviceWake: D3
<==ndisQueryPowerCapabilities: Miniport C1496A70, Status 0x0

If the lower bus reports that it cannot wake from a lower state, NDIS
won’t try to take you to the lower state and will unload you, too.

I hope this helps.

Bryan S. Burgin
xxxxx@microsoft.com

This posting is provided “AS IS” with no warranties, and confers no
rights
(c) 2002 Microsoft Corporation. All rights reserved.

-----Original Message-----
From: Anandhi [mailto:xxxxx@rediffmail.com]
Sent: Wednesday, January 09, 2002 2:24 AM
To: NT Developers Interest List
Subject: [ntdev] Ndis Power management Query

Hi Devs,

How does Ndis handle hibernate requests & stand by reuests for NIC
Miniport
drivers ? I know these request come as OID_PNP_QUERY_POWER and
OID_PNP_SET_POWER queries. But i’d like tio know in which cases the
driver
will get unloded.
Assume the NIC Driver states it supports Lowest power state from which
it
can wakeup as D3 in OID_PNP_CAPABILITIES, in this scenario will the NIC
Miniport driver be unloaded or not during Hibernation ? What is the
expected and correct behaviour ?

For Ndis Miniport Driver with WDM lower edge is there any hard & fast
rule
about Power management support ?

Regards
AN


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Bryan Burgin,

On 01/10/02, ““Bryan Burgin” ” wrote:
> AN,
>
> Your driver will only get unloaded if NDIS believes that you do not
> support power management based on your response to OID_PNP_CAPIBILITIES.
> In the scenario that you posed, you should not get unloaded.

AN> But my driver is getting unloaded in this scenario. I trying to trace
the AN> cause for this.
AN> I need some more clarification from you.
AN> FYI: My driver is a NDIS WDM lower edge driver.

You will
> get an OID_PNP_QUERY_POWER, to which you should always respond with
> SUCCESS. No other processing is required at that stage.
>
> You will then receive an OID_PNP_SET_POWER when the system actually
> changes power states.

AN> What surprises me is i am getting only OID_PNP_CAPABILITIES query.
Neither
AN> OID_PNP_QUERY_POWER or OID_PNP_SET_POWER is received by me
AN> When my driver initially loads I fill up the NDIS_PNP_CAPABILITIES
structure as below for OID_PNP_CAPABILITIES query
---------------------------------------
NDIS_PNP_CAPABILITIES PM_Capabilities;
PM_Capabilities.WakeUpCapabilities.MinMagicPacketWakeUp=NdisDeviceStateUnspecified;
PM_Capabilities.WakeUpCapabilities.MinPatternWakeUp=NdisDeviceStateUnspecified;
PM_Capabilities.WakeUpCapabilities.MinLinkChangeWakeUp=NdisDeviceStateD3 ;
---------------------------------------
AN> As U can see, i am reporting lowest device power state for my miniport
driver as D3.

AN> My doubts…
1) Why is Ndis not sending out OID_PNP_QUERY_POWER or OID_PNP_SET_POWER
queries both during hibernation & standby ?
2) In ndis.h file i saw the _NDIS_MINIPORT_BLOCK structure has
DEVICE_CAPABILITIES DeviceCaps.
How does ndis fill this structure in case of driver with WDM Lower edge ?
Will ndis pass RP_MN_QUERY_CAPABILITIES irp to my lower drivers ?
3) Ok in what ever means this DeviceCaps is filled, My driver is Reporting
lowest possible device power state (D3) as the state Then Ndis Should not
unload my driver at any cost. But why is it unloading it ?

Review the functions MPSetPower(), MPSetPowerD0()
> and MPSetPowerLow() in mp_req.c of the \ src\network\ndis\e100bex
> sample to see how to properly handle OID_PNP_SET_POWER.

AN> I don’t see any mp_req.c in my 2kDDK samples but there is one request.c
file. And my miniport driver handles Powermanagement in similar fasion as
given in e100bex sample.

>
> If you believe that you are handling this correctly and you’re still
> getting unloaded, run your driver on a system with a kernel debugger,
> the checked build of NDIS and turn on full NDIS tracing. Set
> DebugSystems to 0xffffffff and DebugLevel to 0x00000000. NDIS has
> additional debug spew that it will emit if it believes that the system
> is going into a lower powerstate than you can wake from (and, therefore,
> will unload your driver). It will also emit the results from its call
> the lower bus driver (PCI, etc) when it gets the bus’ power
> capabilities. That will look like:

AN> I am using sofice to debug my driver. Can U let me know how to set
AN> DebugSystems to 0xffffffff and DebugLevel to 0x00000000 when softice is
used
AN> Where do i get the checked build of NDIS ?

Thanx & Regards
Anandhi

>
> =3D=3D>ndisQueryPowerCapabilities: Miniport C1496A70
> ndisQueryPowerCapabilities: Miniport C1496A70, Bus PM capabilities
> DeviceD1: 0
> DeviceD2: 0
> WakeFromD0: 0
> WakeFromD1: 0
> WakeFromD2: 0
> WakeFromD3: 0
>
> SystemState DeviceState
> PowerSystemUnspecified D0
> S0 D0
> S1 D0
> S2 D0
> S3 D0
> S4 D0
> S5 D3
> SystemWake: S5
> DeviceWake: D3
> <=3D=3DndisQueryPowerCapabilities: Miniport C1496A70, Status 0x0
>
> If the lower bus reports that it cannot wake from a lower state, NDIS
> won’t try to take you to the lower state and will unload you, too.
>
> I hope this helps.
>
> Bryan S. Burgin
> xxxxx@microsoft.com
>
> This posting is provided “AS IS” with no warranties, and confers no
> rights=20
> (c) 2002 Microsoft Corporation. All rights reserved.
>
> -----Original Message-----
> From: Anandhi [mailto:xxxxx@rediffmail.com]=20
> Sent: Wednesday, January 09, 2002 2:24 AM
> To: NT Developers Interest List
> Subject: [ntdev] Ndis Power management Query
>
> Hi Devs,
>
> How does Ndis handle hibernate requests & stand by reuests for NIC
> Miniport=20
> drivers ? I know these request come as OID_PNP_QUERY_POWER and=20
> OID_PNP_SET_POWER queries. But i’d like tio know in which cases the
> driver=20
> will get unloded.
> Assume the NIC Driver states it supports Lowest power state from which
> it=20
> can wakeup as D3 in OID_PNP_CAPABILITIES, in this scenario will the NIC=20
> Miniport driver be unloaded or not during Hibernation ? What is the=20
> expected and correct behaviour ?
>
> For Ndis Miniport Driver with WDM lower edge is there any hard & fast
> rule=20
> about Power management support ?
>
> Regards
> AN
>
> —
> You are currently subscribed to ntdev as: xxxxx@microsoft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com