EvtDeviceD0Exit
Does this
switch (TargetState) {
case WdfPowerDeviceD1:
case WdfPowerDeviceD2:
case WdfPowerDeviceD3:
break;
Plus some other empty case statements and TraceEvents
EvtDeviceD0Entry
Just has some traceevent statements.
-Harry
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Tuesday, November 11, 2014 1:28 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Devices attached to PCIe powered off/on
Ford, Harry L wrote:
I can’t really still read the register’s, value (it’s a countdown value) and it remains the same between expirations of the watchdog so, I know the device is no longer functioning.
If your device had dropped off of the bus, the address your driver has stored would no longer be valid. Usually, you’ll read back FFFFFFFF. If you’re reading data, then your PCIExpress IP is responding. In that case, whatever problem you have is strictly a problem on your device.
The only way to recover seems to either do a disable/enable from the device manager or use devcon. I’m hoping there’s a way to get the driver to go back through its DriverEntry point programmatically from the driver.
No, there isn’t, but you don’t need that. Disable and enable don’t do ANYTHING to the hardware. That’s just a software operation. What you need to do is do the same things you did in those callbacks. You don’t need to remap the space, but repeat whatever register initialization you did.
So, take the code from your EvtDeviceD0Entry and EvtDeviceD0Exit routines, and put them in separate functions called “PowerDown” and “PowerUp”. Now, in D0Entry you can call PowerUp, and whenever you detect that your watchdog has stopped counting, you can call PowerDown() then PowerUp().
–
Tim Roberts, xxxxx@probo.commailto:xxxxx
Providenza & Boekelheide, Inc.
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
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</mailto:xxxxx>