3 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
4 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
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.
18 EFI_HII_DATABASE_PROTOCOL from UEFI 2.1 specification.
20 This protocol is a database manager for HII related data structures.
26 #ifndef __EFI_HII_DATABASE_PROTOCOL_H__
27 #define __EFI_HII_DATABASE_PROTOCOL_H__
32 // Global ID for the Hii Database Protocol.
35 #define EFI_HII_DATABASE_PROTOCOL_GUID \
37 0xef9fc172, 0xa1b2, 0x4693, {0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42} \
40 #define EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID \
42 0x14982a4f, 0xb0ed, 0x45b8, {0xa8, 0x11, 0x5a, 0x7a, 0x9b, 0xc2, 0x32, 0xdf} \
45 EFI_FORWARD_DECLARATION (EFI_HII_DATABASE_PROTOCOL
);
47 typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE
;
49 #define EFI_HII_DATABASE_NOTIFY_NEW_PACK 0x00000001
50 #define EFI_HII_DATABASE_NOTIFY_REMOVE_PACK 0x00000002
51 #define EFI_HII_DATABASE_NOTIFY_EXPORT_PACK 0x00000004
52 #define EFI_HII_DATABASE_NOTIFY_ADD_PACK 0x00000008
56 (EFIAPI
*EFI_HII_DATABASE_NOTIFY
) (
58 IN CONST EFI_GUID
*PackageGuid
,
59 IN CONST EFI_HII_PACKAGE_HEADER
*Package
,
60 IN EFI_HII_HANDLE Handle
,
61 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
66 Functions which are registered to receive notification of database events have this prototype. The
67 actual event is encoded in NotifyType. The following table describes how PackageType,
68 PackageGuid, Handle, and Package are used for each of the notification types.
71 PackageType - Package type of the notification.
72 PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this is the pointer to
73 the GUID which must match the Guid field of
74 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must be NULL.
75 Package - Points to the package referred to by the notification.
76 Handle - The handle of the package list which contains the specified package.
77 NotifyType - The type of change concerning the database.
86 // EFI_HII_DATABASE_PROTOCOL protocol prototypes
91 (EFIAPI
*EFI_HII_DATABASE_NEW_PACK
) (
92 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
93 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
,
94 IN CONST EFI_HANDLE DriverHandle
,
95 OUT EFI_HII_HANDLE
*Handle
100 This function adds the packages in the package list to the database and returns a handle. If there is a
101 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will
102 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.
105 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
106 PackageList - A pointer to an EFI_HII_PACKAGE_LIST_HEADER structure.
107 DriverHandle - Associate the package list with this EFI handle.
108 Handle - A pointer to the EFI_HII_HANDLE instance.
111 EFI_SUCCESS - The package list associated with the Handle
112 was added to the HII database.
113 EFI_OUT_OF_RESOURCES - Unable to allocate necessary resources for the
114 new database contents.
115 EFI_INVALID_PARAMETER - PackageList is NULL or Handle is NULL.
122 (EFIAPI
*EFI_HII_DATABASE_REMOVE_PACK
) (
123 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
124 IN EFI_HII_HANDLE Handle
129 This function removes the package list that is associated with a handle Handle
130 from the HII database. Before removing the package, any registered functions
131 with the notification type REMOVE_PACK and the same package type will be called.
134 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
135 Handle - The handle that was registered to the data that is requested
139 EFI_SUCCESS - The data associated with the Handle was removed from
141 EFI_NOT_FOUND - The specified Handle is not in database.
148 (EFIAPI
*EFI_HII_DATABASE_UPDATE_PACK
) (
149 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
150 IN EFI_HII_HANDLE Handle
,
151 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageList
156 This function updates the existing package list (which has the specified Handle)
157 in the HII databases, using the new package list specified by PackageList.
160 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
161 Handle - The handle that was registered to the data that is
162 requested to be updated.
163 PackageList - A pointer to an EFI_HII_PACKAGE_LIST_HEADER package.
166 EFI_SUCCESS - The HII database was successfully updated.
167 EFI_OUT_OF_RESOURCES - Unable to allocate enough memory for the updated database.
168 EFI_INVALID_PARAMETER - PackageList was NULL.
169 EFI_NOT_FOUND - The specified Handle is not in database.
176 (EFIAPI
*EFI_HII_DATABASE_LIST_PACKS
) (
177 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
178 IN UINT8 PackageType
,
179 IN CONST EFI_GUID
*PackageGuid
,
180 IN OUT UINTN
*HandleBufferLength
,
181 OUT EFI_HII_HANDLE
*Handle
186 This function returns a list of the package handles of the specified type
187 that are currently active in the database. The pseudo-type
188 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.
191 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
192 PackageType - Specifies the package type of the packages to list or
193 EFI_HII_PACKAGE_TYPE_ALL for all packages to be listed.
194 PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this
195 is the pointer to the GUID which must match the Guid
196 field of EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise,
198 HandleBufferLength - On input, a pointer to the length of the handle buffer.
199 On output, the length of the handle buffer that is
200 required for the handles found.
201 Handle - An array of EFI_HII_HANDLE instances returned.
204 EFI_SUCCESS - The matching handles are outputted successfully.
205 HandleBufferLength is updated with the actual length.
206 EFI_BUFFER_TO_SMALL - The HandleBufferLength parameter indicates that
207 Handle is too small to support the number of handles.
208 HandleBufferLength is updated with a value that will
209 enable the data to fit.
210 EFI_NOT_FOUND - No matching handle could not be found in database.
211 EFI_INVALID_PARAMETER - Handle or HandleBufferLength was NULL.
212 EFI_INVALID_PARAMETER - PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
213 PackageGuid is not NULL, PackageType is a EFI_HII_
214 PACKAGE_TYPE_GUID but PackageGuid is NULL.
221 (EFIAPI
*EFI_HII_DATABASE_EXPORT_PACKS
) (
222 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
223 IN EFI_HII_HANDLE Handle
,
224 IN OUT UINTN
*BufferSize
,
225 OUT EFI_HII_PACKAGE_LIST_HEADER
*Buffer
230 This function will export one or all package lists in the database to a buffer.
231 For each package list exported, this function will call functions registered
232 with EXPORT_PACK and then copy the package list to the buffer.
235 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
236 Handle - An EFI_HII_HANDLE that corresponds to the desired package
237 list in the HII database to export or NULL to indicate
238 all package lists should be exported.
239 BufferSize - On input, a pointer to the length of the buffer.
240 On output, the length of the buffer that is required for
242 Buffer - A pointer to a buffer that will contain the results of
246 EFI_SUCCESS - Package exported.
247 EFI_BUFFER_TO_SMALL - The HandleBufferLength parameter indicates that Handle
248 is too small to support the number of handles.
249 HandleBufferLength is updated with a value that will
250 enable the data to fit.
251 EFI_NOT_FOUND - The specified Handle could not be found in the current
253 EFI_INVALID_PARAMETER - Handle or Buffer or BufferSize was NULL.
260 (EFIAPI
*EFI_HII_DATABASE_REGISTER_NOTIFY
) (
261 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
262 IN UINT8 PackageType
,
263 IN CONST EFI_GUID
*PackageGuid
,
264 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn
,
265 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
,
266 OUT EFI_HANDLE
*NotifyHandle
271 This function registers a function which will be called when specified actions related to packages of
272 the specified type occur in the HII database. By registering a function, other HII-related drivers are
273 notified when specific package types are added, removed or updated in the HII database.
274 Each driver or application which registers a notification should use
275 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.
278 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
279 PackageType - Specifies the package type of the packages to list or
280 EFI_HII_PACKAGE_TYPE_ALL for all packages to be listed.
281 PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this is the pointer to
282 the GUID which must match the Guid field of
283 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must be NULL.
284 PackageNotifyFn - Points to the function to be called when the event specified by
285 NotificationType occurs.
286 NotifyType - Describes the types of notification which this function will be receiving.
287 NotifyHandle - Points to the unique handle assigned to the registered notification. Can be used in
288 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() to stop notifications.
291 EFI_SUCCESS - Notification registered successfully.
292 EFI_OUT_OF_RESOURCES - Unable to allocate necessary data structures
293 EFI_INVALID_PARAMETER - NotifyHandle is NULL.
294 EFI_INVALID_PARAMETER - PackageGuid is not NULL when PackageType is not
295 EFI_HII_PACKAGE_TYPE_GUID.
296 EFI_INVALID_PARAMETER - PackageGuid is NULL when PackageType is EFI_HII_PACKAGE_TYPE_GUID.
303 (EFIAPI
*EFI_HII_DATABASE_UNREGISTER_NOTIFY
) (
304 IN CONST EFI_HII_DATABASE_PROTOCOL
*This
,
305 IN EFI_HANDLE NotificationHandle
310 Removes the specified HII database package-related notification.
313 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
314 NotifyHandle - The handle of the notification function being unregistered.
317 EFI_SUCCESS - Notification is unregistered successfully.
318 EFI_NOT_FOUND - The incoming notification handle does not exist
319 in current hii database.
326 (EFIAPI
*EFI_HII_FIND_KEYBOARD_LAYOUTS
) (
327 IN EFI_HII_DATABASE_PROTOCOL
*This
,
328 IN OUT UINT16
*KeyGuidBufferLength
,
329 OUT EFI_GUID
*KeyGuidBuffer
334 This routine retrieves an array of GUID values for each keyboard layout that
335 was previously registered in the system.
338 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
339 KeyGuidBufferLength - On input, a pointer to the length of the keyboard GUID
340 buffer. On output, the length of the handle buffer
341 that is required for the handles found.
342 KeyGuidBuffer - An array of keyboard layout GUID instances returned.
345 EFI_SUCCESS - KeyGuidBuffer was updated successfully.
346 EFI_BUFFER_TOO_SMALL - The KeyGuidBufferLength parameter indicates
347 that KeyGuidBuffer is too small to support the
348 number of GUIDs. KeyGuidBufferLength is
349 updated with a value that will enable the data to fit.
350 EFI_INVALID_PARAMETER - The KeyGuidBuffer or KeyGuidBufferLength was NULL.
351 EFI_NOT_FOUND - There was no keyboard layout.
358 (EFIAPI
*EFI_HII_GET_KEYBOARD_LAYOUT
) (
359 IN EFI_HII_DATABASE_PROTOCOL
*This
,
360 IN EFI_GUID
*KeyGuid
,
361 IN OUT UINT16
*KeyboardLayoutLength
,
362 OUT EFI_HII_KEYBOARD_LAYOUT
*KeyboardLayout
367 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys
368 on a keyboard and the character(s) that are associated with a particular set of key strokes.
371 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
372 KeyGuid - A pointer to the unique ID associated with a given keyboard layout. If KeyGuid is
373 NULL then the current layout will be retrieved.
374 KeyboardLayoutLength - On input, a pointer to the length of the KeyboardLayout buffer.
375 On output, the length of the data placed into KeyboardLayout.
376 KeyboardLayout - A pointer to a buffer containing the retrieved keyboard layout.
379 EFI_SUCCESS - The keyboard layout was retrieved successfully.
380 EFI_NOT_FOUND - The requested keyboard layout was not found.
381 EFI_INVALID_PARAMETER - The KeyboardLayout or KeyboardLayoutLength was NULL.
388 (EFIAPI
*EFI_HII_SET_KEYBOARD_LAYOUT
) (
389 IN EFI_HII_DATABASE_PROTOCOL
*This
,
395 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine
396 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
397 group type. This is so that agents which are sensitive to the current keyboard layout being changed
398 can be notified of this change.
401 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
402 KeyGuid - A pointer to the unique ID associated with a given keyboard layout.
405 EFI_SUCCESS - The current keyboard layout was successfully set.
406 EFI_NOT_FOUND - The referenced keyboard layout was not found, so action was taken.
407 EFI_INVALID_PARAMETER - The KeyGuid was NULL.
414 (EFIAPI
*EFI_HII_DATABASE_GET_PACK_HANDLE
) (
415 IN EFI_HII_DATABASE_PROTOCOL
*This
,
416 IN EFI_HII_HANDLE PackageListHandle
,
417 OUT EFI_HANDLE
*DriverHandle
422 Return the EFI handle associated with a package list.
425 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
426 PackageListHandle - An EFI_HII_HANDLE that corresponds to the desired package list in the
428 DriverHandle - On return, contains the EFI_HANDLE which was registered with the package list in
432 EFI_SUCCESS - The DriverHandle was returned successfully.
433 EFI_INVALID_PARAMETER - The PackageListHandle was not valid or DriverHandle was NULL.
438 struct _EFI_HII_DATABASE_PROTOCOL
{
439 EFI_HII_DATABASE_NEW_PACK NewPackageList
;
440 EFI_HII_DATABASE_REMOVE_PACK RemovePackageList
;
441 EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList
;
442 EFI_HII_DATABASE_LIST_PACKS ListPackageLists
;
443 EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists
;
444 EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify
;
445 EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify
;
446 EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts
;
447 EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout
;
448 EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout
;
449 EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle
;
452 extern EFI_GUID gEfiHiiDatabaseProtocolGuid
;