Discussion:
WinUSB suspend
(too old to reply)
Dean
2009-08-05 02:03:01 UTC
Permalink
Hi there is a document describe how to Selective Suspend in a UMDF Function
Driver. Here is the link
http://www.microsoft.com/whdc/driver/wdf/USB_select-susp.mspx

My question is if I set idle time-out to 10 seconds, and then I plug in a
USB device, I don't open any client software to read or write to this USB
device for 20 seconds, will this USB device suspend?
Doron Holan [MSFT]
2009-08-05 23:21:24 UTC
Permalink
if the umdf driver enables selective suspend, yes

d
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dean
Hi there is a document describe how to Selective Suspend in a UMDF Function
Driver. Here is the link
http://www.microsoft.com/whdc/driver/wdf/USB_select-susp.mspx
My question is if I set idle time-out to 10 seconds, and then I plug in a
USB device, I don't open any client software to read or write to this USB
device for 20 seconds, will this USB device suspend?
Dean
2009-08-06 03:36:01 UTC
Permalink
Hi again, I make a test.

PC:
Windows Vista sp2
Intel Core2 Duo CPU E8300
4G RAM
32-bit Operating system

WinUSB:
WdfCoInstaller01007.dll
WinUSBCoInstaller.dll

WinUSB settings:
HKR,,"DeviceIdleEnabled",0x00010001,1
HKR,,"DeviceIdleIgnoreWakeEnable",0x00010001,1
HKR,,"UserSetDeviceIdleEnabled",0x00010001,1
HKR,,"DefaultIdleState",0x00010001,1
HKR,,"DefaultIdleTimeout",0x00010001,5000

USB firmware:
Catch USB interrupt, and print the interrupt source to RS232.
If value = 0x80, the interrupt source is Suspend signaling on the bus.

Test senario 1:
I plug in a USB device to my PC, later I disable the USB hub in device
manager. (This senario simulate PC is standby or sleep.)
Result:
RS232 print 0x80, and the current of the usb device is power down, change
from 25mA to 2.5mA. The selective suspend is working.

Test senario 2:
I plug in a USB device to my PC, I don't open any client software to read or
write to this USB device for more than 5 seconds (I set the idle timeout to 5
seconds:HKR,,"DefaultIdleTimeout",0x00010001,5000).
Result:
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.

Test senario 3:
I plug in a USB device to my PC, I open any client software write a message
frame to this USB device, and read an expected message frame from the usb
device. And then close my client software(close file handle). Do nothing for
more than 20 seconds.
Result:
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.


Conclusion:
Using WinUSB as my driver, I would like to make my USB device be able to
suspend while PC is running normally. But when the USB device is idle, WinUSB
does not generate suspend signal, so I couldn't execute suspend command(some
save power command) in my USB device firmware. I can only do it when PC is
standby. I think I miss something, I need help. Thank for any help.
Dean
2009-08-06 03:51:02 UTC
Permalink
By the way, the mcu of USB device is Silicon Laboratories C8051F321.
Don Miller[MS]
2009-08-07 00:07:05 UTC
Permalink
Hi Dean,

From your below info it looks like you have the correct settings assuming
that winusb.sys is the power policy owner for your USB device. To make sure
can you please do the below kernel debugger commands (I am assuming you are
using WinDbg):

1) Break into the debugger and set your symbols to point to MS symbol
server.

2) Do a !devnode 0 1 and find your USB device in the list. For example I
have a OSR USB-FX2 device plugged in on my test system:

!devnode 0 1
.
.
.

DevNode 0x89388e78 for PDO 0x89c35150
InstancePath is "USB\VID_0547&PID_1002\5&f86e282&0&4"
ServiceName is "WUDFRd"
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)

3) Using the above PDO do the below:

!devstack 0x89c35150
.
.
.
!DevObj !DrvObj !DevExt ObjectName
8930f9f8 \Driver\WUDFRd 8930fab0
8936c4b0 \Driver\WinUsb 98364f20
89c35150 \Driver\usbhub 89c35208 USBPDO-10
!DevNode 89388e78 :
DeviceInst is "USB\VID_0547&PID_1002\5&f86e282&0&4"
ServiceName is "WUDFRd"

4) Using the WinUSB !DevExt value, do the below:

dt 98364f20 winusb!_device_extension -r
.
.
.
+0x000 UsbDevice : 0x67c6d118 WDFUSBDEVICE__
+0x000 unused : ??
+0x004 UsbDeviceInformation : _WDF_USB_DEVICE_INFORMATION
+0x000 Size : 0x14
+0x004 UsbdVersionInformation : _USBD_VERSION_INFORMATION
+0x000 USBDI_Version : 0x600
+0x004 Supported_USB_Version : 0x200
+0x00c HcdPortCapabilities : 0
+0x010 Traits : 6
+0x018 PowerPolicyLock : 0
+0x01c DeviceDescriptor : 0x8930b328 _USB_DEVICE_DESCRIPTOR
+0x000 bLength : 0x12 ''
+0x001 bDescriptorType : 0x1 ''
+0x002 bcdUSB : 2
+0x004 bDeviceClass : 0 ''
+0x005 bDeviceSubClass : 0 ''
+0x006 bDeviceProtocol : 0 ''
+0x007 bMaxPacketSize0 : 0x40 '@'
+0x008 idVendor : 0x547
+0x00a idProduct : 0x1002
+0x00c bcdDevice : 0
+0x00e iManufacturer : 0x1 ''
+0x00f iProduct : 0x2 ''
+0x010 iSerialNumber : 0 ''
+0x011 bNumConfigurations : 0x1 ''
+0x020 ConfigurationDescriptor : 0x89cd28c8 _USB_CONFIGURATION_DESCRIPTOR
+0x000 bLength : 0x9 ''
+0x001 bDescriptorType : 0x2 ''
+0x002 wTotalLength : 0x27
+0x004 bNumInterfaces : 0x1 ''
+0x005 bConfigurationValue : 0x1 ''
+0x006 iConfiguration : 0x4 ''
+0x007 bmAttributes : 0xa0 ''
+0x008 MaxPower : 0x32 '2'
+0x024 ConfigurationHandle : (null)
+0x028 InterfaceMutex : _FAST_MUTEX
+0x000 Count : 1
+0x004 Owner : (null)
+0x008 Contention : 0
+0x00c Event : _KEVENT
+0x000 Header : _DISPATCHER_HEADER
+0x01c OldIrql : 0
+0x048 InterfaceCount : 0x1 ''
+0x04c Interfaces : 0x892880f0 _WINUSB_INTERFACE
+0x000 InterfaceNumber : 0 ''
+0x001 CurrentAltSetting : 0 ''
+0x004 WdfInterface : 0x67c6f060 WDFUSBINTERFACE__
+0x000 unused : ??
+0x008 PipeCount : 3
+0x00c Pipes : [32] 0x89c7b6c0 _PIPE
+0x000 PipeInformation : _WDF_USB_PIPE_INFORMATION
+0x014 PipePolicy : _WINUSB_PIPE_POLICY
+0x024 PipePolicyLock : 0
+0x028 IoQueue : (null)
+0x02c RemainderPacket : _PACKET
+0x038 CurrentRequest : (null)
+0x03c RequestCancelled : 0 ''
+0x040 CompleteOrder : 0
+0x044 CompleteStatus : 0
+0x048 ReadRequest : (null)
+0x04c MaxTransferSize : 0
+0x050 ErrorLock : 0
+0x054 HandlingError : 0
+0x058 ErrorQueue : _LIST_ENTRY [ 0x0 - 0x0 ]
+0x060 ErrorWorkItem : (null)
+0x064 WdfUsbPipe : (null)
+0x050 Opened : 0x1 ''
+0x054 InterfaceGuidCollection : 0x6d00d058 WDFCOLLECTION__
+0x000 unused : ??
+0x058 IsPowerPolicyOwner : 0x1 ''
+0x05c PowerPolicy : _WINUSB_POWER_POLICY
+0x000 EnableIdle : 0 ''
+0x004 SuspendDelay : 0
+0x008 DeviceIdleEnabled : 0 ''
+0x009 UserSetDeviceIdleEnabled : 0 ''
+0x00a DeviceIdleIgnoreWake : 0 ''
+0x00b DefaultDeviceIdleState : 0 ''
+0x00c SystemWakeEnabled : 0 ''
+0x010 IdleSettings : _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS
+0x000 Size : 0
+0x004 IdleCaps : 0 ( IdleCapsInvalid )
+0x008 DxState : 0 ( PowerDeviceUnspecified )
+0x00c IdleTimeout : 0
+0x010 UserControlOfIdleSettings : 0 ( IdleUserControlInvalid )
+0x014 Enabled : 0 ( WdfFalse )
+0x018 PowerUpIdleDeviceOnSystemWake : 0 ( WdfFalse )
+0x088 IdleConfigured : 0x1 ''
+0x08c DefaultPowerPolicy : _WINUSB_POWER_POLICY
+0x000 EnableIdle : 0 ''
+0x004 SuspendDelay : 0
+0x008 DeviceIdleEnabled : 0 ''
+0x009 UserSetDeviceIdleEnabled : 0 ''
+0x00a DeviceIdleIgnoreWake : 0 ''
+0x00b DefaultDeviceIdleState : 0 ''
+0x00c SystemWakeEnabled : 0 ''
+0x010 IdleSettings : _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS
+0x000 Size : 0
+0x004 IdleCaps : 0 ( IdleCapsInvalid )
+0x008 DxState : 0 ( PowerDeviceUnspecified )
+0x00c IdleTimeout : 0
+0x010 UserControlOfIdleSettings : 0 ( IdleUserControlInvalid )
+0x014 Enabled : 0 ( WdfFalse )
+0x018 PowerUpIdleDeviceOnSystemWake : 0 ( WdfFalse )
+0x0b8 DefaultPipePolicy : _WINUSB_PIPE_POLICY
+0x000 ShortPacketTerminate : 0 ''
+0x001 AutoClearStall : 0 ''
+0x004 PipeTransferTimeout : 0
+0x008 IgnoreShortPackets : 0 ''
+0x009 AllowPartialReads : 0x1 ''
+0x00a AutoFlush : 0 ''
+0x00b RawIo : 0 ''
+0x00c ResetOnResume : 0 ''
+0x0c8 DefaultAlternateSetting : 0 ''
+0x0cc RequestCount : 0xe
+0x0d0 ResetPortEnabled : 0
+0x0d4 CyclePortEnabled : 0
+0x0d8 DllVersion : 0x100
+0x0da Configured : 0x1 ''
+0x0dc AbortQueue : 0x67ca71f8 WDFQUEUE__
+0x000 unused : ??

5) Please reply back with the data respective to your USB device so I can
take a look at your USB device's power policy settings.

Thanks,

-Don[MS]
Hi again, I make a test.
Windows Vista sp2
Intel Core2 Duo CPU E8300
4G RAM
32-bit Operating system
WdfCoInstaller01007.dll
WinUSBCoInstaller.dll
HKR,,"DeviceIdleEnabled",0x00010001,1
HKR,,"DeviceIdleIgnoreWakeEnable",0x00010001,1
HKR,,"UserSetDeviceIdleEnabled",0x00010001,1
HKR,,"DefaultIdleState",0x00010001,1
HKR,,"DefaultIdleTimeout",0x00010001,5000
Catch USB interrupt, and print the interrupt source to RS232.
If value = 0x80, the interrupt source is Suspend signaling on the bus.
I plug in a USB device to my PC, later I disable the USB hub in device
manager. (This senario simulate PC is standby or sleep.)
RS232 print 0x80, and the current of the usb device is power down, change
from 25mA to 2.5mA. The selective suspend is working.
I plug in a USB device to my PC, I don't open any client software to read or
write to this USB device for more than 5 seconds (I set the idle timeout to 5
seconds:HKR,,"DefaultIdleTimeout",0x00010001,5000).
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.
I plug in a USB device to my PC, I open any client software write a message
frame to this USB device, and read an expected message frame from the usb
device. And then close my client software(close file handle). Do nothing for
more than 20 seconds.
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.
Using WinUSB as my driver, I would like to make my USB device be able to
suspend while PC is running normally. But when the USB device is idle, WinUSB
does not generate suspend signal, so I couldn't execute suspend command(some
save power command) in my USB device firmware. I can only do it when PC is
standby. I think I miss something, I need help. Thank for any help.
Dean
2009-08-11 01:38:01 UTC
Permalink
Thank you. I don't really understand how to do below steps

1) Break into the debugger and set your symbols to point to MS symbol
Post by Don Miller[MS]
server.
2) Do a !devnode 0 1 and find your USB device in the list. For example I
have a OSR USB-FX2 device plugged in on my test system:

I download the Debugging Tools for Windows latest Release version 6.11.1.404
- March 27, 2009 from
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx
After install, I launch WinDbg, I don't know how to "Break into the debugger
and set your symbols to point to MS symbol server."

I find a file "C:\Program Files\Debugging Tools for Windows
(x86)\symsrv.dll", its description is "symbol server", so I use WinDbg open
symsrv.dll, but I don't know how to continue to type "!devnote 0 1".
Post by Don Miller[MS]
Hi Dean,
From your below info it looks like you have the correct settings assuming
that winusb.sys is the power policy owner for your USB device. To make sure
can you please do the below kernel debugger commands (I am assuming you are
1) Break into the debugger and set your symbols to point to MS symbol
server.
2) Do a !devnode 0 1 and find your USB device in the list. For example I
!devnode 0 1
.
.
.
DevNode 0x89388e78 for PDO 0x89c35150
InstancePath is "USB\VID_0547&PID_1002\5&f86e282&0&4"
ServiceName is "WUDFRd"
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)
!devstack 0x89c35150
.
.
.
!DevObj !DrvObj !DevExt ObjectName
8930f9f8 \Driver\WUDFRd 8930fab0
8936c4b0 \Driver\WinUsb 98364f20
89c35150 \Driver\usbhub 89c35208 USBPDO-10
DeviceInst is "USB\VID_0547&PID_1002\5&f86e282&0&4"
ServiceName is "WUDFRd"
dt 98364f20 winusb!_device_extension -r
.
.
.
+0x000 UsbDevice : 0x67c6d118 WDFUSBDEVICE__
+0x000 unused : ??
+0x004 UsbDeviceInformation : _WDF_USB_DEVICE_INFORMATION
+0x000 Size : 0x14
+0x004 UsbdVersionInformation : _USBD_VERSION_INFORMATION
+0x000 USBDI_Version : 0x600
+0x004 Supported_USB_Version : 0x200
+0x00c HcdPortCapabilities : 0
+0x010 Traits : 6
+0x018 PowerPolicyLock : 0
+0x01c DeviceDescriptor : 0x8930b328 _USB_DEVICE_DESCRIPTOR
+0x000 bLength : 0x12 ''
+0x001 bDescriptorType : 0x1 ''
+0x002 bcdUSB : 2
+0x004 bDeviceClass : 0 ''
+0x005 bDeviceSubClass : 0 ''
+0x006 bDeviceProtocol : 0 ''
+0x008 idVendor : 0x547
+0x00a idProduct : 0x1002
+0x00c bcdDevice : 0
+0x00e iManufacturer : 0x1 ''
+0x00f iProduct : 0x2 ''
+0x010 iSerialNumber : 0 ''
+0x011 bNumConfigurations : 0x1 ''
+0x020 ConfigurationDescriptor : 0x89cd28c8 _USB_CONFIGURATION_DESCRIPTOR
+0x000 bLength : 0x9 ''
+0x001 bDescriptorType : 0x2 ''
+0x002 wTotalLength : 0x27
+0x004 bNumInterfaces : 0x1 ''
+0x005 bConfigurationValue : 0x1 ''
+0x006 iConfiguration : 0x4 ''
+0x007 bmAttributes : 0xa0 ''
+0x008 MaxPower : 0x32 '2'
+0x024 ConfigurationHandle : (null)
+0x028 InterfaceMutex : _FAST_MUTEX
+0x000 Count : 1
+0x004 Owner : (null)
+0x008 Contention : 0
+0x00c Event : _KEVENT
+0x000 Header : _DISPATCHER_HEADER
+0x01c OldIrql : 0
+0x048 InterfaceCount : 0x1 ''
+0x04c Interfaces : 0x892880f0 _WINUSB_INTERFACE
+0x000 InterfaceNumber : 0 ''
+0x001 CurrentAltSetting : 0 ''
+0x004 WdfInterface : 0x67c6f060 WDFUSBINTERFACE__
+0x000 unused : ??
+0x008 PipeCount : 3
+0x00c Pipes : [32] 0x89c7b6c0 _PIPE
+0x000 PipeInformation : _WDF_USB_PIPE_INFORMATION
+0x014 PipePolicy : _WINUSB_PIPE_POLICY
+0x024 PipePolicyLock : 0
+0x028 IoQueue : (null)
+0x02c RemainderPacket : _PACKET
+0x038 CurrentRequest : (null)
+0x03c RequestCancelled : 0 ''
+0x040 CompleteOrder : 0
+0x044 CompleteStatus : 0
+0x048 ReadRequest : (null)
+0x04c MaxTransferSize : 0
+0x050 ErrorLock : 0
+0x054 HandlingError : 0
+0x058 ErrorQueue : _LIST_ENTRY [ 0x0 - 0x0 ]
+0x060 ErrorWorkItem : (null)
+0x064 WdfUsbPipe : (null)
+0x050 Opened : 0x1 ''
+0x054 InterfaceGuidCollection : 0x6d00d058 WDFCOLLECTION__
+0x000 unused : ??
+0x058 IsPowerPolicyOwner : 0x1 ''
+0x05c PowerPolicy : _WINUSB_POWER_POLICY
+0x000 EnableIdle : 0 ''
+0x004 SuspendDelay : 0
+0x008 DeviceIdleEnabled : 0 ''
+0x009 UserSetDeviceIdleEnabled : 0 ''
+0x00a DeviceIdleIgnoreWake : 0 ''
+0x00b DefaultDeviceIdleState : 0 ''
+0x00c SystemWakeEnabled : 0 ''
+0x010 IdleSettings : _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS
+0x000 Size : 0
+0x004 IdleCaps : 0 ( IdleCapsInvalid )
+0x008 DxState : 0 ( PowerDeviceUnspecified )
+0x00c IdleTimeout : 0
+0x010 UserControlOfIdleSettings : 0 ( IdleUserControlInvalid )
+0x014 Enabled : 0 ( WdfFalse )
+0x018 PowerUpIdleDeviceOnSystemWake : 0 ( WdfFalse )
+0x088 IdleConfigured : 0x1 ''
+0x08c DefaultPowerPolicy : _WINUSB_POWER_POLICY
+0x000 EnableIdle : 0 ''
+0x004 SuspendDelay : 0
+0x008 DeviceIdleEnabled : 0 ''
+0x009 UserSetDeviceIdleEnabled : 0 ''
+0x00a DeviceIdleIgnoreWake : 0 ''
+0x00b DefaultDeviceIdleState : 0 ''
+0x00c SystemWakeEnabled : 0 ''
+0x010 IdleSettings : _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS
+0x000 Size : 0
+0x004 IdleCaps : 0 ( IdleCapsInvalid )
+0x008 DxState : 0 ( PowerDeviceUnspecified )
+0x00c IdleTimeout : 0
+0x010 UserControlOfIdleSettings : 0 ( IdleUserControlInvalid )
+0x014 Enabled : 0 ( WdfFalse )
+0x018 PowerUpIdleDeviceOnSystemWake : 0 ( WdfFalse )
+0x0b8 DefaultPipePolicy : _WINUSB_PIPE_POLICY
+0x000 ShortPacketTerminate : 0 ''
+0x001 AutoClearStall : 0 ''
+0x004 PipeTransferTimeout : 0
+0x008 IgnoreShortPackets : 0 ''
+0x009 AllowPartialReads : 0x1 ''
+0x00a AutoFlush : 0 ''
+0x00b RawIo : 0 ''
+0x00c ResetOnResume : 0 ''
+0x0c8 DefaultAlternateSetting : 0 ''
+0x0cc RequestCount : 0xe
+0x0d0 ResetPortEnabled : 0
+0x0d4 CyclePortEnabled : 0
+0x0d8 DllVersion : 0x100
+0x0da Configured : 0x1 ''
+0x0dc AbortQueue : 0x67ca71f8 WDFQUEUE__
+0x000 unused : ??
5) Please reply back with the data respective to your USB device so I can
take a look at your USB device's power policy settings.
Thanks,
-Don[MS]
Hi again, I make a test.
Windows Vista sp2
Intel Core2 Duo CPU E8300
4G RAM
32-bit Operating system
WdfCoInstaller01007.dll
WinUSBCoInstaller.dll
HKR,,"DeviceIdleEnabled",0x00010001,1
HKR,,"DeviceIdleIgnoreWakeEnable",0x00010001,1
HKR,,"UserSetDeviceIdleEnabled",0x00010001,1
HKR,,"DefaultIdleState",0x00010001,1
HKR,,"DefaultIdleTimeout",0x00010001,5000
Catch USB interrupt, and print the interrupt source to RS232.
If value = 0x80, the interrupt source is Suspend signaling on the bus.
I plug in a USB device to my PC, later I disable the USB hub in device
manager. (This senario simulate PC is standby or sleep.)
RS232 print 0x80, and the current of the usb device is power down, change
from 25mA to 2.5mA. The selective suspend is working.
I plug in a USB device to my PC, I don't open any client software to read or
write to this USB device for more than 5 seconds (I set the idle timeout to 5
seconds:HKR,,"DefaultIdleTimeout",0x00010001,5000).
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.
I plug in a USB device to my PC, I open any client software write a message
frame to this USB device, and read an expected message frame from the usb
device. And then close my client software(close file handle). Do nothing for
more than 20 seconds.
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.
Using WinUSB as my driver, I would like to make my USB device be able to
suspend while PC is running normally. But when the USB device is idle, WinUSB
does not generate suspend signal, so I couldn't execute suspend command(some
save power command) in my USB device firmware. I can only do it when PC is
standby. I think I miss something, I need help. Thank for any help.
Don Miller[MS]
2009-08-12 23:06:42 UTC
Permalink
Dean,

In order to best do kernel debugging you will need to have two systems
connected via a 1394 cable or a serial cable. The debugee system will be
the system you are debugging the issue on, ie, running WinUSB on. The
debugger system will typically be your dev box and is running the WinDbg
debugger client. The WinDbg help file has documentation on how to setup
this debug scenario. Once you have the debugger setup then you do a
Ctrl+Break to break into the WinDbg debugger client and perform the commands
that I have listed.

Thanks,

-Don[MS]
Post by Dean
Thank you. I don't really understand how to do below steps
1) Break into the debugger and set your symbols to point to MS symbol
Post by Don Miller[MS]
server.
2) Do a !devnode 0 1 and find your USB device in the list. For example I
I download the Debugging Tools for Windows latest Release version 6.11.1.404
- March 27, 2009 from
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx
After install, I launch WinDbg, I don't know how to "Break into the debugger
and set your symbols to point to MS symbol server."
I find a file "C:\Program Files\Debugging Tools for Windows
(x86)\symsrv.dll", its description is "symbol server", so I use WinDbg open
symsrv.dll, but I don't know how to continue to type "!devnote 0 1".
Post by Don Miller[MS]
Hi Dean,
From your below info it looks like you have the correct settings assuming
that winusb.sys is the power policy owner for your USB device. To make sure
can you please do the below kernel debugger commands (I am assuming you are
1) Break into the debugger and set your symbols to point to MS symbol
server.
2) Do a !devnode 0 1 and find your USB device in the list. For example I
!devnode 0 1
.
.
.
DevNode 0x89388e78 for PDO 0x89c35150
InstancePath is "USB\VID_0547&PID_1002\5&f86e282&0&4"
ServiceName is "WUDFRd"
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)
!devstack 0x89c35150
.
.
.
!DevObj !DrvObj !DevExt ObjectName
8930f9f8 \Driver\WUDFRd 8930fab0
8936c4b0 \Driver\WinUsb 98364f20
89c35150 \Driver\usbhub 89c35208 USBPDO-10
DeviceInst is "USB\VID_0547&PID_1002\5&f86e282&0&4"
ServiceName is "WUDFRd"
dt 98364f20 winusb!_device_extension -r
.
.
.
+0x000 UsbDevice : 0x67c6d118 WDFUSBDEVICE__
+0x000 unused : ??
+0x004 UsbDeviceInformation : _WDF_USB_DEVICE_INFORMATION
+0x000 Size : 0x14
+0x004 UsbdVersionInformation : _USBD_VERSION_INFORMATION
+0x000 USBDI_Version : 0x600
+0x004 Supported_USB_Version : 0x200
+0x00c HcdPortCapabilities : 0
+0x010 Traits : 6
+0x018 PowerPolicyLock : 0
+0x01c DeviceDescriptor : 0x8930b328 _USB_DEVICE_DESCRIPTOR
+0x000 bLength : 0x12 ''
+0x001 bDescriptorType : 0x1 ''
+0x002 bcdUSB : 2
+0x004 bDeviceClass : 0 ''
+0x005 bDeviceSubClass : 0 ''
+0x006 bDeviceProtocol : 0 ''
+0x008 idVendor : 0x547
+0x00a idProduct : 0x1002
+0x00c bcdDevice : 0
+0x00e iManufacturer : 0x1 ''
+0x00f iProduct : 0x2 ''
+0x010 iSerialNumber : 0 ''
+0x011 bNumConfigurations : 0x1 ''
+0x020 ConfigurationDescriptor : 0x89cd28c8
_USB_CONFIGURATION_DESCRIPTOR
+0x000 bLength : 0x9 ''
+0x001 bDescriptorType : 0x2 ''
+0x002 wTotalLength : 0x27
+0x004 bNumInterfaces : 0x1 ''
+0x005 bConfigurationValue : 0x1 ''
+0x006 iConfiguration : 0x4 ''
+0x007 bmAttributes : 0xa0 ''
+0x008 MaxPower : 0x32 '2'
+0x024 ConfigurationHandle : (null)
+0x028 InterfaceMutex : _FAST_MUTEX
+0x000 Count : 1
+0x004 Owner : (null)
+0x008 Contention : 0
+0x00c Event : _KEVENT
+0x000 Header : _DISPATCHER_HEADER
+0x01c OldIrql : 0
+0x048 InterfaceCount : 0x1 ''
+0x04c Interfaces : 0x892880f0 _WINUSB_INTERFACE
+0x000 InterfaceNumber : 0 ''
+0x001 CurrentAltSetting : 0 ''
+0x004 WdfInterface : 0x67c6f060 WDFUSBINTERFACE__
+0x000 unused : ??
+0x008 PipeCount : 3
+0x00c Pipes : [32] 0x89c7b6c0 _PIPE
+0x000 PipeInformation : _WDF_USB_PIPE_INFORMATION
+0x014 PipePolicy : _WINUSB_PIPE_POLICY
+0x024 PipePolicyLock : 0
+0x028 IoQueue : (null)
+0x02c RemainderPacket : _PACKET
+0x038 CurrentRequest : (null)
+0x03c RequestCancelled : 0 ''
+0x040 CompleteOrder : 0
+0x044 CompleteStatus : 0
+0x048 ReadRequest : (null)
+0x04c MaxTransferSize : 0
+0x050 ErrorLock : 0
+0x054 HandlingError : 0
+0x058 ErrorQueue : _LIST_ENTRY [ 0x0 - 0x0 ]
+0x060 ErrorWorkItem : (null)
+0x064 WdfUsbPipe : (null)
+0x050 Opened : 0x1 ''
+0x054 InterfaceGuidCollection : 0x6d00d058 WDFCOLLECTION__
+0x000 unused : ??
+0x058 IsPowerPolicyOwner : 0x1 ''
+0x05c PowerPolicy : _WINUSB_POWER_POLICY
+0x000 EnableIdle : 0 ''
+0x004 SuspendDelay : 0
+0x008 DeviceIdleEnabled : 0 ''
+0x009 UserSetDeviceIdleEnabled : 0 ''
+0x00a DeviceIdleIgnoreWake : 0 ''
+0x00b DefaultDeviceIdleState : 0 ''
+0x00c SystemWakeEnabled : 0 ''
+0x010 IdleSettings : _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS
+0x000 Size : 0
+0x004 IdleCaps : 0 ( IdleCapsInvalid )
+0x008 DxState : 0 ( PowerDeviceUnspecified )
+0x00c IdleTimeout : 0
+0x010 UserControlOfIdleSettings : 0 ( IdleUserControlInvalid )
+0x014 Enabled : 0 ( WdfFalse )
+0x018 PowerUpIdleDeviceOnSystemWake : 0 ( WdfFalse )
+0x088 IdleConfigured : 0x1 ''
+0x08c DefaultPowerPolicy : _WINUSB_POWER_POLICY
+0x000 EnableIdle : 0 ''
+0x004 SuspendDelay : 0
+0x008 DeviceIdleEnabled : 0 ''
+0x009 UserSetDeviceIdleEnabled : 0 ''
+0x00a DeviceIdleIgnoreWake : 0 ''
+0x00b DefaultDeviceIdleState : 0 ''
+0x00c SystemWakeEnabled : 0 ''
+0x010 IdleSettings : _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS
+0x000 Size : 0
+0x004 IdleCaps : 0 ( IdleCapsInvalid )
+0x008 DxState : 0 ( PowerDeviceUnspecified )
+0x00c IdleTimeout : 0
+0x010 UserControlOfIdleSettings : 0 ( IdleUserControlInvalid )
+0x014 Enabled : 0 ( WdfFalse )
+0x018 PowerUpIdleDeviceOnSystemWake : 0 ( WdfFalse )
+0x0b8 DefaultPipePolicy : _WINUSB_PIPE_POLICY
+0x000 ShortPacketTerminate : 0 ''
+0x001 AutoClearStall : 0 ''
+0x004 PipeTransferTimeout : 0
+0x008 IgnoreShortPackets : 0 ''
+0x009 AllowPartialReads : 0x1 ''
+0x00a AutoFlush : 0 ''
+0x00b RawIo : 0 ''
+0x00c ResetOnResume : 0 ''
+0x0c8 DefaultAlternateSetting : 0 ''
+0x0cc RequestCount : 0xe
+0x0d0 ResetPortEnabled : 0
+0x0d4 CyclePortEnabled : 0
+0x0d8 DllVersion : 0x100
+0x0da Configured : 0x1 ''
+0x0dc AbortQueue : 0x67ca71f8 WDFQUEUE__
+0x000 unused : ??
5) Please reply back with the data respective to your USB device so I can
take a look at your USB device's power policy settings.
Thanks,
-Don[MS]
Hi again, I make a test.
Windows Vista sp2
Intel Core2 Duo CPU E8300
4G RAM
32-bit Operating system
WdfCoInstaller01007.dll
WinUSBCoInstaller.dll
HKR,,"DeviceIdleEnabled",0x00010001,1
HKR,,"DeviceIdleIgnoreWakeEnable",0x00010001,1
HKR,,"UserSetDeviceIdleEnabled",0x00010001,1
HKR,,"DefaultIdleState",0x00010001,1
HKR,,"DefaultIdleTimeout",0x00010001,5000
Catch USB interrupt, and print the interrupt source to RS232.
If value = 0x80, the interrupt source is Suspend signaling on the bus.
I plug in a USB device to my PC, later I disable the USB hub in device
manager. (This senario simulate PC is standby or sleep.)
RS232 print 0x80, and the current of the usb device is power down, change
from 25mA to 2.5mA. The selective suspend is working.
I plug in a USB device to my PC, I don't open any client software to
read
or
write to this USB device for more than 5 seconds (I set the idle
timeout
to 5
seconds:HKR,,"DefaultIdleTimeout",0x00010001,5000).
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.
I plug in a USB device to my PC, I open any client software write a message
frame to this USB device, and read an expected message frame from the usb
device. And then close my client software(close file handle). Do
nothing
for
more than 20 seconds.
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.
Using WinUSB as my driver, I would like to make my USB device be able to
suspend while PC is running normally. But when the USB device is idle, WinUSB
does not generate suspend signal, so I couldn't execute suspend command(some
save power command) in my USB device firmware. I can only do it when PC is
standby. I think I miss something, I need help. Thank for any help.
Dean
2009-08-07 03:28:01 UTC
Permalink
Thank you, Don. I don't really understand how to do below steps
Post by Don Miller[MS]
1) Break into the debugger and set your symbols to point to MS symbol
server.
2) Do a !devnode 0 1 and find your USB device in the list. For example I
I download the Debugging Tools for Windows latest Release version 6.11.1.404
- March 27, 2009 from
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx
After install, I launch WinDbg, I don't know how to "Break into the debugger
and set your symbols to point to MS symbol server."

I find a file "C:\Program Files\Debugging Tools for Windows
(x86)\symsrv.dll", its description is "symbol server", so I use WinDbg open
symsrv.dll, but I don't know how to continue to type "!devnote 0 1".
Dean
2009-09-07 10:07:04 UTC
Permalink
I download WDDK 7600.16385.0, and resolve the problem. This is a bug if use
the old version WinUSB.
ymhuang
2009-10-12 05:36:25 UTC
Permalink
Dear Don,

I follow the method, and have set symbol path to Microsoft symbol
server, but no WinUSB symbol there.

Any suggestion?


Connected to Windows XP 2600 x86 compatible target at (Mon Oct 12
13:28:29.859 2009 (GMT+8)), ptr64 FALSE
Symbol search path is: SRV*C:\Symbols\Microsoft\Web*http://
msdl.microsoft.com/download/symbols

...

lkd> dt 8599a9f8 winusb!_device_extension -r
*************************************************************************
***
***
***
***
*** Your debugger is not using the correct symbols
***
***
***
*** In order for this command to work properly, your symbol path
***
*** must point to .pdb files that have full type information.
***
***
***
*** Certain .pdb files (such as the public OS symbols) do not
***
*** contain the required information. Contact the group that
***
*** provided you with these symbols if you need this command to
***
*** work.
***
***
***
*** Type referenced: winusb!_device_extension
***
***
***
*************************************************************************
Symbol winusb!_device_extension not found.

regards,
ymhuang
Abdul Qader
2011-01-05 07:16:53 UTC
Permalink
ymhuang,

I am facing the same problem as you are(were?).
Did you resolve the issue of winusb not suspending?

Thaks
Abdul
Post by Dean
Hi there is a document describe how to Selective Suspend in a UMDF Function
Driver. Here is the link
http://www.microsoft.com/whdc/driver/wdf/USB_select-susp.mspx
My question is if I set idle time-out to 10 seconds, and then I plug in a
USB device, I do not open any client software to read or write to this USB
device for 20 seconds, will this USB device suspend?
Post by Doron Holan [MSFT]
if the umdf driver enables selective suspend, yes
d
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Dean
Hi again, I make a test.
Windows Vista sp2
Intel Core2 Duo CPU E8300
4G RAM
32-bit Operating system
WdfCoInstaller01007.dll
WinUSBCoInstaller.dll
HKR,,"DeviceIdleEnabled",0x00010001,1
HKR,,"DeviceIdleIgnoreWakeEnable",0x00010001,1
HKR,,"UserSetDeviceIdleEnabled",0x00010001,1
HKR,,"DefaultIdleState",0x00010001,1
HKR,,"DefaultIdleTimeout",0x00010001,5000
Catch USB interrupt, and print the interrupt source to RS232.
If value = 0x80, the interrupt source is Suspend signaling on the bus.
I plug in a USB device to my PC, later I disable the USB hub in device
manager. (This senario simulate PC is standby or sleep.)
RS232 print 0x80, and the current of the usb device is power down, change
from 25mA to 2.5mA. The selective suspend is working.
I plug in a USB device to my PC, I do not open any client software to read or
write to this USB device for more than 5 seconds (I set the idle timeout to 5
seconds:HKR,,"DefaultIdleTimeout",0x00010001,5000).
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.
I plug in a USB device to my PC, I open any client software write a message
frame to this USB device, and read an expected message frame from the usb
device. And then close my client software(close file handle). Do nothing for
more than 20 seconds.
RS232 print nothing, and the current of the usb device is remain 25mA. The
selective suspend is not working.
Using WinUSB as my driver, I would like to make my USB device be able to
suspend while PC is running normally. But when the USB device is idle, WinUSB
does not generate suspend signal, so I could not execute suspend command(some
save power command) in my USB device firmware. I can only do it when PC is
standby. I think I miss something, I need help. Thank for any help.
Post by Dean
By the way, the mcu of USB device is Silicon Laboratories C8051F321.
Post by Don Miller[MS]
Hi Dean,
From your below info it looks like you have the correct settings assuming
that winusb.sys is the power policy owner for your USB device. To make sure
can you please do the below kernel debugger commands (I am assuming you are
1) Break into the debugger and set your symbols to point to MS symbol
server.
2) Do a !devnode 0 1 and find your USB device in the list. For example I
!devnode 0 1
.
.
.
DevNode 0x89388e78 for PDO 0x89c35150
InstancePath is "USB\VID_0547&PID_1002\5&f86e282&0&4"
ServiceName is "WUDFRd"
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)
!devstack 0x89c35150
.
.
.
!DevObj !DrvObj !DevExt ObjectName
8930f9f8 \Driver\WUDFRd 8930fab0
8936c4b0 \Driver\WinUsb 98364f20
DeviceInst is "USB\VID_0547&PID_1002\5&f86e282&0&4"
ServiceName is "WUDFRd"
dt 98364f20 winusb!_device_extension -r
.
.
.
+0x000 UsbDevice : 0x67c6d118 WDFUSBDEVICE__
+0x000 unused : ??
+0x004 UsbDeviceInformation : _WDF_USB_DEVICE_INFORMATION
+0x000 Size : 0x14
+0x004 UsbdVersionInformation : _USBD_VERSION_INFORMATION
+0x000 USBDI_Version : 0x600
+0x004 Supported_USB_Version : 0x200
+0x00c HcdPortCapabilities : 0
+0x010 Traits : 6
+0x018 PowerPolicyLock : 0
+0x01c DeviceDescriptor : 0x8930b328 _USB_DEVICE_DESCRIPTOR
+0x000 bLength : 0x12 ''
+0x001 bDescriptorType : 0x1 ''
+0x002 bcdUSB : 2
+0x004 bDeviceClass : 0 ''
+0x005 bDeviceSubClass : 0 ''
+0x006 bDeviceProtocol : 0 ''
+0x008 idVendor : 0x547
+0x00a idProduct : 0x1002
+0x00c bcdDevice : 0
+0x00e iManufacturer : 0x1 ''
+0x00f iProduct : 0x2 ''
+0x010 iSerialNumber : 0 ''
+0x011 bNumConfigurations : 0x1 ''
+0x020 ConfigurationDescriptor : 0x89cd28c8 _USB_CONFIGURATION_DESCRIPTOR
+0x000 bLength : 0x9 ''
+0x001 bDescriptorType : 0x2 ''
+0x002 wTotalLength : 0x27
+0x004 bNumInterfaces : 0x1 ''
+0x005 bConfigurationValue : 0x1 ''
+0x006 iConfiguration : 0x4 ''
+0x007 bmAttributes : 0xa0 ''
+0x008 MaxPower : 0x32 '2'
+0x024 ConfigurationHandle : (null)
+0x028 InterfaceMutex : _FAST_MUTEX
+0x000 Count : 1
+0x004 Owner : (null)
+0x008 Contention : 0
+0x00c Event : _KEVENT
+0x000 Header : _DISPATCHER_HEADER
+0x01c OldIrql : 0
+0x048 InterfaceCount : 0x1 ''
+0x04c Interfaces : 0x892880f0 _WINUSB_INTERFACE
+0x000 InterfaceNumber : 0 ''
+0x001 CurrentAltSetting : 0 ''
+0x004 WdfInterface : 0x67c6f060 WDFUSBINTERFACE__
+0x000 unused : ??
+0x008 PipeCount : 3
+0x00c Pipes : [32] 0x89c7b6c0 _PIPE
+0x000 PipeInformation : _WDF_USB_PIPE_INFORMATION
+0x014 PipePolicy : _WINUSB_PIPE_POLICY
+0x024 PipePolicyLock : 0
+0x028 IoQueue : (null)
+0x02c RemainderPacket : _PACKET
+0x038 CurrentRequest : (null)
Thank you, Don. I do not really understand how to do below steps
I download the Debugging Tools for Windows latest Release version 6.11.1.404
- March 27, 2009 from
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx
After install, I launch WinDbg, I do not know how to "Break into the debugger
and set your symbols to point to MS symbol server."
I find a file "C:\Program Files\Debugging Tools for Windows
(x86)\symsrv.dll", its description is "symbol server", so I use WinDbg open
symsrv.dll, but I do not know how to continue to type "!devnote 0 1".
Thank you. I do not really understand how to do below steps
1) Break into the debugger and set your symbols to point to MS symbol
2) Do a !devnode 0 1 and find your USB device in the list. For example I
I download the Debugging Tools for Windows latest Release version 6.11.1.404
- March 27, 2009 from
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx
After install, I launch WinDbg, I do not know how to "Break into the debugger
and set your symbols to point to MS symbol server."
I find a file "C:\Program Files\Debugging Tools for Windows
(x86)\symsrv.dll", its description is "symbol server", so I use WinDbg open
symsrv.dll, but I do not know how to continue to type "!devnote 0 1".
Post by Don Miller[MS]
Dean,
In order to best do kernel debugging you will need to have two systems
connected via a 1394 cable or a serial cable. The debugee system will be
the system you are debugging the issue on, ie, running WinUSB on. The
debugger system will typically be your dev box and is running the WinDbg
debugger client. The WinDbg help file has documentation on how to setup
this debug scenario. Once you have the debugger setup then you do a
Ctrl+Break to break into the WinDbg debugger client and perform the commands
that I have listed.
Thanks,
-Don[MS]
Post by Dean
I download WDDK 7600.16385.0, and resolve the problem. This is a bug if use
the old version WinUSB.
Post by ymhuang
Dear Don,
I follow the method, and have set symbol path to Microsoft symbol
server, but no WinUSB symbol there.
Any suggestion?
Connected to Windows XP 2600 x86 compatible target at (Mon Oct 12
13:28:29.859 2009 (GMT+8)), ptr64 FALSE
Symbol search path is: SRV*C:\Symbols\Microsoft\Web*http://
msdl.microsoft.com/download/symbols
...
lkd> dt 8599a9f8 winusb!_device_extension -r
*************************************************************************
***
***
***
***
*** Your debugger is not using the correct symbols
***
***
***
*** In order for this command to work properly, your symbol path
***
*** must point to .pdb files that have full type information.
***
***
***
*** Certain .pdb files (such as the public OS symbols) do not
***
*** contain the required information. Contact the group that
***
*** provided you with these symbols if you need this command to
***
*** work.
***
***
***
*** Type referenced: winusb!_device_extension
***
***
***
*************************************************************************
Symbol winusb!_device_extension not found.
regards,
ymhuang
Submitted via EggHeadCafe
Microsoft LINQ Query Samples For Beginners
http://www.eggheadcafe.com/training-topic-area/LINQ-Standard-Query-Operators/33/LINQ-Standard-Query-Operators.aspx
Loading...