USB Selective suspend in KMDF with open file handle

Hi all,
I am trying to implement the selective suspend functionality in a KMDF driver (similar to usbser.sys).

Using osrusbfx2 sample as reference I implemented my code changes. With these changes I see that the selective suspend functionality is working fine when the device is not opened (no CreateFile). But selective suspend doesnt happen after device is opened. It starts working again after the last file close. Now my questios are:

  1. Is this the behavior that I should expect ? Seems logical but will wait for your confirmation.

  2. If yes for above question, is there way for me to implement selective suspend that it will happen regardless of whether the device is opened or not ?

Thanks,
Nate

Are you calling for WdfDeviceStopIdle in EvtFileCreate and WdfDeviceResumeIdle in EvtFileCleanup?

S.

No. I am not calling those functions in EvtFileCreate/EvtFileCleanup. Infact I dont even have EvtFileCrate implemented… its the default implementation in KMDF.

Thanks,
Nate

If you are writing a serial port, the best sample to start with is the kmdf serial port driver. From there you can bolt on usb underneath instead of hw io access. The serial driver behabes as you describe, when open it is always powered up, when closed it is always powered down

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@coolgoose.com
Sent: Tuesday, June 16, 2009 6:44 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] USB Selective suspend in KMDF with open file handle

No. I am not calling those functions in EvtFileCreate/EvtFileCleanup. Infact I dont even have EvtFileCrate implemented… its the default implementation in KMDF.

Thanks,
Nate


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 for the reply Doron. Is there a way for me to enable suspend even with the file handle open? Are there any sample that does that using KMDF.

Thanks,
Nate

Kmdf by itself does not tie power state to any open handles, your driver is doing this by configuring a long idle timeout, stoping idle in evtdevicecreatedile, or by having pwr ,managed queues and the app is constantly sending io and keeping the queues busy

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@coolgoose.com
Sent: Tuesday, June 16, 2009 8:02 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] USB Selective suspend in KMDF with open file handle

Thanks for the reply Doron. Is there a way for me to enable suspend even with the file handle open? Are there any sample that does that using KMDF.

Thanks,
Nate


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