TianoCore EDK2 master
|
#include "DriverSample.h"
Go to the source code of this file.
Macros | |
#define | DISPLAY_ONLY_MY_ITEM 0x0002 |
Functions | |
VOID | SetArrayData (IN VOID *Array, IN UINT8 Type, IN UINTN Index, IN UINT64 Value) |
EFI_STATUS EFIAPI | NotificationFunction (IN EFI_KEY_DATA *KeyData) |
EFI_STATUS EFIAPI | InternalStartMonitor (VOID) |
EFI_STATUS EFIAPI | InternalStopMonitor (VOID) |
EFI_STATUS | LoadNameValueNames (IN DRIVER_SAMPLE_PRIVATE_DATA *PrivateData) |
EFI_STATUS | GetValueOfNumber (IN EFI_STRING StringPtr, OUT UINT8 **Number, OUT UINTN *Len) |
EFI_STRING | CreateAltCfgString (IN EFI_STRING Result, IN EFI_STRING ConfigHdr, IN UINTN Offset, IN UINTN Width) |
VOID | AppendAltCfgString (IN OUT EFI_STRING *RequestResult, IN EFI_STRING ConfigRequestHdr) |
EFI_STATUS EFIAPI | ExtractConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results) |
EFI_STATUS EFIAPI | RouteConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress) |
EFI_STATUS EFIAPI | DriverCallback (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest) |
EFI_STATUS EFIAPI | DriverSampleInit (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS EFIAPI | DriverSampleUnload (IN EFI_HANDLE ImageHandle) |
Variables | |
CHAR16 | VariableName [] = L"MyIfrNVData" |
CHAR16 | MyEfiVar [] = L"MyEfiVar" |
CHAR16 | MyEfiBitVar [] = L"MyEfiBitVar" |
CHAR16 | MyEfiUnionVar [] = L"MyEfiUnionVar" |
EFI_HANDLE | DriverHandle [2] = { NULL, NULL } |
DRIVER_SAMPLE_PRIVATE_DATA * | mPrivateData = NULL |
EFI_EVENT | mEvent |
HII_VENDOR_DEVICE_PATH | mHiiVendorDevicePath0 |
HII_VENDOR_DEVICE_PATH | mHiiVendorDevicePath1 |
This is an example of how a driver might export data to the HII protocol to be later utilized by the Setup Protocol
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DriverSample.c.
#define DISPLAY_ONLY_MY_ITEM 0x0002 |
Definition at line 12 of file DriverSample.c.
Check whether need to add the altcfg string. if need to add, add the altcfg string.
RequestResult | The request result string. |
ConfigRequestHdr | The request head info. <ConfigHdr> format. |
Definition at line 459 of file DriverSample.c.
EFI_STRING CreateAltCfgString | ( | IN EFI_STRING | Result, |
IN EFI_STRING | ConfigHdr, | ||
IN UINTN | Offset, | ||
IN UINTN | Width | ||
) |
Create altcfg string.
Result | The request result string. |
ConfigHdr | The request head info. <ConfigHdr> format. |
Offset | The offset of the parameter int he structure. |
Width | The width of the parameter. |
The | string with altcfg info append at the end. |
Definition at line 381 of file DriverSample.c.
EFI_STATUS EFIAPI DriverCallback | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN EFI_BROWSER_ACTION | Action, | ||
IN EFI_QUESTION_ID | QuestionId, | ||
IN UINT8 | Type, | ||
IN EFI_IFR_TYPE_VALUE * | Value, | ||
OUT EFI_BROWSER_ACTION_REQUEST * | ActionRequest | ||
) |
This function processes the results of changes in configuration.
This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
Action | Specifies the type of action taken by the browser. |
QuestionId | A unique value which is sent to the original exporting driver so that it can identify the type of data to expect. |
Type | The type of value for the question. |
Value | A pointer to the data being sent to the original exporting driver. |
ActionRequest | On return, points to the action requested by the callback function. |
EFI_SUCCESS | The callback successfully handled the action. |
EFI_OUT_OF_RESOURCES | Not enough storage is available to hold the variable and its data. |
EFI_DEVICE_ERROR | The variable could not be saved. |
EFI_UNSUPPORTED | The specified Action is not supported by the callback. |
Definition at line 1112 of file DriverSample.c.
EFI_STATUS EFIAPI DriverSampleInit | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Main entry for this driver.
ImageHandle | Image handle this driver. |
SystemTable | Pointer to SystemTable. |
EFI_SUCESS | This function always complete successfully. |
Definition at line 1754 of file DriverSample.c.
EFI_STATUS EFIAPI DriverSampleUnload | ( | IN EFI_HANDLE | ImageHandle | ) |
Unloads the application and its installed protocol.
[in] | ImageHandle | Handle that identifies the image to be unloaded. |
EFI_SUCCESS | The image has been unloaded. |
Definition at line 2252 of file DriverSample.c.
EFI_STATUS EFIAPI ExtractConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Request, | ||
OUT EFI_STRING * | Progress, | ||
OUT EFI_STRING * | Results | ||
) |
This function allows a caller to extract the current configuration for one or more named elements from the target driver.
This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
Request | A null-terminated Unicode string in <ConfigRequest> format. |
Progress | On return, points to a character in the Request string. Points to the string's null terminator if request was successful. Points to the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) if the request was not successful. |
Results | A null-terminated Unicode string in <ConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function. |
EFI_SUCCESS | The Results is filled with the requested values. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the results. |
EFI_INVALID_PARAMETER | Request is illegal syntax, or unknown name. |
EFI_NOT_FOUND | Routing data doesn't match any storage in this driver. |
Definition at line 590 of file DriverSample.c.
EFI_STATUS GetValueOfNumber | ( | IN EFI_STRING | StringPtr, |
OUT UINT8 ** | Number, | ||
OUT UINTN * | Len | ||
) |
Get the value of <Number> in <BlockConfig> format, i.e. the value of OFFSET or WIDTH or VALUE. <BlockConfig> ::= 'OFFSET='<Number>&'WIDTH='<Number>&'VALUE'=<Number>
This is a internal function.
StringPtr | String in <BlockConfig> format and points to the first character of <Number>. |
Number | The output value. Caller takes the responsibility to free memory. |
Len | Length of the <Number>, in characters. |
EFI_OUT_OF_RESOURCES | Insufficient resources to store neccessary structures. |
EFI_SUCCESS | Value of <Number> is outputted in Number successfully. |
Definition at line 301 of file DriverSample.c.
EFI_STATUS EFIAPI InternalStartMonitor | ( | VOID | ) |
Function to start monitoring for CTRL-C using SimpleTextInputEx.
EFI_SUCCESS | The feature is enabled. |
EFI_OUT_OF_RESOURCES | There is not enough mnemory available. |
Definition at line 134 of file DriverSample.c.
EFI_STATUS EFIAPI InternalStopMonitor | ( | VOID | ) |
Function to stop monitoring for CTRL-C using SimpleTextInputEx.
EFI_SUCCESS | The feature is enabled. |
EFI_OUT_OF_RESOURCES | There is not enough mnemory available. |
Definition at line 195 of file DriverSample.c.
EFI_STATUS LoadNameValueNames | ( | IN DRIVER_SAMPLE_PRIVATE_DATA * | PrivateData | ) |
Update names of Name/Value storage to current language.
PrivateData | Points to the driver private data. |
EFI_SUCCESS | All names are successfully updated. |
EFI_NOT_FOUND | Failed to get Name from HII database. |
Definition at line 258 of file DriverSample.c.
EFI_STATUS EFIAPI NotificationFunction | ( | IN EFI_KEY_DATA * | KeyData | ) |
Notification function for keystrokes.
[in] | KeyData | The key that was pressed. |
EFI_SUCCESS | The operation was successful. |
Definition at line 117 of file DriverSample.c.
EFI_STATUS EFIAPI RouteConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Configuration, | ||
OUT EFI_STRING * | Progress | ||
) |
This function processes the results of changes in configuration.
This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
Configuration | A null-terminated Unicode string in <ConfigResp> format. |
Progress | A pointer to a string filled in with the offset of the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) or the terminating NULL if all was successful. |
EFI_SUCCESS | The Results is processed successfully. |
EFI_INVALID_PARAMETER | Configuration is NULL. |
EFI_NOT_FOUND | Routing data doesn't match any storage in this driver. |
EFI_DEVICE_ERROR | If value is 44, return error for testing. |
Definition at line 866 of file DriverSample.c.
Set value of a data element in an Array by its Index.
Array | The data array. |
Type | Type of the data in this array. |
Index | Zero based index for data in this array. |
Value | The value to be set. |
Definition at line 77 of file DriverSample.c.
EFI_HANDLE DriverHandle[2] = { NULL, NULL } |
Definition at line 19 of file DriverSample.c.
EFI_EVENT mEvent |
Definition at line 21 of file DriverSample.c.
HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath0 |
Definition at line 23 of file DriverSample.c.
HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath1 |
Definition at line 45 of file DriverSample.c.
DRIVER_SAMPLE_PRIVATE_DATA* mPrivateData = NULL |
Definition at line 20 of file DriverSample.c.
CHAR16 MyEfiBitVar[] = L"MyEfiBitVar" |
Definition at line 16 of file DriverSample.c.
CHAR16 MyEfiUnionVar[] = L"MyEfiUnionVar" |
Definition at line 17 of file DriverSample.c.
CHAR16 MyEfiVar[] = L"MyEfiVar" |
Definition at line 15 of file DriverSample.c.
CHAR16 VariableName[] = L"MyIfrNVData" |
Definition at line 14 of file DriverSample.c.