]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
f57387d5 HT |
3 | Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
3eb9473e | 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 | FormCallback.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to custom \r | |
19 | NV storage devices as well as communication of user selections in a more \r | |
20 | interactive environment. This protocol should be published by hardware \r | |
21 | specific drivers which want to export access to custom hardware storage or \r | |
22 | publish IFR which has a requirement to call back the original driver.\r | |
23 | \r | |
24 | --*/\r | |
25 | \r | |
26 | #ifndef _FORM_CALLBACK_H_\r | |
27 | #define _FORM_CALLBACK_H_\r | |
28 | \r | |
29 | #include EFI_PROTOCOL_DEFINITION (FormBrowser)\r | |
30 | \r | |
31 | #define EFI_FORM_CALLBACK_PROTOCOL_GUID \\r | |
32 | { \\r | |
7ccf38a3 | 33 | 0xf3e4543d, 0xcf35, 0x6cef, {0x35, 0xc4, 0x4f, 0xe6, 0x34, 0x4d, 0xfc, 0x54} \\r |
3eb9473e | 34 | }\r |
35 | \r | |
36 | //\r | |
37 | // Forward reference for pure ANSI compatability\r | |
38 | //\r | |
3eb9473e | 39 | typedef struct _EFI_FORM_CALLBACK_PROTOCOL EFI_FORM_CALLBACK_PROTOCOL;\r |
40 | \r | |
41 | #define RESET_REQUIRED 1 // Flags setting to signify that the callback operation resulted in an eventual\r | |
42 | // reset to be done upon exit of the browser\r | |
43 | //\r | |
44 | #define EXIT_REQUIRED 2 // Flags setting to signify that after the processing of the callback results - exit the browser\r | |
45 | #define SAVE_REQUIRED 4 // Flags setting to signify that after the processing of the callback results - save the NV data\r | |
46 | #define NV_CHANGED 8 // Flags setting to signify that after the processing of the callback results - turn the NV flag on\r | |
47 | #define NV_NOT_CHANGED 16 // Flags setting to signify that after the processing of the callback results - turn the NV flag off\r | |
48 | #pragma pack(1)\r | |
49 | typedef struct {\r | |
50 | UINT8 OpCode; // Likely a string, numeric, or one-of\r | |
51 | UINT8 Length; // Length of the EFI_IFR_DATA_ENTRY packet\r | |
52 | UINT16 Flags; // Flags settings to determine what behavior is desired from the browser after the callback\r | |
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\r | |
54 | // If the OpCode is a OneOf or Numeric type - Data is a UINT16 value\r | |
55 | // If the OpCode is a String type - Data is a CHAR16[x] type\r | |
56 | // If the OpCode is a Checkbox type - Data is a UINT8 value\r | |
57 | // If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure\r | |
58 | //\r | |
59 | } EFI_IFR_DATA_ENTRY;\r | |
60 | \r | |
61 | typedef struct {\r | |
62 | VOID *NvRamMap; // If the flag of the op-code specified retrieval of a copy of the NVRAM map,\r | |
63 | // this is a pointer to a buffer copy\r | |
64 | //\r | |
65 | UINT32 EntryCount; // How many EFI_IFR_DATA_ENTRY entries\r | |
66 | EFI_IFR_DATA_ENTRY Data[1]; // The in-line Data entries.\r | |
67 | } EFI_IFR_DATA_ARRAY;\r | |
68 | \r | |
69 | typedef union {\r | |
70 | EFI_IFR_DATA_ARRAY DataArray; // Primarily used by those who call back to their drivers and use HII as a repository\r | |
71 | EFI_IFR_PACKET DataPacket; // Primarily used by those which do not use HII as a repository\r | |
72 | CHAR16 String[1]; // If returning an error - fill the string with null-terminated contents\r | |
73 | } EFI_HII_CALLBACK_PACKET;\r | |
74 | #pragma pack()\r | |
75 | //\r | |
76 | // The following types are currently defined:\r | |
77 | //\r | |
78 | typedef\r | |
79 | EFI_STATUS\r | |
80 | (EFIAPI *EFI_NV_READ) (\r | |
81 | IN EFI_FORM_CALLBACK_PROTOCOL * This,\r | |
82 | IN CHAR16 *VariableName,\r | |
83 | IN EFI_GUID * VendorGuid,\r | |
84 | OUT UINT32 *Attributes OPTIONAL,\r | |
85 | IN OUT UINTN *DataSize,\r | |
86 | OUT VOID *Buffer\r | |
87 | );\r | |
88 | \r | |
89 | typedef\r | |
90 | EFI_STATUS\r | |
91 | (EFIAPI *EFI_NV_WRITE) (\r | |
92 | IN EFI_FORM_CALLBACK_PROTOCOL * This,\r | |
93 | IN CHAR16 *VariableName,\r | |
94 | IN EFI_GUID * VendorGuid,\r | |
95 | IN UINT32 Attributes,\r | |
96 | IN UINTN DataSize,\r | |
97 | IN VOID *Buffer,\r | |
98 | OUT BOOLEAN *ResetRequired\r | |
99 | );\r | |
100 | \r | |
101 | typedef\r | |
102 | EFI_STATUS\r | |
103 | (EFIAPI *EFI_FORM_CALLBACK) (\r | |
104 | IN EFI_FORM_CALLBACK_PROTOCOL * This,\r | |
105 | IN UINT16 KeyValue,\r | |
106 | IN EFI_IFR_DATA_ARRAY * Data,\r | |
107 | OUT EFI_HII_CALLBACK_PACKET **Packet\r | |
108 | );\r | |
109 | \r | |
5d46191d | 110 | struct _EFI_FORM_CALLBACK_PROTOCOL {\r |
3eb9473e | 111 | EFI_NV_READ NvRead;\r |
112 | EFI_NV_WRITE NvWrite;\r | |
113 | EFI_FORM_CALLBACK Callback;\r | |
5d46191d | 114 | };\r |
3eb9473e | 115 | \r |
116 | extern EFI_GUID gEfiFormCallbackProtocolGuid;\r | |
117 | \r | |
118 | #endif\r |