Problem with selective suspend in xp.

Hi guys,
I am implementing usb driver with selective suspend functionality. My problem is selective suspend in my driver works fine in windows 7 but its not working properly in xp.
I am using usblyzer for tracing IRPs. In case of xp i could see INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION after idle timeout, but D0exit is not getting called .

I am referring ddk docs for this. My code is as follows:
/* Init the idle policy structure. */
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT (&idleSettings,
IdleUsbSelectiveSuspend );
idleSettings.IdleTimeout = timeout * 1000; /* convert the timeout value to ms. */
idleSettings.DxState = PowerDeviceD2;

status = WdfDeviceAssignS0IdleSettings (Device, &idleSettings );

if (status == STATUS_POWER_STATE_INVALID)
{
ModemTrace(TRACE_LEVEL_ERROR,DBG_POWER,“%s:WdfDeviceAssignS0IdleSettings returned STATUS_POWER_STATE_INVALID, retrying\n”,FUNCTION);

idleSettings.IdleCaps = IdleCannotWakeFromS0;
idleSettings.DxState = PowerDeviceD2;
status = WdfDeviceAssignS0IdleSettings (Device, &idleSettings );

if (!NT_SUCCESS (status ))
{
ModemTrace(TRACE_LEVEL_ERROR,DBG_POWER,“WdfDeviceSetPowerPolicyS0IdlePolicy failed even with IdleCannotWakeFromS0: %x\n”,status);
return status;
}
}

Can any one tell me why this code does not work with xp.

Amit

Are there any other usb devices plugged into the same host controller as your modem?

d

-----Original Message-----
From: xxxxx@gmail.com
Sent: Monday, December 14, 2009 5:10 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Problem with selective suspend in xp.

Hi guys,
I am implementing usb driver with selective suspend functionality. My problem is selective suspend in my driver works fine in windows 7 but its not working properly in xp.
I am using usblyzer for tracing IRPs. In case of xp i could see INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION after idle timeout, but D0exit is not getting called .

I am referring ddk docs for this. My code is as follows:
/* Init the idle policy structure. /
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT (&idleSettings,
IdleUsbSelectiveSuspend );
idleSettings.IdleTimeout = timeout * 1000; /
convert the timeout value to ms. */
idleSettings.DxState = PowerDeviceD2;

status = WdfDeviceAssignS0IdleSettings (Device, &idleSettings );

if (status == STATUS_POWER_STATE_INVALID)
{
ModemTrace(TRACE_LEVEL_ERROR,DBG_POWER,“%s:WdfDeviceAssignS0IdleSettings returned STATUS_POWER_STATE_INVALID, retrying\n”, FUNCTION );

idleSettings.IdleCaps = IdleCannotWakeFromS0;
idleSettings.DxState = PowerDeviceD2;
status = WdfDeviceAssignS0IdleSettings (Device, &idleSettings );

if (!NT_SUCCESS (status ))
{
ModemTrace(TRACE_LEVEL_ERROR,DBG_POWER,“WdfDeviceSetPowerPolicyS0IdlePolicy failed even with IdleCannotWakeFromS0: %x\n”,status);
return status;
}
}

Can any one tell me why this code does not work with xp.

Amit


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

Hi Doron,

There is no other device plugged in except my modem device.
One more unexpected result i saw is i have 2 test devices. Configuration descriptor of one device says it supports remote wake up. And other device says it does not support. For a device which does not support remote wake up i could not see INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION after idle timeout but D0Exit was getting called for it after idle time out.

Amit.