]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Bus/Pci/PciBus/Dxe/PciPowerManagement.c
Remove all blanks lines to avoid build errors.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBus / Dxe / PciPowerManagement.c
1 /*++
2
3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 PciPowerManagement.c
15
16 Abstract:
17
18 PCI Bus Driver
19
20 Revision History
21
22 --*/
23
24 #include "pcibus.h"
25
26 EFI_STATUS
27 ResetPowerManagementFeature (
28 IN PCI_IO_DEVICE *PciIoDevice
29 )
30 /*++
31
32 Routine Description:
33
34 This function is intended to turn off PWE assertion and
35 put the device to D0 state if the device supports
36 PCI Power Management.
37
38 Arguments:
39
40 Returns:
41
42 None
43
44 --*/
45 // TODO: PciIoDevice - add argument and description to function comment
46 // TODO: EFI_UNSUPPORTED - add return value to function comment
47 // TODO: EFI_SUCCESS - add return value to function comment
48 {
49 EFI_STATUS Status;
50 UINT8 PowerManagementRegBlock;
51 UINT16 PMCSR;
52
53 PowerManagementRegBlock = 0;
54
55 Status = LocateCapabilityRegBlock (
56 PciIoDevice,
57 EFI_PCI_CAPABILITY_ID_PMI,
58 &PowerManagementRegBlock,
59 NULL
60 );
61
62 if (EFI_ERROR (Status)) {
63 return EFI_UNSUPPORTED;
64 }
65
66 //
67 // Turn off the PWE assertion and put the device into D0 State
68 //
69 PMCSR = 0x8000;
70
71 //
72 // Write PMCSR
73 //
74 PciIoWrite (
75 &PciIoDevice->PciIo,
76 EfiPciIoWidthUint16,
77 PowerManagementRegBlock + 4,
78 1,
79 &PMCSR
80 );
81
82 return EFI_SUCCESS;
83 }