Hi,
We are writing a WDM driver for a serial device. We are the power
policy owners of the device. Our device supports D0 and D3 states only.
Our device doesn’t have any wake up capabilities.
We are facing a problem related to hibernation and standby
functionality.
Before completion of StartDevice IRP, we set the device power state
to D3.
After this, when we try to set the system to hibernation mode the system
stops responding and never recovers. It doesn’t hibernate either.
We found the following lines in the Programming the WDM model book by
Walter
Oney, in Windows 98 Compatibility Notes of the Power Management chapter.
<>
Requesting Device Power IRPs
Windows 98 appears to have a bug whereby PoRequestPowerIrp can
appear to succeed-that is, it returns STATUS_PENDING–without actually
causing you to
receive a device set-power IRP. The problem arises when you ask for a
set-power IRP that specifies the same device state that your device is
already in- the windows 98 Configuration manager "knows " that there’s
no news to report by sending a configuration event to the configuration
function that NTKERN operates on your behalf. Mind You, If you’re waiting
for a
device IRP to complete, your device will simply stop responding at tis
point.
<>
By the time we try to hibernate, our device will already be in D3.
So according to the behaviour explained in Compatibility notes, hibernation
will also fail as system will try to set the power to D3.
Is this statement correct ? Does that mean that we can’t
power down our device when nobody is using it as we do in Win 2k/XP, in
98/ME ?
With Regards
D.Nagarajan.
Its even worse than this. For non-PnP ISA devices, that would be any root
enumerated devices with no PnP ID, the root bus never powers up the device
to begin with on 98/Me. So, when you requested the device power state be
set to D3 in your Start handler, it might already have been in D3, and this
might be where you problems started.
Restating: According to the DDK docs the bus driver is responsible for
powering up devices on the bus to device power state D0 before your Start
handler gets called. For root enumerated non-PnP devices on 98/Me, this is
not done. As such, when you request a power down, the IRP is never sent.
Further, what you need to do is always track the device power state of your
device in your driver. Wherever you are going to request a device power IRP
always check that you are not attempting to power the device to a state for
which it is already set. So, when you get the system power IRP you won’t
always request the device power IRP. Only do this on 98/Me though.
–
Bill McKenzie
“Nagarajan Duraisamy - CTD, Chennai.” wrote in
message news:xxxxx@ntdev…
>
> Hi,
> We are writing a WDM driver for a serial device. We are the power
> policy owners of the device. Our device supports D0 and D3 states only.
> Our device doesn’t have any wake up capabilities.
>
> We are facing a problem related to hibernation and standby
> functionality.
>
> Before completion of StartDevice IRP, we set the device power state
> to D3.
>
> After this, when we try to set the system to hibernation mode the
system
>
> stops responding and never recovers. It doesn’t hibernate either.
>
> We found the following lines in the Programming the WDM model book by
> Walter
> Oney, in Windows 98 Compatibility Notes of the Power Management chapter.
>
> <>
> Requesting Device Power IRPs
>
> Windows 98 appears to have a bug whereby PoRequestPowerIrp can
> appear to succeed-that is, it returns STATUS_PENDING–without actually
> causing you to
> receive a device set-power IRP. The problem arises when you ask for a
> set-power IRP that specifies the same device state that your device is
> already in- the windows 98 Configuration manager "knows " that there’s
> no news to report by sending a configuration event to the configuration
> function that NTKERN operates on your behalf. Mind You, If you’re waiting
> for a
> device IRP to complete, your device will simply stop responding at tis
> point.
>
> <>
>
> By the time we try to hibernate, our device will already be in D3.
> So according to the behaviour explained in Compatibility notes,
hibernation
> will also fail as system will try to set the power to D3.
>
> Is this statement correct ? Does that mean that we can’t
> power down our device when nobody is using it as we do in Win 2k/XP, in
> 98/ME ?
>
> With Regards
> D.Nagarajan.
>
>
>