USB wakeup problem with OSR USB-FX2

Hi,

I have written a WDF device driver for the OSR USB-FX2 learning kit.

Eveything works fine, except that i have a question about power management.
The device is configured to go to sleep after 10 s idle time, and to resume
if the wake-up button on the kit is pressed. This works fine.

I have also configured the device power state in system sleep to only drop
to D2 instead of D3, and enabled wakeup.
However, when the system goes in standby, the USB device is completely
powered off, and as a result, i cannot wake the system with the wake-up
pushbutton.

The debugging output shows that the device power state is dropped to D3,
even though I configured it not to do that.

Am i doing something wrong here? Is it even possible to wake the system out
of standby that way?
This is my power configuration code, which is called in the
EvtDevicePrepareHardware function.

NTSTATUS
InitPowerManagement(IN WDFDEVICE Device,
IN PDEVICE_CONTEXT Context)
{
NTSTATUS status = STATUS_SUCCESS;
WDF_USB_DEVICE_INFORMATION usbInfo;

KdPrint((__DRIVER_NAME “Device init power management\n”));

status = WdfUsbTargetDeviceRetrieveInformation(
Context->UsbDevice,
&usbInfo);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfUsbTargetDeviceRetrieveInformation failed with status 0x%08x\n”,
status));
return status;
}

KdPrint((__DRIVER_NAME “Device self powered: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_SELF_POWERED ? 1 : 0));
KdPrint((__DRIVER_NAME “Device remote wake capable: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE ? 1 : 0));
KdPrint((__DRIVER_NAME “Device high speed: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_AT_HIGH_SPEED ? 1 : 0));

if(usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE)
{
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings;
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;

WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings,
IdleUsbSelectiveSuspend);
idleSettings.IdleTimeout = 10000;
status = WdfDeviceAssignS0IdleSettings(Device, &idleSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignS0IdleSettings failed with status 0x%08x\n”,
status));
return status;
}

WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
wakeSettings.DxState = PowerDeviceD2;
wakeSettings.Enabled = WdfTrue;
status = WdfDeviceAssignSxWakeSettings(Device, &wakeSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignSxWakeSettings failed with status 0x%08x\n”,
status));
return status;
}
}
return status;
}

kind regards,
Bruno.

Looks ok to me. I have functional code for the vendor’s FX2 dev kit device
(not the OSR device) that enables the power management property sheet and
supports wait wake that looks pretty much the same as yours:

WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings;
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings,
IdleUsbSelectiveSuspend);
idleSettings.UserControlOfIdleSettings = IdleDoNotAllowUserControl;
Status = WdfDeviceAssignS0IdleSettings(Device, &idleSettings);
if (!NT_SUCCESS(Status)) {
UsbShellDbgPrint(TRACE_LEVEL_ERROR, DBG_POWER,
“WdfDeviceAssignS0IdleSettings failed %x\n”,
Status);
break;
}

WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
wakeSettings.UserControlOfWakeSettings = WakeAllowUserControl;
Status = WdfDeviceAssignSxWakeSettings(Device, &wakeSettings);
if (!NT_SUCCESS(Status)) {
UsbShellDbgPrint(TRACE_LEVEL_ERROR, DBG_POWER,
“WdfDeviceAssignSxWakeSettings failed %x\n”,
Status);
break;
}

This code works, last time I tested it.

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

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bruno
van Dooren
Sent: Friday, January 13, 2006 9:06 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] USB wakeup problem with OSR USB-FX2

Hi,

I have written a WDF device driver for the OSR USB-FX2 learning kit.

Eveything works fine, except that i have a question about
power management.
The device is configured to go to sleep after 10 s idle time,
and to resume if the wake-up button on the kit is pressed.
This works fine.

I have also configured the device power state in system sleep
to only drop to D2 instead of D3, and enabled wakeup.
However, when the system goes in standby, the USB device is
completely powered off, and as a result, i cannot wake the
system with the wake-up pushbutton.

The debugging output shows that the device power state is
dropped to D3, even though I configured it not to do that.

Am i doing something wrong here? Is it even possible to wake
the system out of standby that way?
This is my power configuration code, which is called in the
EvtDevicePrepareHardware function.

NTSTATUS
InitPowerManagement(IN WDFDEVICE Device,
IN PDEVICE_CONTEXT Context) {
NTSTATUS status = STATUS_SUCCESS;
WDF_USB_DEVICE_INFORMATION usbInfo;

KdPrint((__DRIVER_NAME “Device init power management\n”));

status = WdfUsbTargetDeviceRetrieveInformation(
Context->UsbDevice,
&usbInfo);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfUsbTargetDeviceRetrieveInformation failed with
status 0x%08x\n”,
status));
return status;
}

KdPrint((__DRIVER_NAME “Device self powered: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_SELF_POWERED ? 1 : 0));
KdPrint((__DRIVER_NAME “Device remote wake capable: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE
? 1 : 0));
KdPrint((__DRIVER_NAME “Device high speed: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_AT_HIGH_SPEED ? 1 : 0));

if(usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE)
{
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings;
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;

WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings,

IdleUsbSelectiveSuspend);
idleSettings.IdleTimeout = 10000;
status = WdfDeviceAssignS0IdleSettings(Device, &idleSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignS0IdleSettings failed with status 0x%08x\n”,
status));
return status;
}

WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
wakeSettings.DxState = PowerDeviceD2;
wakeSettings.Enabled = WdfTrue;
status = WdfDeviceAssignSxWakeSettings(Device, &wakeSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignSxWakeSettings failed with status 0x%08x\n”,
status));
return status;
}
}
return status;
}

kind regards,
Bruno.


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

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

It could be that the machine is going into an Sx state where the usb
host controller cannot wake it.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
Sent: Friday, January 13, 2006 6:06 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] USB wakeup problem with OSR USB-FX2

Hi,

I have written a WDF device driver for the OSR USB-FX2 learning kit.

Eveything works fine, except that i have a question about power
management.
The device is configured to go to sleep after 10 s idle time, and to
resume
if the wake-up button on the kit is pressed. This works fine.

I have also configured the device power state in system sleep to only
drop
to D2 instead of D3, and enabled wakeup.
However, when the system goes in standby, the USB device is completely
powered off, and as a result, i cannot wake the system with the wake-up
pushbutton.

The debugging output shows that the device power state is dropped to D3,
even though I configured it not to do that.

Am i doing something wrong here? Is it even possible to wake the system
out
of standby that way?
This is my power configuration code, which is called in the
EvtDevicePrepareHardware function.

NTSTATUS
InitPowerManagement(IN WDFDEVICE Device,
IN PDEVICE_CONTEXT Context)
{
NTSTATUS status = STATUS_SUCCESS;
WDF_USB_DEVICE_INFORMATION usbInfo;

KdPrint((__DRIVER_NAME “Device init power management\n”));

status = WdfUsbTargetDeviceRetrieveInformation(
Context->UsbDevice,
&usbInfo);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfUsbTargetDeviceRetrieveInformation failed with status
0x%08x\n”,
status));
return status;
}

KdPrint((__DRIVER_NAME “Device self powered: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_SELF_POWERED ? 1 : 0));
KdPrint((__DRIVER_NAME “Device remote wake capable: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE ? 1 : 0));
KdPrint((__DRIVER_NAME “Device high speed: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_AT_HIGH_SPEED ? 1 : 0));

if(usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE)
{
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings;
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;

WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings,
IdleUsbSelectiveSuspend);
idleSettings.IdleTimeout = 10000;
status = WdfDeviceAssignS0IdleSettings(Device, &idleSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignS0IdleSettings failed with status 0x%08x\n”,
status));
return status;
}

WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
wakeSettings.DxState = PowerDeviceD2;
wakeSettings.Enabled = WdfTrue;
status = WdfDeviceAssignSxWakeSettings(Device, &wakeSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignSxWakeSettings failed with status 0x%08x\n”,
status));
return status;
}
}
return status;
}

kind regards,
Bruno.


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

is there anything i can do to influence that?
i assume that in that case the host controller should be told to never power
down completely.
can that be done?

I would think that if my device never wants to power down completely, the
host controller would have to follow suit, because my driver is power policy
owner?

kind regards,
Bruno.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
It could be that the machine is going into an Sx state where the usb
host controller cannot wake it.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
Sent: Friday, January 13, 2006 6:06 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] USB wakeup problem with OSR USB-FX2

Hi,

I have written a WDF device driver for the OSR USB-FX2 learning kit.

Eveything works fine, except that i have a question about power
management.
The device is configured to go to sleep after 10 s idle time, and to
resume
if the wake-up button on the kit is pressed. This works fine.

I have also configured the device power state in system sleep to only
drop
to D2 instead of D3, and enabled wakeup.
However, when the system goes in standby, the USB device is completely
powered off, and as a result, i cannot wake the system with the wake-up
pushbutton.

The debugging output shows that the device power state is dropped to D3,
even though I configured it not to do that.

Am i doing something wrong here? Is it even possible to wake the system
out
of standby that way?
This is my power configuration code, which is called in the
EvtDevicePrepareHardware function.

NTSTATUS
InitPowerManagement(IN WDFDEVICE Device,
IN PDEVICE_CONTEXT Context)
{
NTSTATUS status = STATUS_SUCCESS;
WDF_USB_DEVICE_INFORMATION usbInfo;

KdPrint((__DRIVER_NAME “Device init power management\n”));

status = WdfUsbTargetDeviceRetrieveInformation(
Context->UsbDevice,
&usbInfo);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfUsbTargetDeviceRetrieveInformation failed with status
0x%08x\n”,
status));
return status;
}

KdPrint((__DRIVER_NAME “Device self powered: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_SELF_POWERED ? 1 : 0));
KdPrint((__DRIVER_NAME “Device remote wake capable: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE ? 1 : 0));
KdPrint((__DRIVER_NAME “Device high speed: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_AT_HIGH_SPEED ? 1 : 0));

if(usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE)
{
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings;
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;

WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings,
IdleUsbSelectiveSuspend);
idleSettings.IdleTimeout = 10000;
status = WdfDeviceAssignS0IdleSettings(Device, &idleSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignS0IdleSettings failed with status 0x%08x\n”,
status));
return status;
}

WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
wakeSettings.DxState = PowerDeviceD2;
wakeSettings.Enabled = WdfTrue;
status = WdfDeviceAssignSxWakeSettings(Device, &wakeSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignSxWakeSettings failed with status 0x%08x\n”,
status));
return status;
}
}
return status;
}

kind regards,
Bruno.


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Wake settings are the desired settings for the device, not an absolute.
You are the power policy owner for the device, not for the parent stack.
If the HC can’t wake you up, the HC will power down, you will just go
into D3. technically you can fail the query Sx power irp, but imagine
this scenario

  1. the machine can go into S1 or S3
  2. a device can wake from S1, not S3
  3. another device can wake from S3, not S1

Now if the drivers failed the query Sx state for the Sx state that they
could not wake the machine, the user would not be able to go into a
lower power state at all b/c both S1 and S3 queries would fail. As such
in KMDF, a driver if it can wake from the current Sx state, will arm
itself for wake from Sx. If it can’t, so be it and it does into D3.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
Sent: Friday, January 13, 2006 11:07 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] USB wakeup problem with OSR USB-FX2

is there anything i can do to influence that?
i assume that in that case the host controller should be told to never
power
down completely.
can that be done?

I would think that if my device never wants to power down completely,
the
host controller would have to follow suit, because my driver is power
policy
owner?

kind regards,
Bruno.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
It could be that the machine is going into an Sx state where the usb
host controller cannot wake it.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
Sent: Friday, January 13, 2006 6:06 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] USB wakeup problem with OSR USB-FX2

Hi,

I have written a WDF device driver for the OSR USB-FX2 learning kit.

Eveything works fine, except that i have a question about power
management.
The device is configured to go to sleep after 10 s idle time, and to
resume
if the wake-up button on the kit is pressed. This works fine.

I have also configured the device power state in system sleep to only
drop
to D2 instead of D3, and enabled wakeup.
However, when the system goes in standby, the USB device is completely
powered off, and as a result, i cannot wake the system with the wake-up
pushbutton.

The debugging output shows that the device power state is dropped to D3,
even though I configured it not to do that.

Am i doing something wrong here? Is it even possible to wake the system
out
of standby that way?
This is my power configuration code, which is called in the
EvtDevicePrepareHardware function.

NTSTATUS
InitPowerManagement(IN WDFDEVICE Device,
IN PDEVICE_CONTEXT Context)
{
NTSTATUS status = STATUS_SUCCESS;
WDF_USB_DEVICE_INFORMATION usbInfo;

KdPrint((__DRIVER_NAME “Device init power management\n”));

status = WdfUsbTargetDeviceRetrieveInformation(
Context->UsbDevice,
&usbInfo);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfUsbTargetDeviceRetrieveInformation failed with status
0x%08x\n”,
status));
return status;
}

KdPrint((__DRIVER_NAME “Device self powered: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_SELF_POWERED ? 1 : 0));
KdPrint((__DRIVER_NAME “Device remote wake capable: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE ? 1 : 0));
KdPrint((__DRIVER_NAME “Device high speed: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_AT_HIGH_SPEED ? 1 : 0));

if(usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE)
{
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings;
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;

WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings,
IdleUsbSelectiveSuspend);
idleSettings.IdleTimeout = 10000;
status = WdfDeviceAssignS0IdleSettings(Device, &idleSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignS0IdleSettings failed with status 0x%08x\n”,
status));
return status;
}

WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
wakeSettings.DxState = PowerDeviceD2;
wakeSettings.Enabled = WdfTrue;
status = WdfDeviceAssignSxWakeSettings(Device, &wakeSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignSxWakeSettings failed with status 0x%08x\n”,
status));
return status;
}
}
return status;
}

kind regards,
Bruno.


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Do you consider it reasonable when “a device can wake from S3 but not S1”?

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Wake settings are the desired settings for the device, not an absolute.
You are the power policy owner for the device, not for the parent stack.
If the HC can’t wake you up, the HC will power down, you will just go
into D3. technically you can fail the query Sx power irp, but imagine
this scenario

1) the machine can go into S1 or S3
2) a device can wake from S1, not S3
3) another device can wake from S3, not S1

Now if the drivers failed the query Sx state for the Sx state that they
could not wake the machine, the user would not be able to go into a
lower power state at all b/c both S1 and S3 queries would fail. As such
in KMDF, a driver if it can wake from the current Sx state, will arm
itself for wake from Sx. If it can’t, so be it and it does into D3.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
Sent: Friday, January 13, 2006 11:07 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] USB wakeup problem with OSR USB-FX2

is there anything i can do to influence that?
i assume that in that case the host controller should be told to never
power
down completely.
can that be done?

I would think that if my device never wants to power down completely,
the
host controller would have to follow suit, because my driver is power
policy
owner?

kind regards,
Bruno.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
It could be that the machine is going into an Sx state where the usb
host controller cannot wake it.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
Sent: Friday, January 13, 2006 6:06 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] USB wakeup problem with OSR USB-FX2

Hi,

I have written a WDF device driver for the OSR USB-FX2 learning kit.

Eveything works fine, except that i have a question about power
management.
The device is configured to go to sleep after 10 s idle time, and to
resume
if the wake-up button on the kit is pressed. This works fine.

I have also configured the device power state in system sleep to only
drop
to D2 instead of D3, and enabled wakeup.
However, when the system goes in standby, the USB device is completely
powered off, and as a result, i cannot wake the system with the wake-up
pushbutton.

The debugging output shows that the device power state is dropped to D3,
even though I configured it not to do that.

Am i doing something wrong here? Is it even possible to wake the system
out
of standby that way?
This is my power configuration code, which is called in the
EvtDevicePrepareHardware function.

NTSTATUS
InitPowerManagement(IN WDFDEVICE Device,
IN PDEVICE_CONTEXT Context)
{
NTSTATUS status = STATUS_SUCCESS;
WDF_USB_DEVICE_INFORMATION usbInfo;

KdPrint((__DRIVER_NAME “Device init power management\n”));

status = WdfUsbTargetDeviceRetrieveInformation(
Context->UsbDevice,
&usbInfo);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfUsbTargetDeviceRetrieveInformation failed with status
0x%08x\n”,
status));
return status;
}

KdPrint((__DRIVER_NAME “Device self powered: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_SELF_POWERED ? 1 : 0));
KdPrint((__DRIVER_NAME “Device remote wake capable: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE ? 1 : 0));
KdPrint((__DRIVER_NAME “Device high speed: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_AT_HIGH_SPEED ? 1 : 0));

if(usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE)
{
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings;
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;

WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings,
IdleUsbSelectiveSuspend);
idleSettings.IdleTimeout = 10000;
status = WdfDeviceAssignS0IdleSettings(Device, &idleSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignS0IdleSettings failed with status 0x%08x\n”,
status));
return status;
}

WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
wakeSettings.DxState = PowerDeviceD2;
wakeSettings.Enabled = WdfTrue;
status = WdfDeviceAssignSxWakeSettings(Device, &wakeSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignSxWakeSettings failed with status 0x%08x\n”,
status));
return status;
}
}
return status;
}

kind regards,
Bruno.


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Reasonable or not, it has happened (I have debugged such scenarios) and
is possible to do in WDM. In hindsight, the query Sx irp was well
intentioned, but misplaced. The real place to deny the Sx transition is
in the application layer where it can interact with the user and tell
the user why the transition failed (vs. a popup which says “device ‘x’
has failed a query power and will not let you power down”)

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ivan Bublikov
Sent: Friday, January 13, 2006 11:52 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] USB wakeup problem with OSR USB-FX2

Do you consider it reasonable when “a device can wake from S3 but not
S1”?

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Wake settings are the desired settings for the device, not an absolute.
You are the power policy owner for the device, not for the parent stack.
If the HC can’t wake you up, the HC will power down, you will just go
into D3. technically you can fail the query Sx power irp, but imagine
this scenario

1) the machine can go into S1 or S3
2) a device can wake from S1, not S3
3) another device can wake from S3, not S1

Now if the drivers failed the query Sx state for the Sx state that they
could not wake the machine, the user would not be able to go into a
lower power state at all b/c both S1 and S3 queries would fail. As such
in KMDF, a driver if it can wake from the current Sx state, will arm
itself for wake from Sx. If it can’t, so be it and it does into D3.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
Sent: Friday, January 13, 2006 11:07 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] USB wakeup problem with OSR USB-FX2

is there anything i can do to influence that?
i assume that in that case the host controller should be told to never
power
down completely.
can that be done?

I would think that if my device never wants to power down completely,
the
host controller would have to follow suit, because my driver is power
policy
owner?

kind regards,
Bruno.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
It could be that the machine is going into an Sx state where the usb
host controller cannot wake it.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
Sent: Friday, January 13, 2006 6:06 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] USB wakeup problem with OSR USB-FX2

Hi,

I have written a WDF device driver for the OSR USB-FX2 learning kit.

Eveything works fine, except that i have a question about power
management.
The device is configured to go to sleep after 10 s idle time, and to
resume
if the wake-up button on the kit is pressed. This works fine.

I have also configured the device power state in system sleep to only
drop
to D2 instead of D3, and enabled wakeup.
However, when the system goes in standby, the USB device is completely
powered off, and as a result, i cannot wake the system with the wake-up
pushbutton.

The debugging output shows that the device power state is dropped to D3,
even though I configured it not to do that.

Am i doing something wrong here? Is it even possible to wake the system
out
of standby that way?
This is my power configuration code, which is called in the
EvtDevicePrepareHardware function.

NTSTATUS
InitPowerManagement(IN WDFDEVICE Device,
IN PDEVICE_CONTEXT Context)
{
NTSTATUS status = STATUS_SUCCESS;
WDF_USB_DEVICE_INFORMATION usbInfo;

KdPrint((__DRIVER_NAME “Device init power management\n”));

status = WdfUsbTargetDeviceRetrieveInformation(
Context->UsbDevice,
&usbInfo);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfUsbTargetDeviceRetrieveInformation failed with status
0x%08x\n”,
status));
return status;
}

KdPrint((__DRIVER_NAME “Device self powered: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_SELF_POWERED ? 1 : 0));
KdPrint((__DRIVER_NAME “Device remote wake capable: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE ? 1 : 0));
KdPrint((__DRIVER_NAME “Device high speed: %d”,
usbInfo.Traits & WDF_USB_DEVICE_TRAIT_AT_HIGH_SPEED ? 1 : 0));

if(usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE)
{
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings;
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;

WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings,
IdleUsbSelectiveSuspend);
idleSettings.IdleTimeout = 10000;
status = WdfDeviceAssignS0IdleSettings(Device, &idleSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignS0IdleSettings failed with status 0x%08x\n”,
status));
return status;
}

WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
wakeSettings.DxState = PowerDeviceD2;
wakeSettings.Enabled = WdfTrue;
status = WdfDeviceAssignSxWakeSettings(Device, &wakeSettings);
if(!NT_SUCCESS(status))
{
KdPrint((__DRIVER_NAME
“WdfDeviceAssignSxWakeSettings failed with status 0x%08x\n”,
status));
return status;
}
}
return status;
}

kind regards,
Bruno.


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Exactly. In addition, user should have a choice if it wants S1 or S3 if both states are available. It isn’t so hard to write an application which allows both but only using native API.

WDM driver should never deny Sx query IRP. It’d cause HCT failure, at least for USB drivers.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Friday, January 13, 2006 8:59 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

Reasonable or not, it has happened (I have debugged such scenarios) and
is possible to do in WDM. In hindsight, the query Sx irp was well
intentioned, but misplaced. The real place to deny the Sx transition is
in the application layer where it can interact with the user and tell
the user why the transition failed (vs. a popup which says “device ‘x’
has failed a query power and will not let you power down”)

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ivan Bublikov
Sent: Friday, January 13, 2006 11:52 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] USB wakeup problem with OSR USB-FX2

Do you consider it reasonable when “a device can wake from S3 but not
S1”?

“Doron Holan” wrote in message
> news:xxxxx@ntdev…
> Wake settings are the desired settings for the device, not an absolute.
> You are the power policy owner for the device, not for the parent stack.
> If the HC can’t wake you up, the HC will power down, you will just go
> into D3. technically you can fail the query Sx power irp, but imagine
> this scenario
>
> 1) the machine can go into S1 or S3
> 2) a device can wake from S1, not S3
> 3) another device can wake from S3, not S1
>
> Now if the drivers failed the query Sx state for the Sx state that they
> could not wake the machine, the user would not be able to go into a
> lower power state at all b/c both S1 and S3 queries would fail. As such
> in KMDF, a driver if it can wake from the current Sx state, will arm
> itself for wake from Sx. If it can’t, so be it and it does into D3.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
> Sent: Friday, January 13, 2006 11:07 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] USB wakeup problem with OSR USB-FX2
>
> is there anything i can do to influence that?
> i assume that in that case the host controller should be told to never
> power
> down completely.
> can that be done?
>
> I would think that if my device never wants to power down completely,
> the
> host controller would have to follow suit, because my driver is power
> policy
> owner?
>
> kind regards,
> Bruno.
>
>
> “Doron Holan” wrote in message
> news:xxxxx@ntdev…
> It could be that the machine is going into an Sx state where the usb
> host controller cannot wake it.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Bruno van Dooren
> Sent: Friday, January 13, 2006 6:06 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] USB wakeup problem with OSR USB-FX2
>
> Hi,
>
> I have written a WDF device driver for the OSR USB-FX2 learning kit.
>
> Eveything works fine, except that i have a question about power
> management.
> The device is configured to go to sleep after 10 s idle time, and to
> resume
> if the wake-up button on the kit is pressed. This works fine.>
>
> I have also configured the device power state in system sleep to only
> drop
> to D2 instead of D3, and enabled wakeup.
> However, when the system goes in standby, the USB device is completely
> powered off, and as a result, i cannot wake the system with the wake-up
> pushbutton.
>
> The debugging output shows that the device power state is dropped to D3,
> even though I configured it not to do that.
>
> Am i doing something wrong here? Is it even possible to wake the system
> out
> of standby that way?
> This is my power configuration code, which is called in the
> EvtDevicePrepareHardware function.
>
> NTSTATUS
> InitPowerManagement(IN WDFDEVICE Device,
> IN PDEVICE_CONTEXT Context)
> {
> NTSTATUS status = STATUS_SUCCESS;
> WDF_USB_DEVICE_INFORMATION usbInfo;
>
> KdPrint((__DRIVER_NAME “Device init power management\n”));
>
> status = WdfUsbTargetDeviceRetrieveInformation(
> Context->UsbDevice,
> &usbInfo);
> if(!NT_SUCCESS(status))
> {
> KdPrint((__DRIVER_NAME
> “WdfUsbTargetDeviceRetrieveInformation failed with status
> 0x%08x\n”,
> status));
> return status;
> }
>
> KdPrint((__DRIVER_NAME “Device self powered: %d”,
> usbInfo.Traits & WDF_USB_DEVICE_TRAIT_SELF_POWERED ? 1 : 0));
> KdPrint((__DRIVER_NAME “Device remote wake capable: %d”,
> usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE ? 1 : 0));
> KdPrint((__DRIVER_NAME “Device high speed: %d”,
> usbInfo.Traits & WDF_USB_DEVICE_TRAIT_AT_HIGH_SPEED ? 1 : 0));
>
> if(usbInfo.Traits & WDF_USB_DEVICE_TRAIT_REMOTE_WAKE_CAPABLE)
> {
> WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings;
> WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;
>
> WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings,
> IdleUsbSelectiveSuspend);
> idleSettings.IdleTimeout = 10000;
> status = WdfDeviceAssignS0IdleSettings(Device, &idleSettings);
> if(!NT_SUCCESS(status))
> {
> KdPrint((__DRIVER_NAME
> “WdfDeviceAssignS0IdleSettings failed with status 0x%08x\n”,
> status));
> return status;
> }
>
> WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
> wakeSettings.DxState = PowerDeviceD2;
> wakeSettings.Enabled = WdfTrue;
> status = WdfDeviceAssignSxWakeSettings(Device, &wakeSettings);
> if(!NT_SUCCESS(status))
> {
> KdPrint((__DRIVER_NAME
> “WdfDeviceAssignSxWakeSettings failed with status 0x%08x\n”,
> status));
> return status;
> }
> }
> return status;
> }
>
> kind regards,
> Bruno.
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

The usual way, if the need of awakening the machine from the USB device is
“burning”, then the S3 (and maybe even S2) states are vetoed by the driver, if
it (or the drivers in the stack below) cannot wake the machine from S3.

The logic is:

  • monitor the MN_QUERY_CAPABILITIES flying by, look at whether the devices
    below can wake the machine from S2 and S3
  • add your own limitations
  • then, when the system-query-MJ_POWER request is arrived for S state below
    yours, fail it. This will force Windows to choose “lesser deep” standby, where
    your device and all the devices below will be powered enough to be able to
    awaken the machine.

MOUCLASS sample in the DDK is fine as a sample, it contains the well-known
logic of USB mice - without the USB mouse, Standby is S3 and the laptop power
LED is blinking, with the USB mouse attached, Standby is S2 and the power LED
is on.

This is because MOUCLASS vetoes S3 if wake is enabled from the mouse and
the downlevel stack cannot wake from S3 (and, for USB mouse, it cannot, since
the USB HC is dead on S3).

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

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Friday, January 13, 2006 8:52 PM
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

It could be that the machine is going into an Sx state where the usb
host controller cannot wake it.

>3) another device can wake from S3, not S1

Is it possible at all?

Am I wrong that if the device can wake from some state, then it also can wake
from all more-powered states?

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

>WDM driver should never deny Sx query IRP.

Am I wrong that MOUCLASS does this?

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

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
Reply To: Windows System Software Devs Interest List
Sent: Friday, January 13, 2006 10:32 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2

>WDM driver should never deny Sx query IRP.

Am I wrong that MOUCLASS does this?

No, you’re right. I forgot to add IMO to my posting.

What mouclass does is disputatious. If BIOS developers decide USB device including mouse shouldn’t be able to wake system from S3 and should be able to wake system from S1, driver should adhere this configuration and don’t change system suspend behaviour. Take it from user’s point of view. Normally, system is suspended to S3. When you attach mouse, system is suspended to S1. If you want S3, you have to disable remote wakeup for mouse driver. Isn’t is crazy?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

Mouclass has some special logic in this area

  1. it will deny a query Sx if it can’t wake from it, but it will always
    succeed a query Sx for the lightest possible Sx state on the machine
  2. it will automatically enable the mouse for wake if and only if the
    mouse can wake the machine from the deepest Sx state on the machine,
    otherwise the user has to manually enable the device for wake which will
    degrade the Sx state in which the machine will go into.

(kbdclass has the same logic as well)

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S.
Shatskih
Sent: Friday, January 13, 2006 1:32 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2

WDM driver should never deny Sx query IRP.

Am I wrong that MOUCLASS does this?

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


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

See my other reply. Your mouse will only be automatically enabled for
wake if it can do so from the deepest Sx state, otherwise it is a manual
setting that the user must enable through device manager.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Friday, January 13, 2006 3:05 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2


From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
Reply To: Windows System Software Devs Interest List
Sent: Friday, January 13, 2006 10:32 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2

>WDM driver should never deny Sx query IRP.

Am I wrong that MOUCLASS does this?

No, you’re right. I forgot to add IMO to my posting.

What mouclass does is disputatious. If BIOS developers decide USB device
including mouse shouldn’t be able to wake system from S3 and should be
able to wake system from S1, driver should adhere this configuration and
don’t change system suspend behaviour. Take it from user’s point of
view. Normally, system is suspended to S3. When you attach mouse, system
is suspended to S1. If you want S3, you have to disable remote wakeup
for mouse driver. Isn’t is crazy?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

I’m just trying to find it in mouclass sources :slight_smile: With no success, yet.

In other words my description was correct but the default state of remote wakeup setting in DM is disabled when mouse can’t wake system from deepest Sx state. Right? It makes more sense but still as an user without knowing internals I’d be confused if notice mouse remote wakeup setting change system suspend behaviour.

Anyway, it is correct default. In my experience, notebook manufacturers don’t care about remote wakeup but do care about power consumption during suspend even if it is matter of uA.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Saturday, January 14, 2006 12:17 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

See my other reply. Your mouse will only be automatically enabled for
wake if it can do so from the deepest Sx state, otherwise it is a manual
setting that the user must enable through device manager.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Friday, January 13, 2006 3:05 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

> ----------
> From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Friday, January 13, 2006 10:32 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2
>
> >WDM driver should never deny Sx query IRP.
>
> Am I wrong that MOUCLASS does this?
>
No, you’re right. I forgot to add IMO to my posting.

What mouclass does is disputatious. If BIOS developers decide USB device
including mouse shouldn’t be able to wake system from S3 and should be
able to wake system from S1, driver should adhere this configuration and
don’t change system suspend behaviour. Take it from user’s point of
view. Normally, system is suspended to S3. When you attach mouse, system
is suspended to S1. If you want S3, you have to disable remote wakeup
for mouse driver. Isn’t is crazy?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

>suspended to S3. When you attach mouse, system is suspended to S1. If you

want S3, you have to disable remote wakeup for mouse driver. Isn’t is crazy?

No, because USB HC and thus the mouse is 100% dead on S3 (on this particular
laptop).

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

>2) it will automatically enable the mouse for wake if and only if the

mouse can wake the machine from the deepest Sx state on the machine,
otherwise the user has to manually enable the device for wake which will
degrade the Sx state in which the machine will go into.

Was this so in XP Gold? or was it added later? I remember XP Gold behaved
otherwise if I plugged in the brand new USB mouse.

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

Some of this code might be split out of the DDK sample b/c it relies on
internal function calls not documented in the DDK.

Laptops in the win2k timeframe definitely had this behavior where they
could wake from usb from S1, but not from S3. Modern laptops appear to
have overcome this limitation and can do wakeup from S3.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Friday, January 13, 2006 3:39 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

I’m just trying to find it in mouclass sources :slight_smile: With no success, yet.

In other words my description was correct but the default state of
remote wakeup setting in DM is disabled when mouse can’t wake system
from deepest Sx state. Right? It makes more sense but still as an user
without knowing internals I’d be confused if notice mouse remote wakeup
setting change system suspend behaviour.

Anyway, it is correct default. In my experience, notebook manufacturers
don’t care about remote wakeup but do care about power consumption
during suspend even if it is matter of uA.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Saturday, January 14, 2006 12:17 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

See my other reply. Your mouse will only be automatically enabled for
wake if it can do so from the deepest Sx state, otherwise it is a
manual
setting that the user must enable through device manager.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Friday, January 13, 2006 3:05 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

> ----------
> From:

xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com

] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Friday, January 13, 2006 10:32 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2
>
> >WDM driver should never deny Sx query IRP.
>
> Am I wrong that MOUCLASS does this?
>
No, you’re right. I forgot to add IMO to my posting.

What mouclass does is disputatious. If BIOS developers decide USB
device
including mouse shouldn’t be able to wake system from S3 and should be
able to wake system from S1, driver should adhere this configuration
and
don’t change system suspend behaviour. Take it from user’s point of
view. Normally, system is suspended to S3. When you attach mouse,
system
is suspended to S1. If you want S3, you have to disable remote wakeup
for mouse driver. Isn’t is crazy?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


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

You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Sorry Doron, I don’t see it. In the sources from XP SP1 DDK (I have newer DDK but have BSC database for this one) following macro is used for decision:

#define WAITWAKE_SUPPORTED(port) ((port)->MinDeviceWakeState > PowerDeviceD0 && \
(port)->MinSystemWakeState > PowerSystemWorking)

I haven’t found anything regarding deepest Sx state. Could you tell me where to look?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Michal Vodicka[SMTP:xxxxx@upek.com]
Reply To: Windows System Software Devs Interest List
Sent: Saturday, January 14, 2006 12:39 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

I’m just trying to find it in mouclass sources :slight_smile: With no success, yet.

In other words my description was correct but the default state of remote wakeup setting in DM is disabled when mouse can’t wake system from deepest Sx state. Right? It makes more sense but still as an user without knowing internals I’d be confused if notice mouse remote wakeup setting change system suspend behaviour.

Anyway, it is correct default. In my experience, notebook manufacturers don’t care about remote wakeup but do care about power consumption during suspend even if it is matter of uA.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

> ----------
> From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Saturday, January 14, 2006 12:17 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2
>
> See my other reply. Your mouse will only be automatically enabled for
> wake if it can do so from the deepest Sx state, otherwise it is a manual
> setting that the user must enable through device manager.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
> Sent: Friday, January 13, 2006 3:05 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2
>
> > ----------
> > From:
> xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
> ] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
> > Reply To: Windows System Software Devs Interest List
> > Sent: Friday, January 13, 2006 10:32 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2
> >
> > >WDM driver should never deny Sx query IRP.
> >
> > Am I wrong that MOUCLASS does this?
> >
> No, you’re right. I forgot to add IMO to my posting.
>
> What mouclass does is disputatious. If BIOS developers decide USB device
> including mouse shouldn’t be able to wake system from S3 and should be
> able to wake system from S1, driver should adhere this configuration and
> don’t change system suspend behaviour. Take it from user’s point of
> view. Normally, system is suspended to S3. When you attach mouse, system
> is suspended to S1. If you want S3, you have to disable remote wakeup
> for mouse driver. Isn’t is crazy?
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com>
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

This functionality was added to XP gold IIRC (I added it), it was not
present in win2k. in win2k, the mouse was never enabled for wake by
default, it had to be explicitly enabled.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S.
Shatskih
Sent: Friday, January 13, 2006 3:54 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2

  1. it will automatically enable the mouse for wake if and only if the
    mouse can wake the machine from the deepest Sx state on the machine,
    otherwise the user has to manually enable the device for wake which
    will
    degrade the Sx state in which the machine will go into.

Was this so in XP Gold? or was it added later? I remember XP Gold
behaved
otherwise if I plugged in the brand new USB mouse.

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


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

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com