IIRC, you are in a stack with kbdclass as the class filter right? If so, you don’t need to convert system power irps to device power irps. Kbdclass is the power policy owner for the stack. The src for kbdclass is in the DDK. Kbdclass will send D irps and optionally wake irps for the stack.
Also, a chk version kdbclass will assert if send a query Dx state irp to the stack (it only expects query S irps since it is the power policy owner). Since kbdclass is only expecting query S irps, when you send a query D irp, it is misinterpreted and failed. From KeyboardClassPower:
case IRP_MN_QUERY_POWER:
ASSERT (SystemPowerState == powerType);
//
// Fail the query if we can’t wake the machine. We do, however, want to
// let hibernate succeed no matter what (besides, it is doubtful that a
// keyboard can wait wake the machine out of S4).
//
if (powerState.SystemState < PowerSystemHibernate &&
powerState.SystemState > data->MinSystemWakeState &&
WAITWAKE_ON(data)) {
status = STATUS_POWER_STATE_INVALID;
}
else {
status = STATUS_SUCCESS;
}
Irp->IoStatus.Status = status;
break;
Also, IIRC, this is a simulated device. As such, why are you reporting that you can wake the machine? Ie these power caps:
Kbdsim: WakeFromD0 TRUE
Kbdsim: WakeFromD1 TRUE
Kbdsim: WakeFromD2 TRUE
Kbdsim: PowerSystemSleeping1 = PowerDeviceD2
Kbdsim: SystemWake = PowerSystemSleeping1
Kbdsim: DeviceWake = PowerDeviceD2
These look eerily similar to toaster/busenum … Are are you simulating a keyboard off of a real piece of hardware (like a PCI card), in which case, these caps are filled in pci and this is not a concern.
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Calvin Guan
Sent: Wednesday, April 13, 2005 8:21 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] system standby & power IRPs
So you received a Sys-query for PowerSystemSleeping1 and requested a
Dev-query for D2 but one of the drivers in stack failed the D2-query. Did I
read you right?
When you handled the D-IRP, did you set Irp->IoStatus.Status to
STATUS_SUCCESS before passing it down? You can do a “ba” on the IoStatus to
see who is changing it.
Calvin Guan, Windows DDK MVP
Software Engineer,?NT Driver
ATI Technologies Inc. www.ati.com
?
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeff Lange
Sent: April 13, 2005 9:34 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] system standby & power IRPs
OK,
? Doron, I don’t seem to have any problem with not calling
PoStartNextPowerIrp, so I’ve added a little more debugging output and this
is what I’m seeing now.
HALACPI: The BIOS wants the OS to preserve 22000 bytes
Kbdsim: KbdsimPower Entered.
Kbdsim: Querying SystemPowerState state PowerSystemSleeping1
Kbdsim: Calling PoCallDriver with completion routine =
kbdsimFDOPowerComplete
Kbdsim: Entered kbdsimFDOPowerComplete for IRP_MN_QUERY_POWER
Kbdsim: Calling PoRequestPowerIrp for
??? IRP_MN_QUERY_POWER
??? powerState.DeviceState=PowerDeviceD2
??? powerState.SystemState=PowerSystemSleeping2
??? Completion Routine=kbdsimFDOPowerTransitionPoRequestComplete
Kbdsim: Entered kbdsimFDOPowerTransitionPoRequestComplete for
IRP_MN_QUERY_POWER
Kbdsim: IoStatus->Status = 0xc00002d3
Kbdsim: calling PoStartNextPowerIrp(SystemStateIrp)
Kbdsim: calling IoCompleteRequest(SystemStateIrp)
Kbdsim: kbdsimFDOPowerComplete returning STATUS_UNKNOWN_STATUS
Kbdsim: KbdsimPower Entered.
Kbdsim: Setting SystemPowerState state to PowerSystemWorking
Kbdsim: Calling PoCallDriver with completion routine =
kbdsimFDOPowerComplete
Kbdsim: Entered kbdsimFDOPowerComplete for IRP_MN_SET_POWER,
powerType=SystemPowerState
Kbdsim: Power Unchanged
Kbdsim: Calling PoRequestPowerIrp for
??? IRP_MN_SET_POWER
??? powerState.DeviceState=PowerDeviceD0
??? powerState.SystemState=PowerSystemWorking
??? Completion Routine=kbdsimFDOPowerTransitionPoRequestComplete
Kbdsim: KbdsimPower Entered.
Kbdsim: Setting DevicePowerState state to PowerDeviceD0
Kbdsim: Entered kbdsimFDOPowerTransitionPoRequestComplete for
IRP_MN_SET_POWER
Kbdsim: IoStatus->Status = 0x0
Kbdsim: calling PoStartNextPowerIrp(SystemStateIrp)
Kbdsim: calling IoCompleteRequest(SystemStateIrp)
Kbdsim: kbdsimFDOPowerComplete returning STATUS_MORE_PROCESSING_REQUIRED
Kbdsim: kbdsimFDOPowerComplete returning STATUS_UNKNOWN_STATUS
Abort: \Driver\Kbdclass \Device\KeyboardClass2 irp (8312ce90)
QueryPower-Sleeping1 status c00002d3
PopPolicyWorkerAction: action request 2 failed c00002d3
?
?
?
?
If I dump out my device capibilities this is what I see:
?
Received Device Capabilities Device Capabilities 825F49A8
Kbdsim: Size = 40
Kbdsim: Version = 1
Kbdsim: DeviceD1 TRUE
Kbdsim: DeviceD2 TRUE
Kbdsim: LockSupported FALSE
Kbdsim: EjectSupported FALSE
Kbdsim: Removable TRUE
Kbdsim: DockDevice FALSE
Kbdsim: UniqueID FALSE
Kbdsim: SilentInstall FALSE
Kbdsim: RawDeviceOK FALSE
Kbdsim: SurpriseRemovalOK FALSE
Kbdsim: WakeFromD0 TRUE
Kbdsim: WakeFromD1 TRUE
Kbdsim: WakeFromD2 TRUE
Kbdsim: WakeFromD3 FALSE
Kbdsim: HardwareDisabled FALSE
Kbdsim: NonDynamic FALSE
Kbdsim: WarmEjectSupported FALSE
Kbdsim: NoDisplayInUI FALSE
Kbdsim: Address 2
Kbdsim: UINumber 0
Kbdsim: PowerSystemUnspecified = PowerDeviceUnspecified
Kbdsim: PowerSystemWorking = PowerDeviceD0
Kbdsim: PowerSystemSleeping1 = PowerDeviceD2
Kbdsim: PowerSystemSleeping2 = PowerDeviceD3
Kbdsim: PowerSystemSleeping3 = PowerDeviceD3
Kbdsim: PowerSystemHibernate = PowerDeviceD3
Kbdsim: PowerSystemShutdown = PowerDeviceD3
Kbdsim: SystemWake = PowerSystemSleeping1
Kbdsim: DeviceWake = PowerDeviceD2
Kbdsim: D1Latency 0
Kbdsim: D2Latency 0
Kbdsim: D3Latency 0
?
?
I hope this makes some send to someone becuase this is the first time I’ve
ever had to delve into to world of power management =(
?
Thanks in advance.
-Jeff
?
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com