3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. 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 EFI_FORWARD_DECLARATION (EFI_FORM_CALLBACK_PROTOCOL
);
41 typedef struct _EFI_FORM_CALLBACK_PROTOCOL EFI_FORM_CALLBACK_PROTOCOL
;
43 #define RESET_REQUIRED 1 // Flags setting to signify that the callback operation resulted in an eventual
44 // reset to be done upon exit of the browser
46 #define EXIT_REQUIRED 2 // Flags setting to signify that after the processing of the callback results - exit the browser
47 #define SAVE_REQUIRED 4 // Flags setting to signify that after the processing of the callback results - save the NV data
48 #define NV_CHANGED 8 // Flags setting to signify that after the processing of the callback results - turn the NV flag on
49 #define NV_NOT_CHANGED 16 // Flags setting to signify that after the processing of the callback results - turn the NV flag off
52 UINT8 OpCode
; // Likely a string, numeric, or one-of
53 UINT8 Length
; // Length of the EFI_IFR_DATA_ENTRY packet
54 UINT16 Flags
; // Flags settings to determine what behavior is desired from the browser after the callback
55 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
56 // If the OpCode is a OneOf or Numeric type - Data is a UINT16 value
57 // If the OpCode is a String type - Data is a CHAR16[x] type
58 // If the OpCode is a Checkbox type - Data is a UINT8 value
59 // If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure
64 VOID
*NvRamMap
; // If the flag of the op-code specified retrieval of a copy of the NVRAM map,
65 // this is a pointer to a buffer copy
67 UINT32 EntryCount
; // How many EFI_IFR_DATA_ENTRY entries
68 EFI_IFR_DATA_ENTRY Data
[1]; // The in-line Data entries.
72 EFI_IFR_DATA_ARRAY DataArray
; // Primarily used by those who call back to their drivers and use HII as a repository
73 EFI_IFR_PACKET DataPacket
; // Primarily used by those which do not use HII as a repository
74 CHAR16 String
[1]; // If returning an error - fill the string with null-terminated contents
75 } EFI_HII_CALLBACK_PACKET
;
78 // The following types are currently defined:
82 (EFIAPI
*EFI_NV_READ
) (
83 IN EFI_FORM_CALLBACK_PROTOCOL
* This
,
84 IN CHAR16
*VariableName
,
85 IN EFI_GUID
* VendorGuid
,
86 OUT UINT32
*Attributes OPTIONAL
,
87 IN OUT UINTN
*DataSize
,
93 (EFIAPI
*EFI_NV_WRITE
) (
94 IN EFI_FORM_CALLBACK_PROTOCOL
* This
,
95 IN CHAR16
*VariableName
,
96 IN EFI_GUID
* VendorGuid
,
100 OUT BOOLEAN
*ResetRequired
105 (EFIAPI
*EFI_FORM_CALLBACK
) (
106 IN EFI_FORM_CALLBACK_PROTOCOL
* This
,
108 IN EFI_IFR_DATA_ARRAY
* Data
,
109 OUT EFI_HII_CALLBACK_PACKET
**Packet
112 typedef struct _EFI_FORM_CALLBACK_PROTOCOL
{
114 EFI_NV_WRITE NvWrite
;
115 EFI_FORM_CALLBACK Callback
;
116 } EFI_FORM_CALLBACK_PROTOCOL
;
118 extern EFI_GUID gEfiFormCallbackProtocolGuid
;