It disables GUID_POWER_DEVICE_ENABLE because there’s a stanza of code in the implementation of NDIS.SYS that says:
if (Guid is GUID_POWER_DEVICE_ENABLE) {
if (Miniport has flag NO_HALT_ON_SUSPEND) {
NtStatus = STATUS_INVALID_DEVICE_REQUEST;
} else {
// Implement change of configuration.
}
}
Yeah, but why is NDIS implemented that way? Well, as is typical for NDIS, you have to peer back into history, somewhat…
The NDIS6.x flag NDIS_MINIPORT_ATTRIBUTES_NO_HALT_ON_SUSPEND basically continues the heritage of the NDIS5.x flag NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND. The NDIS5.x flag was added for miniports that can’t really do power management. (IM drivers and very old hardware miniports).
When NDIS gained power-management support, we had to do something with the existing universe of miniports that don’t support power management at all. The solution is to just halt the miniport when the system goes to sleep, then start the miniport again after the system resumes. This is klunky, but it is as good as you can get without changes in the miniport.
If you have a newer miniport driver (say NDIS 5.1) but old hardware that doesn’t support power management, then you can tell NDIS “You don’t have to halt me – I can cope with the fact that my hardware will lose its brains during this power transition. I promise to save off and restore its state for you (instead of having you restart me and replay all the OIDs for packet filters).” That’s why the flag was created.
Now we needed to know if the UI could show some power-management checkboxes for a given piece of hardware. We decided that if the miniport begs for “legacy” treatment, (i.e., it invokes the NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND flag), that’s a good indicator that the miniport can’t really handle power management. So that flag disables the checkboxes.
If you’re writing a modern miniport for modern hardware, there’s really no need for the flag (unless you’re a virtual miniport, i.e., an IM driver). Just support power management. Then your miniport won’t be halted AND you have all the benefits of proper PM support.
BTW, MSDN has some discussion on the flag here: http://msdn.microsoft.com/en-us/library/ff570196(VS.85).aspx . As you’re reading that, keep in mind that the article was mostly written during NDIS 5.1 times, so what it terms “old miniports” really means OLD miniports by today’s standards.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, November 03, 2010 6:18 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] enabling NDIS 6.20 Power management capabilities
Hi Jeffrey
One thing I am not able to understand is why setting NO_HALT_ON_SUSPEND will disable GUID_POWER_DEVICE_ENABLE.
Thanks
Arun
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