Solved

Driver development - power management

Posted on 2001-08-03
2
199 Views
Last Modified: 2013-12-03
I wrote driver for Win2K for radio card. It all works perfect... but I have no idea how to implement awareness of power-management features in W2k.
Let's say system goes to hibernate mode. Radio turns off because of system power loss. But when system comes up again (from hibernation), driver should turn it back on (to same state it was before hibernation).

My problem is that I don't know how to figure out (at kernel mode of course) that system is powering on from hibernate mode.
I searched through almost all DDK docs, but found nothing usefull for my case. Anyone with more serious experiences?

Regards,
    BozzoCage
0
Comment
Question by:BozzoCage
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 300 total points
ID: 6351872
0
 
LVL 2

Author Comment

by:BozzoCage
ID: 6352733
Thanks!
I was so deep in DDK Help that I though I read EVERYTHING.
Now my driver finally works as I wished :)

For others looking for same solution:
I found it on http://www.microsoft.com/hwdev/desinit/ONNOWwdm.HTM
----
Turning on a Device
When the policy owner decides to turn a device on (due to a received I/O request that requires the device to be on), the following actions occur:

The policy owner calls PoRequestPowerIrp to create an IRP_MJ_POWER/IRP_MN_SET_POWER IRP for the D0 state and send it to the FDO at the top of the device's IRP stack.
When the device driver receives the SET_POWER IRP, it merely fills in a completion routine, then forwards the IRP to its PDO using PoStartNextPowerIrp and PoCallDriver.
When the bus driver receives the SET_POWER IRP at the PDO, it exercises its standard hardware mechanisms to restore power to the device and then completes the IRP.
In its completion routine, the device driver restores all device context to return the device to D0.
The device driver calls PoSetPowerState to tell the operating system that the driver is now fully in the D0 power state.
Summary of key points:


The policy owner decides when to turn on the device and initiates that change by calling PoRequestPowerIrp to request a SET_POWER IRP.
The bus driver turns on the device using industry-standard mechanisms.
The device driver restores device context in the completion routine for the SET_POWER IRP.
---

Thanks,
  BozzoCage
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question