3 Copyright (c) 2004, 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 The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to custom
19 NV storage devices as well as communication of user selections in a more
20 interactive environment. This protocol should be published by hardware
21 specific drivers which want to export access to custom hardware storage or
22 publish IFR which has a requirement to call back the original driver.
26 #ifndef _FORM_CALLBACK_H_
27 #define _FORM_CALLBACK_H_
29 #include EFI_PROTOCOL_DEFINITION (FormBrowser)
31 #define EFI_FORM_CALLBACK_PROTOCOL_GUID \
33 0xf3e4543d, 0xcf35, 0x6cef, {0x35, 0xc4, 0x4f, 0xe6, 0x34, 0x4d, 0xfc, 0x54} \
37 // Forward reference for pure ANSI compatability
39 typedef struct _EFI_FORM_CALLBACK_PROTOCOL EFI_FORM_CALLBACK_PROTOCOL
;
41 #define RESET_REQUIRED 1 // Flags setting to signify that the callback operation resulted in an eventual
42 // reset to be done upon exit of the browser
44 #define EXIT_REQUIRED 2 // Flags setting to signify that after the processing of the callback results - exit the browser
45 #define SAVE_REQUIRED 4 // Flags setting to signify that after the processing of the callback results - save the NV data
46 #define NV_CHANGED 8 // Flags setting to signify that after the processing of the callback results - turn the NV flag on
47 #define NV_NOT_CHANGED 16 // Flags setting to signify that after the processing of the callback results - turn the NV flag off
50 UINT8 OpCode
; // Likely a string, numeric, or one-of
51 UINT8 Length
; // Length of the EFI_IFR_DATA_ENTRY packet
52 UINT16 Flags
; // Flags settings to determine what behavior is desired from the browser after the callback
53 VOID
*Data
; // The data in the form based on the op-code type - this is not a pointer to the data, the data follows immediately
54 // If the OpCode is a OneOf or Numeric type - Data is a UINT16 value
55 // If the OpCode is a String type - Data is a CHAR16[x] type
56 // If the OpCode is a Checkbox type - Data is a UINT8 value
57 // If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure
62 VOID
*NvRamMap
; // If the flag of the op-code specified retrieval of a copy of the NVRAM map,
63 // this is a pointer to a buffer copy
65 UINT32 EntryCount
; // How many EFI_IFR_DATA_ENTRY entries
66 EFI_IFR_DATA_ENTRY Data
[1]; // The in-line Data entries.
70 EFI_IFR_DATA_ARRAY DataArray
; // Primarily used by those who call back to their drivers and use HII as a repository
71 EFI_IFR_PACKET DataPacket
; // Primarily used by those which do not use HII as a repository
72 CHAR16 String
[1]; // If returning an error - fill the string with null-terminated contents
73 } EFI_HII_CALLBACK_PACKET
;
76 // The following types are currently defined:
80 (EFIAPI
*EFI_NV_READ
) (
81 IN EFI_FORM_CALLBACK_PROTOCOL
* This
,
82 IN CHAR16
*VariableName
,
83 IN EFI_GUID
* VendorGuid
,
84 OUT UINT32
*Attributes OPTIONAL
,
85 IN OUT UINTN
*DataSize
,
91 (EFIAPI
*EFI_NV_WRITE
) (
92 IN EFI_FORM_CALLBACK_PROTOCOL
* This
,
93 IN CHAR16
*VariableName
,
94 IN EFI_GUID
* VendorGuid
,
98 OUT BOOLEAN
*ResetRequired
103 (EFIAPI
*EFI_FORM_CALLBACK
) (
104 IN EFI_FORM_CALLBACK_PROTOCOL
* This
,
106 IN EFI_IFR_DATA_ARRAY
* Data
,
107 OUT EFI_HII_CALLBACK_PACKET
**Packet
110 struct _EFI_FORM_CALLBACK_PROTOCOL
{
112 EFI_NV_WRITE NvWrite
;
113 EFI_FORM_CALLBACK Callback
;
116 extern EFI_GUID gEfiFormCallbackProtocolGuid
;