From 884cba10efc6dcd1cffeda06a8a2dd2c475c99b4 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 27 Mar 2010 14:54:55 +0000 Subject: [PATCH] [CMPBATT] reduce diff to trunk svn path=/branches/ros-amd64-bringup/; revision=46489 --- reactos/drivers/bus/acpi/cmbatt/cmexec.c | 80 ++++-------------------- 1 file changed, 11 insertions(+), 69 deletions(-) diff --git a/reactos/drivers/bus/acpi/cmbatt/cmexec.c b/reactos/drivers/bus/acpi/cmbatt/cmexec.c index 543a8a70293..beb646ab509 100644 --- a/reactos/drivers/bus/acpi/cmbatt/cmexec.c +++ b/reactos/drivers/bus/acpi/cmbatt/cmexec.c @@ -9,7 +9,6 @@ /* INCLUDES *******************************************************************/ #include "cmbatt.h" -#include "ntstatus.h" /* FUNCTIONS ******************************************************************/ @@ -112,8 +111,8 @@ CmBattSendDownStreamIrp(IN PDEVICE_OBJECT DeviceObject, if (CmBattDebug & 0x4C) DbgPrint("CmBattSendDownStreamIrp: Failed to allocate Irp\n"); return STATUS_INSUFFICIENT_RESOURCES; -} - + } + /* Call ACPI */ if (CmBattDebug & 0x40) DbgPrint("CmBattSendDownStreamIrp: Irp %x [Tid] %x\n", @@ -183,13 +182,13 @@ CmBattGetPsrData(IN PDEVICE_OBJECT DeviceObject, Status = GetDwordElement(OutputBuffer.Argument, PsrData); if (CmBattDebug & 0x440) DbgPrint("CmBattGetPsrData: _PSR method returned %x \n", *PsrData); -} + } else if (CmBattDebug & 0x44C) { /* Failure */ DbgPrint("CmBattGetPsrData: Failed _PSR method - Status (0x%x)\n", Status); } - + /* Return status */ return Status; } @@ -228,14 +227,14 @@ CmBattGetStaData(IN PDEVICE_OBJECT DeviceObject, Status = GetDwordElement(OutputBuffer.Argument, StaData); if (CmBattDebug & 0x440) DbgPrint("CmBattGetStaData: _STA method returned %x \n", *StaData); -} + } else if (CmBattDebug & 0x44C) { /* Failure */ DbgPrint("CmBattGetStaData: Failed _STA method - Status (0x%x)\n", Status); Status = STATUS_NO_SUCH_DEVICE; } - + /* Return status */ return Status; } @@ -274,14 +273,14 @@ CmBattGetUniqueId(IN PDEVICE_OBJECT DeviceObject, Status = GetDwordElement(OutputBuffer.Argument, UniqueId); if (CmBattDebug & 0x440) DbgPrint("CmBattGetUniqueId: _UID method returned %x \n", *UniqueId); -} + } else if (CmBattDebug & 0x44C) { /* Failure */ DbgPrint("CmBattGetUniqueId: Failed _UID method - Status (0x%x)\n", Status); Status = STATUS_NO_SUCH_DEVICE; } - + /* Return status */ return Status; } @@ -332,65 +331,8 @@ NTAPI CmBattGetBstData(PCMBATT_DEVICE_EXTENSION DeviceExtension, PACPI_BST_DATA BstData) { - PIRP Irp; - NTSTATUS Status; - KEVENT Event; - IO_STATUS_BLOCK IoStatusBlock; - PAGED_CODE(); - - /* Initialize our wait event */ - KeInitializeEvent(&Event, SynchronizationEvent, 0); - - /* Allocate the IRP */ - Irp = IoBuildDeviceIoControlRequest(IoControlCode, - DeviceObject, - InputBuffer, - InputBufferLength, - OutputBuffer, - OutputBufferLength, - 0, - &Event, - &IoStatusBlock); - if (!Irp) - { - /* No IRP, fail */ - if (CmBattDebug & 0x4C) - DbgPrint("CmBattSendDownStreamIrp: Failed to allocate Irp\n"); - return STATUS_INSUFFICIENT_RESOURCES; - } - - /* Call ACPI */ - if (CmBattDebug & 0x40) - DbgPrint("CmBattSendDownStreamIrp: Irp %x [Tid] %x\n", Irp, KeGetCurrentThread()); - Status = IoCallDriver(DeviceObject, Irp); - if (Status == STATUS_PENDING) - { - /* Wait for completion */ - KeWaitForSingleObject(&Event, - Executive, - KernelMode, - FALSE, - NULL); - Status = Irp->IoStatus.Status; - } - - /* Check if caller wanted output */ - if (OutputBuffer) - { - /* Make sure it's valid ACPI output buffer */ - if ((OutputBuffer->Signature != ACPI_EVAL_OUTPUT_BUFFER_SIGNATURE) || - !(OutputBuffer->Count)) - { - /* It isn't, so set failure code */ - Status = STATUS_ACPI_INVALID_DATA; - } - } - - /* Return status */ - if (CmBattDebug & 0x40) - DbgPrint("CmBattSendDownStreamIrp: Irp %x completed %x! [Tid] %x\n", - Irp, Status, KeGetCurrentThread()); - return Status; + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; } - + /* EOF */