Enabling Selective Suspend in usbprint.sys through its INF file

Anyone know how to enable selective suspend for the usbprint.sys driver through its INF file?
I have found documentation for how to do this for the WinUsb.sys driver
(with the line HKR,“DeviceIdleEnabled”,0x00010001,1), but I cannot find anything for usbprint.sys (?).

usbprint enables selective suspend automatically from what I can tell during start device and when the device handle is closed

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@airosciences.com
Sent: Monday, September 20, 2010 3:10 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Enabling Selective Suspend in usbprint.sys through its INF file

Anyone know how to enable selective suspend for the usbprint.sys driver through its INF file?
I have found documentation for how to do this for the WinUsb.sys driver (with the line HKR,“DeviceIdleEnabled”,0x00010001,1), but I cannot find anything for usbprint.sys (?).


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 Doron, that is what I was looking for.

Chris

Hi Chris,

I’m interested in knowing if you were able to get this done.

I read in a FAQ that only a few USB drivers support selective suspend.
http://www.microsoft.com/whdc/connect/usb/usbfaq_intro.mspx#EDMAC

I was not able to get any documentation on how to control selective suspend for usbprint.sys.
By control I mean to be able to configure the idle time duration after which the device enters the D3 state.

Will an upper or lower filter be able to do this?
In case of a filter will there be problems with becoming the PPO in the stack?

From what i could tell from looking at the code, the timeout is not configurable. No, the filter cannot be the ppo.

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@hotmail.com
Sent: September 26, 2010 10:54 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Enabling Selective Suspend in usbprint.sys through its INF file

Hi Chris,

I’m interested in knowing if you were able to get this done.

I read in a FAQ that only a few USB drivers support selective suspend.
http://www.microsoft.com/whdc/connect/usb/usbfaq_intro.mspx#EDMAC

I was not able to get any documentation on how to control selective suspend for usbprint.sys.
By control I mean to be able to configure the idle time duration after which the device enters the D3 state.

Will an upper or lower filter be able to do this?
In case of a filter will there be problems with becoming the PPO in the stack?


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 Doron.

No, the filter cannot be the ppo.

Which means, I cannot use a filter to enable/disable/configure selective suspend for usbprint.sys?

You could use a lower filter to fail the selective suspend irp (ie disable), but not enable nor configure

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Sunday, September 26, 2010 11:25 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Enabling Selective Suspend in usbprint.sys through its INF file

Thanks Doron.

No, the filter cannot be the ppo.

Which means, I cannot use a filter to enable/disable/configure selective suspend for usbprint.sys?


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

Using usbprint.sys, I don’t see the USB port suspending for device startup or handle close.

Here is my setup:

  1. I have a host running Windows 7, with usbprint.sys installed by default and verified under Device Manager | Universal Serial Bus controllers | USB Printing support. My understanding is that Windows 7 enables power management by default, therefore I don’t need to do anything special in order to enable selective suspend on the USB hub.

  2. My device has the remote wakeup flag enabled, which I have verified using USBView under the line: “bmAttributes: 0xE0 (Bus Powered Self Powered Remote Wakeup)”.

  3. A CATC Advisor is attached between the host and device so I can view the usb I/O traffic.

And here is my test:
I start the device, let Windows 7 install usbprint.sys by default, and I choose not to install any other driver for my printer. Then I watch the I/O traffic over my CATC, expecting the port to suspend and the SOF’s to stop after a short period of time (I read it is 5 seconds by default), but the SOF’s never stop.

To be sure, I am also testing the device handle close scenario, but I get the same behavior: the SOF’s never stop.

Am I missing something here?

Thank you in advance.

xxxxx@airosciences.com wrote:

Using usbprint.sys, I don’t see the USB port suspending for device startup or handle close.

Here is my setup:

  1. I have a host running Windows 7, with usbprint.sys installed by default and verified under Device Manager | Universal Serial Bus controllers | USB Printing support. My understanding is that Windows 7 enables power management by default, therefore I don’t need to do anything special in order to enable selective suspend on the USB hub.

Well, I would point out the following rather discouraging quote from KB
article 974330:

On Windows XP and Windows Server 2003, the Microsoft USB Printer
class driver (Usbprint.sys) implements USB Selective Suspend
functionality. Usbprint sets the printer to Idle status if there
are no handles open to the USB printer port, which may cause the USB
printer to enter the USB Suspended state. When port-monitor calls
are made while the printer is suspended, the port monitor times out
the request sooner than the printer and intervening hubs can resume
from USB Suspended state, and returns Error 21 (ERROR_NOT_READY).

This problem does not occur on Windows Vista, Windows Server 2008,
and later versions of Windows, because the version of Usbprint.sys
included with these Windows versions does not implement USB
Selective Suspend functionality.

Now, this contradicts what Doron said earlier in this thread, and Doron
is usually right. The article doesn’t specifically mention Win 7 (other
than saying “later versions of Windows”).

  1. My device has the remote wakeup flag enabled, which I have verified using USBView under the line: “bmAttributes: 0xE0 (Bus Powered Self Powered Remote Wakeup)”.

OK, but that doesn’t have anything to do with remote wakeup. Does your
device really need to wake the system?

And here is my test:
I start the device, let Windows 7 install usbprint.sys by default, and I choose not to install any other driver for my printer. Then I watch the I/O traffic over my CATC, expecting the port to suspend and the SOF’s to stop after a short period of time (I read it is 5 seconds by default), but the SOF’s never stop.

Is there another device on this hub?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

What I said was based off of a 3 minute read of the source, I could have easily missed something that doesn’t allow SS to occur.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Thursday, October 07, 2010 11:38 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Enabling Selective Suspend in usbprint.sys through its INF file

xxxxx@airosciences.com wrote:

Using usbprint.sys, I don’t see the USB port suspending for device startup or handle close.

Here is my setup:

  1. I have a host running Windows 7, with usbprint.sys installed by default and verified under Device Manager | Universal Serial Bus controllers | USB Printing support. My understanding is that Windows 7 enables power management by default, therefore I don’t need to do anything special in order to enable selective suspend on the USB hub.

Well, I would point out the following rather discouraging quote from KB article 974330:

On Windows XP and Windows Server 2003, the Microsoft USB Printer
class driver (Usbprint.sys) implements USB Selective Suspend
functionality. Usbprint sets the printer to Idle status if there
are no handles open to the USB printer port, which may cause the USB
printer to enter the USB Suspended state. When port-monitor calls
are made while the printer is suspended, the port monitor times out
the request sooner than the printer and intervening hubs can resume
from USB Suspended state, and returns Error 21 (ERROR_NOT_READY).

This problem does not occur on Windows Vista, Windows Server 2008,
and later versions of Windows, because the version of Usbprint.sys
included with these Windows versions does not implement USB
Selective Suspend functionality.

Now, this contradicts what Doron said earlier in this thread, and Doron is usually right. The article doesn’t specifically mention Win 7 (other than saying “later versions of Windows”).

  1. My device has the remote wakeup flag enabled, which I have verified using USBView under the line: “bmAttributes: 0xE0 (Bus Powered Self Powered Remote Wakeup)”.

OK, but that doesn’t have anything to do with remote wakeup. Does your device really need to wake the system?

And here is my test:
I start the device, let Windows 7 install usbprint.sys by default, and I choose not to install any other driver for my printer. Then I watch the I/O traffic over my CATC, expecting the port to suspend and the SOF’s to stop after a short period of time (I read it is 5 seconds by default), but the SOF’s never stop.

Is there another device on this hub?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


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

Tim Roberts wrote:

xxxxx@airosciences.com wrote:

> 2. My device has the remote wakeup flag enabled, which I have verified using USBView under the line: “bmAttributes: 0xE0 (Bus Powered Self Powered Remote Wakeup)”.
OK, but that doesn’t have anything to do with remote wakeup. Does your
device really need to wake the system?

Whoops, make that “doesn’t have anything to do with selective suspend.”


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> -----Original Message-----

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Thursday, October 07, 2010 8:38 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Enabling Selective Suspend in
usbprint.sys through its INF file

> 2. My device has the remote wakeup flag enabled, which I
have verified using USBView under the line: “bmAttributes:
0xE0 (Bus Powered Self Powered Remote Wakeup)”.

OK, but that doesn’t have anything to do with remote wakeup.
Does your
device really need to wake the system?

This flag is necessary for both system wake and to wake the bus when it
is suspended. Without it the suspended device can’t tell the host it
decided to wake on its own. Anyway, this flag doesn’t (shouldn’t?)
influence the host decision to suspend a device. Only if
SET_FEATURE(RemoteWakeup) is sent just before suspend.

Best regards,

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

>Michael wrote:

This flag is necessary for both system wake and to wake the bus when it
is suspended. Without it the suspended device can’t tell the host it
decided to wake on its own. Anyway, this flag doesn’t (shouldn’t?)
influence the host decision to suspend a device. Only if
SET_FEATURE(RemoteWakeup) is sent just before suspend.

Michael,
Good point, SS and RW are separate behaviors from the standpoint of what I’m trying to do: initiating SS from the host. I added this piece of info for completeness, just in case there was something I was missing and the RW flag somehow influences the host invoking SS …but I’m not hearing that possibility.

Doron wrote:
What I said was based off of a 3 minute read of the source, I could have easily
missed something that doesn’t allow SS to occur.

Doron,
That quote from KB article 974330 which Tim points out (thanks Tim) is discouraging, but after reading your initial reply I was hoping the usbprint SS functionality would still be there even if it may not “supported” formally in Windows Vista and beyond. I’m not ready to give up on this just yet, but I would like to hear your thoughts…?

Thanks all for your help so far. Maybe I will reach the conclusion that cracking this nut is “wishful thinking” on my part, but it is proving to be a great exercise for me nevertheless! :slight_smile: