-/*++\r
+/** @file\r
+ Power management support fucntions implementation for PCI Bus module.\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2009, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
+**/\r
\r
- PciPowerManagement.c\r
+#include "PciBus.h"\r
\r
-Abstract:\r
-\r
- PCI Bus Driver\r
-\r
-Revision History\r
+/**\r
+ This function is intended to turn off PWE assertion and\r
+ put the device to D0 state if the device supports\r
+ PCI Power Management.\r
\r
---*/\r
+ @param PciIoDevice PCI device instance.\r
\r
-#include "pcibus.h"\r
+ @retval EFI_UNSUPPORTED PCI Device does not support power management.\r
+ @retval EFI_SUCCESS Turned off PWE successfully.\r
\r
+**/\r
EFI_STATUS\r
ResetPowerManagementFeature (\r
IN PCI_IO_DEVICE *PciIoDevice\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- This function is intended to turn off PWE assertion and\r
- put the device to D0 state if the device supports\r
- PCI Power Management.\r
-\r
-Arguments:\r
-\r
-Returns:\r
- \r
- None\r
-\r
---*/\r
-// TODO: PciIoDevice - add argument and description to function comment\r
-// TODO: EFI_UNSUPPORTED - add return value to function comment\r
-// TODO: EFI_SUCCESS - add return value to function comment\r
{\r
EFI_STATUS Status;\r
UINT8 PowerManagementRegBlock;\r
- UINT16 PMCSR;\r
+ UINT16 PowerManagementCSR;\r
\r
PowerManagementRegBlock = 0;\r
\r
//\r
// Turn off the PWE assertion and put the device into D0 State\r
//\r
- PMCSR = 0x8000;\r
+ PowerManagementCSR = 0x8000;\r
\r
//\r
// Write PMCSR\r
//\r
- PciIoWrite (\r
- &PciIoDevice->PciIo,\r
- EfiPciIoWidthUint16,\r
- PowerManagementRegBlock + 4,\r
- 1,\r
- &PMCSR\r
- );\r
+ PciIoDevice->PciIo.Pci.Write (\r
+ &PciIoDevice->PciIo,\r
+ EfiPciIoWidthUint16,\r
+ PowerManagementRegBlock + 4,\r
+ 1,\r
+ &PowerManagementCSR\r
+ );\r
\r
return EFI_SUCCESS;\r
}\r
+\r