TianoCore EDK2 master
Loading...
Searching...
No Matches
RedfishPlatformConfigImpl.h
Go to the documentation of this file.
1
12#ifndef EDKII_REDFISH_PLATFORM_CONFIG_IMPL_H_
13#define EDKII_REDFISH_PLATFORM_CONFIG_IMPL_H_
14
15#include <Uefi.h>
16#include <RedfishCommon.h>
17
18//
19// Libraries
20//
21#include <Library/BaseLib.h>
23#include <Library/DebugLib.h>
26#include <Library/HiiLib.h>
29#include <Library/UefiLib.h>
30
31#define ENGLISH_LANGUAGE_CODE "en-US"
32#define X_UEFI_SCHEMA_PREFIX "x-UEFI-redfish-"
33
34#define MAX_X_UEFI_REDFISH_STRING_SIZE (128 * 2)// 128 character in UCS.
35
37
38//
39// Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
40//
41typedef struct {
42 LIST_ENTRY Link;
43 EFI_HII_HANDLE HiiHandle;
44 BOOLEAN IsDeleted;
46
47#define REDFISH_PLATFORM_CONFIG_PENDING_LIST_FROM_LINK(a) BASE_CR (a, REDFISH_PLATFORM_CONFIG_PENDING_LIST, Link)
48
49typedef struct {
50 UINTN Count; // Number of schema in list
51 CHAR8 **SchemaList; // Schema list
53
54// Defines the number of elements in array
55#define X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER 1024
56
57//
58// Definition of x-UEFI-redfish string element.
59//
60typedef struct {
61 EFI_STRING_ID StringId;
62 CHAR16 *UcsString;
64
65//
66// Discrete string array buffer, each has X_UEFI_REDFISH_STRING_ARRAY_NUMBER element.
67//
68typedef struct {
69 LIST_ENTRY NextArray;
70 REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT *ArrayEntryAddress;
72
73//
74// x-UEFI-redfish string database, x-UEFI-redfish language based.
75//
76typedef struct {
77 LIST_ENTRY NextXuefiRedfishLanguage; // Link to the next suppoted x-UEFI-Redfish language.
78 CHAR8 *XuefiRedfishLanguage; // x-UEFI-redfish language.
79 UINTN StringsArrayBlocks; // Number of the array blocks that accommodate X_UEFI_REDFISH_STRING_ARRAY_NUMBER
80 // elements in each.
81 LIST_ENTRY XuefiRedfishStringArrays; // Link entry of x-UEFI-redfish string array.
83
84//
85// Definition of REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE
86//
87typedef struct {
88 LIST_ENTRY Link;
89 HII_FORMSET *HiiFormSet; // Pointer to HII formset data.
90 EFI_GUID Guid; // Formset GUID.
91 EFI_HII_HANDLE HiiHandle; // Hii Handle of this formset.
92 EFI_HII_PACKAGE_LIST_HEADER *HiiPackageListHeader; // Hii Package list header.
93 LIST_ENTRY HiiFormList; // Form list that keep form data under this formset.
94 CHAR16 *DevicePathStr; // Device path of this formset.
95 REDFISH_PLATFORM_CONFIG_SCHEMA SupportedSchema; // Schema that is supported in this formset.
96 LIST_ENTRY XuefiRedfishStringDatabase; // x-UEFI-redfish string/Id data base;
98
99#define REDFISH_PLATFORM_CONFIG_FORMSET_FROM_LINK(a) BASE_CR (a, REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE, Link)
100
101//
102// Definition of REDFISH_PLATFORM_CONFIG_FORM_PRIVATE
103//
104typedef struct {
105 LIST_ENTRY Link;
106 UINT16 Id; // Form ID.
107 EFI_STRING_ID Title; // String token of form title.
109 HII_FORM *HiiForm; // Pointer to HII form data.
110 LIST_ENTRY StatementList; // Statement list that keep statement under this form.
111 BOOLEAN Suppressed; // Form is suppressed
113
114#define REDFISH_PLATFORM_CONFIG_FORM_FROM_LINK(a) BASE_CR (a, REDFISH_PLATFORM_CONFIG_FORM_PRIVATE, Link)
115
116//
117// Definition of REDFISH_PLATFORM_CONFIG_STATEMENT_DATA
118//
119typedef struct {
120 UINT64 NumMinimum;
121 UINT64 NumMaximum;
122 UINT64 NumStep;
123 UINT8 StrMinSize;
124 UINT8 StrMaxSize;
126
127//
128// Definition of REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
129//
131 LIST_ENTRY Link;
133 HII_STATEMENT *HiiStatement; // Pointer to HII statement data.
134 EFI_QUESTION_ID QuestionId; // Question ID of this statement.
135 EFI_STRING_ID Description; // String token of this question.
136 CHAR16 *XuefiRedfishStr; // x-UEFI-redfish string of this question.
137 EFI_STRING_ID Help; // String token of help message.
138 UINT8 Flags; // The statement flag.
139 REDFISH_PLATFORM_CONFIG_STATEMENT_DATA StatementData; // The max/min for statement value.
140 BOOLEAN Suppressed; // Statement is suppressed.
141 BOOLEAN GrayedOut; // Statement is GrayedOut.
142};
143
144#define REDFISH_PLATFORM_CONFIG_STATEMENT_FROM_LINK(a) BASE_CR (a, REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE, Link)
145
146//
147// Definition of REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE_REF
148//
149typedef struct {
150 LIST_ENTRY Link;
153
154#define REDFISH_PLATFORM_CONFIG_STATEMENT_REF_FROM_LINK(a) BASE_CR (a, REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE_REF, Link)
155
156//
157// Definition of REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE_LIST
158//
159typedef struct {
160 LIST_ENTRY StatementList; // List of REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE_REF
161 UINTN Count;
163
175 IN LIST_ENTRY *FormsetList
176 );
177
189 IN EFI_HII_HANDLE *HiiHandle,
190 OUT LIST_ENTRY *FormsetList
191 );
192
207 IN EFI_HII_HANDLE *HiiHandle,
208 IN LIST_ENTRY *PendingList
209 );
210
225 IN EFI_HII_HANDLE *HiiHandle,
226 IN LIST_ENTRY *PendingList
227 );
228
241 IN LIST_ENTRY *FormsetList,
242 IN CHAR8 *Schema,
243 IN EFI_STRING ConfigureLang
244 );
245
265 IN EFI_REGULAR_EXPRESSION_PROTOCOL *RegularExpressionProtocol,
266 IN LIST_ENTRY *FormsetList,
267 IN CHAR8 *Schema,
268 IN EFI_STRING Pattern,
270 );
271
286 IN LIST_ENTRY *FormsetList,
287 IN LIST_ENTRY *PendingList
288 );
289
302 IN EFI_STRING_ID StringId,
303 IN EFI_HII_HANDLE HiiHandle
304 );
305
323EFI_STRING
325 IN EFI_HII_HANDLE HiiHandle,
326 IN CHAR8 *Language,
327 IN EFI_STRING_ID StringId
328 );
329
347CHAR8 *
349 IN EFI_HII_HANDLE HiiHandle,
350 IN CHAR8 *Language,
351 IN EFI_STRING_ID StringId
352 );
353
367CHAR8 *
369 IN EFI_HII_HANDLE HiiHandle,
370 IN EFI_STRING_ID StringId
371 );
372
385 );
386
398UINTN
399EFIAPI
400HiiStrLen (
401 IN CONST CHAR16 *String
402 );
403
415UINTN
416EFIAPI
418 IN CONST CHAR16 *String
419 );
420
430BOOLEAN
432 IN UINT64 DebugProp
433 );
434
444BOOLEAN
446 IN UINT64 FeatureProp
447 );
448
449#endif
UINT64 UINTN
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE * GetStatementPrivateByConfigureLang(IN LIST_ENTRY *FormsetList, IN CHAR8 *Schema, IN EFI_STRING ConfigureLang)
EFI_STATUS NotifyFormsetUpdate(IN EFI_HII_HANDLE *HiiHandle, IN LIST_ENTRY *PendingList)
EFI_STATUS LoadFormsetList(IN EFI_HII_HANDLE *HiiHandle, OUT LIST_ENTRY *FormsetList)
EFI_STATUS ReleaseStatementList(IN REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE_LIST *StatementList)
UINTN EFIAPI HiiStrSize(IN CONST CHAR16 *String)
EFI_STATUS ProcessPendingList(IN LIST_ENTRY *FormsetList, IN LIST_ENTRY *PendingList)
EFI_STATUS NotifyFormsetDeleted(IN EFI_HII_HANDLE *HiiHandle, IN LIST_ENTRY *PendingList)
BOOLEAN RedfishPlatformConfigFeatureProp(IN UINT64 FeatureProp)
EFI_STATUS GetStatementPrivateByConfigureLangRegex(IN EFI_REGULAR_EXPRESSION_PROTOCOL *RegularExpressionProtocol, IN LIST_ENTRY *FormsetList, IN CHAR8 *Schema, IN EFI_STRING Pattern, OUT REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE_LIST *StatementList)
CHAR8 * HiiGetEnglishAsciiString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId)
EFI_STRING HiiGetRedfishString(IN EFI_HII_HANDLE HiiHandle, IN CHAR8 *Language, IN EFI_STRING_ID StringId)
UINTN EFIAPI HiiStrLen(IN CONST CHAR16 *String)
EFI_STATUS HiiDeleteString(IN EFI_STRING_ID StringId, IN EFI_HII_HANDLE HiiHandle)
BOOLEAN RedfishPlatformConfigDebugProp(IN UINT64 DebugProp)
CHAR8 * HiiGetRedfishAsciiString(IN EFI_HII_HANDLE HiiHandle, IN CHAR8 *Language, IN EFI_STRING_ID StringId)
EFI_STATUS ReleaseFormsetList(IN LIST_ENTRY *FormsetList)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HII_HANDLE
Definition: Base.h:213