xref: /freebsd/sys/contrib/edk2/Include/Protocol/HiiDatabase.h (revision f439973d6726c3be929c8fb3b1545b8b1744abc3)
1*f439973dSWarner Losh /** @file
2*f439973dSWarner Losh   The file provides Database manager for HII-related data
3*f439973dSWarner Losh   structures.
4*f439973dSWarner Losh 
5*f439973dSWarner Losh Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
6*f439973dSWarner Losh SPDX-License-Identifier: BSD-2-Clause-Patent
7*f439973dSWarner Losh 
8*f439973dSWarner Losh   @par Revision Reference:
9*f439973dSWarner Losh   This Protocol was introduced in UEFI Specification 2.1.
10*f439973dSWarner Losh 
11*f439973dSWarner Losh **/
12*f439973dSWarner Losh 
13*f439973dSWarner Losh #ifndef __HII_DATABASE_H__
14*f439973dSWarner Losh #define __HII_DATABASE_H__
15*f439973dSWarner Losh 
16*f439973dSWarner Losh #define EFI_HII_DATABASE_PROTOCOL_GUID \
17*f439973dSWarner Losh   { 0xef9fc172, 0xa1b2, 0x4693, { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } }
18*f439973dSWarner Losh 
19*f439973dSWarner Losh typedef struct _EFI_HII_DATABASE_PROTOCOL EFI_HII_DATABASE_PROTOCOL;
20*f439973dSWarner Losh 
21*f439973dSWarner Losh ///
22*f439973dSWarner Losh /// EFI_HII_DATABASE_NOTIFY_TYPE.
23*f439973dSWarner Losh ///
24*f439973dSWarner Losh typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE;
25*f439973dSWarner Losh 
26*f439973dSWarner Losh #define EFI_HII_DATABASE_NOTIFY_NEW_PACK     0x00000001
27*f439973dSWarner Losh #define EFI_HII_DATABASE_NOTIFY_REMOVE_PACK  0x00000002
28*f439973dSWarner Losh #define EFI_HII_DATABASE_NOTIFY_EXPORT_PACK  0x00000004
29*f439973dSWarner Losh #define EFI_HII_DATABASE_NOTIFY_ADD_PACK     0x00000008
30*f439973dSWarner Losh 
31*f439973dSWarner Losh /**
32*f439973dSWarner Losh 
33*f439973dSWarner Losh   Functions which are registered to receive notification of
34*f439973dSWarner Losh   database events have this prototype. The actual event is encoded
35*f439973dSWarner Losh   in NotifyType. The following table describes how PackageType,
36*f439973dSWarner Losh   PackageGuid, Handle, and Package are used for each of the
37*f439973dSWarner Losh   notification types.
38*f439973dSWarner Losh 
39*f439973dSWarner Losh   @param PackageType  Package type of the notification.
40*f439973dSWarner Losh 
41*f439973dSWarner Losh   @param PackageGuid  If PackageType is
42*f439973dSWarner Losh                       EFI_HII_PACKAGE_TYPE_GUID, then this is
43*f439973dSWarner Losh                       the pointer to the GUID from the Guid
44*f439973dSWarner Losh                       field of EFI_HII_PACKAGE_GUID_HEADER.
45*f439973dSWarner Losh                       Otherwise, it must be NULL.
46*f439973dSWarner Losh 
47*f439973dSWarner Losh   @param Package      Points to the package referred to by the notification.
48*f439973dSWarner Losh 
49*f439973dSWarner Losh   @param Handle       The handle of the package
50*f439973dSWarner Losh                       list which contains the specified package.
51*f439973dSWarner Losh 
52*f439973dSWarner Losh   @param NotifyType   The type of change concerning the
53*f439973dSWarner Losh                       database. See
54*f439973dSWarner Losh                       EFI_HII_DATABASE_NOTIFY_TYPE.
55*f439973dSWarner Losh 
56*f439973dSWarner Losh **/
57*f439973dSWarner Losh typedef
58*f439973dSWarner Losh EFI_STATUS
59*f439973dSWarner Losh (EFIAPI *EFI_HII_DATABASE_NOTIFY)(
60*f439973dSWarner Losh   IN        UINT8                         PackageType,
61*f439973dSWarner Losh   IN CONST  EFI_GUID                      *PackageGuid,
62*f439973dSWarner Losh   IN CONST  EFI_HII_PACKAGE_HEADER        *Package,
63*f439973dSWarner Losh   IN        EFI_HII_HANDLE                 Handle,
64*f439973dSWarner Losh   IN        EFI_HII_DATABASE_NOTIFY_TYPE  NotifyType
65*f439973dSWarner Losh   );
66*f439973dSWarner Losh 
67*f439973dSWarner Losh /**
68*f439973dSWarner Losh 
69*f439973dSWarner Losh   This function adds the packages in the package list to the
70*f439973dSWarner Losh   database and returns a handle. If there is a
71*f439973dSWarner Losh   EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then
72*f439973dSWarner Losh   this function will create a package of type
73*f439973dSWarner Losh   EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list. For
74*f439973dSWarner Losh   each package in the package list, registered functions with the
75*f439973dSWarner Losh   notification type NEW_PACK and having the same package type will
76*f439973dSWarner Losh   be called. For each call to NewPackageList(), there should be a
77*f439973dSWarner Losh   corresponding call to
78*f439973dSWarner Losh   EFI_HII_DATABASE_PROTOCOL.RemovePackageList().
79*f439973dSWarner Losh 
80*f439973dSWarner Losh   @param This           A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
81*f439973dSWarner Losh 
82*f439973dSWarner Losh   @param PackageList    A pointer to an EFI_HII_PACKAGE_LIST_HEADER structure.
83*f439973dSWarner Losh 
84*f439973dSWarner Losh   @param DriverHandle   Associate the package list with this EFI handle.
85*f439973dSWarner Losh                         If a NULL is specified, this data will not be associate
86*f439973dSWarner Losh                         with any drivers and cannot have a callback induced.
87*f439973dSWarner Losh 
88*f439973dSWarner Losh   @param Handle         A pointer to the EFI_HII_HANDLE instance.
89*f439973dSWarner Losh 
90*f439973dSWarner Losh   @retval EFI_SUCCESS           The package list associated with the
91*f439973dSWarner Losh                                 Handle was added to the HII database.
92*f439973dSWarner Losh 
93*f439973dSWarner Losh   @retval EFI_OUT_OF_RESOURCES  Unable to allocate necessary
94*f439973dSWarner Losh                                 resources for the new database
95*f439973dSWarner Losh                                 contents.
96*f439973dSWarner Losh 
97*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER PackageList is NULL, or Handle is NULL.
98*f439973dSWarner Losh 
99*f439973dSWarner Losh **/
100*f439973dSWarner Losh typedef
101*f439973dSWarner Losh EFI_STATUS
102*f439973dSWarner Losh (EFIAPI *EFI_HII_DATABASE_NEW_PACK)(
103*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL   *This,
104*f439973dSWarner Losh   IN CONST  EFI_HII_PACKAGE_LIST_HEADER *PackageList,
105*f439973dSWarner Losh   IN        EFI_HANDLE                  DriverHandle  OPTIONAL,
106*f439973dSWarner Losh   OUT       EFI_HII_HANDLE               *Handle
107*f439973dSWarner Losh   );
108*f439973dSWarner Losh 
109*f439973dSWarner Losh /**
110*f439973dSWarner Losh 
111*f439973dSWarner Losh   This function removes the package list that is associated with a
112*f439973dSWarner Losh   handle Handle from the HII database. Before removing the
113*f439973dSWarner Losh   package, any registered functions with the notification type
114*f439973dSWarner Losh   REMOVE_PACK and the same package type will be called. For each
115*f439973dSWarner Losh   call to EFI_HII_DATABASE_PROTOCOL.NewPackageList(), there should
116*f439973dSWarner Losh   be a corresponding call to RemovePackageList.
117*f439973dSWarner Losh 
118*f439973dSWarner Losh   @param This             A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
119*f439973dSWarner Losh 
120*f439973dSWarner Losh   @param Handle           The handle that was registered to the data
121*f439973dSWarner Losh                           that is requested for removal.
122*f439973dSWarner Losh 
123*f439973dSWarner Losh   @retval EFI_SUCCESS     The data associated with the Handle was
124*f439973dSWarner Losh                           removed from the HII database.
125*f439973dSWarner Losh   @retval EFI_NOT_FOUND   The specified Handle is not in database.
126*f439973dSWarner Losh 
127*f439973dSWarner Losh **/
128*f439973dSWarner Losh typedef
129*f439973dSWarner Losh EFI_STATUS
130*f439973dSWarner Losh (EFIAPI *EFI_HII_DATABASE_REMOVE_PACK)(
131*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,
132*f439973dSWarner Losh   IN        EFI_HII_HANDLE             Handle
133*f439973dSWarner Losh   );
134*f439973dSWarner Losh 
135*f439973dSWarner Losh /**
136*f439973dSWarner Losh 
137*f439973dSWarner Losh   This function updates the existing package list (which has the
138*f439973dSWarner Losh   specified Handle) in the HII databases, using the new package
139*f439973dSWarner Losh   list specified by PackageList. The update process has the
140*f439973dSWarner Losh   following steps: Collect all the package types in the package
141*f439973dSWarner Losh   list specified by PackageList. A package type consists of the
142*f439973dSWarner Losh   Type field of EFI_HII_PACKAGE_HEADER and, if the Type is
143*f439973dSWarner Losh   EFI_HII_PACKAGE_TYPE_GUID, the Guid field, as defined in
144*f439973dSWarner Losh   EFI_HII_PACKAGE_GUID_HEADER. Iterate through the packages within
145*f439973dSWarner Losh   the existing package list in the HII database specified by
146*f439973dSWarner Losh   Handle. If a package's type matches one of the collected types collected
147*f439973dSWarner Losh   in step 1, then perform the following steps:
148*f439973dSWarner Losh   - Call any functions registered with the notification type
149*f439973dSWarner Losh   REMOVE_PACK.
150*f439973dSWarner Losh   - Remove the package from the package list and the HII
151*f439973dSWarner Losh   database.
152*f439973dSWarner Losh   Add all of the packages within the new package list specified
153*f439973dSWarner Losh   by PackageList, using the following steps:
154*f439973dSWarner Losh   - Add the package to the package list and the HII database.
155*f439973dSWarner Losh   - Call any functions registered with the notification type
156*f439973dSWarner Losh   ADD_PACK.
157*f439973dSWarner Losh 
158*f439973dSWarner Losh   @param This         A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
159*f439973dSWarner Losh 
160*f439973dSWarner Losh   @param Handle       The handle that was registered to the data
161*f439973dSWarner Losh                       that is requested for removal.
162*f439973dSWarner Losh 
163*f439973dSWarner Losh   @param PackageList  A pointer to an EFI_HII_PACKAGE_LIST
164*f439973dSWarner Losh                       package.
165*f439973dSWarner Losh 
166*f439973dSWarner Losh   @retval EFI_SUCCESS            The HII database was successfully updated.
167*f439973dSWarner Losh 
168*f439973dSWarner Losh   @retval EFI_OUT_OF_RESOURCES   Unable to allocate enough memory
169*f439973dSWarner Losh                                  for the updated database.
170*f439973dSWarner Losh 
171*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER  PackageList was NULL.
172*f439973dSWarner Losh   @retval EFI_NOT_FOUND          The specified Handle is not in database.
173*f439973dSWarner Losh 
174*f439973dSWarner Losh **/
175*f439973dSWarner Losh typedef
176*f439973dSWarner Losh EFI_STATUS
177*f439973dSWarner Losh (EFIAPI *EFI_HII_DATABASE_UPDATE_PACK)(
178*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL   *This,
179*f439973dSWarner Losh   IN        EFI_HII_HANDLE               Handle,
180*f439973dSWarner Losh   IN CONST  EFI_HII_PACKAGE_LIST_HEADER *PackageList
181*f439973dSWarner Losh   );
182*f439973dSWarner Losh 
183*f439973dSWarner Losh /**
184*f439973dSWarner Losh 
185*f439973dSWarner Losh   This function returns a list of the package handles of the
186*f439973dSWarner Losh   specified type that are currently active in the database. The
187*f439973dSWarner Losh   pseudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package
188*f439973dSWarner Losh   handles to be listed.
189*f439973dSWarner Losh 
190*f439973dSWarner Losh   @param This                 A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
191*f439973dSWarner Losh 
192*f439973dSWarner Losh   @param PackageType          Specifies the package type of the packages
193*f439973dSWarner Losh                               to list or EFI_HII_PACKAGE_TYPE_ALL for
194*f439973dSWarner Losh                               all packages to be listed.
195*f439973dSWarner Losh 
196*f439973dSWarner Losh   @param PackageGuid          If PackageType is
197*f439973dSWarner Losh                               EFI_HII_PACKAGE_TYPE_GUID, then this is
198*f439973dSWarner Losh                               the pointer to the GUID which must match
199*f439973dSWarner Losh                               the Guid field of
200*f439973dSWarner Losh                               EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it
201*f439973dSWarner Losh                               must be NULL.
202*f439973dSWarner Losh 
203*f439973dSWarner Losh   @param HandleBufferLength   On input, a pointer to the length
204*f439973dSWarner Losh                               of the handle buffer. On output,
205*f439973dSWarner Losh                               the length of the handle buffer
206*f439973dSWarner Losh                               that is required for the handles found.
207*f439973dSWarner Losh 
208*f439973dSWarner Losh   @param Handle               An array of EFI_HII_HANDLE instances returned.
209*f439973dSWarner Losh 
210*f439973dSWarner Losh   @retval EFI_SUCCESS           The matching handles are outputted successfully.
211*f439973dSWarner Losh                                 HandleBufferLength is updated with the actual length.
212*f439973dSWarner Losh   @retval EFI_BUFFER_TOO_SMALL  The HandleBufferLength parameter
213*f439973dSWarner Losh                                 indicates that Handle is too
214*f439973dSWarner Losh                                 small to support the number of
215*f439973dSWarner Losh                                 handles. HandleBufferLength is
216*f439973dSWarner Losh                                 updated with a value that will
217*f439973dSWarner Losh                                 enable the data to fit.
218*f439973dSWarner Losh   @retval EFI_NOT_FOUND         No matching handle could be found in database.
219*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER HandleBufferLength was NULL.
220*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER The value referenced by HandleBufferLength was not
221*f439973dSWarner Losh                                 zero and Handle was NULL.
222*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
223*f439973dSWarner Losh                                 PackageGuid is not NULL, PackageType is a EFI_HII_
224*f439973dSWarner Losh                                 PACKAGE_TYPE_GUID but PackageGuid is NULL.
225*f439973dSWarner Losh **/
226*f439973dSWarner Losh typedef
227*f439973dSWarner Losh EFI_STATUS
228*f439973dSWarner Losh (EFIAPI *EFI_HII_DATABASE_LIST_PACKS)(
229*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,
230*f439973dSWarner Losh   IN        UINT8                     PackageType,
231*f439973dSWarner Losh   IN CONST  EFI_GUID                  *PackageGuid,
232*f439973dSWarner Losh   IN OUT    UINTN                     *HandleBufferLength,
233*f439973dSWarner Losh   OUT       EFI_HII_HANDLE            *Handle
234*f439973dSWarner Losh   );
235*f439973dSWarner Losh 
236*f439973dSWarner Losh /**
237*f439973dSWarner Losh 
238*f439973dSWarner Losh   This function will export one or all package lists in the
239*f439973dSWarner Losh   database to a buffer. For each package list exported, this
240*f439973dSWarner Losh   function will call functions registered with EXPORT_PACK and
241*f439973dSWarner Losh   then copy the package list to the buffer. The registered
242*f439973dSWarner Losh   functions may call EFI_HII_DATABASE_PROTOCOL.UpdatePackageList()
243*f439973dSWarner Losh   to modify the package list before it is copied to the buffer. If
244*f439973dSWarner Losh   the specified BufferSize is too small, then the status
245*f439973dSWarner Losh   EFI_OUT_OF_RESOURCES will be returned and the actual package
246*f439973dSWarner Losh   size will be returned in BufferSize.
247*f439973dSWarner Losh 
248*f439973dSWarner Losh   @param This         A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
249*f439973dSWarner Losh 
250*f439973dSWarner Losh 
251*f439973dSWarner Losh   @param Handle       An EFI_HII_HANDLE  that corresponds to the
252*f439973dSWarner Losh                       desired package list in the HII database to
253*f439973dSWarner Losh                       export or NULL to indicate all package lists
254*f439973dSWarner Losh                       should be exported.
255*f439973dSWarner Losh 
256*f439973dSWarner Losh   @param BufferSize   On input, a pointer to the length of the
257*f439973dSWarner Losh                       buffer. On output, the length of the
258*f439973dSWarner Losh                       buffer that is required for the exported
259*f439973dSWarner Losh                       data.
260*f439973dSWarner Losh 
261*f439973dSWarner Losh   @param Buffer       A pointer to a buffer that will contain the
262*f439973dSWarner Losh                       results of the export function.
263*f439973dSWarner Losh 
264*f439973dSWarner Losh 
265*f439973dSWarner Losh   @retval EFI_SUCCESS           Package exported.
266*f439973dSWarner Losh 
267*f439973dSWarner Losh   @retval EFI_OUT_OF_RESOURCES  BufferSize is too small to hold the package.
268*f439973dSWarner Losh 
269*f439973dSWarner Losh   @retval EFI_NOT_FOUND         The specified Handle could not be found in the
270*f439973dSWarner Losh                                 current database.
271*f439973dSWarner Losh 
272*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER BufferSize was NULL.
273*f439973dSWarner Losh 
274*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER The value referenced by BufferSize was not zero
275*f439973dSWarner Losh                                 and Buffer was NULL.
276*f439973dSWarner Losh **/
277*f439973dSWarner Losh typedef
278*f439973dSWarner Losh EFI_STATUS
279*f439973dSWarner Losh (EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS)(
280*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL      *This,
281*f439973dSWarner Losh   IN        EFI_HII_HANDLE                 Handle,
282*f439973dSWarner Losh   IN OUT    UINTN                          *BufferSize,
283*f439973dSWarner Losh   OUT       EFI_HII_PACKAGE_LIST_HEADER    *Buffer
284*f439973dSWarner Losh   );
285*f439973dSWarner Losh 
286*f439973dSWarner Losh /**
287*f439973dSWarner Losh 
288*f439973dSWarner Losh 
289*f439973dSWarner Losh   This function registers a function which will be called when
290*f439973dSWarner Losh   specified actions related to packages of the specified type
291*f439973dSWarner Losh   occur in the HII database. By registering a function, other
292*f439973dSWarner Losh   HII-related drivers are notified when specific package types
293*f439973dSWarner Losh   are added, removed or updated in the HII database. Each driver
294*f439973dSWarner Losh   or application which registers a notification should use
295*f439973dSWarner Losh   EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before
296*f439973dSWarner Losh   exiting.
297*f439973dSWarner Losh 
298*f439973dSWarner Losh 
299*f439973dSWarner Losh   @param This             A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
300*f439973dSWarner Losh 
301*f439973dSWarner Losh   @param PackageType      The package type. See
302*f439973dSWarner Losh                           EFI_HII_PACKAGE_TYPE_x in EFI_HII_PACKAGE_HEADER.
303*f439973dSWarner Losh 
304*f439973dSWarner Losh   @param PackageGuid      If PackageType is
305*f439973dSWarner Losh                           EFI_HII_PACKAGE_TYPE_GUID, then this is
306*f439973dSWarner Losh                           the pointer to the GUID which must match
307*f439973dSWarner Losh                           the Guid field of
308*f439973dSWarner Losh                           EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it
309*f439973dSWarner Losh                           must be NULL.
310*f439973dSWarner Losh 
311*f439973dSWarner Losh   @param PackageNotifyFn  Points to the function to be called
312*f439973dSWarner Losh                           when the event specified by
313*f439973dSWarner Losh                           NotificationType occurs. See
314*f439973dSWarner Losh                           EFI_HII_DATABASE_NOTIFY.
315*f439973dSWarner Losh 
316*f439973dSWarner Losh   @param NotifyType       Describes the types of notification which
317*f439973dSWarner Losh                           this function will be receiving. See
318*f439973dSWarner Losh                           EFI_HII_DATABASE_NOTIFY_TYPE for a
319*f439973dSWarner Losh                           list of types.
320*f439973dSWarner Losh 
321*f439973dSWarner Losh   @param NotifyHandle     Points to the unique handle assigned to
322*f439973dSWarner Losh                           the registered notification. Can be used
323*f439973dSWarner Losh                           in EFI_HII_DATABASE_PROTOCOL.UnregisterPack
324*f439973dSWarner Losh                           to stop notifications.
325*f439973dSWarner Losh 
326*f439973dSWarner Losh 
327*f439973dSWarner Losh   @retval EFI_SUCCESS           Notification registered successfully.
328*f439973dSWarner Losh 
329*f439973dSWarner Losh   @retval EFI_OUT_OF_RESOURCES  Unable to allocate necessary
330*f439973dSWarner Losh                                 data structures.
331*f439973dSWarner Losh 
332*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when
333*f439973dSWarner Losh                                 PackageType is not
334*f439973dSWarner Losh                                 EFI_HII_PACKAGE_TYPE_GUID.
335*f439973dSWarner Losh 
336*f439973dSWarner Losh **/
337*f439973dSWarner Losh typedef
338*f439973dSWarner Losh EFI_STATUS
339*f439973dSWarner Losh (EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY)(
340*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL     *This,
341*f439973dSWarner Losh   IN        UINT8                         PackageType,
342*f439973dSWarner Losh   IN CONST  EFI_GUID                      *PackageGuid,
343*f439973dSWarner Losh   IN        EFI_HII_DATABASE_NOTIFY       PackageNotifyFn,
344*f439973dSWarner Losh   IN        EFI_HII_DATABASE_NOTIFY_TYPE  NotifyType,
345*f439973dSWarner Losh   OUT       EFI_HANDLE                    *NotifyHandle
346*f439973dSWarner Losh   );
347*f439973dSWarner Losh 
348*f439973dSWarner Losh /**
349*f439973dSWarner Losh 
350*f439973dSWarner Losh   Removes the specified HII database package-related notification.
351*f439973dSWarner Losh 
352*f439973dSWarner Losh   @param This                 A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
353*f439973dSWarner Losh 
354*f439973dSWarner Losh   @param NotificationHandle   The handle of the notification
355*f439973dSWarner Losh                               function being unregistered.
356*f439973dSWarner Losh 
357*f439973dSWarner Losh   @retval EFI_SUCCESS   Successsfully unregistered the notification.
358*f439973dSWarner Losh 
359*f439973dSWarner Losh   @retval EFI_NOT_FOUND The incoming notification handle does not exist
360*f439973dSWarner Losh                         in the current hii database.
361*f439973dSWarner Losh 
362*f439973dSWarner Losh **/
363*f439973dSWarner Losh typedef
364*f439973dSWarner Losh EFI_STATUS
365*f439973dSWarner Losh (EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY)(
366*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,
367*f439973dSWarner Losh   IN        EFI_HANDLE                NotificationHandle
368*f439973dSWarner Losh   );
369*f439973dSWarner Losh 
370*f439973dSWarner Losh /**
371*f439973dSWarner Losh 
372*f439973dSWarner Losh   This routine retrieves an array of GUID values for each keyboard
373*f439973dSWarner Losh   layout that was previously registered in the system.
374*f439973dSWarner Losh 
375*f439973dSWarner Losh   @param This                 A pointer to the EFI_HII_PROTOCOL instance.
376*f439973dSWarner Losh 
377*f439973dSWarner Losh   @param KeyGuidBufferLength  On input, a pointer to the length
378*f439973dSWarner Losh                               of the keyboard GUID buffer. On
379*f439973dSWarner Losh                               output, the length of the handle
380*f439973dSWarner Losh                               buffer that is required for the
381*f439973dSWarner Losh                               handles found.
382*f439973dSWarner Losh 
383*f439973dSWarner Losh   @param KeyGuidBuffer        An array of keyboard layout GUID
384*f439973dSWarner Losh                               instances returned.
385*f439973dSWarner Losh 
386*f439973dSWarner Losh   @retval EFI_SUCCESS           KeyGuidBuffer was updated successfully.
387*f439973dSWarner Losh 
388*f439973dSWarner Losh   @retval EFI_BUFFER_TOO_SMALL  The KeyGuidBufferLength
389*f439973dSWarner Losh                                 parameter indicates that
390*f439973dSWarner Losh                                 KeyGuidBuffer is too small to
391*f439973dSWarner Losh                                 support the number of GUIDs.
392*f439973dSWarner Losh                                 KeyGuidBufferLength is updated
393*f439973dSWarner Losh                                 with a value that will enable
394*f439973dSWarner Losh                                 the data to fit.
395*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER The KeyGuidBufferLength is NULL.
396*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER The value referenced by
397*f439973dSWarner Losh                                 KeyGuidBufferLength is not
398*f439973dSWarner Losh                                 zero and KeyGuidBuffer is NULL.
399*f439973dSWarner Losh   @retval EFI_NOT_FOUND         There was no keyboard layout.
400*f439973dSWarner Losh 
401*f439973dSWarner Losh **/
402*f439973dSWarner Losh typedef
403*f439973dSWarner Losh EFI_STATUS
404*f439973dSWarner Losh (EFIAPI *EFI_HII_FIND_KEYBOARD_LAYOUTS)(
405*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,
406*f439973dSWarner Losh   IN OUT    UINT16                    *KeyGuidBufferLength,
407*f439973dSWarner Losh   OUT       EFI_GUID                  *KeyGuidBuffer
408*f439973dSWarner Losh   );
409*f439973dSWarner Losh 
410*f439973dSWarner Losh /**
411*f439973dSWarner Losh 
412*f439973dSWarner Losh   This routine retrieves the requested keyboard layout. The layout
413*f439973dSWarner Losh   is a physical description of the keys on a keyboard, and the
414*f439973dSWarner Losh   character(s) that are associated with a particular set of key
415*f439973dSWarner Losh   strokes.
416*f439973dSWarner Losh 
417*f439973dSWarner Losh   @param This                   A pointer to the EFI_HII_PROTOCOL instance.
418*f439973dSWarner Losh 
419*f439973dSWarner Losh   @param KeyGuid                A pointer to the unique ID associated with a
420*f439973dSWarner Losh                                 given keyboard layout. If KeyGuid is NULL then
421*f439973dSWarner Losh                                 the current layout will be retrieved.
422*f439973dSWarner Losh 
423*f439973dSWarner Losh   @param KeyboardLayoutLength   On input, a pointer to the length of the
424*f439973dSWarner Losh                                 KeyboardLayout buffer.  On output, the length of
425*f439973dSWarner Losh                                 the data placed into KeyboardLayout.
426*f439973dSWarner Losh 
427*f439973dSWarner Losh   @param KeyboardLayout         A pointer to a buffer containing the
428*f439973dSWarner Losh                                 retrieved keyboard layout.
429*f439973dSWarner Losh 
430*f439973dSWarner Losh   @retval EFI_SUCCESS   The keyboard layout was retrieved
431*f439973dSWarner Losh                         successfully.
432*f439973dSWarner Losh 
433*f439973dSWarner Losh   @retval EFI_NOT_FOUND The requested keyboard layout was not found.
434*f439973dSWarner Losh 
435*f439973dSWarner Losh **/
436*f439973dSWarner Losh typedef
437*f439973dSWarner Losh EFI_STATUS
438*f439973dSWarner Losh (EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT)(
439*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,
440*f439973dSWarner Losh   IN CONST  EFI_GUID                  *KeyGuid,
441*f439973dSWarner Losh   IN OUT UINT16                       *KeyboardLayoutLength,
442*f439973dSWarner Losh   OUT       EFI_HII_KEYBOARD_LAYOUT   *KeyboardLayout
443*f439973dSWarner Losh   );
444*f439973dSWarner Losh 
445*f439973dSWarner Losh /**
446*f439973dSWarner Losh 
447*f439973dSWarner Losh   This routine sets the default keyboard layout to the one
448*f439973dSWarner Losh   referenced by KeyGuid. When this routine is called, an event
449*f439973dSWarner Losh   will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
450*f439973dSWarner Losh   group type. This is so that agents which are sensitive to the
451*f439973dSWarner Losh   current keyboard layout being changed can be notified of this
452*f439973dSWarner Losh   change.
453*f439973dSWarner Losh 
454*f439973dSWarner Losh   @param This      A pointer to the EFI_HII_PROTOCOL instance.
455*f439973dSWarner Losh 
456*f439973dSWarner Losh   @param KeyGuid   A pointer to the unique ID associated with a
457*f439973dSWarner Losh                    given keyboard layout.
458*f439973dSWarner Losh 
459*f439973dSWarner Losh   @retval EFI_SUCCESS    The current keyboard layout was successfully set.
460*f439973dSWarner Losh 
461*f439973dSWarner Losh   @retval EFI_NOT_FOUND  The referenced keyboard layout was not
462*f439973dSWarner Losh                          found, so action was taken.
463*f439973dSWarner Losh 
464*f439973dSWarner Losh **/
465*f439973dSWarner Losh typedef
466*f439973dSWarner Losh EFI_STATUS
467*f439973dSWarner Losh (EFIAPI *EFI_HII_SET_KEYBOARD_LAYOUT)(
468*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,
469*f439973dSWarner Losh   IN CONST  EFI_GUID                  *KeyGuid
470*f439973dSWarner Losh   );
471*f439973dSWarner Losh 
472*f439973dSWarner Losh /**
473*f439973dSWarner Losh 
474*f439973dSWarner Losh   Return the EFI handle associated with a package list.
475*f439973dSWarner Losh 
476*f439973dSWarner Losh   @param This               A pointer to the EFI_HII_PROTOCOL instance.
477*f439973dSWarner Losh 
478*f439973dSWarner Losh   @param PackageListHandle  An EFI_HII_HANDLE  that corresponds
479*f439973dSWarner Losh                             to the desired package list in the
480*f439973dSWarner Losh                             HIIdatabase.
481*f439973dSWarner Losh 
482*f439973dSWarner Losh   @param DriverHandle       On return, contains the EFI_HANDLE which
483*f439973dSWarner Losh                             was registered with the package list in
484*f439973dSWarner Losh                             NewPackageList().
485*f439973dSWarner Losh 
486*f439973dSWarner Losh   @retval EFI_SUCCESS            The DriverHandle was returned successfully.
487*f439973dSWarner Losh 
488*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER  The PackageListHandle was not valid.
489*f439973dSWarner Losh 
490*f439973dSWarner Losh **/
491*f439973dSWarner Losh typedef
492*f439973dSWarner Losh EFI_STATUS
493*f439973dSWarner Losh (EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE)(
494*f439973dSWarner Losh   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,
495*f439973dSWarner Losh   IN        EFI_HII_HANDLE             PackageListHandle,
496*f439973dSWarner Losh   OUT       EFI_HANDLE                *DriverHandle
497*f439973dSWarner Losh   );
498*f439973dSWarner Losh 
499*f439973dSWarner Losh ///
500*f439973dSWarner Losh /// Database manager for HII-related data structures.
501*f439973dSWarner Losh ///
502*f439973dSWarner Losh struct _EFI_HII_DATABASE_PROTOCOL {
503*f439973dSWarner Losh   EFI_HII_DATABASE_NEW_PACK             NewPackageList;
504*f439973dSWarner Losh   EFI_HII_DATABASE_REMOVE_PACK          RemovePackageList;
505*f439973dSWarner Losh   EFI_HII_DATABASE_UPDATE_PACK          UpdatePackageList;
506*f439973dSWarner Losh   EFI_HII_DATABASE_LIST_PACKS           ListPackageLists;
507*f439973dSWarner Losh   EFI_HII_DATABASE_EXPORT_PACKS         ExportPackageLists;
508*f439973dSWarner Losh   EFI_HII_DATABASE_REGISTER_NOTIFY      RegisterPackageNotify;
509*f439973dSWarner Losh   EFI_HII_DATABASE_UNREGISTER_NOTIFY    UnregisterPackageNotify;
510*f439973dSWarner Losh   EFI_HII_FIND_KEYBOARD_LAYOUTS         FindKeyboardLayouts;
511*f439973dSWarner Losh   EFI_HII_GET_KEYBOARD_LAYOUT           GetKeyboardLayout;
512*f439973dSWarner Losh   EFI_HII_SET_KEYBOARD_LAYOUT           SetKeyboardLayout;
513*f439973dSWarner Losh   EFI_HII_DATABASE_GET_PACK_HANDLE      GetPackageListHandle;
514*f439973dSWarner Losh };
515*f439973dSWarner Losh 
516*f439973dSWarner Losh extern EFI_GUID  gEfiHiiDatabaseProtocolGuid;
517*f439973dSWarner Losh 
518*f439973dSWarner Losh #endif
519