Author: sir_richard
Date: Mon Mar 22 03:18:28 2010
New Revision: 46337
URL:
http://svn.reactos.org/svn/reactos?rev=46337&view=rev
Log:
[CMBATT]: Implement CmBattPowerDispatch for power requests.
Modified:
trunk/reactos/drivers/bus/acpi/cmbatt/cmbpnp.c
Modified: trunk/reactos/drivers/bus/acpi/cmbatt/cmbpnp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/cmbatt/cm…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/cmbatt/cmbpnp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/cmbatt/cmbpnp.c [iso-8859-1] Mon Mar 22 03:18:28 2010
@@ -159,11 +159,65 @@
NTSTATUS
NTAPI
-CmBattPowerDispatch(PDEVICE_OBJECT DeviceObject,
- PIRP Irp)
-{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+CmBattPowerDispatch(IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ PIO_STACK_LOCATION IoStackLocation;
+ PCMBATT_DEVICE_EXTENSION DeviceExtension;
+ NTSTATUS Status;
+ if (CmBattDebug & 0x210) DbgPrint("CmBattPowerDispatch\n");
+
+ /* Get stack location and device extension */
+ IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
+ DeviceExtension = DeviceObject->DeviceExtension;
+ switch (IoStackLocation->MinorFunction)
+ {
+ case IRP_MN_WAIT_WAKE:
+ if (CmBattDebug & 0x10)
+ DbgPrint("CmBattPowerDispatch: IRP_MN_WAIT_WAKE\n");
+ break;
+
+ case IRP_MN_POWER_SEQUENCE:
+ if (CmBattDebug & 0x10)
+ DbgPrint("CmBattPowerDispatch: IRP_MN_POWER_SEQUENCE\n");
+ break;
+
+ case IRP_MN_QUERY_POWER:
+ if (CmBattDebug & 0x10)
+ DbgPrint("CmBattPowerDispatch: IRP_MN_WAIT_WAKE\n");
+ break;
+
+ case IRP_MN_SET_POWER:
+ if (CmBattDebug & 0x10)
+ DbgPrint("CmBattPowerDispatch: IRP_MN_SET_POWER type: %d, State: %d
\n",
+ IoStackLocation->Parameters.Power.Type,
+ IoStackLocation->Parameters.Power.State);
+ break;
+
+ default:
+
+ if (CmBattDebug & 1)
+ DbgPrint("CmBattPowerDispatch: minor %d\n",
IoStackLocation->MinorFunction);
+ break;
+ }
+
+ /* Start the next IRP and see if we're attached */
+ PoStartNextPowerIrp(Irp);
+ if (DeviceExtension->AttachedDevice)
+ {
+ /* Call ACPI */
+ IoSkipCurrentIrpStackLocation(Irp);
+ Status = PoCallDriver(DeviceExtension->AttachedDevice, Irp);
+ }
+ else
+ {
+ /* Complete the request here */
+ Status = Irp->IoStatus.Status;
+ IofCompleteRequest(Irp, IO_NO_INCREMENT);
+ }
+
+ /* Return status */
+ return Status;
}
NTSTATUS