]>
Commit | Line | Data |
---|---|---|
95276127 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
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 | |
12 | Module Name:\r | |
13 | \r | |
14 | ConPlatform.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | --*/\r | |
19 | \r | |
20 | #ifndef CON_MANAGE_H_\r | |
21 | #define CON_MANAGE_H_\r | |
22 | \r | |
859b72fa A |
23 | #include <Uefi.h>\r |
24 | #include <Protocol/SimpleTextOut.h>\r | |
25 | #include <Guid/GlobalVariable.h>\r | |
26 | #include <Guid/ConsoleInDevice.h>\r | |
27 | #include <Protocol/DevicePath.h>\r | |
28 | #include <Protocol/SimpleTextIn.h>\r | |
29 | #include <Guid/HotPlugDevice.h>\r | |
30 | #include <Guid/StandardErrorDevice.h>\r | |
31 | #include <Guid/ConsoleOutDevice.h>\r | |
32 | #include <Library/DebugLib.h>\r | |
33 | #include <Library/UefiDriverEntryPoint.h>\r | |
34 | #include <Library/UefiLib.h>\r | |
35 | #include <Library/BaseMemoryLib.h>\r | |
36 | #include <Library/UefiBootServicesTableLib.h>\r | |
37 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
38 | #include <Library/DevicePathLib.h>\r | |
39 | #include <Library/MemoryAllocationLib.h>\r | |
40 | \r | |
95276127 | 41 | //\r |
859b72fa | 42 | // Driver Binding Externs\r |
95276127 | 43 | //\r |
5bca971e | 44 | extern EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextInDriverBinding;\r |
45 | extern EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName;\r | |
46 | extern EFI_COMPONENT_NAME2_PROTOCOL gConPlatformComponentName2;\r | |
47 | extern EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextOutDriverBinding;\r | |
48 | extern EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName;\r | |
49 | extern EFI_COMPONENT_NAME2_PROTOCOL gConPlatformComponentName2;\r | |
95276127 | 50 | \r |
95276127 | 51 | \r |
52 | typedef enum {\r | |
53 | CHECK,\r | |
54 | APPEND,\r | |
55 | DELETE\r | |
56 | } CONPLATFORM_VAR_OPERATION;\r | |
57 | \r | |
58 | EFI_STATUS\r | |
59 | ConPlatformDriverBindingSupported (\r | |
60 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
61 | IN EFI_HANDLE ControllerHandle,\r | |
62 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath,\r | |
63 | IN EFI_GUID *ProtocolGuid\r | |
64 | );\r | |
65 | \r | |
66 | EFI_STATUS\r | |
67 | EFIAPI\r | |
68 | ConPlatformTextInDriverBindingSupported (\r | |
69 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
70 | IN EFI_HANDLE Handle,\r | |
71 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
72 | );\r | |
73 | \r | |
74 | EFI_STATUS\r | |
75 | EFIAPI\r | |
76 | ConPlatformTextOutDriverBindingSupported (\r | |
77 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
78 | IN EFI_HANDLE Handle,\r | |
79 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
80 | );\r | |
81 | \r | |
82 | EFI_STATUS\r | |
83 | EFIAPI\r | |
84 | ConPlatformTextInDriverBindingStart (\r | |
85 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
86 | IN EFI_HANDLE Handle,\r | |
87 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
88 | );\r | |
89 | \r | |
90 | EFI_STATUS\r | |
91 | EFIAPI\r | |
92 | ConPlatformTextOutDriverBindingStart (\r | |
93 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
94 | IN EFI_HANDLE Handle,\r | |
95 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
96 | );\r | |
97 | \r | |
98 | EFI_STATUS\r | |
99 | EFIAPI\r | |
100 | ConPlatformTextInDriverBindingStop (\r | |
101 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
102 | IN EFI_HANDLE Handle,\r | |
103 | IN UINTN NumberOfChildren,\r | |
104 | IN EFI_HANDLE *ChildHandleBuffer\r | |
105 | );\r | |
106 | \r | |
107 | EFI_STATUS\r | |
108 | EFIAPI\r | |
109 | ConPlatformTextOutDriverBindingStop (\r | |
110 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
111 | IN EFI_HANDLE Handle,\r | |
112 | IN UINTN NumberOfChildren,\r | |
113 | IN EFI_HANDLE *ChildHandleBuffer\r | |
114 | );\r | |
115 | \r | |
116 | VOID\r | |
117 | ConPlatformUnInstallProtocol (\r | |
118 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
119 | IN EFI_HANDLE Handle,\r | |
120 | IN EFI_GUID *ProtocolGuid\r | |
121 | );\r | |
122 | \r | |
123 | VOID *\r | |
124 | ConPlatformGetVariable (\r | |
125 | IN CHAR16 *Name\r | |
126 | );\r | |
127 | \r | |
128 | EFI_STATUS\r | |
129 | ConPlatformMatchDevicePaths (\r | |
130 | IN EFI_DEVICE_PATH_PROTOCOL * Multi,\r | |
131 | IN EFI_DEVICE_PATH_PROTOCOL * Single,\r | |
132 | IN EFI_DEVICE_PATH_PROTOCOL **NewDevicePath OPTIONAL,\r | |
133 | IN BOOLEAN Delete\r | |
134 | );\r | |
135 | \r | |
136 | EFI_STATUS\r | |
137 | ConPlatformUpdateDeviceVariable (\r | |
138 | IN CHAR16 *VariableName,\r | |
139 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r | |
140 | IN CONPLATFORM_VAR_OPERATION Operation\r | |
141 | );\r | |
142 | \r | |
143 | BOOLEAN\r | |
144 | IsHotPlugDevice (\r | |
145 | EFI_HANDLE DriverBindingHandle,\r | |
146 | EFI_HANDLE ControllerHandle\r | |
147 | );\r | |
148 | \r | |
859b72fa A |
149 | //\r |
150 | // EFI Component Name Functions\r | |
151 | //\r | |
5bca971e | 152 | /**\r |
153 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
154 | \r | |
155 | This function retrieves the user readable name of a driver in the form of a\r | |
156 | Unicode string. If the driver specified by This has a user readable name in\r | |
157 | the language specified by Language, then a pointer to the driver name is\r | |
158 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
159 | by This does not support the language specified by Language,\r | |
160 | then EFI_UNSUPPORTED is returned.\r | |
161 | \r | |
162 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
163 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
164 | \r | |
165 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
166 | array indicating the language. This is the\r | |
167 | language of the driver name that the caller is\r | |
168 | requesting, and it must match one of the\r | |
169 | languages specified in SupportedLanguages. The\r | |
170 | number of languages supported by a driver is up\r | |
171 | to the driver writer. Language is specified\r | |
172 | in RFC 3066 or ISO 639-2 language code format.\r | |
173 | \r | |
174 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
175 | This Unicode string is the name of the\r | |
176 | driver specified by This in the language\r | |
177 | specified by Language.\r | |
178 | \r | |
179 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
180 | This and the language specified by Language was\r | |
181 | returned in DriverName.\r | |
182 | \r | |
183 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
184 | \r | |
185 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
186 | \r | |
187 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
188 | the language specified by Language.\r | |
189 | \r | |
190 | **/\r | |
859b72fa A |
191 | EFI_STATUS\r |
192 | EFIAPI\r | |
193 | ConPlatformComponentNameGetDriverName (\r | |
194 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
195 | IN CHAR8 *Language,\r | |
196 | OUT CHAR16 **DriverName\r | |
197 | );\r | |
198 | \r | |
5bca971e | 199 | \r |
200 | /**\r | |
201 | Retrieves a Unicode string that is the user readable name of the controller\r | |
202 | that is being managed by a driver.\r | |
203 | \r | |
204 | This function retrieves the user readable name of the controller specified by\r | |
205 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
206 | driver specified by This has a user readable name in the language specified by\r | |
207 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
208 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
209 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
210 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
211 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
212 | \r | |
213 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
214 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
215 | \r | |
216 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
217 | specified by This is managing. This handle\r | |
218 | specifies the controller whose name is to be\r | |
219 | returned.\r | |
220 | \r | |
221 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
222 | the name of. This is an optional parameter that\r | |
223 | may be NULL. It will be NULL for device\r | |
224 | drivers. It will also be NULL for a bus drivers\r | |
225 | that wish to retrieve the name of the bus\r | |
226 | controller. It will not be NULL for a bus\r | |
227 | driver that wishes to retrieve the name of a\r | |
228 | child controller.\r | |
229 | \r | |
230 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
231 | array indicating the language. This is the\r | |
232 | language of the driver name that the caller is\r | |
233 | requesting, and it must match one of the\r | |
234 | languages specified in SupportedLanguages. The\r | |
235 | number of languages supported by a driver is up\r | |
236 | to the driver writer. Language is specified in\r | |
237 | RFC 3066 or ISO 639-2 language code format.\r | |
238 | \r | |
239 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
240 | This Unicode string is the name of the\r | |
241 | controller specified by ControllerHandle and\r | |
242 | ChildHandle in the language specified by\r | |
243 | Language from the point of view of the driver\r | |
244 | specified by This.\r | |
245 | \r | |
246 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
247 | the language specified by Language for the\r | |
248 | driver specified by This was returned in\r | |
249 | DriverName.\r | |
250 | \r | |
251 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
252 | \r | |
253 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
254 | EFI_HANDLE.\r | |
255 | \r | |
256 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
257 | \r | |
258 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
259 | \r | |
260 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
261 | managing the controller specified by\r | |
262 | ControllerHandle and ChildHandle.\r | |
263 | \r | |
264 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
265 | the language specified by Language.\r | |
266 | \r | |
267 | **/\r | |
859b72fa A |
268 | EFI_STATUS\r |
269 | EFIAPI\r | |
270 | ConPlatformComponentNameGetControllerName (\r | |
271 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
272 | IN EFI_HANDLE ControllerHandle,\r | |
273 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
274 | IN CHAR8 *Language,\r | |
275 | OUT CHAR16 **ControllerName\r | |
276 | );\r | |
277 | \r | |
5bca971e | 278 | \r |
95276127 | 279 | #endif\r |