]>
Commit | Line | Data |
---|---|---|
eeefcb9d | 1 | /** @file\r |
ead42efc | 2 | \r |
3db51098 | 3 | Copyright (c) 2006, Intel Corporation \r |
ead42efc | 4 | All rights reserved. This program and the accompanying materials \r |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
3db51098 | 12 | **/\r |
ead42efc | 13 | \r |
ead42efc | 14 | \r |
eeefcb9d | 15 | #ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H_\r |
16 | #define _EFI_PCI_HOT_PLUG_SUPPORT_H_\r | |
ead42efc | 17 | \r |
18 | \r | |
19 | //\r | |
20 | // stall 1 second\r | |
21 | //\r | |
22 | #define STALL_1_SECOND 1000000 \r | |
23 | \r | |
24 | typedef struct {\r | |
25 | EFI_EVENT Event;\r | |
26 | BOOLEAN Initialized;\r | |
27 | VOID *Padding;\r | |
28 | } ROOT_HPC_DATA;\r | |
29 | \r | |
30 | extern EFI_PCI_HOT_PLUG_INIT_PROTOCOL *gPciHotPlugInit;\r | |
31 | extern EFI_HPC_LOCATION *gPciRootHpcPool;\r | |
32 | extern UINTN gPciRootHpcCount;\r | |
33 | extern ROOT_HPC_DATA *gPciRootHpcData;\r | |
34 | \r | |
57076f45 | 35 | /**\r |
36 | Init HPC private data.\r | |
37 | \r | |
38 | @param Event event object\r | |
39 | @param Context HPC private data.\r | |
40 | **/\r | |
ead42efc | 41 | VOID\r |
42 | EFIAPI\r | |
43 | PciHPCInitialized (\r | |
44 | IN EFI_EVENT Event,\r | |
45 | IN VOID *Context\r | |
ed66e1bc | 46 | );\r |
ead42efc | 47 | \r |
57076f45 | 48 | /**\r |
49 | Compare two device path\r | |
50 | \r | |
97404058 | 51 | @param DevicePath1 the first device path want to be compared.\r |
52 | @param DevicePath2 the first device path want to be compared.\r | |
57076f45 | 53 | \r |
97404058 | 54 | @retval TRUE equal.\r |
55 | @retval FALSE different.\r | |
57076f45 | 56 | **/\r |
ead42efc | 57 | BOOLEAN\r |
58 | EfiCompareDevicePath (\r | |
59 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,\r | |
60 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2\r | |
ed66e1bc | 61 | );\r |
ead42efc | 62 | \r |
57076f45 | 63 | /**\r |
64 | Init hot plug support and root hot plug private data.\r | |
65 | \r | |
66 | **/\r | |
ead42efc | 67 | EFI_STATUS\r |
68 | InitializeHotPlugSupport (\r | |
69 | VOID\r | |
ed66e1bc | 70 | );\r |
ead42efc | 71 | \r |
57076f45 | 72 | /**\r |
73 | Test whether PCI device is hot plug bus.\r | |
74 | \r | |
97404058 | 75 | @param PciIoDevice PCI device instance.\r |
57076f45 | 76 | \r |
97404058 | 77 | @retval EFI_SUCCESS PCI device is hot plug bus.\r |
78 | @retval EFI_NOT_FOUND PCI device is not hot plug bus.\r | |
57076f45 | 79 | **/\r |
ead42efc | 80 | EFI_STATUS\r |
81 | IsPciHotPlugBus (\r | |
82 | PCI_IO_DEVICE *PciIoDevice\r | |
ed66e1bc | 83 | );\r |
ead42efc | 84 | \r |
57076f45 | 85 | /**\r |
86 | Test whether device path is for root pci hot plug bus\r | |
87 | \r | |
97404058 | 88 | @param HpbDevicePath tested device path\r |
57076f45 | 89 | @param HpIndex Return the index of root hot plug in global array.\r |
90 | \r | |
91 | @retval TRUE device path is for root pci hot plug\r | |
92 | @retval FALSE device path is not for root pci hot plug\r | |
93 | **/\r | |
ead42efc | 94 | BOOLEAN\r |
95 | IsRootPciHotPlugBus (\r | |
96 | IN EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath,\r | |
97 | OUT UINTN *HpIndex\r | |
ed66e1bc | 98 | );\r |
ead42efc | 99 | \r |
57076f45 | 100 | /**\r |
101 | Test whether device path is for root pci hot plug controller\r | |
102 | \r | |
97404058 | 103 | @param HpcDevicePath tested device path.\r |
57076f45 | 104 | @param HpIndex Return the index of root hot plug in global array.\r |
105 | \r | |
97404058 | 106 | @retval TRUE device path is for root pci hot plug controller.\r |
107 | @retval FALSE device path is not for root pci hot plug controller.\r | |
57076f45 | 108 | **/\r |
ead42efc | 109 | BOOLEAN\r |
110 | IsRootPciHotPlugController (\r | |
111 | IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,\r | |
112 | OUT UINTN *HpIndex\r | |
ed66e1bc | 113 | );\r |
ead42efc | 114 | \r |
57076f45 | 115 | /**\r |
116 | Wrapper for creating event object for HPC \r | |
117 | \r | |
97404058 | 118 | @param HpIndex index of hot plug device in global array.\r |
119 | @param Event event object.\r | |
57076f45 | 120 | \r |
97404058 | 121 | @return status of create event invoken.\r |
57076f45 | 122 | **/\r |
ead42efc | 123 | EFI_STATUS\r |
124 | CreateEventForHpc (\r | |
125 | IN UINTN HpIndex,\r | |
126 | OUT EFI_EVENT *Event\r | |
ed66e1bc | 127 | );\r |
ead42efc | 128 | \r |
57076f45 | 129 | /**\r |
130 | Wait for all root HPC initialized.\r | |
131 | \r | |
97404058 | 132 | @param TimeoutInMicroSeconds microseconds to wait for all root hpc's initialization.\r |
57076f45 | 133 | **/\r |
ead42efc | 134 | EFI_STATUS\r |
135 | AllRootHPCInitialized (\r | |
136 | IN UINTN TimeoutInMicroSeconds\r | |
ed66e1bc | 137 | );\r |
ead42efc | 138 | \r |
57076f45 | 139 | /**\r |
140 | Check HPC capability register block\r | |
141 | \r | |
97404058 | 142 | @param PciIoDevice PCI device instance.\r |
57076f45 | 143 | \r |
97404058 | 144 | @retval EFI_SUCCESS PCI device is HPC.\r |
145 | @retval EFI_NOT_FOUND PCI device is not HPC.\r | |
57076f45 | 146 | **/\r |
ead42efc | 147 | EFI_STATUS\r |
148 | IsSHPC (\r | |
149 | PCI_IO_DEVICE *PciIoDevice\r | |
ed66e1bc | 150 | );\r |
ead42efc | 151 | \r |
57076f45 | 152 | /**\r |
153 | Get resource padding for hot plug bus\r | |
154 | \r | |
97404058 | 155 | @param PciIoDevice PCI device instance.\r |
57076f45 | 156 | \r |
97404058 | 157 | @retval EFI_SUCCESS success get padding and set it into PCI device instance.\r |
57076f45 | 158 | @retval EFI_NOT_FOUND PCI device is not a hot plug bus.\r |
159 | **/\r | |
ead42efc | 160 | EFI_STATUS\r |
161 | GetResourcePaddingForHpb (\r | |
162 | IN PCI_IO_DEVICE *PciIoDevice\r | |
ed66e1bc | 163 | );\r |
ead42efc | 164 | \r |
165 | #endif\r |