TianoCore EDK2 master
Loading...
Searching...
No Matches
WifiConnectionMgrHiiConfigAccess.c File Reference

Go to the source code of this file.

Macros

#define RSSI_TO_SIGNAL_STRENGTH_BAR(Rssi)   mSignalStrengthBar[((Rssi + 19)/20)]
 
#define NET_LIST_FOR_EACH_FROM_NODE(Entry, Node, ListHead)    for(Entry = Node->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)
 

Functions

EFI_STATUS WifiMgrCreateOpCode (IN UINT16 StartLabelNumber, OUT VOID **StartOpCodeHandle, OUT VOID **EndOpCodeHandle)
 
EFI_STATUS WifiMgrShowNicList (IN WIFI_MGR_PRIVATE_DATA *Private)
 
CHAR16 * WifiMgrGetStrAKMList (IN WIFI_MGR_NETWORK_PROFILE *Profile)
 
CHAR16 * WifiMgrGetStrCipherList (IN WIFI_MGR_NETWORK_PROFILE *Profile)
 
EFI_STATUS WifiMgrRefreshNetworkList (IN WIFI_MGR_PRIVATE_DATA *Private, OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData)
 
EFI_STATUS WifiMgrRefreshHiddenList (IN WIFI_MGR_PRIVATE_DATA *Private)
 
EFI_STATUS WifiMgrSelectNic (IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_QUESTION_ID KeyValue)
 
VOID WifiMgrCleanUserInput (IN WIFI_MGR_PRIVATE_DATA *Private)
 
EFI_STATUS WifiMgrUserSelectProfileToConnect (IN WIFI_MGR_PRIVATE_DATA *Private, IN UINT32 ProfileIndex)
 
EFI_STATUS WifiMgrRecordPassword (IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_STRING_ID StringId, IN CHAR16 *StringBuffer, IN UINTN StringBufferLen)
 
VOID WifiMgrUpdateConnectMessage (IN WIFI_MGR_DEVICE_DATA *Nic, IN BOOLEAN ConnectStateChanged, IN EFI_STRING ConnectStatusMessage)
 
EFI_STATUS WifiMgrConvertConfigDataToIfrNvData (IN WIFI_MGR_PRIVATE_DATA *Private, OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData)
 
EFI_STATUS WifiMgrConvertIfrNvDataToConfigData (IN WIFI_MGR_PRIVATE_DATA *Private, IN OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData)
 
EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessExtractConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
 
EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessRouteConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
 
EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessCallback (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN OUT EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
 
EFI_STATUS WifiMgrDxeConfigFormInit (WIFI_MGR_PRIVATE_DATA *Private)
 
EFI_STATUS WifiMgrDxeConfigFormUnload (WIFI_MGR_PRIVATE_DATA *Private)
 

Variables

CHAR16 mVendorStorageName [] = L"WIFI_MANAGER_IFR_NVDATA"
 
HII_VENDOR_DEVICE_PATH mWifiMgrDxeHiiVendorDevicePath
 
GLOBAL_REMOVE_IF_UNREFERENCED EFI_HII_CONFIG_ACCESS_PROTOCOL gWifiMgrDxeHiiConfigAccess
 
CHAR16 * mSecurityType []
 
CHAR16 * mSignalStrengthBar []
 
EFI_GUID gWifiConfigFormSetGuid
 

Detailed Description

The Hii functions for WiFi Connection Manager.

Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file WifiConnectionMgrHiiConfigAccess.c.

Macro Definition Documentation

◆ NET_LIST_FOR_EACH_FROM_NODE

#define NET_LIST_FOR_EACH_FROM_NODE (   Entry,
  Node,
  ListHead 
)     for(Entry = Node->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)

Definition at line 69 of file WifiConnectionMgrHiiConfigAccess.c.

◆ RSSI_TO_SIGNAL_STRENGTH_BAR

#define RSSI_TO_SIGNAL_STRENGTH_BAR (   Rssi)    mSignalStrengthBar[((Rssi + 19)/20)]

Definition at line 67 of file WifiConnectionMgrHiiConfigAccess.c.

Function Documentation

◆ WifiMgrCleanUserInput()

VOID WifiMgrCleanUserInput ( IN WIFI_MGR_PRIVATE_DATA Private)

Restore the NV data to be default.

Parameters
[in]PrivateThe pointer to the global private data structure.
[out]IfrNvDataThe IFR NV data.

Definition at line 814 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrConvertConfigDataToIfrNvData()

EFI_STATUS WifiMgrConvertConfigDataToIfrNvData ( IN WIFI_MGR_PRIVATE_DATA Private,
OUT WIFI_MANAGER_IFR_NVDATA IfrNvData 
)

Convert the driver configuration data into the IFR data.

Parameters
[in]PrivateThe pointer to the global private data structure.
[out]IfrNvDataThe IFR NV data.
Return values
EFI_SUCCESSThe operation is completed successfully.

Definition at line 1024 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrConvertIfrNvDataToConfigData()

EFI_STATUS WifiMgrConvertIfrNvDataToConfigData ( IN WIFI_MGR_PRIVATE_DATA Private,
IN OUT WIFI_MANAGER_IFR_NVDATA IfrNvData 
)

Convert the IFR data into the driver configuration data.

Parameters
[in]PrivateThe pointer to the global private data structure.
[in,out]IfrNvDataThe IFR NV data.
Return values
EFI_SUCCESSThe operation is completed successfully.

Definition at line 1053 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrCreateOpCode()

EFI_STATUS WifiMgrCreateOpCode ( IN UINT16  StartLabelNumber,
OUT VOID **  StartOpCodeHandle,
OUT VOID **  EndOpCodeHandle 
)

Create Hii Extend Label OpCode as the start opcode and end opcode. The caller is responsible for freeing the OpCode with HiiFreeOpCodeHandle().

Parameters
[in]StartLabelNumberThe number of start label.
[out]StartOpCodeHandlePoints to the start opcode handle.
[out]EndOpCodeHandlePoints to the end opcode handle.
Return values
EFI_OUT_OF_RESOURCESDo not have sufficient resource to finish this operation.
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_SUCCESSThe operation is completed successfully.
OtherErrors Returned errors when updating the HII form.

Definition at line 90 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrDxeConfigFormInit()

EFI_STATUS WifiMgrDxeConfigFormInit ( WIFI_MGR_PRIVATE_DATA Private)

Initialize the WiFi configuration form.

Parameters
[in]PrivateThe pointer to the global private data structure.
Return values
EFI_SUCCESSThe configuration form is initialized.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_INVALID_PARAMETERAny input parameter is invalid.
OtherErros Returned Errors when installing protocols.

Definition at line 1975 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrDxeConfigFormUnload()

EFI_STATUS WifiMgrDxeConfigFormUnload ( WIFI_MGR_PRIVATE_DATA Private)

Unload the WiFi configuration form.

Parameters
[in]PrivateThe pointer to the global private data structure.
Return values
EFI_SUCCESSThe configuration form is unloaded successfully.
EFI_INVALID_PARAMETERAny input parameter is invalid.
OtherErrors Returned Erros when uninstalling protocols.

Definition at line 2045 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrDxeHiiConfigAccessCallback()

EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessCallback ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN EFI_BROWSER_ACTION  Action,
IN EFI_QUESTION_ID  QuestionId,
IN UINT8  Type,
IN OUT EFI_IFR_TYPE_VALUE Value,
OUT EFI_BROWSER_ACTION_REQUEST *  ActionRequest 
)

This function is called to provide results data to the driver. This data consists of a unique key that is used to identify which data is either being passed back or being asked for.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
ActionSpecifies the type of action taken by the browser.
QuestionIdA unique value which is sent to the original exporting driver so that it can identify the type of data to expect. The format of the data tends to vary based on the opcode that generated the callback.
TypeThe type of value for the question.
ValueA pointer to the data being sent to the original exporting driver.
ActionRequestOn return, points to the action requested by the callback function.
Return values
EFI_SUCCESSThe callback successfully handled the action.
EFI_OUT_OF_RESOURCESNot enough storage is available to hold the variable and its data.
EFI_DEVICE_ERRORThe variable could not be saved.
EFI_UNSUPPORTEDThe specified Action is not supported by the callback.

Definition at line 1361 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrDxeHiiConfigAccessExtractConfig()

EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessExtractConfig ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN CONST EFI_STRING  Request,
OUT EFI_STRING *  Progress,
OUT EFI_STRING *  Results 
)

This function allows the caller to request the current configuration for one or more named elements. The resulting string is in <ConfigAltResp> format. Any and all alternative configuration strings shall also be appended to the end of the current configuration string. If they are, they must appear after the current configuration. They must contain the same routing (GUID, NAME, PATH) as the current configuration string. They must have an additional description indicating the type of alternative configuration the string represents, "ALTCFG=<StringToken>". That <StringToken> (when converted from Hex UNICODE to binary) is a reference to a string in the associated string pack.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
RequestA null-terminated Unicode string in <ConfigRequest> format. Note that this includes the routing information as well as the configurable name / value pairs. It is invalid for this string to be in <MultiConfigRequest> format. If a NULL is passed in for the Request field, all of the settings being abstracted by this function will be returned in the Results field. In addition, if a ConfigHdr is passed in with no request elements, all of the settings being abstracted for that particular ConfigHdr reference will be returned in the Results Field.
ProgressOn 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.
ResultsA null-terminated Unicode string in <MultiConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function.
Return values
EFI_SUCCESSThe Results string is filled with the values corresponding to all requested names.
EFI_OUT_OF_RESOURCESNot enough memory to store the parts of the results that must be stored awaiting possible future protocols.
EFI_NOT_FOUNDRouting data doesn't match any known driver. Progress set to the first character in the routing header. Note: There is no requirement that the driver validate the routing data. It must skip the <ConfigHdr> in order to process the names.
EFI_INVALID_PARAMETERIllegal syntax. Progress set to most recent "&" before the error or the beginning of the string.
EFI_INVALID_PARAMETERUnknown name. Progress points to the & before the name in question.

Definition at line 1133 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrDxeHiiConfigAccessRouteConfig()

EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessRouteConfig ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN CONST EFI_STRING  Configuration,
OUT EFI_STRING *  Progress 
)

This function applies changes in a driver's configuration. Input is a Configuration, which has the routing data for this driver followed by name / value configuration pairs. The driver must apply those pairs to its configurable storage. If the driver's configuration is stored in a linear block of data and the driver's name / value pairs are in <BlockConfig> format, it may use the ConfigToBlock helper function (above) to simplify the job.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
ConfigurationA null-terminated Unicode string in <ConfigString> format.
ProgressA pointer to a string filled in with the offset of the most recent '&' before the first failing name / value pair (or the beginn ing of the string if the failure is in the first name / value pair) or the terminating NULL if all was successful.
Return values
EFI_SUCCESSThe results have been distributed or are awaiting distribution.
EFI_OUT_OF_RESOURCESNot enough memory to store the parts of the results that must be stored awaiting possible future protocols.
EFI_INVALID_PARAMETERSPassing in a NULL for the Results parameter would result in this type of error.
EFI_NOT_FOUNDTarget for the specified routing data was not found

Definition at line 1285 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrGetStrAKMList()

CHAR16 * WifiMgrGetStrAKMList ( IN WIFI_MGR_NETWORK_PROFILE Profile)

Retreive the unicode string of the AKM Suite list of a profile. The caller is responsible for freeing the string with FreePool().

Parameters
[in]ProfileThe network profile contains a AKM suite list.
Returns
the unicode string of AKM suite list or "None".

Definition at line 267 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrGetStrCipherList()

CHAR16 * WifiMgrGetStrCipherList ( IN WIFI_MGR_NETWORK_PROFILE Profile)

Retreive the unicode string of the Cipher Suite list of a profile. The caller is responsible for freeing the string with FreePool().

Parameters
[in]ProfileThe network profile contains a Cipher suite list.
Returns
the unicode string of Cipher suite list or "None".

Definition at line 326 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrRecordPassword()

EFI_STATUS WifiMgrRecordPassword ( IN WIFI_MGR_PRIVATE_DATA Private,
IN EFI_STRING_ID  StringId,
IN CHAR16 *  StringBuffer,
IN UINTN  StringBufferLen 
)

Record password from a HII input string.

Parameters
[in]PrivateThe pointer to the global private data structure.
[in]StringIdThe QuestionId received from HII input.
[in]StringBufferThe unicode string buffer to store password.
[in]StringBufferLenThe len of unicode string buffer.
Return values
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_NOT_FOUNDThe password string is not found or invalid.
EFI_SUCCESSThe operation is completed successfully.

Definition at line 878 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrRefreshHiddenList()

EFI_STATUS WifiMgrRefreshHiddenList ( IN WIFI_MGR_PRIVATE_DATA Private)

Refresh the hidden network list configured by user.

Parameters
[in]PrivateThe pointer to the global private data structure.
Return values
EFI_SUCCESSThe operation is completed successfully.
OtherErrors Returned errors when creating Opcodes or updating the Hii form.

Definition at line 707 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrRefreshNetworkList()

EFI_STATUS WifiMgrRefreshNetworkList ( IN WIFI_MGR_PRIVATE_DATA Private,
OUT WIFI_MANAGER_IFR_NVDATA IfrNvData 
)

Refresh the network list display of the current Nic.

Parameters
[in]PrivateThe pointer to the global private data structure.
[out]IfrNvDataThe IFR NV data.
Return values
EFI_SUCCESSThe operation is completed successfully.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
OtherErrors Returned errors when creating Opcodes or updating the Hii form.

Definition at line 386 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrSelectNic()

EFI_STATUS WifiMgrSelectNic ( IN WIFI_MGR_PRIVATE_DATA Private,
IN EFI_QUESTION_ID  KeyValue 
)

Callback function for user to select a Nic.

Parameters
[in]PrivateThe pointer to the global private data structure.
[in]KeyValueThe key value received from HII input.
Return values
EFI_NOT_FOUNDThe corresponding Nic is not found.
EFI_SUCCESSThe operation is completed successfully.

Definition at line 784 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrShowNicList()

EFI_STATUS WifiMgrShowNicList ( IN WIFI_MGR_PRIVATE_DATA Private)

Display the Nic list contains all available Nics.

Parameters
[in]PrivateThe pointer to the global private data structure.
Return values
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_SUCCESSThe operation is completed successfully.

Definition at line 178 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrUpdateConnectMessage()

VOID WifiMgrUpdateConnectMessage ( IN WIFI_MGR_DEVICE_DATA Nic,
IN BOOLEAN  ConnectStateChanged,
IN EFI_STRING  ConnectStatusMessage 
)

Update connection message on connect configuration page, and trigger related form refresh.

Parameters
[in]NicThe related Nic for updating message.
[in]ConnectStateChangedThe tag to tell if the connection state has been changed, only when the connection changes from "Connected" or "Disconnecting" to "Disconnected", or from "Disconnected" or "Connecting" to "Connected", this tag can be set as TRUE.
[in]ConnectStatusMessageThe message to show on connected status bar, if NULL, will use default message.

Definition at line 925 of file WifiConnectionMgrHiiConfigAccess.c.

◆ WifiMgrUserSelectProfileToConnect()

EFI_STATUS WifiMgrUserSelectProfileToConnect ( IN WIFI_MGR_PRIVATE_DATA Private,
IN UINT32  ProfileIndex 
)

UI handle function when user select a network to connect.

Parameters
[in]PrivateThe pointer to the global private data structure.
[in]ProfileIndexThe profile index user selected to connect.
Return values
EFI_INVALID_PARAMETERNic is null.
EFI_NOT_FOUNDProfile could not be found.
EFI_SUCCESSThe operation is completed successfully.

Definition at line 836 of file WifiConnectionMgrHiiConfigAccess.c.

Variable Documentation

◆ gWifiConfigFormSetGuid

EFI_GUID gWifiConfigFormSetGuid
extern

Definition at line 37 of file WifiConnectionMgrDriver.c.

◆ gWifiMgrDxeHiiConfigAccess

Initial value:
= {
}
EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessRouteConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessExtractConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
EFI_STATUS EFIAPI WifiMgrDxeHiiConfigAccessCallback(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN OUT EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)

Definition at line 40 of file WifiConnectionMgrHiiConfigAccess.c.

◆ mSecurityType

CHAR16* mSecurityType[]
Initial value:
= {
L"OPEN ",
L"WPA-Enterprise ",
L"WPA2-Enterprise",
L"WPA-Personal ",
L"WPA2-Personal ",
L"WEP ",
L"WPA3-Personal ",
L"WPA3-Enterprise",
L"UnKnown "
}

Definition at line 46 of file WifiConnectionMgrHiiConfigAccess.c.

◆ mSignalStrengthBar

CHAR16* mSignalStrengthBar[]
Initial value:
= {
L"[-----]",
L"[*----]",
L"[**---]",
L"[***--]",
L"[****-]",
L"[*****]"
}

Definition at line 58 of file WifiConnectionMgrHiiConfigAccess.c.

◆ mVendorStorageName

CHAR16 mVendorStorageName[] = L"WIFI_MANAGER_IFR_NVDATA"

Definition at line 12 of file WifiConnectionMgrHiiConfigAccess.c.

◆ mWifiMgrDxeHiiVendorDevicePath

HII_VENDOR_DEVICE_PATH mWifiMgrDxeHiiVendorDevicePath
Initial value:
= {
{
{
{
(UINT8)(sizeof (VENDOR_DEVICE_PATH)),
(UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
}
},
WIFI_CONNECTION_MANAGER_CONFIG_GUID
},
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{
(UINT8)(END_DEVICE_PATH_LENGTH),
(UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
}
}
}
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_VENDOR_DP
Definition: DevicePath.h:133

Definition at line 14 of file WifiConnectionMgrHiiConfigAccess.c.