Device Capabilities - remote wake up, waitwake

Hi All,

I have question regarding remote wake up (waitwake) functionality. In WDM documentation there is information:

“SystemWake
Specifies the least-powered system power state from which the device can signal a wake event.”
More, we should not change this value, only this change is allow for higher-powered state.

So, now I am little bit confused:
I have USB (HID) mouse that use generic mouse driver and this mouse can wake up system from PowerSleeping3 state.

As I can see in Device Tree tool all devices in stack starting from USB-hub have in DEVICE_CAPABILITIES in field SystemWake: PowerSleeping1.

So, is that a wrong behavior when we have in SystemWake value PowerSleeping1 and our driver wake up system from lower System power state (mouse generic driver)?

What should I use in case that I have in SystemWake PowerSleeping1 value?:

  1. In this case I can wakeup system only from PowerSleeping1

systemState = irpStack->Parameters.Power.State.SystemState;

if(systemState > pDevExt->SystemPower) // Decrese power
{
if (systemState <= pDevExt->DeviceCapabilities.SystemWake)
{
RegisterWaitWakeIrp();
}
else
{
CancelWaitWakeIrp();
}
}

  1. In this case I can wake up system from PowerSleeping3

if((systemState > devExt->SystemPowerState) && (devExt->WaitWakeEnable))
{
IssueWaitWake(devExt);
}

Which case should I choose (I want also pass HCT tests)?
Why USB-hub PDO have in device capabilities structure in SystemState field PowerSleeping1?

Best Regards
Janusz

The value of SystemWake in the DEVICE_CAPABILITIES takes into account
the capabilities of the entire stack, which results in the deepest sleep
state that is supported by ALL drivers in the stack. For USB, usually
the determining factor is the host controller itself. Sometimes the
system does not support wake from deep sleep states because it shuts off
power to the host controller completely. This situation is not all that
common on the latest machines with embedded host controllers. Most of
these systems can wake from at least S3.

Your 1st example is the better design, as it doesn’t make any
assumptions as to the capabilities of the system.

The real question I have for you is why do you need a driver at all if
you have a USB HID mouse? HIDUSB.SYS already handles this logic.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Janusz Dziedzic
Sent: Monday, February 27, 2006 3:46 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Device Capabilities - remote wake up, waitwake

Hi All,

I have question regarding remote wake up (waitwake) functionality. In
WDM documentation there is information:

“SystemWake
Specifies the least-powered system power state from which the device can
signal a wake event.”
More, we should not change this value, only this change is allow for
higher-powered state.

So, now I am little bit confused:
I have USB (HID) mouse that use generic mouse driver and this mouse can
wake up system from PowerSleeping3 state.

As I can see in Device Tree tool all devices in stack starting from
USB-hub have in DEVICE_CAPABILITIES in field SystemWake: PowerSleeping1.

So, is that a wrong behavior when we have in SystemWake value
PowerSleeping1 and our driver wake up system from lower System power
state (mouse generic driver)?

What should I use in case that I have in SystemWake PowerSleeping1
value?:

  1. In this case I can wakeup system only from PowerSleeping1

systemState = irpStack->Parameters.Power.State.SystemState;

if(systemState > pDevExt->SystemPower) // Decrese power
{
if (systemState <= pDevExt->DeviceCapabilities.SystemWake)
{
RegisterWaitWakeIrp();
}
else
{
CancelWaitWakeIrp();
}
}

  1. In this case I can wake up system from PowerSleeping3

if((systemState > devExt->SystemPowerState) && (devExt->WaitWakeEnable))

{
IssueWaitWake(devExt);
}

Which case should I choose (I want also pass HCT tests)?
Why USB-hub PDO have in device capabilities structure in SystemState
field PowerSleeping1?

Best Regards
Janusz


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer