You never *ever* call PoRequestPowerIrp in a KMDF driver that is the power policy owner. Turn on KMDF verifier and you will hit stops very quickly with your current scheme. Look at the PDO callbacks you can register for, one of them is to tell you about wake. What you want to do is register yourself for S0Idle (can wake from S0, not USBSelectiveSuspend) with a very short idle timeout (1ms) and then immediately call WdfDeviceStopIdle(). When the hub below you calls your idle routine, call WdfDeviceResumeIdle and let KMDF power you down. KMDF will send the wake and Dx IRPs.
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, February 09, 2010 9:43 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Problem with USB composite bus driver.
Hi Doron ,
1 As of now i am exposing only modem to composite driver, no other functions. Once my composite is a bit stable with one function then i will expose other functions.
So in this case also is it mandatory for me to create a config descriptor per child i enumerate when receiving the select config from the child, convert that to a select interface.
2 As of now as only one child is there so it’s a bit easy as i do not have to wait for all children to go to suspend to put my bus driver in suspend state. So i could able to put both composite as well as modem in suspend. First Modem sends IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION request to my composite driver which i am pending first by putting it in my own manual queue.
Then from my composite i am manually sending IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION to usb hub by setting idle notification callback and completion routine for it.
Then idle callback of composite driver idle request is getting called by usb hub , in which i am calling idle callback of modem driver to put it in suspend state first.
After this i am calling PorequestpowerIrp with minor code IRP_MN_SET_POWER and power state PowerDeviceD2 in idle callback of composite driver to put it in suspend state.
In this way i could able to put both drivers in suspend state , but when i try to wake them up it is getting hung as i have not implemented wake up functionality.
So i was thinking of implementing it in same way as given in ddk docs by manually sending IRP_MN_WAIT_WAKE up lower driver and setting call back routine for it .
As you said we do not receive wait wake irps in a kmdf driver. So how will my composite driver get to know that upper driver (Modem driver has sent IRP_MN_WAIT_WAKE)
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