summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/WifiConnectionManagerDxe
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:07 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commitd1050b9dff1cace252aff86630bfdb59dff5f507 (patch)
tree77f796143980742d97a883f62ce339a270474801 /NetworkPkg/WifiConnectionManagerDxe
parent2f88bd3a1296c522317f1c21377876de63de5be7 (diff)
downloadedk2-d1050b9dff1cace252aff86630bfdb59dff5f507.tar.gz
edk2-d1050b9dff1cace252aff86630bfdb59dff5f507.tar.bz2
edk2-d1050b9dff1cace252aff86630bfdb59dff5f507.zip
NetworkPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the NetworkPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Diffstat (limited to 'NetworkPkg/WifiConnectionManagerDxe')
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/EapContext.h10
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrComponentName.c18
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfig.h10
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfigNVDataStruct.h174
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c160
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDxe.h117
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.c134
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.h16
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c1282
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.h26
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c734
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.h12
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c388
-rw-r--r--NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.h75
14 files changed, 1678 insertions, 1478 deletions
diff --git a/NetworkPkg/WifiConnectionManagerDxe/EapContext.h b/NetworkPkg/WifiConnectionManagerDxe/EapContext.h
index 9b3801926a..8b18988f7f 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/EapContext.h
+++ b/NetworkPkg/WifiConnectionManagerDxe/EapContext.h
@@ -11,12 +11,10 @@
#define __EFI_WIFI_EAP_CONTEXT_H__
typedef struct {
-
- BOOLEAN IsEncrypted;
- CHAR16 EncryptPassword[PASSWORD_STORAGE_SIZE];
- UINTN KeySize;
- UINT8 KeyData[1];
-
+ BOOLEAN IsEncrypted;
+ CHAR16 EncryptPassword[PASSWORD_STORAGE_SIZE];
+ UINTN KeySize;
+ UINT8 KeyData[1];
} EFI_EAP_PRIVATE_KEY;
#endif
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrComponentName.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrComponentName.c
index 1bcd3daa23..c72f9f7095 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrComponentName.c
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrComponentName.c
@@ -9,15 +9,15 @@
#include "WifiConnectionMgrDxe.h"
-extern EFI_GUID mEfiWifiMgrPrivateGuid;
+extern EFI_GUID mEfiWifiMgrPrivateGuid;
///
/// Component Name Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME_PROTOCOL gWifiMgrDxeComponentName = {
- (EFI_COMPONENT_NAME_GET_DRIVER_NAME) WifiMgrDxeComponentNameGetDriverName,
- (EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) WifiMgrDxeComponentNameGetControllerName,
+ (EFI_COMPONENT_NAME_GET_DRIVER_NAME)WifiMgrDxeComponentNameGetDriverName,
+ (EFI_COMPONENT_NAME_GET_CONTROLLER_NAME)WifiMgrDxeComponentNameGetControllerName,
"eng"
};
@@ -35,7 +35,7 @@ EFI_COMPONENT_NAME2_PROTOCOL gWifiMgrDxeComponentName2 = {
/// Table of driver names
///
GLOBAL_REMOVE_IF_UNREFERENCED
-EFI_UNICODE_STRING_TABLE mWifiMgrDxeDriverNameTable[] = {
+EFI_UNICODE_STRING_TABLE mWifiMgrDxeDriverNameTable[] = {
{
"eng;en",
L"UEFI WiFi Connection Manager"
@@ -50,7 +50,7 @@ EFI_UNICODE_STRING_TABLE mWifiMgrDxeDriverNameTable[] = {
/// Table of controller names
///
GLOBAL_REMOVE_IF_UNREFERENCED
-EFI_UNICODE_STRING_TABLE mWifiMgrDxeControllerNameTable[] = {
+EFI_UNICODE_STRING_TABLE mWifiMgrDxeControllerNameTable[] = {
{
"eng;en",
L"UEFI WiFi Connection Manager Controller"
@@ -150,13 +150,13 @@ WifiMgrDxeComponentNameGetControllerName (
OUT CHAR16 **ControllerName
)
{
- EFI_STATUS Status;
- WIFI_MGR_PRIVATE_PROTOCOL *WifiMgrPrivate;
+ EFI_STATUS Status;
+ WIFI_MGR_PRIVATE_PROTOCOL *WifiMgrPrivate;
//
// ChildHandle must be NULL for a Device Driver
//
- if (ControllerHandle == NULL || ChildHandle != NULL) {
+ if ((ControllerHandle == NULL) || (ChildHandle != NULL)) {
return EFI_UNSUPPORTED;
}
@@ -166,7 +166,7 @@ WifiMgrDxeComponentNameGetControllerName (
Status = gBS->OpenProtocol (
ControllerHandle,
&mEfiWifiMgrPrivateGuid,
- (VOID **) &WifiMgrPrivate,
+ (VOID **)&WifiMgrPrivate,
NULL,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfig.h b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfig.h
index c0b440fd25..a1ed09af71 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfig.h
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfig.h
@@ -12,8 +12,8 @@
#include "WifiConnectionMgrConfigNVDataStruct.h"
-extern UINT8 WifiConnectionManagerDxeBin[];
-extern UINT8 WifiConnectionManagerDxeStrings[];
+extern UINT8 WifiConnectionManagerDxeBin[];
+extern UINT8 WifiConnectionManagerDxeStrings[];
typedef struct {
UINT32 Signature;
@@ -40,7 +40,7 @@ typedef struct {
CHAR16 PrivateKeyName[WIFI_FILENAME_STR_MAX_SIZE];
VOID *PrivateKeyData;
UINTN PrivateKeyDataSize;
- CHAR16 PrivateKeyPassword[PASSWORD_STORAGE_SIZE]; //Password to protect private key file
+ CHAR16 PrivateKeyPassword[PASSWORD_STORAGE_SIZE]; // Password to protect private key file
CHAR16 EapIdentity[EAP_IDENTITY_SIZE];
CHAR16 EapPassword[PASSWORD_STORAGE_SIZE];
UINT8 EapSecondAuthMethod;
@@ -60,8 +60,8 @@ typedef struct {
/// HII specific Vendor Device Path definition.
///
typedef struct {
- VENDOR_DEVICE_PATH VendorDevicePath;
- EFI_DEVICE_PATH_PROTOCOL End;
+ VENDOR_DEVICE_PATH VendorDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL End;
} HII_VENDOR_DEVICE_PATH;
#pragma pack()
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfigNVDataStruct.h b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfigNVDataStruct.h
index cffc51f592..69878bc457 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfigNVDataStruct.h
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrConfigNVDataStruct.h
@@ -13,139 +13,137 @@
#include <Guid/WifiConnectionManagerConfigHii.h>
#include "WifiConnectionMgrConfigHii.h"
-#define MANAGER_VARSTORE_ID 0x0802
+#define MANAGER_VARSTORE_ID 0x0802
-#define WIFI_STR_MAX_SIZE 224
-#define WIFI_FILENAME_STR_MAX_SIZE 224
-#define WIFI_MGR_MAX_MAC_STRING_LEN 96
+#define WIFI_STR_MAX_SIZE 224
+#define WIFI_FILENAME_STR_MAX_SIZE 224
+#define WIFI_MGR_MAX_MAC_STRING_LEN 96
-#define SSID_MIN_LEN 1
-#define SSID_MAX_LEN 32
-#define SSID_STORAGE_SIZE 33
+#define SSID_MIN_LEN 1
+#define SSID_MAX_LEN 32
+#define SSID_STORAGE_SIZE 33
-#define PASSWORD_MIN_LEN 8
-#define PASSWORD_MAX_LEN 63
-#define PASSWORD_STORAGE_SIZE 64
+#define PASSWORD_MIN_LEN 8
+#define PASSWORD_MAX_LEN 63
+#define PASSWORD_STORAGE_SIZE 64
-#define EAP_IDENTITY_LEN 63
-#define EAP_IDENTITY_SIZE 64
+#define EAP_IDENTITY_LEN 63
+#define EAP_IDENTITY_SIZE 64
-#define FORMID_NONE_FORM 0
-#define FORMID_MAC_SELECTION 1
-#define FORMID_WIFI_MAINPAGE 2
-#define FORMID_NETWORK_LIST 3
-#define FORMID_CONNECT_NETWORK 4
-#define FORMID_ENROLL_CERT 5
-#define FORMID_CA_LIST 6
-#define FORMID_ENROLL_PRIVATE_KEY 7
-#define FORMID_PRIVATE_KEY_LIST 8
-#define FORMID_WIFI_SETTINGS 9
-#define FORMID_HIDDEN_NETWORK_LIST 10
+#define FORMID_NONE_FORM 0
+#define FORMID_MAC_SELECTION 1
+#define FORMID_WIFI_MAINPAGE 2
+#define FORMID_NETWORK_LIST 3
+#define FORMID_CONNECT_NETWORK 4
+#define FORMID_ENROLL_CERT 5
+#define FORMID_CA_LIST 6
+#define FORMID_ENROLL_PRIVATE_KEY 7
+#define FORMID_PRIVATE_KEY_LIST 8
+#define FORMID_WIFI_SETTINGS 9
+#define FORMID_HIDDEN_NETWORK_LIST 10
//
// Mac List Form Key
//
-#define KEY_MAC_LIST 0x100
+#define KEY_MAC_LIST 0x100
//
// Main Form Key
//
-#define KEY_REFRESH_TITLE_CONNECTION_STATUS 0x101
+#define KEY_REFRESH_TITLE_CONNECTION_STATUS 0x101
//
// Network List Form Key
//
-#define KEY_NETWORK_LIST 0x102
-#define KEY_REFRESH_NETWORK_LIST 0x103
-#define KEY_WIFI_SETTINGS 0x104
+#define KEY_NETWORK_LIST 0x102
+#define KEY_REFRESH_NETWORK_LIST 0x103
+#define KEY_WIFI_SETTINGS 0x104
//
// Connect Network Form Key
//
-#define KEY_PASSWORD_CONNECT_NETWORK 0x201
-#define KEY_CONNECT_ACTION 0x202
-#define KEY_REFRESH_CONNECT_CONFIGURATION 0x203
-#define KEY_EAP_AUTH_METHOD_CONNECT_NETWORK 0x204
-#define KEY_EAP_SEAUTH_METHOD_CONNECT_NETWORK 0x205
-#define KEY_ENROLL_CA_CERT_CONNECT_NETWORK 0x206
-#define KEY_ENROLL_CLIENT_CERT_CONNECT_NETWORK 0x207
-#define KEY_ENROLL_PRIVATE_KEY_CONNECT_NETWORK 0x208
-#define KEY_EAP_IDENTITY_CONNECT_NETWORK 0x209
-#define KEY_EAP_PASSWORD_CONNECT_NETWORK 0x210
+#define KEY_PASSWORD_CONNECT_NETWORK 0x201
+#define KEY_CONNECT_ACTION 0x202
+#define KEY_REFRESH_CONNECT_CONFIGURATION 0x203
+#define KEY_EAP_AUTH_METHOD_CONNECT_NETWORK 0x204
+#define KEY_EAP_SEAUTH_METHOD_CONNECT_NETWORK 0x205
+#define KEY_ENROLL_CA_CERT_CONNECT_NETWORK 0x206
+#define KEY_ENROLL_CLIENT_CERT_CONNECT_NETWORK 0x207
+#define KEY_ENROLL_PRIVATE_KEY_CONNECT_NETWORK 0x208
+#define KEY_EAP_IDENTITY_CONNECT_NETWORK 0x209
+#define KEY_EAP_PASSWORD_CONNECT_NETWORK 0x210
//
-//Cert Form And Private Key Form
+// Cert Form And Private Key Form
//
-#define KEY_EAP_ENROLL_CERT_FROM_FILE 0x301
-#define KEY_EAP_ENROLL_PRIVATE_KEY_FROM_FILE 0x302
-#define KEY_SAVE_CERT_TO_MEM 0x303
-#define KEY_NO_SAVE_CERT_TO_MEM 0x304
-#define KEY_SAVE_PRIVATE_KEY_TO_MEM 0x305
-#define KEY_NO_SAVE_PRIVATE_KEY_TO_MEM 0x306
-#define KEY_PRIVATE_KEY_PASSWORD 0x307
-#define KEY_ENROLLED_CERT_NAME 0x308
-#define KEY_ENROLLED_PRIVATE_KEY_NAME 0x309
+#define KEY_EAP_ENROLL_CERT_FROM_FILE 0x301
+#define KEY_EAP_ENROLL_PRIVATE_KEY_FROM_FILE 0x302
+#define KEY_SAVE_CERT_TO_MEM 0x303
+#define KEY_NO_SAVE_CERT_TO_MEM 0x304
+#define KEY_SAVE_PRIVATE_KEY_TO_MEM 0x305
+#define KEY_NO_SAVE_PRIVATE_KEY_TO_MEM 0x306
+#define KEY_PRIVATE_KEY_PASSWORD 0x307
+#define KEY_ENROLLED_CERT_NAME 0x308
+#define KEY_ENROLLED_PRIVATE_KEY_NAME 0x309
//
// Hidden Network Configuration Form
//
-#define KEY_HIDDEN_NETWORK 0x401
-#define KEY_ADD_HIDDEN_NETWORK 0x402
-#define KEY_REMOVE_HIDDEN_NETWORK 0x403
+#define KEY_HIDDEN_NETWORK 0x401
+#define KEY_ADD_HIDDEN_NETWORK 0x402
+#define KEY_REMOVE_HIDDEN_NETWORK 0x403
//
// Dynamic Lists
//
-#define MAC_LIST_COUNT_MAX 255
-#define LABEL_MAC_ENTRY 0x1000
-#define KEY_MAC_ENTRY_BASE 0x1100
+#define MAC_LIST_COUNT_MAX 255
+#define LABEL_MAC_ENTRY 0x1000
+#define KEY_MAC_ENTRY_BASE 0x1100
-#define NETWORK_LIST_COUNT_MAX 4095
-#define LABEL_NETWORK_LIST_ENTRY 0x2000
-#define KEY_AVAILABLE_NETWORK_ENTRY_BASE 0x3000
+#define NETWORK_LIST_COUNT_MAX 4095
+#define LABEL_NETWORK_LIST_ENTRY 0x2000
+#define KEY_AVAILABLE_NETWORK_ENTRY_BASE 0x3000
-#define HIDDEN_NETWORK_LIST_COUNT_MAX 255
-#define LABEL_HIDDEN_NETWORK_ENTRY 0x4000
-#define KEY_HIDDEN_NETWORK_ENTRY_BASE 0x4100
+#define HIDDEN_NETWORK_LIST_COUNT_MAX 255
+#define LABEL_HIDDEN_NETWORK_ENTRY 0x4000
+#define KEY_HIDDEN_NETWORK_ENTRY_BASE 0x4100
-#define LABEL_END 0xffff
+#define LABEL_END 0xffff
//
// Network Security Type
//
-#define SECURITY_TYPE_NONE 0
-#define SECURITY_TYPE_WPA_ENTERPRISE 1
-#define SECURITY_TYPE_WPA2_ENTERPRISE 2
-#define SECURITY_TYPE_WPA_PERSONAL 3
-#define SECURITY_TYPE_WPA2_PERSONAL 4
-#define SECURITY_TYPE_WEP 5
-#define SECURITY_TYPE_UNKNOWN 6
-#define SECURITY_TYPE_MAX 7
+#define SECURITY_TYPE_NONE 0
+#define SECURITY_TYPE_WPA_ENTERPRISE 1
+#define SECURITY_TYPE_WPA2_ENTERPRISE 2
+#define SECURITY_TYPE_WPA_PERSONAL 3
+#define SECURITY_TYPE_WPA2_PERSONAL 4
+#define SECURITY_TYPE_WEP 5
+#define SECURITY_TYPE_UNKNOWN 6
+#define SECURITY_TYPE_MAX 7
-#define EAP_AUTH_METHOD_TTLS 0
-#define EAP_AUTH_METHOD_PEAP 1
-#define EAP_AUTH_METHOD_TLS 2
-#define EAP_AUTH_METHOD_MAX 3
+#define EAP_AUTH_METHOD_TTLS 0
+#define EAP_AUTH_METHOD_PEAP 1
+#define EAP_AUTH_METHOD_TLS 2
+#define EAP_AUTH_METHOD_MAX 3
-#define EAP_SEAUTH_METHOD_MSCHAPV2 0
-#define EAP_SEAUTH_METHOD_MAX 1
+#define EAP_SEAUTH_METHOD_MSCHAPV2 0
+#define EAP_SEAUTH_METHOD_MAX 1
-#define HIDDEN_NETWORK_LIST_VAR_OFFSET ((UINT16) OFFSET_OF (WIFI_MANAGER_IFR_NVDATA, HiddenNetworkList))
+#define HIDDEN_NETWORK_LIST_VAR_OFFSET ((UINT16) OFFSET_OF (WIFI_MANAGER_IFR_NVDATA, HiddenNetworkList))
#pragma pack(1)
typedef struct _WIFI_MANAGER_IFR_NVDATA {
-
- UINT32 ProfileCount;
- CHAR16 SSId[SSID_STORAGE_SIZE];
- CHAR16 Password[PASSWORD_STORAGE_SIZE];
- CHAR16 PrivateKeyPassword[PASSWORD_STORAGE_SIZE];
- CHAR16 EapIdentity[EAP_IDENTITY_SIZE];
- CHAR16 EapPassword[PASSWORD_STORAGE_SIZE];
- UINT8 SecurityType;
- UINT8 EapAuthMethod;
- UINT8 EapSecondAuthMethod;
- UINT8 HiddenNetworkList[HIDDEN_NETWORK_LIST_COUNT_MAX];
-
+ UINT32 ProfileCount;
+ CHAR16 SSId[SSID_STORAGE_SIZE];
+ CHAR16 Password[PASSWORD_STORAGE_SIZE];
+ CHAR16 PrivateKeyPassword[PASSWORD_STORAGE_SIZE];
+ CHAR16 EapIdentity[EAP_IDENTITY_SIZE];
+ CHAR16 EapPassword[PASSWORD_STORAGE_SIZE];
+ UINT8 SecurityType;
+ UINT8 EapAuthMethod;
+ UINT8 EapSecondAuthMethod;
+ UINT8 HiddenNetworkList[HIDDEN_NETWORK_LIST_COUNT_MAX];
} WIFI_MANAGER_IFR_NVDATA;
#pragma pack()
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c
index 841ff52588..67a01ca058 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDriver.c
@@ -12,7 +12,7 @@
///
/// Driver Binding Protocol instance
///
-EFI_DRIVER_BINDING_PROTOCOL gWifiMgrDxeDriverBinding = {
+EFI_DRIVER_BINDING_PROTOCOL gWifiMgrDxeDriverBinding = {
WifiMgrDxeDriverBindingSupported,
WifiMgrDxeDriverBindingStart,
WifiMgrDxeDriverBindingStop,
@@ -22,22 +22,22 @@ EFI_DRIVER_BINDING_PROTOCOL gWifiMgrDxeDriverBinding = {
};
//
-//The private global data for WiFi Connection Manager
+// The private global data for WiFi Connection Manager
//
-WIFI_MGR_PRIVATE_DATA *mPrivate = NULL;
+WIFI_MGR_PRIVATE_DATA *mPrivate = NULL;
//
-//The private guid to identify WiFi Connection Manager
+// The private guid to identify WiFi Connection Manager
//
-EFI_GUID mEfiWifiMgrPrivateGuid = EFI_WIFIMGR_PRIVATE_GUID;
+EFI_GUID mEfiWifiMgrPrivateGuid = EFI_WIFIMGR_PRIVATE_GUID;
//
-//The Hii config guids
+// The Hii config guids
//
-EFI_GUID gWifiConfigFormSetGuid = WIFI_CONNECTION_MANAGER_CONFIG_GUID;
-EFI_GUID mWifiConfigNetworkListRefreshGuid = WIFI_CONFIG_NETWORK_LIST_REFRESH_GUID;
-EFI_GUID mWifiConfigConnectFormRefreshGuid = WIFI_CONFIG_CONNECT_FORM_REFRESH_GUID;
-EFI_GUID mWifiConfigMainFormRefreshGuid = WIFI_CONFIG_MAIN_FORM_REFRESH_GUID;
+EFI_GUID gWifiConfigFormSetGuid = WIFI_CONNECTION_MANAGER_CONFIG_GUID;
+EFI_GUID mWifiConfigNetworkListRefreshGuid = WIFI_CONFIG_NETWORK_LIST_REFRESH_GUID;
+EFI_GUID mWifiConfigConnectFormRefreshGuid = WIFI_CONFIG_CONNECT_FORM_REFRESH_GUID;
+EFI_GUID mWifiConfigMainFormRefreshGuid = WIFI_CONFIG_MAIN_FORM_REFRESH_GUID;
/**
Tests to see if this driver supports a given controller. If a child device is provided,
@@ -85,12 +85,12 @@ EFI_GUID mWifiConfigMainFormRefreshGuid = WIFI_CONFIG_MAIN_FORM_REFRESH_GUID;
EFI_STATUS
EFIAPI
WifiMgrDxeDriverBindingSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
Status = gBS->OpenProtocol (
ControllerHandle,
@@ -155,28 +155,28 @@ WifiMgrDxeDriverBindingSupported (
EFI_STATUS
EFIAPI
WifiMgrDxeDriverBindingStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
{
- EFI_STATUS Status;
- EFI_TPL OldTpl;
- UINTN AddressSize;
- WIFI_MGR_DEVICE_DATA *Nic;
- EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *Wmp;
- EFI_SUPPLICANT_PROTOCOL *Supplicant;
- EFI_EAP_CONFIGURATION_PROTOCOL *EapConfig;
+ EFI_STATUS Status;
+ EFI_TPL OldTpl;
+ UINTN AddressSize;
+ WIFI_MGR_DEVICE_DATA *Nic;
+ EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *Wmp;
+ EFI_SUPPLICANT_PROTOCOL *Supplicant;
+ EFI_EAP_CONFIGURATION_PROTOCOL *EapConfig;
Nic = NULL;
//
- //Open Protocols
+ // Open Protocols
//
Status = gBS->OpenProtocol (
ControllerHandle,
&gEfiWiFi2ProtocolGuid,
- (VOID**) &Wmp,
+ (VOID **)&Wmp,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -188,7 +188,7 @@ WifiMgrDxeDriverBindingStart (
Status = gBS->OpenProtocol (
ControllerHandle,
&gEfiSupplicantProtocolGuid,
- (VOID**) &Supplicant,
+ (VOID **)&Supplicant,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -200,7 +200,7 @@ WifiMgrDxeDriverBindingStart (
Status = gBS->OpenProtocol (
ControllerHandle,
&gEfiEapConfigurationProtocolGuid,
- (VOID**) &EapConfig,
+ (VOID **)&EapConfig,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -210,26 +210,27 @@ WifiMgrDxeDriverBindingStart (
}
//
- //Initialize Nic device data
+ // Initialize Nic device data
//
Nic = AllocateZeroPool (sizeof (WIFI_MGR_DEVICE_DATA));
if (Nic == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ERROR1;
}
- Nic->Signature = WIFI_MGR_DEVICE_DATA_SIGNATURE;
- Nic->DriverHandle = This->DriverBindingHandle;
- Nic->ControllerHandle = ControllerHandle;
- Nic->Private = mPrivate;
- Nic->Wmp = Wmp;
- Nic->Supplicant = Supplicant;
- Nic->EapConfig = EapConfig;
- Nic->UserSelectedProfile = NULL;
- Nic->OneTimeScanRequest = FALSE;
- Nic->ScanTickTime = WIFI_SCAN_FREQUENCY; //Initialize the first scan
+
+ Nic->Signature = WIFI_MGR_DEVICE_DATA_SIGNATURE;
+ Nic->DriverHandle = This->DriverBindingHandle;
+ Nic->ControllerHandle = ControllerHandle;
+ Nic->Private = mPrivate;
+ Nic->Wmp = Wmp;
+ Nic->Supplicant = Supplicant;
+ Nic->EapConfig = EapConfig;
+ Nic->UserSelectedProfile = NULL;
+ Nic->OneTimeScanRequest = FALSE;
+ Nic->ScanTickTime = WIFI_SCAN_FREQUENCY; // Initialize the first scan
if (Nic->Supplicant != NULL) {
- WifiMgrGetSupportedSuites(Nic);
+ WifiMgrGetSupportedSuites (Nic);
}
InitializeListHead (&Nic->ProfileList);
@@ -239,7 +240,7 @@ WifiMgrDxeDriverBindingStart (
//
Status = NetLibGetMacAddress (
ControllerHandle,
- (EFI_MAC_ADDRESS*) &Nic->MacAddress,
+ (EFI_MAC_ADDRESS *)&Nic->MacAddress,
&AddressSize
);
if (EFI_ERROR (Status)) {
@@ -260,7 +261,7 @@ WifiMgrDxeDriverBindingStart (
goto ERROR2;
}
- Status = gBS->SetTimer (Nic->TickTimer, TimerPeriodic, EFI_TIMER_PERIOD_MILLISECONDS(500));
+ Status = gBS->SetTimer (Nic->TickTimer, TimerPeriodic, EFI_TIMER_PERIOD_MILLISECONDS (500));
if (EFI_ERROR (Status)) {
goto ERROR3;
}
@@ -270,10 +271,11 @@ WifiMgrDxeDriverBindingStart (
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
InsertTailList (&mPrivate->NicList, &Nic->Link);
- Nic->NicIndex = mPrivate->NicCount ++;
+ Nic->NicIndex = mPrivate->NicCount++;
if (mPrivate->CurrentNic == NULL) {
mPrivate->CurrentNic = Nic;
}
+
gBS->RestoreTPL (OldTpl);
Status = gBS->InstallProtocolInterface (
@@ -306,13 +308,16 @@ ERROR2:
if (Nic->SupportedSuites.SupportedAKMSuites != NULL) {
FreePool (Nic->SupportedSuites.SupportedAKMSuites);
}
+
if (Nic->SupportedSuites.SupportedSwCipherSuites != NULL) {
FreePool (Nic->SupportedSuites.SupportedSwCipherSuites);
}
+
if (Nic->SupportedSuites.SupportedHwCipherSuites != NULL) {
FreePool (Nic->SupportedSuites.SupportedHwCipherSuites);
}
}
+
FreePool (Nic);
ERROR1:
@@ -374,21 +379,21 @@ ERROR1:
EFI_STATUS
EFIAPI
WifiMgrDxeDriverBindingStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
)
{
- EFI_STATUS Status;
- EFI_TPL OldTpl;
- WIFI_MGR_PRIVATE_PROTOCOL *WifiMgrIdentifier;
- WIFI_MGR_DEVICE_DATA *Nic;
+ EFI_STATUS Status;
+ EFI_TPL OldTpl;
+ WIFI_MGR_PRIVATE_PROTOCOL *WifiMgrIdentifier;
+ WIFI_MGR_DEVICE_DATA *Nic;
Status = gBS->OpenProtocol (
ControllerHandle,
&mEfiWifiMgrPrivateGuid,
- (VOID **) &WifiMgrIdentifier,
+ (VOID **)&WifiMgrIdentifier,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
@@ -415,9 +420,11 @@ WifiMgrDxeDriverBindingStop (
if (Nic->SupportedSuites.SupportedAKMSuites != NULL) {
FreePool (Nic->SupportedSuites.SupportedAKMSuites);
}
+
if (Nic->SupportedSuites.SupportedSwCipherSuites != NULL) {
FreePool (Nic->SupportedSuites.SupportedSwCipherSuites);
}
+
if (Nic->SupportedSuites.SupportedHwCipherSuites != NULL) {
FreePool (Nic->SupportedSuites.SupportedHwCipherSuites);
}
@@ -427,31 +434,31 @@ WifiMgrDxeDriverBindingStop (
// Close Protocols
//
Status = gBS->UninstallProtocolInterface (
- ControllerHandle,
- &mEfiWifiMgrPrivateGuid,
- &Nic->WifiMgrIdentifier
- );
+ ControllerHandle,
+ &mEfiWifiMgrPrivateGuid,
+ &Nic->WifiMgrIdentifier
+ );
if (EFI_ERROR (Status)) {
return Status;
}
Status = gBS->CloseProtocol (
- ControllerHandle,
- &gEfiWiFi2ProtocolGuid,
- Nic->DriverHandle,
- Nic->ControllerHandle
- );
+ ControllerHandle,
+ &gEfiWiFi2ProtocolGuid,
+ Nic->DriverHandle,
+ Nic->ControllerHandle
+ );
if (EFI_ERROR (Status)) {
return Status;
}
if (Nic->Supplicant != NULL) {
Status = gBS->CloseProtocol (
- ControllerHandle,
- &gEfiSupplicantProtocolGuid,
- Nic->DriverHandle,
- Nic->ControllerHandle
- );
+ ControllerHandle,
+ &gEfiSupplicantProtocolGuid,
+ Nic->DriverHandle,
+ Nic->ControllerHandle
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -459,11 +466,11 @@ WifiMgrDxeDriverBindingStop (
if (Nic->EapConfig != NULL) {
Status = gBS->CloseProtocol (
- ControllerHandle,
- &gEfiEapConfigurationProtocolGuid,
- Nic->DriverHandle,
- Nic->ControllerHandle
- );
+ ControllerHandle,
+ &gEfiEapConfigurationProtocolGuid,
+ Nic->DriverHandle,
+ Nic->ControllerHandle
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -505,11 +512,11 @@ WifiMgrDxeDriverBindingStop (
EFI_STATUS
EFIAPI
WifiMgrDxeDriverEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
Status = EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
@@ -531,16 +538,17 @@ WifiMgrDxeDriverEntryPoint (
Status = EFI_OUT_OF_RESOURCES;
goto ERROR1;
}
+
mPrivate->Signature = WIFI_MGR_PRIVATE_DATA_SIGNATURE;
mPrivate->DriverHandle = ImageHandle;
InitializeListHead (&mPrivate->NicList);
- mPrivate->NicCount = 0;
+ mPrivate->NicCount = 0;
mPrivate->CurrentNic = NULL;
InitializeListHead (&mPrivate->HiddenNetworkList);
mPrivate->HiddenNetworkCount = 0;
//
- //Create events for page refresh
+ // Create events for page refresh
//
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDxe.h b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDxe.h
index 170991253e..c3c70b2752 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDxe.h
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrDxe.h
@@ -73,31 +73,31 @@
//
#define WIFI_MGR_DXE_VERSION 0xb
-#define OUI_IEEE_80211I 0xAC0F00
+#define OUI_IEEE_80211I 0xAC0F00
typedef enum {
Ieee80211PairwiseCipherSuiteUseGroupCipherSuite = 0,
- Ieee80211PairwiseCipherSuiteWEP40 = 1,
- Ieee80211PairwiseCipherSuiteTKIP = 2,
- Ieee80211PairwiseCipherSuiteCCMP = 4,
- Ieee80211PairwiseCipherSuiteWEP104 = 5,
- Ieee80211PairwiseCipherSuiteBIP = 6,
- //...
+ Ieee80211PairwiseCipherSuiteWEP40 = 1,
+ Ieee80211PairwiseCipherSuiteTKIP = 2,
+ Ieee80211PairwiseCipherSuiteCCMP = 4,
+ Ieee80211PairwiseCipherSuiteWEP104 = 5,
+ Ieee80211PairwiseCipherSuiteBIP = 6,
+ // ...
} IEEE_80211_PAIRWISE_CIPHER_SUITE;
-#define IEEE_80211_PAIRWISE_CIPHER_SUITE_USE_GROUP (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteUseGroupCipherSuite << 24))
-#define IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP40 (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteWEP40 << 24))
-#define IEEE_80211_PAIRWISE_CIPHER_SUITE_TKIP (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteTKIP << 24))
-#define IEEE_80211_PAIRWISE_CIPHER_SUITE_CCMP (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteCCMP << 24))
-#define IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP104 (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteWEP104 << 24))
-#define IEEE_80211_PAIRWISE_CIPHER_SUITE_BIP (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteBIP << 24))
+#define IEEE_80211_PAIRWISE_CIPHER_SUITE_USE_GROUP (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteUseGroupCipherSuite << 24))
+#define IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP40 (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteWEP40 << 24))
+#define IEEE_80211_PAIRWISE_CIPHER_SUITE_TKIP (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteTKIP << 24))
+#define IEEE_80211_PAIRWISE_CIPHER_SUITE_CCMP (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteCCMP << 24))
+#define IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP104 (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteWEP104 << 24))
+#define IEEE_80211_PAIRWISE_CIPHER_SUITE_BIP (OUI_IEEE_80211I | (Ieee80211PairwiseCipherSuiteBIP << 24))
typedef enum {
Ieee80211AkmSuite8021XOrPMKSA = 1,
Ieee80211AkmSuitePSK = 2,
Ieee80211AkmSuite8021XOrPMKSASHA256 = 5,
Ieee80211AkmSuitePSKSHA256 = 6
- //...
+ // ...
} IEEE_80211_AKM_SUITE;
#define IEEE_80211_AKM_SUITE_8021X_OR_PMKSA (OUI_IEEE_80211I | (Ieee80211AkmSuite8021XOrPMKSA << 24))
@@ -108,10 +108,10 @@ typedef enum {
//
// Protocol instances
//
-extern EFI_DRIVER_BINDING_PROTOCOL gWifiMgrDxeDriverBinding;
-extern EFI_COMPONENT_NAME2_PROTOCOL gWifiMgrDxeComponentName2;
-extern EFI_COMPONENT_NAME_PROTOCOL gWifiMgrDxeComponentName;
-extern EFI_HII_CONFIG_ACCESS_PROTOCOL gWifiMgrDxeHiiConfigAccess;
+extern EFI_DRIVER_BINDING_PROTOCOL gWifiMgrDxeDriverBinding;
+extern EFI_COMPONENT_NAME2_PROTOCOL gWifiMgrDxeComponentName2;
+extern EFI_COMPONENT_NAME_PROTOCOL gWifiMgrDxeComponentName;
+extern EFI_HII_CONFIG_ACCESS_PROTOCOL gWifiMgrDxeHiiConfigAccess;
//
// Private Context Data Structure
@@ -130,12 +130,12 @@ typedef enum {
WifiMgrScanStateMaximum
} WIFI_MGR_SCAN_STATE;
-#define WIFI_SCAN_FREQUENCY 30
+#define WIFI_SCAN_FREQUENCY 30
typedef struct _WIFI_MGR_SUPPORTED_SUITES {
- EFI_80211_AKM_SUITE_SELECTOR *SupportedAKMSuites;
- EFI_80211_CIPHER_SUITE_SELECTOR *SupportedSwCipherSuites;
- EFI_80211_CIPHER_SUITE_SELECTOR *SupportedHwCipherSuites;
+ EFI_80211_AKM_SUITE_SELECTOR *SupportedAKMSuites;
+ EFI_80211_CIPHER_SUITE_SELECTOR *SupportedSwCipherSuites;
+ EFI_80211_CIPHER_SUITE_SELECTOR *SupportedHwCipherSuites;
} WIFI_MGR_SUPPORTED_SUITES;
#define EFI_WIFIMGR_PRIVATE_GUID \
@@ -143,15 +143,15 @@ typedef struct _WIFI_MGR_SUPPORTED_SUITES {
0x99b7c019, 0x4789, 0x4829, { 0xa7, 0xbd, 0x0d, 0x4b, 0xaa, 0x62, 0x28, 0x72 } \
}
-typedef struct _WIFI_MGR_PRIVATE_DATA WIFI_MGR_PRIVATE_DATA;
+typedef struct _WIFI_MGR_PRIVATE_DATA WIFI_MGR_PRIVATE_DATA;
typedef struct _WIFI_MGR_PRIVATE_PROTOCOL {
- UINT32 Reserved;
+ UINT32 Reserved;
} WIFI_MGR_PRIVATE_PROTOCOL;
typedef struct _WIFI_MGR_FILE_CONTEXT {
- EFI_FILE_HANDLE FHandle;
- UINT16 *FileName;
+ EFI_FILE_HANDLE FHandle;
+ UINT16 *FileName;
} WIFI_MGR_FILE_CONTEXT;
typedef enum {
@@ -177,43 +177,43 @@ typedef struct {
//
// Produced protocols
//
- WIFI_MGR_PRIVATE_PROTOCOL WifiMgrIdentifier;
+ WIFI_MGR_PRIVATE_PROTOCOL WifiMgrIdentifier;
//
// Private functions and data fields
//
- LIST_ENTRY Link; // Link to the NicList in global private data structure.
- UINT32 NicIndex;
- EFI_80211_MAC_ADDRESS MacAddress;
- WIFI_MGR_SUPPORTED_SUITES SupportedSuites;
- EFI_ADAPTER_INFO_MEDIA_STATE LastLinkState;
+ LIST_ENTRY Link; // Link to the NicList in global private data structure.
+ UINT32 NicIndex;
+ EFI_80211_MAC_ADDRESS MacAddress;
+ WIFI_MGR_SUPPORTED_SUITES SupportedSuites;
+ EFI_ADAPTER_INFO_MEDIA_STATE LastLinkState;
//
// The network is currently connected, connecting or disconnecting.
// Only one network can be operated at one time.
//
- WIFI_MGR_NETWORK_PROFILE *CurrentOperateNetwork;
- WIFI_MGR_NETWORK_PROFILE *ConnectPendingNetwork;
- BOOLEAN HasDisconnectPendingNetwork;
+ WIFI_MGR_NETWORK_PROFILE *CurrentOperateNetwork;
+ WIFI_MGR_NETWORK_PROFILE *ConnectPendingNetwork;
+ BOOLEAN HasDisconnectPendingNetwork;
//
- //Profile related data fields
+ // Profile related data fields
//
- LIST_ENTRY ProfileList; // List of WIFI_MGR_NETWORK_PROFILE
- UINT32 AvailableCount;
- UINT32 MaxProfileIndex;
- WIFI_MGR_NETWORK_PROFILE *UserSelectedProfile;
+ LIST_ENTRY ProfileList; // List of WIFI_MGR_NETWORK_PROFILE
+ UINT32 AvailableCount;
+ UINT32 MaxProfileIndex;
+ WIFI_MGR_NETWORK_PROFILE *UserSelectedProfile;
//
// Data fields for Hii functionlity
//
- BOOLEAN OneTimeScanRequest;
- BOOLEAN OneTimeConnectRequest;
- BOOLEAN OneTimeDisconnectRequest;
- WIFI_MGR_SCAN_STATE ScanState;
- UINTN ScanTickTime;
- WIFI_MGR_CONNECT_STATE ConnectState;
- BOOLEAN ConnectStateChanged;
+ BOOLEAN OneTimeScanRequest;
+ BOOLEAN OneTimeConnectRequest;
+ BOOLEAN OneTimeDisconnectRequest;
+ WIFI_MGR_SCAN_STATE ScanState;
+ UINTN ScanTickTime;
+ WIFI_MGR_CONNECT_STATE ConnectState;
+ BOOLEAN ConnectStateChanged;
} WIFI_MGR_DEVICE_DATA;
#define WIFI_MGR_DEVICE_DATA_SIGNATURE SIGNATURE_32 ('W','M','D','D')
@@ -227,9 +227,9 @@ typedef struct {
)
typedef struct {
- UINT32 Signature;
- LIST_ENTRY Link;
- CHAR16 SSId[SSID_STORAGE_SIZE];
+ UINT32 Signature;
+ LIST_ENTRY Link;
+ CHAR16 SSId[SSID_STORAGE_SIZE];
} WIFI_HIDDEN_NETWORK_DATA;
#define WIFI_MGR_HIDDEN_NETWORK_SIGNATURE SIGNATURE_32 ('W','M','H','N')
@@ -246,7 +246,6 @@ typedef struct {
// Global private data struct
//
struct _WIFI_MGR_PRIVATE_DATA {
-
UINT32 Signature;
EFI_HANDLE DriverHandle;
EFI_HII_HANDLE RegisteredHandle;
@@ -264,7 +263,7 @@ struct _WIFI_MGR_PRIVATE_DATA {
EFI_EVENT MainPageRefreshEvent; // Event to refresh the main page
//
- //User Input Record
+ // User Input Record
//
UINT8 SecurityType;
UINT8 EapAuthMethod;
@@ -287,7 +286,7 @@ struct _WIFI_MGR_PRIVATE_DATA {
ConfigAccess, \
WIFI_MGR_PRIVATE_DATA_SIGNATURE \
)
-extern WIFI_MGR_PRIVATE_DATA *mPrivate;
+extern WIFI_MGR_PRIVATE_DATA *mPrivate;
typedef enum {
TokenTypeGetNetworksToken,
@@ -297,15 +296,15 @@ typedef enum {
} WIFI_MGR_MAC_CONFIG_TOKEN_TYPE;
typedef union {
- EFI_80211_GET_NETWORKS_TOKEN *GetNetworksToken;
- EFI_80211_CONNECT_NETWORK_TOKEN *ConnectNetworkToken;
- EFI_80211_DISCONNECT_NETWORK_TOKEN *DisconnectNetworkToken;
+ EFI_80211_GET_NETWORKS_TOKEN *GetNetworksToken;
+ EFI_80211_CONNECT_NETWORK_TOKEN *ConnectNetworkToken;
+ EFI_80211_DISCONNECT_NETWORK_TOKEN *DisconnectNetworkToken;
} MAC_CONNECTION2_ADAPTER_TOKEN;
typedef struct {
- WIFI_MGR_DEVICE_DATA *Nic;
- WIFI_MGR_MAC_CONFIG_TOKEN_TYPE Type;
- MAC_CONNECTION2_ADAPTER_TOKEN Token;
+ WIFI_MGR_DEVICE_DATA *Nic;
+ WIFI_MGR_MAC_CONFIG_TOKEN_TYPE Type;
+ MAC_CONNECTION2_ADAPTER_TOKEN Token;
} WIFI_MGR_MAC_CONFIG_TOKEN;
//
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.c
index c0e0de1b86..82ef92dd1c 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.c
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.c
@@ -9,7 +9,7 @@
#include "WifiConnectionMgrFileUtil.h"
-CHAR16* mDerPemEncodedSuffix[] = {
+CHAR16 *mDerPemEncodedSuffix[] = {
L".cer",
L".der",
L".crt",
@@ -28,15 +28,17 @@ CHAR16* mDerPemEncodedSuffix[] = {
**/
BOOLEAN
IsDerPemEncodeCertificate (
- IN CONST CHAR16 *FileSuffix
-)
+ IN CONST CHAR16 *FileSuffix
+ )
{
- UINTN Index;
+ UINTN Index;
+
for (Index = 0; mDerPemEncodedSuffix[Index] != NULL; Index++) {
if (StrCmp (FileSuffix, mDerPemEncodedSuffix[Index]) == 0) {
return TRUE;
}
}
+
return FALSE;
}
@@ -58,16 +60,16 @@ IsDerPemEncodeCertificate (
**/
EFI_STATUS
ReadFileContent (
- IN EFI_FILE_HANDLE FileHandle,
- IN OUT VOID **BufferPtr,
- OUT UINTN *FileSize,
- IN UINTN AddtionAllocateSize
+ IN EFI_FILE_HANDLE FileHandle,
+ IN OUT VOID **BufferPtr,
+ OUT UINTN *FileSize,
+ IN UINTN AddtionAllocateSize
)
{
- UINTN BufferSize;
- UINT64 SourceFileSize;
- VOID *Buffer;
- EFI_STATUS Status;
+ UINTN BufferSize;
+ UINT64 SourceFileSize;
+ VOID *Buffer;
+ EFI_STATUS Status;
if ((FileHandle == NULL) || (FileSize == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -78,7 +80,7 @@ ReadFileContent (
//
// Get the file size
//
- Status = FileHandle->SetPosition (FileHandle, (UINT64) -1);
+ Status = FileHandle->SetPosition (FileHandle, (UINT64)-1);
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
@@ -93,20 +95,20 @@ ReadFileContent (
goto ON_EXIT;
}
- BufferSize = (UINTN) SourceFileSize + AddtionAllocateSize;
- Buffer = AllocateZeroPool(BufferSize);
+ BufferSize = (UINTN)SourceFileSize + AddtionAllocateSize;
+ Buffer = AllocateZeroPool (BufferSize);
if (Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- BufferSize = (UINTN) SourceFileSize;
+ BufferSize = (UINTN)SourceFileSize;
*FileSize = BufferSize;
Status = FileHandle->Read (FileHandle, &BufferSize, Buffer);
- if (EFI_ERROR (Status) || BufferSize != *FileSize) {
+ if (EFI_ERROR (Status) || (BufferSize != *FileSize)) {
FreePool (Buffer);
Buffer = NULL;
- Status = EFI_BAD_BUFFER_SIZE;
+ Status = EFI_BAD_BUFFER_SIZE;
goto ON_EXIT;
}
@@ -127,7 +129,7 @@ ON_EXIT:
CHAR16 *
EFIAPI
DevicePathToStr (
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath
+ IN EFI_DEVICE_PATH_PROTOCOL *DevPath
)
{
return ConvertDevicePathToText (
@@ -150,37 +152,38 @@ DevicePathToStr (
**/
CHAR16 *
ExtractFileNameFromDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
{
- CHAR16 *String;
- CHAR16 *MatchString;
- CHAR16 *LastMatch;
- CHAR16 *FileName;
- UINTN Length;
+ CHAR16 *String;
+ CHAR16 *MatchString;
+ CHAR16 *LastMatch;
+ CHAR16 *FileName;
+ UINTN Length;
- ASSERT(DevicePath != NULL);
+ ASSERT (DevicePath != NULL);
- String = DevicePathToStr(DevicePath);
+ String = DevicePathToStr (DevicePath);
if (String == NULL) {
return NULL;
}
+
MatchString = String;
LastMatch = String;
FileName = NULL;
- while(MatchString != NULL){
+ while (MatchString != NULL) {
LastMatch = MatchString + 1;
- MatchString = StrStr(LastMatch,L"\\");
+ MatchString = StrStr (LastMatch, L"\\");
}
- Length = StrLen(LastMatch);
- FileName = AllocateCopyPool ((Length + 1) * sizeof(CHAR16), LastMatch);
+ Length = StrLen (LastMatch);
+ FileName = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), LastMatch);
if (FileName != NULL) {
*(FileName + Length) = 0;
}
- FreePool(String);
+ FreePool (String);
return FileName;
}
@@ -197,20 +200,21 @@ ExtractFileNameFromDevicePath (
**/
BOOLEAN
-UpdatePage(
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
- IN EFI_FORM_ID FormId
+UpdatePage (
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ IN EFI_FORM_ID FormId
)
{
- CHAR16 *FileName;
- EFI_STATUS Status;
+ CHAR16 *FileName;
+ EFI_STATUS Status;
FileName = NULL;
if (FilePath != NULL) {
- FileName = ExtractFileNameFromDevicePath(FilePath);
+ FileName = ExtractFileNameFromDevicePath (FilePath);
}
+
if (FileName == NULL) {
//
// FileName = NULL has two cases:
@@ -227,6 +231,7 @@ UpdatePage(
if (Private->FileContext->FHandle != NULL) {
Private->FileContext->FHandle->Close (Private->FileContext->FHandle);
}
+
Private->FileContext->FHandle = NULL;
Status = EfiOpenFileByDevicePath (
@@ -237,26 +242,42 @@ UpdatePage(
);
if (EFI_ERROR (Status)) {
if (FormId == FORMID_ENROLL_CERT) {
- HiiSetString (Private->RegisteredHandle,
- STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), L"", NULL);
- } else if (FormId == FORMID_ENROLL_PRIVATE_KEY){
- HiiSetString (Private->RegisteredHandle,
- STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME), L"", NULL);
+ HiiSetString (
+ Private->RegisteredHandle,
+ STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME),
+ L"",
+ NULL
+ );
+ } else if (FormId == FORMID_ENROLL_PRIVATE_KEY) {
+ HiiSetString (
+ Private->RegisteredHandle,
+ STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME),
+ L"",
+ NULL
+ );
}
} else {
-
if (Private->FileContext->FileName != NULL) {
FreePool (Private->FileContext->FileName);
Private->FileContext->FileName = NULL;
}
+
Private->FileContext->FileName = FileName;
if (FormId == FORMID_ENROLL_CERT) {
- HiiSetString (Private->RegisteredHandle,
- STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), FileName, NULL);
- } else if (FormId == FORMID_ENROLL_PRIVATE_KEY){
- HiiSetString (Private->RegisteredHandle,
- STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME), FileName, NULL);
+ HiiSetString (
+ Private->RegisteredHandle,
+ STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME),
+ FileName,
+ NULL
+ );
+ } else if (FormId == FORMID_ENROLL_PRIVATE_KEY) {
+ HiiSetString (
+ Private->RegisteredHandle,
+ STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME),
+ FileName,
+ NULL
+ );
}
}
@@ -275,11 +296,11 @@ UpdatePage(
**/
BOOLEAN
UpdateCAFromFile (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
{
- return UpdatePage(Private, FilePath, FORMID_ENROLL_CERT);
+ return UpdatePage (Private, FilePath, FORMID_ENROLL_CERT);
}
/**
@@ -294,10 +315,9 @@ UpdateCAFromFile (
**/
BOOLEAN
UpdatePrivateKeyFromFile (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
{
- return UpdatePage(Private, FilePath, FORMID_ENROLL_PRIVATE_KEY);
+ return UpdatePage (Private, FilePath, FORMID_ENROLL_PRIVATE_KEY);
}
-
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.h b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.h
index 9d9e909d68..a5ac239fdf 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.h
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.h
@@ -30,10 +30,10 @@
**/
EFI_STATUS
ReadFileContent (
- IN EFI_FILE_HANDLE FileHandle,
- IN OUT VOID **BufferPtr,
- OUT UINTN *FileSize,
- IN UINTN AddtionAllocateSize
+ IN EFI_FILE_HANDLE FileHandle,
+ IN OUT VOID **BufferPtr,
+ OUT UINTN *FileSize,
+ IN UINTN AddtionAllocateSize
);
/**
@@ -48,8 +48,8 @@ ReadFileContent (
**/
BOOLEAN
UpdateCAFromFile (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
);
/**
@@ -64,8 +64,8 @@ UpdateCAFromFile (
**/
BOOLEAN
UpdatePrivateKeyFromFile (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
);
#endif
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c
index 881592efd9..b49825bcb7 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c
@@ -17,8 +17,8 @@ HII_VENDOR_DEVICE_PATH mWifiMgrDxeHiiVendorDevicePath = {
HARDWARE_DEVICE_PATH,
HW_VENDOR_DP,
{
- (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
- (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
+ (UINT8)(sizeof (VENDOR_DEVICE_PATH)),
+ (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
}
},
WIFI_CONNECTION_MANAGER_CONFIG_GUID
@@ -27,8 +27,8 @@ HII_VENDOR_DEVICE_PATH mWifiMgrDxeHiiVendorDevicePath = {
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{
- (UINT8) (END_DEVICE_PATH_LENGTH),
- (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
+ (UINT8)(END_DEVICE_PATH_LENGTH),
+ (UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
}
}
};
@@ -37,13 +37,13 @@ HII_VENDOR_DEVICE_PATH mWifiMgrDxeHiiVendorDevicePath = {
// HII Config Access Protocol instance
//
GLOBAL_REMOVE_IF_UNREFERENCED
-EFI_HII_CONFIG_ACCESS_PROTOCOL gWifiMgrDxeHiiConfigAccess = {
+EFI_HII_CONFIG_ACCESS_PROTOCOL gWifiMgrDxeHiiConfigAccess = {
WifiMgrDxeHiiConfigAccessExtractConfig,
WifiMgrDxeHiiConfigAccessRouteConfig,
WifiMgrDxeHiiConfigAccessCallback
};
-CHAR16* mSecurityType[] = {
+CHAR16 *mSecurityType[] = {
L"OPEN ",
L"WPA-Enterprise ",
L"WPA2-Enterprise",
@@ -53,7 +53,7 @@ CHAR16* mSecurityType[] = {
L"UnKnown "
};
-CHAR16* mSignalStrengthBar[] = {
+CHAR16 *mSignalStrengthBar[] = {
L"[-----]",
L"[*----]",
L"[**---]",
@@ -67,7 +67,7 @@ CHAR16* mSignalStrengthBar[] = {
#define NET_LIST_FOR_EACH_FROM_NODE(Entry, Node, ListHead) \
for(Entry = Node->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)
-extern EFI_GUID gWifiConfigFormSetGuid;
+extern EFI_GUID gWifiConfigFormSetGuid;
/**
Create Hii Extend Label OpCode as the start opcode and end opcode.
@@ -86,16 +86,16 @@ extern EFI_GUID gWifiConfigFormSetGuid;
**/
EFI_STATUS
WifiMgrCreateOpCode (
- IN UINT16 StartLabelNumber,
- OUT VOID **StartOpCodeHandle,
- OUT VOID **EndOpCodeHandle
+ IN UINT16 StartLabelNumber,
+ OUT VOID **StartOpCodeHandle,
+ OUT VOID **EndOpCodeHandle
)
{
- EFI_STATUS Status;
- EFI_IFR_GUID_LABEL *InternalStartLabel;
- EFI_IFR_GUID_LABEL *InternalEndLabel;
+ EFI_STATUS Status;
+ EFI_IFR_GUID_LABEL *InternalStartLabel;
+ EFI_IFR_GUID_LABEL *InternalEndLabel;
- if (StartOpCodeHandle == NULL || EndOpCodeHandle == NULL) {
+ if ((StartOpCodeHandle == NULL) || (EndOpCodeHandle == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -110,6 +110,7 @@ WifiMgrCreateOpCode (
if (*StartOpCodeHandle == NULL) {
goto Exit;
}
+
*EndOpCodeHandle = HiiAllocateOpCodeHandle ();
if (*EndOpCodeHandle == NULL) {
goto Exit;
@@ -118,30 +119,32 @@ WifiMgrCreateOpCode (
//
// Create Hii Extend Label OpCode as the start opcode.
//
- InternalStartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (
- *StartOpCodeHandle,
- &gEfiIfrTianoGuid,
- NULL,
- sizeof (EFI_IFR_GUID_LABEL)
- );
+ InternalStartLabel = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode (
+ *StartOpCodeHandle,
+ &gEfiIfrTianoGuid,
+ NULL,
+ sizeof (EFI_IFR_GUID_LABEL)
+ );
if (InternalStartLabel == NULL) {
goto Exit;
}
+
InternalStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
InternalStartLabel->Number = StartLabelNumber;
//
// Create Hii Extend Label OpCode as the end opcode.
//
- InternalEndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (
- *EndOpCodeHandle,
- &gEfiIfrTianoGuid,
- NULL,
- sizeof (EFI_IFR_GUID_LABEL)
- );
+ InternalEndLabel = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode (
+ *EndOpCodeHandle,
+ &gEfiIfrTianoGuid,
+ NULL,
+ sizeof (EFI_IFR_GUID_LABEL)
+ );
if (InternalEndLabel == NULL) {
goto Exit;
}
+
InternalEndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
InternalEndLabel->Number = LABEL_END;
@@ -152,9 +155,11 @@ Exit:
if (*StartOpCodeHandle != NULL) {
HiiFreeOpCodeHandle (*StartOpCodeHandle);
}
+
if (*EndOpCodeHandle != NULL) {
HiiFreeOpCodeHandle (*EndOpCodeHandle);
}
+
return Status;
}
@@ -169,18 +174,18 @@ Exit:
**/
EFI_STATUS
WifiMgrShowNicList (
- IN WIFI_MGR_PRIVATE_DATA *Private
-)
+ IN WIFI_MGR_PRIVATE_DATA *Private
+ )
{
- EFI_STATUS Status;
- CHAR16 MacString[WIFI_MGR_MAX_MAC_STRING_LEN];
- CHAR16 PortString[WIFI_STR_MAX_SIZE];
- EFI_STRING_ID PortTitleToken;
- EFI_STRING_ID PortTitleHelpToken;
- WIFI_MGR_DEVICE_DATA *Nic;
- LIST_ENTRY *Entry;
- VOID *StartOpCodeHandle;
- VOID *EndOpCodeHandle;
+ EFI_STATUS Status;
+ CHAR16 MacString[WIFI_MGR_MAX_MAC_STRING_LEN];
+ CHAR16 PortString[WIFI_STR_MAX_SIZE];
+ EFI_STRING_ID PortTitleToken;
+ EFI_STRING_ID PortTitleHelpToken;
+ WIFI_MGR_DEVICE_DATA *Nic;
+ LIST_ENTRY *Entry;
+ VOID *StartOpCodeHandle;
+ VOID *EndOpCodeHandle;
if (Private == NULL) {
return EFI_INVALID_PARAMETER;
@@ -228,7 +233,7 @@ WifiMgrShowNicList (
PortTitleToken,
PortTitleHelpToken,
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (KEY_MAC_ENTRY_BASE + Nic->NicIndex)
+ (UINT16)(KEY_MAC_ENTRY_BASE + Nic->NicIndex)
);
}
@@ -256,29 +261,28 @@ Exit:
@return the unicode string of AKM suite list or "None".
**/
-CHAR16*
+CHAR16 *
WifiMgrGetStrAKMList (
- IN WIFI_MGR_NETWORK_PROFILE *Profile
-)
+ IN WIFI_MGR_NETWORK_PROFILE *Profile
+ )
{
- UINT8 Index;
- UINT16 AKMSuiteCount;
- CHAR16 *AKMListDisplay;
+ UINT8 Index;
+ UINT16 AKMSuiteCount;
+ CHAR16 *AKMListDisplay;
AKMListDisplay = NULL;
- if (Profile == NULL || Profile->Network.AKMSuite == NULL) {
+ if ((Profile == NULL) || (Profile->Network.AKMSuite == NULL)) {
goto Exit;
}
AKMSuiteCount = Profile->Network.AKMSuite->AKMSuiteCount;
if (AKMSuiteCount != 0) {
-
//
// Current AKM Suite is between 1-9
//
- AKMListDisplay = (CHAR16 *) AllocateZeroPool(sizeof (CHAR16) * AKMSuiteCount * 2);
+ AKMListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * AKMSuiteCount * 2);
if (AKMListDisplay != NULL) {
- for (Index = 0; Index < AKMSuiteCount; Index ++) {
+ for (Index = 0; Index < AKMSuiteCount; Index++) {
UnicodeSPrint (
AKMListDisplay + (Index * 2),
sizeof (CHAR16) * 2,
@@ -297,6 +301,7 @@ Exit:
if (AKMListDisplay == NULL) {
AKMListDisplay = AllocateCopyPool (sizeof (L"None"), L"None");
}
+
return AKMListDisplay;
}
@@ -309,29 +314,28 @@ Exit:
@return the unicode string of Cipher suite list or "None".
**/
-CHAR16*
+CHAR16 *
WifiMgrGetStrCipherList (
- IN WIFI_MGR_NETWORK_PROFILE *Profile
-)
+ IN WIFI_MGR_NETWORK_PROFILE *Profile
+ )
{
- UINT8 Index;
- UINT16 CipherSuiteCount;
- CHAR16 *CipherListDisplay;
+ UINT8 Index;
+ UINT16 CipherSuiteCount;
+ CHAR16 *CipherListDisplay;
CipherListDisplay = NULL;
- if (Profile == NULL || Profile->Network.CipherSuite == NULL) {
+ if ((Profile == NULL) || (Profile->Network.CipherSuite == NULL)) {
goto Exit;
}
- CipherSuiteCount = Profile->Network.CipherSuite->CipherSuiteCount;
+ CipherSuiteCount = Profile->Network.CipherSuite->CipherSuiteCount;
if (CipherSuiteCount != 0) {
-
//
// Current Cipher Suite is between 1-9
//
- CipherListDisplay = (CHAR16 *) AllocateZeroPool(sizeof (CHAR16) * CipherSuiteCount * 2);
+ CipherListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * CipherSuiteCount * 2);
if (CipherListDisplay != NULL) {
- for (Index = 0; Index < CipherSuiteCount; Index ++) {
+ for (Index = 0; Index < CipherSuiteCount; Index++) {
UnicodeSPrint (
CipherListDisplay + (Index * 2),
sizeof (CHAR16) * 2,
@@ -350,6 +354,7 @@ Exit:
if (CipherListDisplay == NULL) {
CipherListDisplay = AllocateCopyPool (sizeof (L"None"), L"None");
}
+
return CipherListDisplay;
}
@@ -367,25 +372,25 @@ Exit:
**/
EFI_STATUS
WifiMgrRefreshNetworkList (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
)
{
- EFI_STATUS Status;
- EFI_TPL OldTpl;
- UINT32 AvailableCount;
- EFI_STRING_ID PortPromptToken;
- EFI_STRING_ID PortTextToken;
- EFI_STRING_ID PortHelpToken;
- WIFI_MGR_NETWORK_PROFILE *Profile;
- LIST_ENTRY *Entry;
- VOID *StartOpCodeHandle;
- VOID *EndOpCodeHandle;
- CHAR16 *AKMListDisplay;
- CHAR16 *CipherListDisplay;
- CHAR16 PortString[WIFI_STR_MAX_SIZE];
- UINTN PortStringSize;
- WIFI_MGR_NETWORK_PROFILE *ConnectedProfile;
+ EFI_STATUS Status;
+ EFI_TPL OldTpl;
+ UINT32 AvailableCount;
+ EFI_STRING_ID PortPromptToken;
+ EFI_STRING_ID PortTextToken;
+ EFI_STRING_ID PortHelpToken;
+ WIFI_MGR_NETWORK_PROFILE *Profile;
+ LIST_ENTRY *Entry;
+ VOID *StartOpCodeHandle;
+ VOID *EndOpCodeHandle;
+ CHAR16 *AKMListDisplay;
+ CHAR16 *CipherListDisplay;
+ CHAR16 PortString[WIFI_STR_MAX_SIZE];
+ UINTN PortStringSize;
+ WIFI_MGR_NETWORK_PROFILE *ConnectedProfile;
if (Private->CurrentNic == NULL) {
return EFI_SUCCESS;
@@ -400,7 +405,7 @@ WifiMgrRefreshNetworkList (
return Status;
}
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
AvailableCount = 0;
PortStringSize = sizeof (PortString);
ConnectedProfile = NULL;
@@ -408,23 +413,23 @@ WifiMgrRefreshNetworkList (
CipherListDisplay = NULL;
if (Private->CurrentNic->ConnectState == WifiMgrConnectedToAp) {
-
//
// Display the current connected network.
// Find the current operate network under connected status.
//
- if (Private->CurrentNic->CurrentOperateNetwork != NULL &&
- Private->CurrentNic->CurrentOperateNetwork->IsAvailable) {
-
+ if ((Private->CurrentNic->CurrentOperateNetwork != NULL) &&
+ Private->CurrentNic->CurrentOperateNetwork->IsAvailable)
+ {
Profile = Private->CurrentNic->CurrentOperateNetwork;
- AvailableCount ++;
+ AvailableCount++;
AKMListDisplay = WifiMgrGetStrAKMList (Profile);
if (AKMListDisplay == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;
}
- CipherListDisplay = WifiMgrGetStrCipherList(Profile);
+
+ CipherListDisplay = WifiMgrGetStrCipherList (Profile);
if (CipherListDisplay == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;
@@ -439,6 +444,7 @@ WifiMgrRefreshNetworkList (
UnicodeSPrint (PortString, PortStringSize, L"AKMSuite: %s CipherSuite: %s", AKMListDisplay, CipherListDisplay);
PortHelpToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
}
+
FreePool (AKMListDisplay);
FreePool (CipherListDisplay);
AKMListDisplay = NULL;
@@ -450,7 +456,7 @@ WifiMgrRefreshNetworkList (
PortPromptToken,
PortHelpToken,
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (KEY_AVAILABLE_NETWORK_ENTRY_BASE + Profile->ProfileIndex)
+ (UINT16)(KEY_AVAILABLE_NETWORK_ENTRY_BASE + Profile->ProfileIndex)
);
UnicodeSPrint (
@@ -459,7 +465,7 @@ WifiMgrRefreshNetworkList (
L"%s %s %s",
(Profile->SecurityType != SECURITY_TYPE_NONE ? L"Secured" : L"Open "),
mSecurityType[Profile->SecurityType],
- RSSI_TO_SIGNAL_STRENGTH_BAR(Profile->NetworkQuality)
+ RSSI_TO_SIGNAL_STRENGTH_BAR (Profile->NetworkQuality)
);
PortTextToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
@@ -468,7 +474,7 @@ WifiMgrRefreshNetworkList (
PortTextToken,
0,
0
- );
+ );
ConnectedProfile = Profile;
} else {
@@ -480,7 +486,6 @@ WifiMgrRefreshNetworkList (
// Display all supported available networks.
//
NET_LIST_FOR_EACH (Entry, &Private->CurrentNic->ProfileList) {
-
Profile = NET_LIST_USER_STRUCT_S (
Entry,
WIFI_MGR_NETWORK_PROFILE,
@@ -490,16 +495,17 @@ WifiMgrRefreshNetworkList (
if (ConnectedProfile == Profile) {
continue;
}
- if (Profile->IsAvailable && Profile->CipherSuiteSupported) {
- AvailableCount ++;
+ if (Profile->IsAvailable && Profile->CipherSuiteSupported) {
+ AvailableCount++;
AKMListDisplay = WifiMgrGetStrAKMList (Profile);
if (AKMListDisplay == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;
}
- CipherListDisplay = WifiMgrGetStrCipherList(Profile);
+
+ CipherListDisplay = WifiMgrGetStrCipherList (Profile);
if (CipherListDisplay == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;
@@ -518,7 +524,8 @@ WifiMgrRefreshNetworkList (
PortString,
PortStringSize,
L"AKMSuite: %s CipherSuite: %s",
- AKMListDisplay, CipherListDisplay
+ AKMListDisplay,
+ CipherListDisplay
);
PortHelpToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
if (PortHelpToken == 0) {
@@ -526,6 +533,7 @@ WifiMgrRefreshNetworkList (
goto Exit;
}
}
+
FreePool (AKMListDisplay);
FreePool (CipherListDisplay);
AKMListDisplay = NULL;
@@ -537,7 +545,7 @@ WifiMgrRefreshNetworkList (
PortPromptToken,
PortHelpToken,
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (KEY_AVAILABLE_NETWORK_ENTRY_BASE + Profile->ProfileIndex)
+ (UINT16)(KEY_AVAILABLE_NETWORK_ENTRY_BASE + Profile->ProfileIndex)
);
UnicodeSPrint (
@@ -546,13 +554,14 @@ WifiMgrRefreshNetworkList (
L"%s %s %s",
(Profile->SecurityType != SECURITY_TYPE_NONE ? L"Secured" : L"Open "),
mSecurityType[Profile->SecurityType],
- RSSI_TO_SIGNAL_STRENGTH_BAR(Profile->NetworkQuality)
+ RSSI_TO_SIGNAL_STRENGTH_BAR (Profile->NetworkQuality)
);
PortTextToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
if (PortTextToken == 0) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;
}
+
HiiCreateTextOpCode (
StartOpCodeHandle,
PortTextToken,
@@ -566,7 +575,6 @@ WifiMgrRefreshNetworkList (
// Display all Unsupported available networks.
//
NET_LIST_FOR_EACH (Entry, &Private->CurrentNic->ProfileList) {
-
Profile = NET_LIST_USER_STRUCT_S (
Entry,
WIFI_MGR_NETWORK_PROFILE,
@@ -576,16 +584,17 @@ WifiMgrRefreshNetworkList (
if (ConnectedProfile == Profile) {
continue;
}
- if (Profile->IsAvailable && !Profile->CipherSuiteSupported) {
- AvailableCount ++;
+ if (Profile->IsAvailable && !Profile->CipherSuiteSupported) {
+ AvailableCount++;
AKMListDisplay = WifiMgrGetStrAKMList (Profile);
if (AKMListDisplay == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;
}
- CipherListDisplay = WifiMgrGetStrCipherList(Profile);
+
+ CipherListDisplay = WifiMgrGetStrCipherList (Profile);
if (CipherListDisplay == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;
@@ -598,16 +607,19 @@ WifiMgrRefreshNetworkList (
PortString,
PortStringSize,
L"AKMSuite: %s CipherSuite(UnSupported): %s",
- AKMListDisplay, CipherListDisplay
+ AKMListDisplay,
+ CipherListDisplay
);
} else {
UnicodeSPrint (
PortString,
PortStringSize,
L"AKMSuite(UnSupported): %s CipherSuite(UnSupported): %s",
- AKMListDisplay, CipherListDisplay
+ AKMListDisplay,
+ CipherListDisplay
);
}
+
FreePool (AKMListDisplay);
FreePool (CipherListDisplay);
AKMListDisplay = NULL;
@@ -621,7 +633,7 @@ WifiMgrRefreshNetworkList (
PortPromptToken,
PortHelpToken,
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (KEY_AVAILABLE_NETWORK_ENTRY_BASE + Profile->ProfileIndex)
+ (UINT16)(KEY_AVAILABLE_NETWORK_ENTRY_BASE + Profile->ProfileIndex)
);
UnicodeSPrint (
@@ -630,7 +642,7 @@ WifiMgrRefreshNetworkList (
L"%s %s %s",
L"UnSupported",
mSecurityType[Profile->SecurityType],
- RSSI_TO_SIGNAL_STRENGTH_BAR(Profile->NetworkQuality)
+ RSSI_TO_SIGNAL_STRENGTH_BAR (Profile->NetworkQuality)
);
PortTextToken = HiiSetString (Private->RegisteredHandle, 0, PortString, NULL);
@@ -658,6 +670,7 @@ Exit:
if (AKMListDisplay != NULL) {
FreePool (AKMListDisplay);
}
+
if (CipherListDisplay != NULL) {
FreePool (CipherListDisplay);
}
@@ -680,17 +693,17 @@ Exit:
**/
EFI_STATUS
WifiMgrRefreshHiddenList (
- IN WIFI_MGR_PRIVATE_DATA *Private
+ IN WIFI_MGR_PRIVATE_DATA *Private
)
{
- EFI_STATUS Status;
- EFI_TPL OldTpl;
- UINTN Index;
- EFI_STRING_ID StringId;
- VOID *StartOpCodeHandle;
- VOID *EndOpCodeHandle;
- WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
- LIST_ENTRY *Entry;
+ EFI_STATUS Status;
+ EFI_TPL OldTpl;
+ UINTN Index;
+ EFI_STRING_ID StringId;
+ VOID *StartOpCodeHandle;
+ VOID *EndOpCodeHandle;
+ WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
+ LIST_ENTRY *Entry;
if (Private == NULL) {
return EFI_SUCCESS;
@@ -709,7 +722,6 @@ WifiMgrRefreshHiddenList (
Index = 0;
NET_LIST_FOR_EACH (Entry, &Private->HiddenNetworkList) {
-
HiddenNetwork = NET_LIST_USER_STRUCT_S (
Entry,
WIFI_HIDDEN_NETWORK_DATA,
@@ -720,16 +732,16 @@ WifiMgrRefreshHiddenList (
HiiCreateCheckBoxOpCode (
StartOpCodeHandle,
- (EFI_QUESTION_ID) (KEY_HIDDEN_NETWORK_ENTRY_BASE + Index),
+ (EFI_QUESTION_ID)(KEY_HIDDEN_NETWORK_ENTRY_BASE + Index),
MANAGER_VARSTORE_ID,
- (UINT16) (HIDDEN_NETWORK_LIST_VAR_OFFSET + Index),
+ (UINT16)(HIDDEN_NETWORK_LIST_VAR_OFFSET + Index),
StringId,
0,
0,
0,
NULL
);
- Index ++;
+ Index++;
}
Status = HiiUpdateForm (
@@ -746,7 +758,6 @@ WifiMgrRefreshHiddenList (
return Status;
}
-
/**
Callback function for user to select a Nic.
@@ -759,23 +770,24 @@ WifiMgrRefreshHiddenList (
**/
EFI_STATUS
WifiMgrSelectNic (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN EFI_QUESTION_ID KeyValue
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN EFI_QUESTION_ID KeyValue
)
{
- WIFI_MGR_DEVICE_DATA *Nic;
- UINT32 NicIndex;
- CHAR16 MacString[WIFI_MGR_MAX_MAC_STRING_LEN];
+ WIFI_MGR_DEVICE_DATA *Nic;
+ UINT32 NicIndex;
+ CHAR16 MacString[WIFI_MGR_MAX_MAC_STRING_LEN];
NicIndex = KeyValue - KEY_MAC_ENTRY_BASE;
Nic = WifiMgrGetNicByIndex (Private, NicIndex);
if (Nic == NULL) {
return EFI_NOT_FOUND;
}
+
Private->CurrentNic = Nic;
WifiMgrMacAddrToStr (&Nic->MacAddress, sizeof (MacString), MacString);
- HiiSetString (Private->RegisteredHandle, STRING_TOKEN(STR_MAC_ADDRESS), MacString, NULL);
+ HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_MAC_ADDRESS), MacString, NULL);
return EFI_SUCCESS;
}
@@ -788,7 +800,7 @@ WifiMgrSelectNic (
**/
VOID
WifiMgrCleanUserInput (
- IN WIFI_MGR_PRIVATE_DATA *Private
+ IN WIFI_MGR_PRIVATE_DATA *Private
)
{
Private->SecurityType = SECURITY_TYPE_NONE;
@@ -809,13 +821,13 @@ WifiMgrCleanUserInput (
**/
EFI_STATUS
-WifiMgrUserSelectProfileToConnect(
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN UINT32 ProfileIndex
+WifiMgrUserSelectProfileToConnect (
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN UINT32 ProfileIndex
)
{
- WIFI_MGR_NETWORK_PROFILE *Profile;
- WIFI_MGR_DEVICE_DATA *Nic;
+ WIFI_MGR_NETWORK_PROFILE *Profile;
+ WIFI_MGR_DEVICE_DATA *Nic;
Nic = Private->CurrentNic;
if (Nic == NULL) {
@@ -823,14 +835,15 @@ WifiMgrUserSelectProfileToConnect(
}
//
- //Initialize the connection page
+ // Initialize the connection page
//
- WifiMgrCleanUserInput(Private);
+ WifiMgrCleanUserInput (Private);
Profile = WifiMgrGetProfileByProfileIndex (ProfileIndex, &Nic->ProfileList);
if (Profile == NULL) {
return EFI_NOT_FOUND;
}
+
Private->CurrentNic->UserSelectedProfile = Profile;
return EFI_SUCCESS;
@@ -851,15 +864,15 @@ WifiMgrUserSelectProfileToConnect(
**/
EFI_STATUS
WifiMgrRecordPassword (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN EFI_STRING_ID StringId,
- IN CHAR16 *StringBuffer,
- IN UINTN StringBufferLen
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN EFI_STRING_ID StringId,
+ IN CHAR16 *StringBuffer,
+ IN UINTN StringBufferLen
)
{
- CHAR16 *Password;
+ CHAR16 *Password;
- if (StringId == 0 || StringBuffer == NULL || StringBufferLen <= 0) {
+ if ((StringId == 0) || (StringBuffer == NULL) || (StringBufferLen <= 0)) {
return EFI_INVALID_PARAMETER;
}
@@ -867,10 +880,12 @@ WifiMgrRecordPassword (
if (Password == NULL) {
return EFI_NOT_FOUND;
}
+
if (StrLen (Password) > StringBufferLen) {
FreePool (Password);
return EFI_NOT_FOUND;
}
+
StrnCpyS (StringBuffer, StringBufferLen, Password, StrLen (Password));
ZeroMem (Password, (StrLen (Password) + 1) * sizeof (CHAR16));
FreePool (Password);
@@ -896,16 +911,16 @@ WifiMgrRecordPassword (
**/
VOID
WifiMgrUpdateConnectMessage (
- IN WIFI_MGR_DEVICE_DATA *Nic,
- IN BOOLEAN ConnectStateChanged,
- IN EFI_STRING ConnectStatusMessage
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ IN BOOLEAN ConnectStateChanged,
+ IN EFI_STRING ConnectStatusMessage
)
{
- CHAR16 ConnectStatusStr[WIFI_STR_MAX_SIZE];
- WIFI_MGR_PRIVATE_DATA *Private;
+ CHAR16 ConnectStatusStr[WIFI_STR_MAX_SIZE];
+ WIFI_MGR_PRIVATE_DATA *Private;
Private = Nic->Private;
- if (Private == NULL || Private->CurrentNic != Nic) {
+ if ((Private == NULL) || (Private->CurrentNic != Nic)) {
return;
}
@@ -916,22 +931,30 @@ WifiMgrUpdateConnectMessage (
HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), ConnectStatusMessage, NULL);
} else {
if (Nic->ConnectState == WifiMgrConnectedToAp) {
-
- UnicodeSPrint (ConnectStatusStr, sizeof (ConnectStatusStr), L"Connected to %s",
- Nic->CurrentOperateNetwork->SSId);
+ UnicodeSPrint (
+ ConnectStatusStr,
+ sizeof (ConnectStatusStr),
+ L"Connected to %s",
+ Nic->CurrentOperateNetwork->SSId
+ );
HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), ConnectStatusStr, NULL);
} else if (Nic->ConnectState == WifiMgrDisconnected) {
-
HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), L"Disconnected", NULL);
} else if (Nic->ConnectState == WifiMgrConnectingToAp) {
-
- UnicodeSPrint (ConnectStatusStr, sizeof (ConnectStatusStr), L"Connecting to %s ...",
- Nic->CurrentOperateNetwork->SSId);
+ UnicodeSPrint (
+ ConnectStatusStr,
+ sizeof (ConnectStatusStr),
+ L"Connecting to %s ...",
+ Nic->CurrentOperateNetwork->SSId
+ );
HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), ConnectStatusStr, NULL);
} else if (Nic->ConnectState == WifiMgrDisconnectingToAp) {
-
- UnicodeSPrint (ConnectStatusStr, sizeof (ConnectStatusStr), L"Disconnecting from %s ...",
- Nic->CurrentOperateNetwork->SSId);
+ UnicodeSPrint (
+ ConnectStatusStr,
+ sizeof (ConnectStatusStr),
+ L"Disconnecting from %s ...",
+ Nic->CurrentOperateNetwork->SSId
+ );
HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_STATUS), ConnectStatusStr, NULL);
} else {
return;
@@ -941,25 +964,31 @@ WifiMgrUpdateConnectMessage (
//
// Update Connect Button
//
- if (Nic->ConnectState == WifiMgrConnectedToAp && Nic->UserSelectedProfile == Nic->CurrentOperateNetwork) {
-
- HiiSetString (Private->RegisteredHandle,
- STRING_TOKEN (STR_CONNECT_NOW), L"Disconnect from this Network", NULL);
+ if ((Nic->ConnectState == WifiMgrConnectedToAp) && (Nic->UserSelectedProfile == Nic->CurrentOperateNetwork)) {
+ HiiSetString (
+ Private->RegisteredHandle,
+ STRING_TOKEN (STR_CONNECT_NOW),
+ L"Disconnect from this Network",
+ NULL
+ );
} else {
HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECT_NOW), L"Connect to this Network", NULL);
}
+
gBS->SignalEvent (Private->ConnectFormRefreshEvent);
//
// Update Main Page and Network List
//
if (ConnectStateChanged) {
-
if (Nic->ConnectState == WifiMgrConnectedToAp) {
-
HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECTION_INFO), L"Connected to", NULL);
- HiiSetString (Private->RegisteredHandle,
- STRING_TOKEN (STR_CONNECTED_SSID), Nic->CurrentOperateNetwork->SSId, NULL);
+ HiiSetString (
+ Private->RegisteredHandle,
+ STRING_TOKEN (STR_CONNECTED_SSID),
+ Nic->CurrentOperateNetwork->SSId,
+ NULL
+ );
} else {
HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECTION_INFO), L"Disconnected", NULL);
HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_CONNECTED_SSID), L"", NULL);
@@ -981,8 +1010,8 @@ WifiMgrUpdateConnectMessage (
**/
EFI_STATUS
WifiMgrConvertConfigDataToIfrNvData (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
)
{
//
@@ -1010,8 +1039,8 @@ WifiMgrConvertConfigDataToIfrNvData (
**/
EFI_STATUS
WifiMgrConvertIfrNvDataToConfigData (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
)
{
return EFI_SUCCESS;
@@ -1096,22 +1125,23 @@ WifiMgrDxeHiiConfigAccessExtractConfig (
OUT EFI_STRING *Results
)
{
- WIFI_MGR_PRIVATE_DATA *Private;
- WIFI_MANAGER_IFR_NVDATA *IfrNvData;
- EFI_STRING ConfigRequestHdr;
- EFI_STRING ConfigRequest;
- UINTN Size;
- BOOLEAN AllocatedRequest;
- UINTN BufferSize;
- EFI_STATUS Status;
-
- if (This == NULL || Progress == NULL || Results == NULL) {
+ WIFI_MGR_PRIVATE_DATA *Private;
+ WIFI_MANAGER_IFR_NVDATA *IfrNvData;
+ EFI_STRING ConfigRequestHdr;
+ EFI_STRING ConfigRequest;
+ UINTN Size;
+ BOOLEAN AllocatedRequest;
+ UINTN BufferSize;
+ EFI_STATUS Status;
+
+ if ((This == NULL) || (Progress == NULL) || (Results == NULL)) {
return EFI_INVALID_PARAMETER;
}
*Progress = Request;
if ((Request != NULL) &&
- !HiiIsConfigHdrMatch (Request, &gWifiConfigFormSetGuid, mVendorStorageName)) {
+ !HiiIsConfigHdrMatch (Request, &gWifiConfigFormSetGuid, mVendorStorageName))
+ {
return EFI_NOT_FOUND;
}
@@ -1120,10 +1150,10 @@ WifiMgrDxeHiiConfigAccessExtractConfig (
AllocatedRequest = FALSE;
Size = 0;
- Private = WIFI_MGR_PRIVATE_DATA_FROM_CONFIG_ACCESS (This);
+ Private = WIFI_MGR_PRIVATE_DATA_FROM_CONFIG_ACCESS (This);
BufferSize = sizeof (WIFI_MANAGER_IFR_NVDATA);
- IfrNvData = AllocateZeroPool (BufferSize);
+ IfrNvData = AllocateZeroPool (BufferSize);
if (IfrNvData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -1140,16 +1170,16 @@ WifiMgrDxeHiiConfigAccessExtractConfig (
ConfigRequestHdr = HiiConstructConfigHdr (
&gWifiConfigFormSetGuid,
mVendorStorageName,
- Private->DriverHandle);
+ Private->DriverHandle
+ );
if (ConfigRequestHdr == NULL) {
FreePool (IfrNvData);
return EFI_OUT_OF_RESOURCES;
}
- Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
+ Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
ConfigRequest = AllocateZeroPool (Size);
if (ConfigRequest == NULL) {
-
FreePool (IfrNvData);
FreePool (ConfigRequestHdr);
return EFI_OUT_OF_RESOURCES;
@@ -1161,7 +1191,7 @@ WifiMgrDxeHiiConfigAccessExtractConfig (
Size,
L"%s&OFFSET=0&WIDTH=%016LX",
ConfigRequestHdr,
- (UINT64) BufferSize
+ (UINT64)BufferSize
);
FreePool (ConfigRequestHdr);
}
@@ -1172,7 +1202,7 @@ WifiMgrDxeHiiConfigAccessExtractConfig (
Status = gHiiConfigRouting->BlockToConfig (
gHiiConfigRouting,
ConfigRequest,
- (UINT8 *) IfrNvData,
+ (UINT8 *)IfrNvData,
BufferSize,
Results,
Progress
@@ -1186,6 +1216,7 @@ WifiMgrDxeHiiConfigAccessExtractConfig (
FreePool (ConfigRequest);
ConfigRequest = NULL;
}
+
//
// Set Progress string to the original request string.
//
@@ -1245,12 +1276,12 @@ WifiMgrDxeHiiConfigAccessRouteConfig (
OUT EFI_STRING *Progress
)
{
- EFI_STATUS Status;
- UINTN BufferSize;
- WIFI_MGR_PRIVATE_DATA *Private;
- WIFI_MANAGER_IFR_NVDATA *IfrNvData;
+ EFI_STATUS Status;
+ UINTN BufferSize;
+ WIFI_MGR_PRIVATE_DATA *Private;
+ WIFI_MANAGER_IFR_NVDATA *IfrNvData;
- if (Configuration == NULL || Progress == NULL) {
+ if ((Configuration == NULL) || (Progress == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1273,7 +1304,7 @@ WifiMgrDxeHiiConfigAccessRouteConfig (
Status = gHiiConfigRouting->ConfigToBlock (
gHiiConfigRouting,
Configuration,
- (UINT8*) IfrNvData,
+ (UINT8 *)IfrNvData,
&BufferSize,
Progress
);
@@ -1316,39 +1347,40 @@ WifiMgrDxeHiiConfigAccessRouteConfig (
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
+ 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 Status;
- EFI_INPUT_KEY Key;
- UINTN BufferSize;
- WIFI_MGR_PRIVATE_DATA *Private;
- WIFI_MANAGER_IFR_NVDATA *IfrNvData;
- EFI_DEVICE_PATH_PROTOCOL *FilePath;
- WIFI_MGR_NETWORK_PROFILE *Profile;
- WIFI_MGR_NETWORK_PROFILE *ProfileToConnect;
- WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
- UINTN TempDataSize;
- VOID *TempData;
- LIST_ENTRY *Entry;
- UINT32 Index;
- UINT32 RemoveCount;
- CHAR16 *TempPassword;
- CHAR16 *ErrorMessage;
-
- if (Action != EFI_BROWSER_ACTION_FORM_OPEN &&
- Action != EFI_BROWSER_ACTION_FORM_CLOSE &&
- Action != EFI_BROWSER_ACTION_CHANGING &&
- Action != EFI_BROWSER_ACTION_CHANGED &&
- Action != EFI_BROWSER_ACTION_RETRIEVE) {
-
+ EFI_STATUS Status;
+ EFI_INPUT_KEY Key;
+ UINTN BufferSize;
+ WIFI_MGR_PRIVATE_DATA *Private;
+ WIFI_MANAGER_IFR_NVDATA *IfrNvData;
+ EFI_DEVICE_PATH_PROTOCOL *FilePath;
+ WIFI_MGR_NETWORK_PROFILE *Profile;
+ WIFI_MGR_NETWORK_PROFILE *ProfileToConnect;
+ WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
+ UINTN TempDataSize;
+ VOID *TempData;
+ LIST_ENTRY *Entry;
+ UINT32 Index;
+ UINT32 RemoveCount;
+ CHAR16 *TempPassword;
+ CHAR16 *ErrorMessage;
+
+ if ((Action != EFI_BROWSER_ACTION_FORM_OPEN) &&
+ (Action != EFI_BROWSER_ACTION_FORM_CLOSE) &&
+ (Action != EFI_BROWSER_ACTION_CHANGING) &&
+ (Action != EFI_BROWSER_ACTION_CHANGED) &&
+ (Action != EFI_BROWSER_ACTION_RETRIEVE))
+ {
return EFI_UNSUPPORTED;
}
+
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1363,525 +1395,531 @@ WifiMgrDxeHiiConfigAccessCallback (
// Retrieve uncommitted data from Browser
//
BufferSize = sizeof (WIFI_MANAGER_IFR_NVDATA);
- IfrNvData = AllocateZeroPool (BufferSize);
+ IfrNvData = AllocateZeroPool (BufferSize);
if (IfrNvData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- HiiGetBrowserData (&gWifiConfigFormSetGuid, mVendorStorageName, BufferSize, (UINT8 *) IfrNvData);
+
+ HiiGetBrowserData (&gWifiConfigFormSetGuid, mVendorStorageName, BufferSize, (UINT8 *)IfrNvData);
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
switch (QuestionId) {
+ case KEY_MAC_LIST:
- case KEY_MAC_LIST:
+ Status = WifiMgrShowNicList (Private);
+ break;
- Status = WifiMgrShowNicList (Private);
- break;
+ case KEY_REFRESH_NETWORK_LIST:
- case KEY_REFRESH_NETWORK_LIST:
+ if (Private->CurrentNic->UserSelectedProfile != NULL) {
+ Profile = Private->CurrentNic->UserSelectedProfile;
- if (Private->CurrentNic->UserSelectedProfile != NULL) {
+ //
+ // Erase secrets since user has left Connection Page
+ // Connection Page may direct to Network List Page or Eap Configuration Page,
+ // secrets only need to be erased when head to Network List Page
+ //
+ WifiMgrCleanProfileSecrets (Profile);
+
+ Private->CurrentNic->UserSelectedProfile = NULL;
+ }
+
+ break;
+
+ case KEY_CONNECT_ACTION:
+
+ if (Private->CurrentNic->UserSelectedProfile == NULL) {
+ break;
+ }
Profile = Private->CurrentNic->UserSelectedProfile;
//
- // Erase secrets since user has left Connection Page
- // Connection Page may direct to Network List Page or Eap Configuration Page,
- // secrets only need to be erased when head to Network List Page
+ // Enter the network connection configuration page
+ // Recovery from restored data
//
- WifiMgrCleanProfileSecrets (Profile);
-
- Private->CurrentNic->UserSelectedProfile = NULL;
- }
+ if (HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_SSID), Profile->SSId, NULL) == 0) {
+ return EFI_OUT_OF_RESOURCES;
+ }
- break;
+ IfrNvData->SecurityType = Profile->SecurityType;
+ if (HiiSetString (
+ Private->RegisteredHandle,
+ STRING_TOKEN (STR_SECURITY_TYPE),
+ mSecurityType[IfrNvData->SecurityType],
+ NULL
+ ) == 0)
+ {
+ return EFI_OUT_OF_RESOURCES;
+ }
- case KEY_CONNECT_ACTION:
+ if (IfrNvData->SecurityType == SECURITY_TYPE_WPA2_ENTERPRISE) {
+ IfrNvData->EapAuthMethod = Profile->EapAuthMethod;
+ IfrNvData->EapSecondAuthMethod = Profile->EapSecondAuthMethod;
+ StrCpyS (IfrNvData->EapIdentity, EAP_IDENTITY_SIZE, Profile->EapIdentity);
+ }
- if (Private->CurrentNic->UserSelectedProfile == NULL) {
break;
- }
- Profile = Private->CurrentNic->UserSelectedProfile;
-
- //
- //Enter the network connection configuration page
- //Recovery from restored data
- //
- if (HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_SSID), Profile->SSId, NULL) == 0) {
- return EFI_OUT_OF_RESOURCES;
- }
- IfrNvData->SecurityType = Profile->SecurityType;
- if (HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_SECURITY_TYPE),
- mSecurityType[IfrNvData->SecurityType], NULL) == 0) {
- return EFI_OUT_OF_RESOURCES;
- }
- if (IfrNvData->SecurityType == SECURITY_TYPE_WPA2_ENTERPRISE) {
+ case KEY_ENROLLED_CERT_NAME:
- IfrNvData->EapAuthMethod = Profile->EapAuthMethod;
- IfrNvData->EapSecondAuthMethod = Profile->EapSecondAuthMethod;
- StrCpyS (IfrNvData->EapIdentity, EAP_IDENTITY_SIZE, Profile->EapIdentity);
- }
+ if (Private->CurrentNic->UserSelectedProfile == NULL) {
+ break;
+ }
- break;
+ Profile = Private->CurrentNic->UserSelectedProfile;
- case KEY_ENROLLED_CERT_NAME:
+ //
+ // Enter the key enrollment page
+ // For TTLS and PEAP, only CA cert needs to be cared
+ //
+ if (Private->FileType == FileTypeCACert) {
+ if (Profile->CACertData != NULL) {
+ HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), Profile->CACertName, NULL);
+ } else {
+ HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), L"", NULL);
+ }
+ } else if (Private->FileType == FileTypeClientCert) {
+ if (Profile->ClientCertData != NULL) {
+ HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), Profile->ClientCertName, NULL);
+ } else {
+ HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), L"", NULL);
+ }
+ }
- if (Private->CurrentNic->UserSelectedProfile == NULL) {
break;
- }
- Profile = Private->CurrentNic->UserSelectedProfile;
- //
- //Enter the key enrollment page
- //For TTLS and PEAP, only CA cert needs to be cared
- //
- if (Private->FileType == FileTypeCACert) {
+ case KEY_ENROLLED_PRIVATE_KEY_NAME:
- if (Profile->CACertData != NULL) {
- HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), Profile->CACertName, NULL);
- } else {
- HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), L"", NULL);
+ if (Private->CurrentNic->UserSelectedProfile == NULL) {
+ break;
}
- } else if (Private->FileType == FileTypeClientCert) {
- if (Profile->ClientCertData != NULL) {
- HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), Profile->ClientCertName, NULL);
+ Profile = Private->CurrentNic->UserSelectedProfile;
+
+ if (Profile->PrivateKeyData != NULL) {
+ HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME), Profile->PrivateKeyName, NULL);
} else {
- HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_CERT_NAME), L"", NULL);
+ HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME), L"", NULL);
}
- }
- break;
- case KEY_ENROLLED_PRIVATE_KEY_NAME:
-
- if (Private->CurrentNic->UserSelectedProfile == NULL) {
break;
- }
- Profile = Private->CurrentNic->UserSelectedProfile;
- if (Profile->PrivateKeyData != NULL) {
- HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME), Profile->PrivateKeyName, NULL);
- } else {
- HiiSetString (Private->RegisteredHandle, STRING_TOKEN (STR_EAP_ENROLLED_PRIVATE_KEY_NAME), L"", NULL);
- }
- break;
-
- default:
- break;
+ default:
+ break;
}
} else if (Action == EFI_BROWSER_ACTION_FORM_CLOSE) {
switch (QuestionId) {
+ case KEY_CONNECT_ACTION:
- case KEY_CONNECT_ACTION:
+ if (Private->CurrentNic->UserSelectedProfile == NULL) {
+ break;
+ }
- if (Private->CurrentNic->UserSelectedProfile == NULL) {
- break;
- }
- Profile = Private->CurrentNic->UserSelectedProfile;
+ Profile = Private->CurrentNic->UserSelectedProfile;
- //
- //Restore User Config Data for Page recovery
- //
- if (IfrNvData->SecurityType == SECURITY_TYPE_WPA2_ENTERPRISE) {
+ //
+ // Restore User Config Data for Page recovery
+ //
+ if (IfrNvData->SecurityType == SECURITY_TYPE_WPA2_ENTERPRISE) {
+ Profile->EapAuthMethod = IfrNvData->EapAuthMethod;
+ Profile->EapSecondAuthMethod = IfrNvData->EapSecondAuthMethod;
+ StrCpyS (Profile->EapIdentity, EAP_IDENTITY_SIZE, IfrNvData->EapIdentity);
+ }
- Profile->EapAuthMethod = IfrNvData->EapAuthMethod;
- Profile->EapSecondAuthMethod = IfrNvData->EapSecondAuthMethod;
- StrCpyS (Profile->EapIdentity, EAP_IDENTITY_SIZE, IfrNvData->EapIdentity);
- }
- break;
+ break;
- default:
- break;
+ default:
+ break;
}
} else if (Action == EFI_BROWSER_ACTION_CHANGING) {
switch (QuestionId) {
+ case KEY_NETWORK_LIST:
- case KEY_NETWORK_LIST:
-
- //
- //User triggered a scan process.
- //
- Private->CurrentNic->OneTimeScanRequest = TRUE;
- break;
-
- case KEY_PASSWORD_CONNECT_NETWORK:
- case KEY_EAP_PASSWORD_CONNECT_NETWORK:
- case KEY_PRIVATE_KEY_PASSWORD:
-
- if (Private->CurrentNic->UserSelectedProfile == NULL) {
- break;
- }
- Profile = Private->CurrentNic->UserSelectedProfile;
-
- if (QuestionId == KEY_PASSWORD_CONNECT_NETWORK) {
- TempPassword = Profile->Password;
- } else if (QuestionId == KEY_EAP_PASSWORD_CONNECT_NETWORK) {
- TempPassword = Profile->EapPassword;
- } else {
- TempPassword = Profile->PrivateKeyPassword;
- }
-
- Status = WifiMgrRecordPassword (Private, Value->string, TempPassword, PASSWORD_STORAGE_SIZE);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "[WiFi Connection Manager] Error: Failed to input password!"));
+ //
+ // User triggered a scan process.
+ //
+ Private->CurrentNic->OneTimeScanRequest = TRUE;
break;
- }
- //
- // This password is not a new created password, so no need to confirm.
- //
- Status = EFI_NOT_FOUND;
- break;
+ case KEY_PASSWORD_CONNECT_NETWORK:
+ case KEY_EAP_PASSWORD_CONNECT_NETWORK:
+ case KEY_PRIVATE_KEY_PASSWORD:
- case KEY_CONNECT_ACTION:
+ if (Private->CurrentNic->UserSelectedProfile == NULL) {
+ break;
+ }
- ErrorMessage = NULL;
- ProfileToConnect = NULL;
+ Profile = Private->CurrentNic->UserSelectedProfile;
- if (Private->CurrentNic->UserSelectedProfile == NULL) {
- break;
- }
- Profile = Private->CurrentNic->UserSelectedProfile;
+ if (QuestionId == KEY_PASSWORD_CONNECT_NETWORK) {
+ TempPassword = Profile->Password;
+ } else if (QuestionId == KEY_EAP_PASSWORD_CONNECT_NETWORK) {
+ TempPassword = Profile->EapPassword;
+ } else {
+ TempPassword = Profile->PrivateKeyPassword;
+ }
- if (Private->CurrentNic->ConnectState == WifiMgrDisconnected ||
- Profile != Private->CurrentNic->CurrentOperateNetwork) {
+ Status = WifiMgrRecordPassword (Private, Value->string, TempPassword, PASSWORD_STORAGE_SIZE);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "[WiFi Connection Manager] Error: Failed to input password!"));
+ break;
+ }
//
- // When this network is not currently connected, pend it to connect.
+ // This password is not a new created password, so no need to confirm.
//
- if (Profile->AKMSuiteSupported && Profile->CipherSuiteSupported) {
-
- if (Profile->SecurityType == SECURITY_TYPE_NONE || Profile->SecurityType == SECURITY_TYPE_WPA2_PERSONAL) {
+ Status = EFI_NOT_FOUND;
+ break;
- //
- // For Open network, connect directly.
- //
- ProfileToConnect = Profile;
+ case KEY_CONNECT_ACTION:
- } else if (Profile->SecurityType == SECURITY_TYPE_WPA2_ENTERPRISE) {
+ ErrorMessage = NULL;
+ ProfileToConnect = NULL;
- //
- // For WPA/WPA2-Enterprise network, conduct eap configuration first.
- // Only EAP-TLS, TTLS and PEAP is supported now!
- //
- Profile->EapAuthMethod = IfrNvData->EapAuthMethod;
- StrCpyS (Profile->EapIdentity, EAP_IDENTITY_SIZE, IfrNvData->EapIdentity);
+ if (Private->CurrentNic->UserSelectedProfile == NULL) {
+ break;
+ }
- if (IfrNvData->EapAuthMethod == EAP_AUTH_METHOD_TTLS || IfrNvData->EapAuthMethod == EAP_AUTH_METHOD_PEAP) {
+ Profile = Private->CurrentNic->UserSelectedProfile;
- Profile->EapSecondAuthMethod = IfrNvData->EapSecondAuthMethod;
- ProfileToConnect = Profile;
- } else if (IfrNvData->EapAuthMethod == EAP_AUTH_METHOD_TLS) {
+ if ((Private->CurrentNic->ConnectState == WifiMgrDisconnected) ||
+ (Profile != Private->CurrentNic->CurrentOperateNetwork))
+ {
+ //
+ // When this network is not currently connected, pend it to connect.
+ //
+ if (Profile->AKMSuiteSupported && Profile->CipherSuiteSupported) {
+ if ((Profile->SecurityType == SECURITY_TYPE_NONE) || (Profile->SecurityType == SECURITY_TYPE_WPA2_PERSONAL)) {
+ //
+ // For Open network, connect directly.
+ //
ProfileToConnect = Profile;
+ } else if (Profile->SecurityType == SECURITY_TYPE_WPA2_ENTERPRISE) {
+ //
+ // For WPA/WPA2-Enterprise network, conduct eap configuration first.
+ // Only EAP-TLS, TTLS and PEAP is supported now!
+ //
+ Profile->EapAuthMethod = IfrNvData->EapAuthMethod;
+ StrCpyS (Profile->EapIdentity, EAP_IDENTITY_SIZE, IfrNvData->EapIdentity);
+
+ if ((IfrNvData->EapAuthMethod == EAP_AUTH_METHOD_TTLS) || (IfrNvData->EapAuthMethod == EAP_AUTH_METHOD_PEAP)) {
+ Profile->EapSecondAuthMethod = IfrNvData->EapSecondAuthMethod;
+ ProfileToConnect = Profile;
+ } else if (IfrNvData->EapAuthMethod == EAP_AUTH_METHOD_TLS) {
+ ProfileToConnect = Profile;
+ } else {
+ ErrorMessage = L"ERROR: Only EAP-TLS, TTLS or PEAP is supported now!";
+ }
} else {
- ErrorMessage = L"ERROR: Only EAP-TLS, TTLS or PEAP is supported now!";
+ ErrorMessage = L"ERROR: Can't connect to this network!";
}
} else {
- ErrorMessage = L"ERROR: Can't connect to this network!";
+ ErrorMessage = L"ERROR: This network is not supported!";
}
- } else {
- ErrorMessage = L"ERROR: This network is not supported!";
- }
-
- if (ErrorMessage != NULL) {
- CreatePopUp (
- EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
- &Key,
- ErrorMessage,
- NULL
- );
- }
- if (ProfileToConnect != NULL) {
+ if (ErrorMessage != NULL) {
+ CreatePopUp (
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
+ &Key,
+ ErrorMessage,
+ NULL
+ );
+ }
- Private->CurrentNic->OneTimeConnectRequest = TRUE;
- Private->CurrentNic->ConnectPendingNetwork = ProfileToConnect;
+ if (ProfileToConnect != NULL) {
+ Private->CurrentNic->OneTimeConnectRequest = TRUE;
+ Private->CurrentNic->ConnectPendingNetwork = ProfileToConnect;
+ }
+ } else if (Private->CurrentNic->ConnectState == WifiMgrConnectedToAp) {
+ //
+ // This network is currently connected, just disconnect from it.
+ //
+ Private->CurrentNic->OneTimeDisconnectRequest = TRUE;
+ Private->CurrentNic->HasDisconnectPendingNetwork = TRUE;
}
- } else if (Private->CurrentNic->ConnectState == WifiMgrConnectedToAp) {
- //
- // This network is currently connected, just disconnect from it.
- //
- Private->CurrentNic->OneTimeDisconnectRequest = TRUE;
- Private->CurrentNic->HasDisconnectPendingNetwork = TRUE;
- }
- break;
-
- case KEY_ENROLL_CA_CERT_CONNECT_NETWORK:
-
- Private->FileType = FileTypeCACert;
- break;
-
- case KEY_ENROLL_CLIENT_CERT_CONNECT_NETWORK:
-
- Private->FileType = FileTypeClientCert;
- break;
-
- case KEY_EAP_ENROLL_PRIVATE_KEY_FROM_FILE:
+ break;
- FilePath = NULL;
- ChooseFile (NULL, NULL, NULL, &FilePath);
+ case KEY_ENROLL_CA_CERT_CONNECT_NETWORK:
- if (FilePath != NULL) {
+ Private->FileType = FileTypeCACert;
+ break;
- UpdatePrivateKeyFromFile(Private, FilePath);
- FreePool (FilePath);
- }
- break;
+ case KEY_ENROLL_CLIENT_CERT_CONNECT_NETWORK:
- case KEY_EAP_ENROLL_CERT_FROM_FILE:
+ Private->FileType = FileTypeClientCert;
+ break;
- //
- //User will select a cert file from File Explore
- //
- FilePath = NULL;
- ChooseFile( NULL, NULL, NULL, &FilePath);
+ case KEY_EAP_ENROLL_PRIVATE_KEY_FROM_FILE:
- if (FilePath != NULL) {
+ FilePath = NULL;
+ ChooseFile (NULL, NULL, NULL, &FilePath);
- UpdateCAFromFile(Private, FilePath);
- FreePool (FilePath);
- }
- break;
+ if (FilePath != NULL) {
+ UpdatePrivateKeyFromFile (Private, FilePath);
+ FreePool (FilePath);
+ }
- case KEY_SAVE_PRIVATE_KEY_TO_MEM:
+ break;
- if (Private->FileContext != NULL && Private->FileContext->FHandle != NULL &&
- Private->CurrentNic->UserSelectedProfile != NULL) {
+ case KEY_EAP_ENROLL_CERT_FROM_FILE:
//
- // Read Private Key file to Buffer
+ // User will select a cert file from File Explore
//
- Profile = Private->CurrentNic->UserSelectedProfile;
- if (Profile->PrivateKeyData != NULL) {
+ FilePath = NULL;
+ ChooseFile (NULL, NULL, NULL, &FilePath);
- ZeroMem (Profile->PrivateKeyData, Profile->PrivateKeyDataSize);
- FreePool (Profile->PrivateKeyData);
- Profile->PrivateKeyData = NULL;
+ if (FilePath != NULL) {
+ UpdateCAFromFile (Private, FilePath);
+ FreePool (FilePath);
}
- Status = WifiMgrReadFileToBuffer (
- Private->FileContext,
- &TempData,
- &TempDataSize
- );
- if (EFI_ERROR (Status)) {
- CreatePopUp (
- EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
- &Key,
- L"ERROR: Can't read this private key file!",
- NULL
- );
- } else {
-
- ASSERT (Private->FileContext->FileName != NULL);
-
- Profile->PrivateKeyData = TempData;
- Profile->PrivateKeyDataSize = TempDataSize;
- StrCpyS(Profile->PrivateKeyName, WIFI_FILENAME_STR_MAX_SIZE, Private->FileContext->FileName);
-
- DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Private Key: %s has been enrolled! Size: %d\n",
- Profile->PrivateKeyName, Profile->PrivateKeyDataSize));
- }
- }
- break;
-
- case KEY_SAVE_CERT_TO_MEM:
-
- if (Private->FileContext != NULL && Private->FileContext->FHandle != NULL &&
- Private->CurrentNic->UserSelectedProfile != NULL) {
-
- //
- // Read Cert file to Buffer
- //
- Profile = Private->CurrentNic->UserSelectedProfile;
-
- if (Private->FileType == FileTypeCACert) {
- if (Profile->CACertData != NULL) {
+ break;
- ZeroMem (Profile->CACertData, Profile->CACertSize);
- FreePool (Profile->CACertData);
- Profile->CACertData = NULL;
+ case KEY_SAVE_PRIVATE_KEY_TO_MEM:
+
+ if ((Private->FileContext != NULL) && (Private->FileContext->FHandle != NULL) &&
+ (Private->CurrentNic->UserSelectedProfile != NULL))
+ {
+ //
+ // Read Private Key file to Buffer
+ //
+ Profile = Private->CurrentNic->UserSelectedProfile;
+ if (Profile->PrivateKeyData != NULL) {
+ ZeroMem (Profile->PrivateKeyData, Profile->PrivateKeyDataSize);
+ FreePool (Profile->PrivateKeyData);
+ Profile->PrivateKeyData = NULL;
}
- } else if (Private->FileType == FileTypeClientCert) {
- if (Profile->ClientCertData != NULL) {
- ZeroMem (Profile->ClientCertData, Profile->ClientCertSize);
- FreePool (Profile->ClientCertData);
- Profile->ClientCertData = NULL;
+ Status = WifiMgrReadFileToBuffer (
+ Private->FileContext,
+ &TempData,
+ &TempDataSize
+ );
+ if (EFI_ERROR (Status)) {
+ CreatePopUp (
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
+ &Key,
+ L"ERROR: Can't read this private key file!",
+ NULL
+ );
+ } else {
+ ASSERT (Private->FileContext->FileName != NULL);
+
+ Profile->PrivateKeyData = TempData;
+ Profile->PrivateKeyDataSize = TempDataSize;
+ StrCpyS (Profile->PrivateKeyName, WIFI_FILENAME_STR_MAX_SIZE, Private->FileContext->FileName);
+
+ DEBUG ((
+ DEBUG_INFO,
+ "[WiFi Connection Manager] Private Key: %s has been enrolled! Size: %d\n",
+ Profile->PrivateKeyName,
+ Profile->PrivateKeyDataSize
+ ));
}
- } else {
- break;
}
- Status = WifiMgrReadFileToBuffer (
- Private->FileContext,
- &TempData,
- &TempDataSize
- );
- if (EFI_ERROR (Status)) {
- CreatePopUp (
- EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
- &Key,
- L"ERROR: Can't read this certificate file!",
- NULL
- );
- } else {
+ break;
- ASSERT (Private->FileContext->FileName != NULL);
- if (Private->FileType == FileTypeCACert) {
+ case KEY_SAVE_CERT_TO_MEM:
+
+ if ((Private->FileContext != NULL) && (Private->FileContext->FHandle != NULL) &&
+ (Private->CurrentNic->UserSelectedProfile != NULL))
+ {
+ //
+ // Read Cert file to Buffer
+ //
+ Profile = Private->CurrentNic->UserSelectedProfile;
- Profile->CACertData = TempData;
- Profile->CACertSize = TempDataSize;
- StrCpyS(Profile->CACertName, WIFI_FILENAME_STR_MAX_SIZE, Private->FileContext->FileName);
- DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] CA Cert: %s has been enrolled! Size: %d\n",
- Profile->CACertName, Profile->CACertSize));
+ if (Private->FileType == FileTypeCACert) {
+ if (Profile->CACertData != NULL) {
+ ZeroMem (Profile->CACertData, Profile->CACertSize);
+ FreePool (Profile->CACertData);
+ Profile->CACertData = NULL;
+ }
+ } else if (Private->FileType == FileTypeClientCert) {
+ if (Profile->ClientCertData != NULL) {
+ ZeroMem (Profile->ClientCertData, Profile->ClientCertSize);
+ FreePool (Profile->ClientCertData);
+ Profile->ClientCertData = NULL;
+ }
} else {
+ break;
+ }
- Profile->ClientCertData = TempData;
- Profile->ClientCertSize = TempDataSize;
- StrCpyS(Profile->ClientCertName, WIFI_FILENAME_STR_MAX_SIZE, Private->FileContext->FileName);
- DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Client Cert: %s has been enrolled! Size: %d\n",
- Profile->ClientCertName, Profile->ClientCertSize));
+ Status = WifiMgrReadFileToBuffer (
+ Private->FileContext,
+ &TempData,
+ &TempDataSize
+ );
+ if (EFI_ERROR (Status)) {
+ CreatePopUp (
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
+ &Key,
+ L"ERROR: Can't read this certificate file!",
+ NULL
+ );
+ } else {
+ ASSERT (Private->FileContext->FileName != NULL);
+ if (Private->FileType == FileTypeCACert) {
+ Profile->CACertData = TempData;
+ Profile->CACertSize = TempDataSize;
+ StrCpyS (Profile->CACertName, WIFI_FILENAME_STR_MAX_SIZE, Private->FileContext->FileName);
+ DEBUG ((
+ DEBUG_INFO,
+ "[WiFi Connection Manager] CA Cert: %s has been enrolled! Size: %d\n",
+ Profile->CACertName,
+ Profile->CACertSize
+ ));
+ } else {
+ Profile->ClientCertData = TempData;
+ Profile->ClientCertSize = TempDataSize;
+ StrCpyS (Profile->ClientCertName, WIFI_FILENAME_STR_MAX_SIZE, Private->FileContext->FileName);
+ DEBUG ((
+ DEBUG_INFO,
+ "[WiFi Connection Manager] Client Cert: %s has been enrolled! Size: %d\n",
+ Profile->ClientCertName,
+ Profile->ClientCertSize
+ ));
+ }
}
}
- }
- break;
- case KEY_ADD_HIDDEN_NETWORK:
-
- //
- // Add a Hidden Network
- //
- if (StrLen (IfrNvData->SSId) < SSID_MIN_LEN ||
- Private->HiddenNetworkCount >= HIDDEN_NETWORK_LIST_COUNT_MAX) {
-
- Status = EFI_ABORTED;
break;
- } else {
+
+ case KEY_ADD_HIDDEN_NETWORK:
//
- // Check if this SSId is already in Hidden Network List
+ // Add a Hidden Network
//
- NET_LIST_FOR_EACH (Entry, &Private->HiddenNetworkList) {
-
- HiddenNetwork = NET_LIST_USER_STRUCT_S (Entry, WIFI_HIDDEN_NETWORK_DATA,
- Link, WIFI_MGR_HIDDEN_NETWORK_SIGNATURE);
- if (StrCmp (HiddenNetwork->SSId, IfrNvData->SSId) == 0) {
-
- Status = EFI_ABORTED;
- break;
+ if ((StrLen (IfrNvData->SSId) < SSID_MIN_LEN) ||
+ (Private->HiddenNetworkCount >= HIDDEN_NETWORK_LIST_COUNT_MAX))
+ {
+ Status = EFI_ABORTED;
+ break;
+ } else {
+ //
+ // Check if this SSId is already in Hidden Network List
+ //
+ NET_LIST_FOR_EACH (Entry, &Private->HiddenNetworkList) {
+ HiddenNetwork = NET_LIST_USER_STRUCT_S (
+ Entry,
+ WIFI_HIDDEN_NETWORK_DATA,
+ Link,
+ WIFI_MGR_HIDDEN_NETWORK_SIGNATURE
+ );
+ if (StrCmp (HiddenNetwork->SSId, IfrNvData->SSId) == 0) {
+ Status = EFI_ABORTED;
+ break;
+ }
}
}
- }
-
- HiddenNetwork = (WIFI_HIDDEN_NETWORK_DATA *) AllocateZeroPool (sizeof (WIFI_HIDDEN_NETWORK_DATA));
- if (HiddenNetwork == NULL) {
-
- Status = EFI_OUT_OF_RESOURCES;
- break;
- }
- HiddenNetwork->Signature = WIFI_MGR_HIDDEN_NETWORK_SIGNATURE;
- StrCpyS (HiddenNetwork->SSId, SSID_STORAGE_SIZE, IfrNvData->SSId);
-
- InsertTailList (&Private->HiddenNetworkList, &HiddenNetwork->Link);
- Private->HiddenNetworkCount ++;
- WifiMgrRefreshHiddenList (Private);
- break;
-
- case KEY_REMOVE_HIDDEN_NETWORK:
-
- //
- // Remove Hidden Networks
- //
- Entry = GetFirstNode (&Private->HiddenNetworkList);
- RemoveCount = 0;
- for (Index = 0; Index < Private->HiddenNetworkCount; Index ++) {
- if (IfrNvData->HiddenNetworkList[Index] != 0) {
+ HiddenNetwork = (WIFI_HIDDEN_NETWORK_DATA *)AllocateZeroPool (sizeof (WIFI_HIDDEN_NETWORK_DATA));
+ if (HiddenNetwork == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ break;
+ }
- HiddenNetwork = NET_LIST_USER_STRUCT_S (Entry, WIFI_HIDDEN_NETWORK_DATA, Link, WIFI_MGR_HIDDEN_NETWORK_SIGNATURE);
- Entry = RemoveEntryList (Entry);
- RemoveCount ++;
+ HiddenNetwork->Signature = WIFI_MGR_HIDDEN_NETWORK_SIGNATURE;
+ StrCpyS (HiddenNetwork->SSId, SSID_STORAGE_SIZE, IfrNvData->SSId);
- FreePool (HiddenNetwork);
- } else {
- Entry = GetNextNode (&Private->HiddenNetworkList, Entry);
- }
- }
+ InsertTailList (&Private->HiddenNetworkList, &HiddenNetwork->Link);
+ Private->HiddenNetworkCount++;
- Private->HiddenNetworkCount -= RemoveCount;
- WifiMgrRefreshHiddenList (Private);
- break;
+ WifiMgrRefreshHiddenList (Private);
+ break;
- default:
+ case KEY_REMOVE_HIDDEN_NETWORK:
- if (QuestionId >= KEY_MAC_ENTRY_BASE && QuestionId < KEY_MAC_ENTRY_BASE + Private->NicCount) {
//
- // User selects a wireless NIC.
+ // Remove Hidden Networks
//
- Status = WifiMgrSelectNic (Private, QuestionId);
- if (EFI_ERROR (Status)) {
- CreatePopUp (
- EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
- &Key,
- L"ERROR: Fail to operate the wireless NIC!",
- NULL
- );
+ Entry = GetFirstNode (&Private->HiddenNetworkList);
+ RemoveCount = 0;
+ for (Index = 0; Index < Private->HiddenNetworkCount; Index++) {
+ if (IfrNvData->HiddenNetworkList[Index] != 0) {
+ HiddenNetwork = NET_LIST_USER_STRUCT_S (Entry, WIFI_HIDDEN_NETWORK_DATA, Link, WIFI_MGR_HIDDEN_NETWORK_SIGNATURE);
+ Entry = RemoveEntryList (Entry);
+ RemoveCount++;
+
+ FreePool (HiddenNetwork);
+ } else {
+ Entry = GetNextNode (&Private->HiddenNetworkList, Entry);
+ }
}
- } else if (Private->CurrentNic != NULL) {
- if (QuestionId >= KEY_AVAILABLE_NETWORK_ENTRY_BASE &&
- QuestionId <= KEY_AVAILABLE_NETWORK_ENTRY_BASE + Private->CurrentNic->MaxProfileIndex) {
- Status = WifiMgrUserSelectProfileToConnect (Private, QuestionId - KEY_AVAILABLE_NETWORK_ENTRY_BASE);
- if (!EFI_ERROR (Status)) {
- WifiMgrUpdateConnectMessage(Private->CurrentNic, FALSE, NULL);
+ Private->HiddenNetworkCount -= RemoveCount;
+ WifiMgrRefreshHiddenList (Private);
+ break;
+
+ default:
+
+ if ((QuestionId >= KEY_MAC_ENTRY_BASE) && (QuestionId < KEY_MAC_ENTRY_BASE + Private->NicCount)) {
+ //
+ // User selects a wireless NIC.
+ //
+ Status = WifiMgrSelectNic (Private, QuestionId);
+ if (EFI_ERROR (Status)) {
+ CreatePopUp (
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
+ &Key,
+ L"ERROR: Fail to operate the wireless NIC!",
+ NULL
+ );
+ }
+ } else if (Private->CurrentNic != NULL) {
+ if ((QuestionId >= KEY_AVAILABLE_NETWORK_ENTRY_BASE) &&
+ (QuestionId <= KEY_AVAILABLE_NETWORK_ENTRY_BASE + Private->CurrentNic->MaxProfileIndex))
+ {
+ Status = WifiMgrUserSelectProfileToConnect (Private, QuestionId - KEY_AVAILABLE_NETWORK_ENTRY_BASE);
+ if (!EFI_ERROR (Status)) {
+ WifiMgrUpdateConnectMessage (Private->CurrentNic, FALSE, NULL);
+ }
}
- }
- if (EFI_ERROR (Status)) {
- CreatePopUp (
- EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
- &Key,
- L"ERROR: Fail to operate this profile!",
- NULL
- );
+ if (EFI_ERROR (Status)) {
+ CreatePopUp (
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
+ &Key,
+ L"ERROR: Fail to operate this profile!",
+ NULL
+ );
+ }
}
- }
- break;
+ break;
}
} else if (Action == EFI_BROWSER_ACTION_CHANGED) {
switch (QuestionId) {
+ case KEY_SAVE_CERT_TO_MEM:
+ case KEY_SAVE_PRIVATE_KEY_TO_MEM:
- case KEY_SAVE_CERT_TO_MEM:
- case KEY_SAVE_PRIVATE_KEY_TO_MEM:
-
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
- break;
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
+ break;
- case KEY_NO_SAVE_CERT_TO_MEM:
- case KEY_NO_SAVE_PRIVATE_KEY_TO_MEM:
+ case KEY_NO_SAVE_CERT_TO_MEM:
+ case KEY_NO_SAVE_PRIVATE_KEY_TO_MEM:
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
- break;
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
+ break;
- default:
+ default:
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
- break;
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
+ break;
}
} else if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
-
switch (QuestionId) {
+ case KEY_REFRESH_NETWORK_LIST:
- case KEY_REFRESH_NETWORK_LIST:
-
- WifiMgrRefreshNetworkList (Private, IfrNvData);
- break;
+ WifiMgrRefreshNetworkList (Private, IfrNvData);
+ break;
- default:
- break;
+ default:
+ break;
}
}
@@ -1890,7 +1928,7 @@ WifiMgrDxeHiiConfigAccessCallback (
// Pass changed uncommitted data back to Form Browser.
//
BufferSize = sizeof (WIFI_MANAGER_IFR_NVDATA);
- HiiSetBrowserData (&gWifiConfigFormSetGuid, mVendorStorageName, BufferSize, (UINT8 *) IfrNvData, NULL);
+ HiiSetBrowserData (&gWifiConfigFormSetGuid, mVendorStorageName, BufferSize, (UINT8 *)IfrNvData, NULL);
}
ZeroMem (IfrNvData, sizeof (WIFI_MANAGER_IFR_NVDATA));
@@ -1911,10 +1949,10 @@ WifiMgrDxeHiiConfigAccessCallback (
**/
EFI_STATUS
WifiMgrDxeConfigFormInit (
- WIFI_MGR_PRIVATE_DATA *Private
-)
+ WIFI_MGR_PRIVATE_DATA *Private
+ )
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
if (Private == NULL) {
return EFI_INVALID_PARAMETER;
@@ -1981,17 +2019,16 @@ WifiMgrDxeConfigFormInit (
**/
EFI_STATUS
WifiMgrDxeConfigFormUnload (
- WIFI_MGR_PRIVATE_DATA *Private
-)
+ WIFI_MGR_PRIVATE_DATA *Private
+ )
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
if (Private == NULL) {
return EFI_INVALID_PARAMETER;
}
if (Private->FileContext != NULL) {
-
if (Private->FileContext->FHandle != NULL) {
Private->FileContext->FHandle->Close (Private->FileContext->FHandle);
}
@@ -1999,19 +2036,20 @@ WifiMgrDxeConfigFormUnload (
if (Private->FileContext->FileName != NULL) {
FreePool (Private->FileContext->FileName);
}
+
FreePool (Private->FileContext);
}
- HiiRemovePackages(Private->RegisteredHandle);
+ HiiRemovePackages (Private->RegisteredHandle);
Status = gBS->UninstallMultipleProtocolInterfaces (
- Private->DriverHandle,
- &gEfiDevicePathProtocolGuid,
- &mWifiMgrDxeHiiVendorDevicePath,
- &gEfiHiiConfigAccessProtocolGuid,
- &Private->ConfigAccess,
- NULL
- );
+ Private->DriverHandle,
+ &gEfiDevicePathProtocolGuid,
+ &mWifiMgrDxeHiiVendorDevicePath,
+ &gEfiHiiConfigAccessProtocolGuid,
+ &Private->ConfigAccess,
+ NULL
+ );
return Status;
}
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.h b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.h
index ebb18e1a98..029cb55ac5 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.h
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.h
@@ -24,9 +24,9 @@
**/
VOID
WifiMgrUpdateConnectMessage (
- IN WIFI_MGR_DEVICE_DATA *Nic,
- IN BOOLEAN ConnectStateChanged,
- IN EFI_STRING ConnectStatusMessage
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ IN BOOLEAN ConnectStateChanged,
+ IN EFI_STRING ConnectStatusMessage
);
/**
@@ -183,12 +183,12 @@ WifiMgrDxeHiiConfigAccessRouteConfig (
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
+ 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
);
/**
@@ -203,7 +203,7 @@ WifiMgrDxeHiiConfigAccessCallback (
**/
EFI_STATUS
WifiMgrDxeConfigFormInit (
- WIFI_MGR_PRIVATE_DATA *Private
+ WIFI_MGR_PRIVATE_DATA *Private
);
/**
@@ -217,7 +217,7 @@ WifiMgrDxeConfigFormInit (
**/
EFI_STATUS
WifiMgrDxeConfigFormUnload (
- WIFI_MGR_PRIVATE_DATA *Private
+ WIFI_MGR_PRIVATE_DATA *Private
);
/**
@@ -234,8 +234,8 @@ WifiMgrDxeConfigFormUnload (
**/
EFI_STATUS
WifiMgrRefreshNetworkList (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
);
#endif
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c
index 2fbd3ebad2..7630c0695c 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c
@@ -9,13 +9,13 @@
#include "WifiConnectionMgrDxe.h"
-EFI_EAP_TYPE mEapAuthMethod[] = {
+EFI_EAP_TYPE mEapAuthMethod[] = {
EFI_EAP_TYPE_TTLS,
EFI_EAP_TYPE_PEAP,
EFI_EAP_TYPE_EAPTLS
};
-EFI_EAP_TYPE mEapSecondAuthMethod[] = {
+EFI_EAP_TYPE mEapSecondAuthMethod[] = {
EFI_EAP_TYPE_MSCHAPV2
};
@@ -32,28 +32,28 @@ EFI_EAP_TYPE mEapSecondAuthMethod[] = {
VOID
EFIAPI
WifiMgrOnScanFinished (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
- EFI_STATUS Status;
- WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
- WIFI_MGR_DEVICE_DATA *Nic;
- WIFI_MGR_NETWORK_PROFILE *Profile;
- EFI_80211_NETWORK *Network;
- UINTN DataSize;
- EFI_80211_NETWORK_DESCRIPTION *NetworkDescription;
- EFI_80211_GET_NETWORKS_RESULT *Result;
- LIST_ENTRY *Entry;
- UINT8 SecurityType;
- BOOLEAN AKMSuiteSupported;
- BOOLEAN CipherSuiteSupported;
- CHAR8 *AsciiSSId;
- UINTN Index;
+ EFI_STATUS Status;
+ WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
+ WIFI_MGR_DEVICE_DATA *Nic;
+ WIFI_MGR_NETWORK_PROFILE *Profile;
+ EFI_80211_NETWORK *Network;
+ UINTN DataSize;
+ EFI_80211_NETWORK_DESCRIPTION *NetworkDescription;
+ EFI_80211_GET_NETWORKS_RESULT *Result;
+ LIST_ENTRY *Entry;
+ UINT8 SecurityType;
+ BOOLEAN AKMSuiteSupported;
+ BOOLEAN CipherSuiteSupported;
+ CHAR8 *AsciiSSId;
+ UINTN Index;
ASSERT (Context != NULL);
- ConfigToken = (WIFI_MGR_MAC_CONFIG_TOKEN *) Context;
+ ConfigToken = (WIFI_MGR_MAC_CONFIG_TOKEN *)Context;
ASSERT (ConfigToken->Nic != NULL);
ASSERT (ConfigToken->Type == TokenTypeGetNetworksToken);
@@ -69,29 +69,32 @@ WifiMgrOnScanFinished (
//
// Clean previous result, and update network list according to the scan result
//
- Nic->AvailableCount = 0;
+ Nic->AvailableCount = 0;
NET_LIST_FOR_EACH (Entry, &Nic->ProfileList) {
- Profile = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_NETWORK_PROFILE,
- Link, WIFI_MGR_PROFILE_SIGNATURE);
+ Profile = NET_LIST_USER_STRUCT_S (
+ Entry,
+ WIFI_MGR_NETWORK_PROFILE,
+ Link,
+ WIFI_MGR_PROFILE_SIGNATURE
+ );
Profile->IsAvailable = FALSE;
}
if (Result == NULL) {
gBS->SignalEvent (Nic->Private->NetworkListRefreshEvent);
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
return;
}
- for (Index = 0; Index < Result->NumOfNetworkDesc; Index ++) {
-
+ for (Index = 0; Index < Result->NumOfNetworkDesc; Index++) {
NetworkDescription = Result->NetworkDesc + Index;
if (NetworkDescription == NULL) {
continue;
}
Network = &NetworkDescription->Network;
- if (Network == NULL || Network->SSId.SSIdLen == 0) {
+ if ((Network == NULL) || (Network->SSId.SSIdLen == 0)) {
continue;
}
@@ -104,22 +107,21 @@ WifiMgrOnScanFinished (
&CipherSuiteSupported
);
if (EFI_ERROR (Status)) {
-
- SecurityType = SECURITY_TYPE_UNKNOWN;
- AKMSuiteSupported = FALSE;
- CipherSuiteSupported = FALSE;
+ SecurityType = SECURITY_TYPE_UNKNOWN;
+ AKMSuiteSupported = FALSE;
+ CipherSuiteSupported = FALSE;
}
- AsciiSSId = (CHAR8*) AllocateZeroPool(sizeof (CHAR8) * (Network->SSId.SSIdLen + 1));
+ AsciiSSId = (CHAR8 *)AllocateZeroPool (sizeof (CHAR8) * (Network->SSId.SSIdLen + 1));
if (AsciiSSId == NULL) {
continue;
}
- CopyMem(AsciiSSId, (CHAR8 *) Network->SSId.SSId, sizeof (CHAR8) * Network->SSId.SSIdLen);
+
+ CopyMem (AsciiSSId, (CHAR8 *)Network->SSId.SSId, sizeof (CHAR8) * Network->SSId.SSIdLen);
*(AsciiSSId + Network->SSId.SSIdLen) = '\0';
Profile = WifiMgrGetProfileByAsciiSSId (AsciiSSId, SecurityType, &Nic->ProfileList);
if (Profile == NULL) {
-
if (Nic->MaxProfileIndex >= NETWORK_LIST_COUNT_MAX) {
FreePool (AsciiSSId);
continue;
@@ -133,66 +135,69 @@ WifiMgrOnScanFinished (
FreePool (AsciiSSId);
continue;
}
+
Profile->Signature = WIFI_MGR_PROFILE_SIGNATURE;
Profile->NicIndex = Nic->NicIndex;
Profile->ProfileIndex = Nic->MaxProfileIndex + 1;
AsciiStrToUnicodeStrS (AsciiSSId, Profile->SSId, SSID_STORAGE_SIZE);
InsertTailList (&Nic->ProfileList, &Profile->Link);
- Nic->MaxProfileIndex ++;
+ Nic->MaxProfileIndex++;
}
+
FreePool (AsciiSSId);
//
- //May receive duplicate networks in scan results, check if it has already
- //been processed.
+ // May receive duplicate networks in scan results, check if it has already
+ // been processed.
//
if (!Profile->IsAvailable) {
-
Profile->IsAvailable = TRUE;
Profile->SecurityType = SecurityType;
Profile->AKMSuiteSupported = AKMSuiteSupported;
Profile->CipherSuiteSupported = CipherSuiteSupported;
Profile->NetworkQuality = NetworkDescription->NetworkQuality;
- Nic->AvailableCount ++;
+ Nic->AvailableCount++;
//
- //Copy BSSType and SSId
+ // Copy BSSType and SSId
//
- CopyMem(&Profile->Network, Network, sizeof (EFI_80211_NETWORK));
+ CopyMem (&Profile->Network, Network, sizeof (EFI_80211_NETWORK));
//
- //Copy AKMSuite list
+ // Copy AKMSuite list
//
if (Network->AKMSuite != NULL) {
-
if (Network->AKMSuite->AKMSuiteCount == 0) {
DataSize = sizeof (EFI_80211_AKM_SUITE_SELECTOR);
} else {
DataSize = sizeof (EFI_80211_AKM_SUITE_SELECTOR) + sizeof (EFI_80211_SUITE_SELECTOR)
- * (Network->AKMSuite->AKMSuiteCount - 1);
+ * (Network->AKMSuite->AKMSuiteCount - 1);
}
- Profile->Network.AKMSuite = (EFI_80211_AKM_SUITE_SELECTOR *) AllocateZeroPool (DataSize);
+
+ Profile->Network.AKMSuite = (EFI_80211_AKM_SUITE_SELECTOR *)AllocateZeroPool (DataSize);
if (Profile->Network.AKMSuite == NULL) {
continue;
}
+
CopyMem (Profile->Network.AKMSuite, Network->AKMSuite, DataSize);
}
//
- //Copy CipherSuite list
+ // Copy CipherSuite list
//
if (Network->CipherSuite != NULL) {
-
if (Network->CipherSuite->CipherSuiteCount == 0) {
DataSize = sizeof (EFI_80211_CIPHER_SUITE_SELECTOR);
} else {
DataSize = sizeof (EFI_80211_CIPHER_SUITE_SELECTOR) + sizeof (EFI_80211_SUITE_SELECTOR)
- * (Network->CipherSuite->CipherSuiteCount - 1);
+ * (Network->CipherSuite->CipherSuiteCount - 1);
}
- Profile->Network.CipherSuite = (EFI_80211_CIPHER_SUITE_SELECTOR *) AllocateZeroPool (DataSize);
+
+ Profile->Network.CipherSuite = (EFI_80211_CIPHER_SUITE_SELECTOR *)AllocateZeroPool (DataSize);
if (Profile->Network.CipherSuite == NULL) {
continue;
}
+
CopyMem (Profile->Network.CipherSuite, Network->CipherSuite, DataSize);
}
} else {
@@ -202,6 +207,7 @@ WifiMgrOnScanFinished (
if (Profile->NetworkQuality < NetworkDescription->NetworkQuality) {
Profile->NetworkQuality = NetworkDescription->NetworkQuality;
}
+
continue;
}
}
@@ -212,14 +218,14 @@ WifiMgrOnScanFinished (
// The current connected network should always be available until disconnection
// happens in Wifi FW layer, even when it is not in this time's scan result.
//
- if (Nic->ConnectState == WifiMgrConnectedToAp && Nic->CurrentOperateNetwork != NULL) {
+ if ((Nic->ConnectState == WifiMgrConnectedToAp) && (Nic->CurrentOperateNetwork != NULL)) {
if (!Nic->CurrentOperateNetwork->IsAvailable) {
Nic->CurrentOperateNetwork->IsAvailable = TRUE;
- Nic->AvailableCount ++;
+ Nic->AvailableCount++;
}
}
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
}
/**
@@ -236,20 +242,20 @@ WifiMgrOnScanFinished (
**/
EFI_STATUS
WifiMgrStartScan (
- IN WIFI_MGR_DEVICE_DATA *Nic
+ IN WIFI_MGR_DEVICE_DATA *Nic
)
{
- EFI_STATUS Status;
- EFI_TPL OldTpl;
- WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
- EFI_80211_GET_NETWORKS_TOKEN *GetNetworksToken;
- UINT32 HiddenSSIdIndex;
- UINT32 HiddenSSIdCount;
- EFI_80211_SSID *HiddenSSIdList;
- WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
- LIST_ENTRY *Entry;
-
- if (Nic == NULL || Nic->Wmp == NULL) {
+ EFI_STATUS Status;
+ EFI_TPL OldTpl;
+ WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
+ EFI_80211_GET_NETWORKS_TOKEN *GetNetworksToken;
+ UINT32 HiddenSSIdIndex;
+ UINT32 HiddenSSIdCount;
+ EFI_80211_SSID *HiddenSSIdList;
+ WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
+ LIST_ENTRY *Entry;
+
+ if ((Nic == NULL) || (Nic->Wmp == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -265,61 +271,70 @@ WifiMgrStartScan (
HiddenSSIdIndex = 0;
//
- //create a new get network token
+ // create a new get network token
//
- ConfigToken = AllocateZeroPool (sizeof (WIFI_MGR_MAC_CONFIG_TOKEN));
+ ConfigToken = AllocateZeroPool (sizeof (WIFI_MGR_MAC_CONFIG_TOKEN));
if (ConfigToken == NULL) {
gBS->RestoreTPL (OldTpl);
return EFI_OUT_OF_RESOURCES;
}
- ConfigToken->Type = TokenTypeGetNetworksToken;
- ConfigToken->Nic = Nic;
+ ConfigToken->Type = TokenTypeGetNetworksToken;
+ ConfigToken->Nic = Nic;
ConfigToken->Token.GetNetworksToken = AllocateZeroPool (sizeof (EFI_80211_GET_NETWORKS_TOKEN));
if (ConfigToken->Token.GetNetworksToken == NULL) {
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
gBS->RestoreTPL (OldTpl);
return EFI_OUT_OF_RESOURCES;
}
+
GetNetworksToken = ConfigToken->Token.GetNetworksToken;
//
// There are some hidden networks to scan, add them into scan list
//
if (HiddenSSIdCount > 0) {
- HiddenSSIdList = AllocateZeroPool(HiddenSSIdCount * sizeof (EFI_80211_SSID));
+ HiddenSSIdList = AllocateZeroPool (HiddenSSIdCount * sizeof (EFI_80211_SSID));
if (HiddenSSIdList == NULL) {
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
gBS->RestoreTPL (OldTpl);
return EFI_OUT_OF_RESOURCES;
}
HiddenSSIdIndex = 0;
NET_LIST_FOR_EACH (Entry, &Nic->Private->HiddenNetworkList) {
-
- HiddenNetwork = NET_LIST_USER_STRUCT_S (Entry, WIFI_HIDDEN_NETWORK_DATA,
- Link, WIFI_MGR_HIDDEN_NETWORK_SIGNATURE);
- HiddenSSIdList[HiddenSSIdIndex].SSIdLen = (UINT8) StrLen (HiddenNetwork->SSId);
- UnicodeStrToAsciiStrS(HiddenNetwork->SSId,
- (CHAR8 *) HiddenSSIdList[HiddenSSIdIndex].SSId, SSID_STORAGE_SIZE);
- HiddenSSIdIndex ++;
+ HiddenNetwork = NET_LIST_USER_STRUCT_S (
+ Entry,
+ WIFI_HIDDEN_NETWORK_DATA,
+ Link,
+ WIFI_MGR_HIDDEN_NETWORK_SIGNATURE
+ );
+ HiddenSSIdList[HiddenSSIdIndex].SSIdLen = (UINT8)StrLen (HiddenNetwork->SSId);
+ UnicodeStrToAsciiStrS (
+ HiddenNetwork->SSId,
+ (CHAR8 *)HiddenSSIdList[HiddenSSIdIndex].SSId,
+ SSID_STORAGE_SIZE
+ );
+ HiddenSSIdIndex++;
}
- GetNetworksToken->Data = AllocateZeroPool (sizeof (EFI_80211_GET_NETWORKS_DATA) +
- (HiddenSSIdCount - 1) * sizeof (EFI_80211_SSID));
+ GetNetworksToken->Data = AllocateZeroPool (
+ sizeof (EFI_80211_GET_NETWORKS_DATA) +
+ (HiddenSSIdCount - 1) * sizeof (EFI_80211_SSID)
+ );
if (GetNetworksToken->Data == NULL) {
FreePool (HiddenSSIdList);
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
gBS->RestoreTPL (OldTpl);
return EFI_OUT_OF_RESOURCES;
}
+
GetNetworksToken->Data->NumOfSSID = HiddenSSIdCount;
- CopyMem(GetNetworksToken->Data->SSIDList, HiddenSSIdList, HiddenSSIdCount * sizeof (EFI_80211_SSID));
- FreePool(HiddenSSIdList);
+ CopyMem (GetNetworksToken->Data->SSIDList, HiddenSSIdList, HiddenSSIdCount * sizeof (EFI_80211_SSID));
+ FreePool (HiddenSSIdList);
} else {
-
GetNetworksToken->Data = AllocateZeroPool (sizeof (EFI_80211_GET_NETWORKS_DATA));
if (GetNetworksToken->Data == NULL) {
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
gBS->RestoreTPL (OldTpl);
return EFI_OUT_OF_RESOURCES;
}
@@ -328,7 +343,7 @@ WifiMgrStartScan (
}
//
- //Create a handle when scan process ends
+ // Create a handle when scan process ends
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
@@ -338,18 +353,18 @@ WifiMgrStartScan (
&GetNetworksToken->Event
);
if (EFI_ERROR (Status)) {
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
gBS->RestoreTPL (OldTpl);
return Status;
}
//
- //Start scan ...
+ // Start scan ...
//
Status = Nic->Wmp->GetNetworks (Nic->Wmp, GetNetworksToken);
if (EFI_ERROR (Status)) {
- Nic->ScanState = WifiMgrScanFinished;
- WifiMgrFreeToken(ConfigToken);
+ Nic->ScanState = WifiMgrScanFinished;
+ WifiMgrFreeToken (ConfigToken);
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -373,45 +388,56 @@ WifiMgrStartScan (
**/
EFI_STATUS
WifiMgrConfigPassword (
- IN WIFI_MGR_DEVICE_DATA *Nic,
- IN WIFI_MGR_NETWORK_PROFILE *Profile
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ IN WIFI_MGR_NETWORK_PROFILE *Profile
)
{
- EFI_STATUS Status;
- EFI_SUPPLICANT_PROTOCOL *Supplicant;
- EFI_80211_SSID SSId;
- UINT8 *AsciiPassword;
+ EFI_STATUS Status;
+ EFI_SUPPLICANT_PROTOCOL *Supplicant;
+ EFI_80211_SSID SSId;
+ UINT8 *AsciiPassword;
- if (Nic == NULL || Nic->Supplicant == NULL || Profile == NULL) {
+ if ((Nic == NULL) || (Nic->Supplicant == NULL) || (Profile == NULL)) {
return EFI_INVALID_PARAMETER;
}
+
Supplicant = Nic->Supplicant;
//
- //Set SSId to supplicant
+ // Set SSId to supplicant
//
SSId.SSIdLen = Profile->Network.SSId.SSIdLen;
- CopyMem(SSId.SSId, Profile->Network.SSId.SSId, sizeof (Profile->Network.SSId.SSId));
- Status = Supplicant->SetData(Supplicant,EfiSupplicant80211TargetSSIDName,
- (VOID *)&SSId, sizeof(EFI_80211_SSID));
- if (EFI_ERROR(Status)) {
+ CopyMem (SSId.SSId, Profile->Network.SSId.SSId, sizeof (Profile->Network.SSId.SSId));
+ Status = Supplicant->SetData (
+ Supplicant,
+ EfiSupplicant80211TargetSSIDName,
+ (VOID *)&SSId,
+ sizeof (EFI_80211_SSID)
+ );
+ if (EFI_ERROR (Status)) {
return Status;
}
//
- //Set password to supplicant
+ // Set password to supplicant
//
if (StrLen (Profile->Password) < PASSWORD_MIN_LEN) {
return EFI_NOT_FOUND;
}
- AsciiPassword = AllocateZeroPool ((StrLen(Profile->Password) + 1) * sizeof (UINT8));
+
+ AsciiPassword = AllocateZeroPool ((StrLen (Profile->Password) + 1) * sizeof (UINT8));
if (AsciiPassword == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- UnicodeStrToAsciiStrS (Profile->Password, (CHAR8 *) AsciiPassword, PASSWORD_STORAGE_SIZE);
- Status = Supplicant->SetData (Supplicant, EfiSupplicant80211PskPassword,
- AsciiPassword, (StrLen(Profile->Password) + 1) * sizeof (UINT8));
- ZeroMem (AsciiPassword, AsciiStrLen ((CHAR8 *) AsciiPassword) + 1);
- FreePool(AsciiPassword);
+
+ UnicodeStrToAsciiStrS (Profile->Password, (CHAR8 *)AsciiPassword, PASSWORD_STORAGE_SIZE);
+ Status = Supplicant->SetData (
+ Supplicant,
+ EfiSupplicant80211PskPassword,
+ AsciiPassword,
+ (StrLen (Profile->Password) + 1) * sizeof (UINT8)
+ );
+ ZeroMem (AsciiPassword, AsciiStrLen ((CHAR8 *)AsciiPassword) + 1);
+ FreePool (AsciiPassword);
return Status;
}
@@ -435,51 +461,59 @@ WifiMgrConfigPassword (
**/
EFI_STATUS
WifiMgrConfigEap (
- IN WIFI_MGR_DEVICE_DATA *Nic,
- IN WIFI_MGR_NETWORK_PROFILE *Profile
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ IN WIFI_MGR_NETWORK_PROFILE *Profile
)
{
- EFI_STATUS Status;
- EFI_EAP_CONFIGURATION_PROTOCOL *EapConfig;
- EFI_EAP_TYPE EapAuthMethod;
- EFI_EAP_TYPE EapSecondAuthMethod;
- EFI_EAP_TYPE *AuthMethodList;
- CHAR8 *Identity;
- UINTN IdentitySize;
- CHAR16 *Password;
- UINTN PasswordSize;
- UINTN EncryptPasswordLen;
- CHAR8 *AsciiEncryptPassword;
- UINTN AuthMethodListSize;
- UINTN Index;
-
- if (Nic == NULL || Nic->EapConfig == NULL || Profile == NULL) {
+ EFI_STATUS Status;
+ EFI_EAP_CONFIGURATION_PROTOCOL *EapConfig;
+ EFI_EAP_TYPE EapAuthMethod;
+ EFI_EAP_TYPE EapSecondAuthMethod;
+ EFI_EAP_TYPE *AuthMethodList;
+ CHAR8 *Identity;
+ UINTN IdentitySize;
+ CHAR16 *Password;
+ UINTN PasswordSize;
+ UINTN EncryptPasswordLen;
+ CHAR8 *AsciiEncryptPassword;
+ UINTN AuthMethodListSize;
+ UINTN Index;
+
+ if ((Nic == NULL) || (Nic->EapConfig == NULL) || (Profile == NULL)) {
return EFI_INVALID_PARAMETER;
}
+
EapConfig = Nic->EapConfig;
if (Profile->EapAuthMethod >= EAP_AUTH_METHOD_MAX) {
return EFI_INVALID_PARAMETER;
}
+
EapAuthMethod = mEapAuthMethod[Profile->EapAuthMethod];
if (EapAuthMethod != EFI_EAP_TYPE_EAPTLS) {
if (Profile->EapSecondAuthMethod >= EAP_SEAUTH_METHOD_MAX) {
return EFI_INVALID_PARAMETER;
}
+
EapSecondAuthMethod = mEapSecondAuthMethod[Profile->EapSecondAuthMethod];
}
//
- //The first time to get Supported Auth Method list, return the size.
+ // The first time to get Supported Auth Method list, return the size.
//
- AuthMethodListSize = 0;
- AuthMethodList = NULL;
- Status = EapConfig->GetData (EapConfig, EFI_EAP_TYPE_ATTRIBUTE, EfiEapConfigEapSupportedAuthMethod,
- (VOID *) AuthMethodList, &AuthMethodListSize);
+ AuthMethodListSize = 0;
+ AuthMethodList = NULL;
+ Status = EapConfig->GetData (
+ EapConfig,
+ EFI_EAP_TYPE_ATTRIBUTE,
+ EfiEapConfigEapSupportedAuthMethod,
+ (VOID *)AuthMethodList,
+ &AuthMethodListSize
+ );
if (Status == EFI_SUCCESS) {
//
- //No Supported Eap Auth Method
+ // No Supported Eap Auth Method
//
return EFI_UNSUPPORTED;
} else if (Status != EFI_BUFFER_TOO_SMALL) {
@@ -490,48 +524,62 @@ WifiMgrConfigEap (
// The second time to get Supported Auth Method list, return the list.
// In current design, only EAPTLS, TTLS and PEAP are supported
//
- AuthMethodList = (EFI_EAP_TYPE *) AllocateZeroPool(AuthMethodListSize);
+ AuthMethodList = (EFI_EAP_TYPE *)AllocateZeroPool (AuthMethodListSize);
if (AuthMethodList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- Status = EapConfig->GetData (EapConfig, EFI_EAP_TYPE_ATTRIBUTE, EfiEapConfigEapSupportedAuthMethod,
- (VOID *) AuthMethodList, &AuthMethodListSize);
+
+ Status = EapConfig->GetData (
+ EapConfig,
+ EFI_EAP_TYPE_ATTRIBUTE,
+ EfiEapConfigEapSupportedAuthMethod,
+ (VOID *)AuthMethodList,
+ &AuthMethodListSize
+ );
if (EFI_ERROR (Status)) {
FreePool (AuthMethodList);
return Status;
}
//
- //Check if EapAuthMethod is in supported Auth Method list, if found, skip the loop.
+ // Check if EapAuthMethod is in supported Auth Method list, if found, skip the loop.
//
- for (Index = 0; Index < AuthMethodListSize / sizeof (EFI_EAP_TYPE); Index ++) {
+ for (Index = 0; Index < AuthMethodListSize / sizeof (EFI_EAP_TYPE); Index++) {
if (EapAuthMethod == AuthMethodList[Index]) {
break;
}
}
+
if (Index == AuthMethodListSize / sizeof (EFI_EAP_TYPE)) {
FreePool (AuthMethodList);
return EFI_UNSUPPORTED;
}
+
FreePool (AuthMethodList);
//
// Set Identity to Eap peer, Mandatory field for PEAP and TTLS
//
if (StrLen (Profile->EapIdentity) > 0) {
-
- IdentitySize = sizeof(CHAR8) * (StrLen(Profile->EapIdentity) + 1);
- Identity = AllocateZeroPool (IdentitySize);
+ IdentitySize = sizeof (CHAR8) * (StrLen (Profile->EapIdentity) + 1);
+ Identity = AllocateZeroPool (IdentitySize);
if (Identity == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- UnicodeStrToAsciiStrS(Profile->EapIdentity, Identity, IdentitySize);
- Status = EapConfig->SetData (EapConfig, EFI_EAP_TYPE_IDENTITY, EfiEapConfigIdentityString,
- (VOID *) Identity, IdentitySize - 1);
- if (EFI_ERROR(Status)) {
+
+ UnicodeStrToAsciiStrS (Profile->EapIdentity, Identity, IdentitySize);
+ Status = EapConfig->SetData (
+ EapConfig,
+ EFI_EAP_TYPE_IDENTITY,
+ EfiEapConfigIdentityString,
+ (VOID *)Identity,
+ IdentitySize - 1
+ );
+ if (EFI_ERROR (Status)) {
FreePool (Identity);
return Status;
}
+
FreePool (Identity);
} else {
if (EapAuthMethod != EFI_EAP_TYPE_EAPTLS) {
@@ -540,19 +588,28 @@ WifiMgrConfigEap (
}
//
- //Set Auth Method to Eap peer, Mandatory field
+ // Set Auth Method to Eap peer, Mandatory field
//
- Status = EapConfig->SetData (EapConfig, EFI_EAP_TYPE_ATTRIBUTE, EfiEapConfigEapAuthMethod,
- (VOID *) &EapAuthMethod, sizeof (EapAuthMethod));
- if (EFI_ERROR(Status)) {
+ Status = EapConfig->SetData (
+ EapConfig,
+ EFI_EAP_TYPE_ATTRIBUTE,
+ EfiEapConfigEapAuthMethod,
+ (VOID *)&EapAuthMethod,
+ sizeof (EapAuthMethod)
+ );
+ if (EFI_ERROR (Status)) {
return Status;
}
- if (EapAuthMethod == EFI_EAP_TYPE_TTLS || EapAuthMethod == EFI_EAP_TYPE_PEAP) {
-
- Status = EapConfig->SetData (EapConfig, EapAuthMethod, EfiEapConfigEap2ndAuthMethod,
- (VOID *) &EapSecondAuthMethod, sizeof (EapSecondAuthMethod));
- if (EFI_ERROR(Status)) {
+ if ((EapAuthMethod == EFI_EAP_TYPE_TTLS) || (EapAuthMethod == EFI_EAP_TYPE_PEAP)) {
+ Status = EapConfig->SetData (
+ EapConfig,
+ EapAuthMethod,
+ EfiEapConfigEap2ndAuthMethod,
+ (VOID *)&EapSecondAuthMethod,
+ sizeof (EapSecondAuthMethod)
+ );
+ if (EFI_ERROR (Status)) {
return Status;
}
@@ -560,19 +617,24 @@ WifiMgrConfigEap (
// Set Password to Eap peer
//
if (StrLen (Profile->EapPassword) < PASSWORD_MIN_LEN) {
-
DEBUG ((DEBUG_ERROR, "[WiFi Connection Manager] Error: No Eap Password for Network: %s.\n", Profile->SSId));
return EFI_INVALID_PARAMETER;
}
PasswordSize = sizeof (CHAR16) * (StrLen (Profile->EapPassword) + 1);
- Password = AllocateZeroPool (PasswordSize);
+ Password = AllocateZeroPool (PasswordSize);
if (Password == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- StrCpyS (Password, PasswordSize, Profile->EapPassword);;
- Status = EapConfig->SetData (EapConfig, EFI_EAP_TYPE_MSCHAPV2, EfiEapConfigEapMSChapV2Password,
- (VOID *) Password, PasswordSize);
+
+ StrCpyS (Password, PasswordSize, Profile->EapPassword);
+ Status = EapConfig->SetData (
+ EapConfig,
+ EFI_EAP_TYPE_MSCHAPV2,
+ EfiEapConfigEapMSChapV2Password,
+ (VOID *)Password,
+ PasswordSize
+ );
ZeroMem (Password, PasswordSize);
FreePool (Password);
if (EFI_ERROR (Status)) {
@@ -580,72 +642,94 @@ WifiMgrConfigEap (
}
//
- //If CA cert is required, set it to Eap peer
+ // If CA cert is required, set it to Eap peer
//
if (Profile->CACertData != NULL) {
-
- Status = EapConfig->SetData (EapConfig, EapAuthMethod, EfiEapConfigEapTlsCACert,
- Profile->CACertData, Profile->CACertSize);
- if (EFI_ERROR(Status)) {
+ Status = EapConfig->SetData (
+ EapConfig,
+ EapAuthMethod,
+ EfiEapConfigEapTlsCACert,
+ Profile->CACertData,
+ Profile->CACertSize
+ );
+ if (EFI_ERROR (Status)) {
return Status;
}
} else {
return EFI_INVALID_PARAMETER;
}
} else if (EapAuthMethod == EFI_EAP_TYPE_EAPTLS) {
-
//
- //Set CA cert to Eap peer
+ // Set CA cert to Eap peer
//
if (Profile->CACertData == NULL) {
return EFI_INVALID_PARAMETER;
}
- Status = EapConfig->SetData (EapConfig, EFI_EAP_TYPE_EAPTLS, EfiEapConfigEapTlsCACert,
- Profile->CACertData, Profile->CACertSize);
- if (EFI_ERROR(Status)) {
+
+ Status = EapConfig->SetData (
+ EapConfig,
+ EFI_EAP_TYPE_EAPTLS,
+ EfiEapConfigEapTlsCACert,
+ Profile->CACertData,
+ Profile->CACertSize
+ );
+ if (EFI_ERROR (Status)) {
return Status;
}
//
- //Set Client cert to Eap peer
+ // Set Client cert to Eap peer
//
if (Profile->ClientCertData == NULL) {
return EFI_INVALID_PARAMETER;
}
- Status = EapConfig->SetData (EapConfig, EFI_EAP_TYPE_EAPTLS, EfiEapConfigEapTlsClientCert,
- Profile->ClientCertData, Profile->ClientCertSize);
- if (EFI_ERROR(Status)) {
+
+ Status = EapConfig->SetData (
+ EapConfig,
+ EFI_EAP_TYPE_EAPTLS,
+ EfiEapConfigEapTlsClientCert,
+ Profile->ClientCertData,
+ Profile->ClientCertSize
+ );
+ if (EFI_ERROR (Status)) {
return Status;
}
//
- //Set Private key to Eap peer
+ // Set Private key to Eap peer
//
if (Profile->PrivateKeyData == NULL) {
-
DEBUG ((DEBUG_ERROR, "[WiFi Connection Manager] Error: No Private Key for Network: %s.\n", Profile->SSId));
return EFI_INVALID_PARAMETER;
}
- Status = EapConfig->SetData (EapConfig, EFI_EAP_TYPE_EAPTLS, EfiEapConfigEapTlsClientPrivateKeyFile,
- Profile->PrivateKeyData, Profile->PrivateKeyDataSize);
- if (EFI_ERROR(Status)) {
+ Status = EapConfig->SetData (
+ EapConfig,
+ EFI_EAP_TYPE_EAPTLS,
+ EfiEapConfigEapTlsClientPrivateKeyFile,
+ Profile->PrivateKeyData,
+ Profile->PrivateKeyDataSize
+ );
+ if (EFI_ERROR (Status)) {
return Status;
}
if (StrLen (Profile->PrivateKeyPassword) > 0) {
-
- EncryptPasswordLen = StrLen (Profile->PrivateKeyPassword);
- AsciiEncryptPassword = AllocateZeroPool(EncryptPasswordLen + 1);
+ EncryptPasswordLen = StrLen (Profile->PrivateKeyPassword);
+ AsciiEncryptPassword = AllocateZeroPool (EncryptPasswordLen + 1);
if (AsciiEncryptPassword == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- UnicodeStrToAsciiStrS(Profile->PrivateKeyPassword, AsciiEncryptPassword, EncryptPasswordLen + 1);
- Status = EapConfig->SetData(EapConfig, EFI_EAP_TYPE_EAPTLS,
- EfiEapConfigEapTlsClientPrivateKeyFilePassword,
- (VOID *) AsciiEncryptPassword, EncryptPasswordLen + 1);
- if (EFI_ERROR(Status)) {
+ UnicodeStrToAsciiStrS (Profile->PrivateKeyPassword, AsciiEncryptPassword, EncryptPasswordLen + 1);
+ Status = EapConfig->SetData (
+ EapConfig,
+ EFI_EAP_TYPE_EAPTLS,
+ EfiEapConfigEapTlsClientPrivateKeyFilePassword,
+ (VOID *)AsciiEncryptPassword,
+ EncryptPasswordLen + 1
+ );
+ if (EFI_ERROR (Status)) {
ZeroMem (AsciiEncryptPassword, EncryptPasswordLen + 1);
FreePool (AsciiEncryptPassword);
return Status;
@@ -675,17 +759,17 @@ WifiMgrConfigEap (
**/
EFI_STATUS
WifiMgrGetLinkState (
- IN WIFI_MGR_DEVICE_DATA *Nic,
- OUT EFI_ADAPTER_INFO_MEDIA_STATE *LinkState
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ OUT EFI_ADAPTER_INFO_MEDIA_STATE *LinkState
)
{
- EFI_STATUS Status;
- EFI_TPL OldTpl;
- UINTN DataSize;
- EFI_ADAPTER_INFO_MEDIA_STATE *UndiState;
- EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;
+ EFI_STATUS Status;
+ EFI_TPL OldTpl;
+ UINTN DataSize;
+ EFI_ADAPTER_INFO_MEDIA_STATE *UndiState;
+ EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;
- if (Nic == NULL || LinkState == NULL) {
+ if ((Nic == NULL) || (LinkState == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -693,7 +777,7 @@ WifiMgrGetLinkState (
Status = gBS->OpenProtocol (
Nic->ControllerHandle,
&gEfiAdapterInformationProtocolGuid,
- (VOID**) &Aip,
+ (VOID **)&Aip,
Nic->DriverHandle,
Nic->ControllerHandle,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
@@ -703,16 +787,17 @@ WifiMgrGetLinkState (
return EFI_UNSUPPORTED;
}
- Status = Aip->GetInformation(
+ Status = Aip->GetInformation (
Aip,
&gEfiAdapterInfoMediaStateGuid,
- (VOID **) &UndiState,
+ (VOID **)&UndiState,
&DataSize
);
if (EFI_ERROR (Status)) {
gBS->RestoreTPL (OldTpl);
return Status;
}
+
gBS->RestoreTPL (OldTpl);
CopyMem (LinkState, UndiState, sizeof (EFI_ADAPTER_INFO_MEDIA_STATE));
@@ -735,21 +820,27 @@ WifiMgrGetLinkState (
**/
EFI_STATUS
WifiMgrPrepareConnection (
- IN WIFI_MGR_DEVICE_DATA *Nic,
- IN WIFI_MGR_NETWORK_PROFILE *Profile
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ IN WIFI_MGR_NETWORK_PROFILE *Profile
)
{
- EFI_STATUS Status;
- UINT8 SecurityType;
- BOOLEAN AKMSuiteSupported;
- BOOLEAN CipherSuiteSupported;
+ EFI_STATUS Status;
+ UINT8 SecurityType;
+ BOOLEAN AKMSuiteSupported;
+ BOOLEAN CipherSuiteSupported;
- if (Profile == NULL || Nic == NULL) {
+ if ((Profile == NULL) || (Nic == NULL)) {
return EFI_INVALID_PARAMETER;
}
- Status = WifiMgrCheckRSN (Profile->Network.AKMSuite, Profile->Network.CipherSuite,
- Nic, &SecurityType, &AKMSuiteSupported, &CipherSuiteSupported);
+ Status = WifiMgrCheckRSN (
+ Profile->Network.AKMSuite,
+ Profile->Network.CipherSuite,
+ Nic,
+ &SecurityType,
+ &AKMSuiteSupported,
+ &CipherSuiteSupported
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -765,8 +856,10 @@ WifiMgrPrepareConnection (
WifiMgrUpdateConnectMessage (Nic, FALSE, L"Connect Failed: Invalid Password!");
}
}
+
return Status;
}
+
break;
case SECURITY_TYPE_WPA2_ENTERPRISE:
@@ -778,8 +871,10 @@ WifiMgrPrepareConnection (
WifiMgrUpdateConnectMessage (Nic, FALSE, L"Connect Failed: Invalid Configuration!");
}
}
+
return Status;
}
+
break;
case SECURITY_TYPE_NONE:
@@ -807,21 +902,21 @@ WifiMgrPrepareConnection (
VOID
EFIAPI
WifiMgrOnConnectFinished (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
- EFI_STATUS Status;
- WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
- WIFI_MGR_NETWORK_PROFILE *ConnectedProfile;
- UINT8 SecurityType;
- UINT8 SSIdLen;
- CHAR8 *AsciiSSId;
+ EFI_STATUS Status;
+ WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
+ WIFI_MGR_NETWORK_PROFILE *ConnectedProfile;
+ UINT8 SecurityType;
+ UINT8 SSIdLen;
+ CHAR8 *AsciiSSId;
ASSERT (Context != NULL);
ConnectedProfile = NULL;
- ConfigToken = (WIFI_MGR_MAC_CONFIG_TOKEN*) Context;
+ ConfigToken = (WIFI_MGR_MAC_CONFIG_TOKEN *)Context;
ASSERT (ConfigToken->Nic != NULL);
ConfigToken->Nic->ConnectState = WifiMgrDisconnected;
@@ -829,39 +924,38 @@ WifiMgrOnConnectFinished (
ASSERT (ConfigToken->Token.ConnectNetworkToken != NULL);
if (ConfigToken->Token.ConnectNetworkToken->Status != EFI_SUCCESS) {
-
if (ConfigToken->Nic->OneTimeConnectRequest) {
//
// Only update message for user triggered connection
//
if (ConfigToken->Token.ConnectNetworkToken->Status == EFI_ACCESS_DENIED) {
-
WifiMgrUpdateConnectMessage (ConfigToken->Nic, FALSE, L"Connect Failed: Permission Denied!");
} else {
WifiMgrUpdateConnectMessage (ConfigToken->Nic, FALSE, L"Connect Failed!");
}
+
ConfigToken->Nic->OneTimeConnectRequest = FALSE;
}
+
ConfigToken->Nic->CurrentOperateNetwork = NULL;
return;
}
if (ConfigToken->Token.ConnectNetworkToken->ResultCode != ConnectSuccess) {
-
if (ConfigToken->Nic->OneTimeConnectRequest) {
-
if (ConfigToken->Token.ConnectNetworkToken->ResultCode == ConnectFailedReasonUnspecified) {
WifiMgrUpdateConnectMessage (ConfigToken->Nic, FALSE, L"Connect Failed: Wrong Password or Unexpected Error!");
} else {
WifiMgrUpdateConnectMessage (ConfigToken->Nic, FALSE, L"Connect Failed!");
}
}
+
goto Exit;
}
- if (ConfigToken->Token.ConnectNetworkToken->Data == NULL ||
- ConfigToken->Token.ConnectNetworkToken->Data->Network == NULL) {
-
+ if ((ConfigToken->Token.ConnectNetworkToken->Data == NULL) ||
+ (ConfigToken->Token.ConnectNetworkToken->Data->Network == NULL))
+ {
//
// An unexpected error occurs, tell low layer to perform a disconnect
//
@@ -873,26 +967,31 @@ WifiMgrOnConnectFinished (
//
// A correct connect token received, terminate the connection process
//
- Status = WifiMgrCheckRSN(ConfigToken->Token.ConnectNetworkToken->Data->Network->AKMSuite,
+ Status = WifiMgrCheckRSN (
+ ConfigToken->Token.ConnectNetworkToken->Data->Network->AKMSuite,
ConfigToken->Token.ConnectNetworkToken->Data->Network->CipherSuite,
- ConfigToken->Nic, &SecurityType, NULL, NULL);
- if (EFI_ERROR(Status)) {
+ ConfigToken->Nic,
+ &SecurityType,
+ NULL,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
SecurityType = SECURITY_TYPE_UNKNOWN;
}
SSIdLen = ConfigToken->Token.ConnectNetworkToken->Data->Network->SSId.SSIdLen;
- AsciiSSId = (CHAR8*) AllocateZeroPool(sizeof (CHAR8) * (SSIdLen + 1));
+ AsciiSSId = (CHAR8 *)AllocateZeroPool (sizeof (CHAR8) * (SSIdLen + 1));
if (AsciiSSId == NULL) {
ConfigToken->Nic->HasDisconnectPendingNetwork = TRUE;
WifiMgrUpdateConnectMessage (ConfigToken->Nic, FALSE, NULL);
goto Exit;
}
- CopyMem(AsciiSSId, ConfigToken->Token.ConnectNetworkToken->Data->Network->SSId.SSId, SSIdLen);
+ CopyMem (AsciiSSId, ConfigToken->Token.ConnectNetworkToken->Data->Network->SSId.SSId, SSIdLen);
*(AsciiSSId + SSIdLen) = '\0';
- ConnectedProfile = WifiMgrGetProfileByAsciiSSId(AsciiSSId, SecurityType, &ConfigToken->Nic->ProfileList);
- FreePool(AsciiSSId);
+ ConnectedProfile = WifiMgrGetProfileByAsciiSSId (AsciiSSId, SecurityType, &ConfigToken->Nic->ProfileList);
+ FreePool (AsciiSSId);
if (ConnectedProfile == NULL) {
ConfigToken->Nic->HasDisconnectPendingNetwork = TRUE;
WifiMgrUpdateConnectMessage (ConfigToken->Nic, FALSE, NULL);
@@ -907,8 +1006,9 @@ Exit:
if (ConfigToken->Nic->ConnectState == WifiMgrDisconnected) {
ConfigToken->Nic->CurrentOperateNetwork = NULL;
}
+
ConfigToken->Nic->OneTimeConnectRequest = FALSE;
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
}
/**
@@ -927,17 +1027,17 @@ Exit:
**/
EFI_STATUS
WifiMgrConnectToNetwork (
- IN WIFI_MGR_DEVICE_DATA *Nic,
- IN WIFI_MGR_NETWORK_PROFILE *Profile
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ IN WIFI_MGR_NETWORK_PROFILE *Profile
)
{
- EFI_STATUS Status;
- EFI_TPL OldTpl;
- EFI_ADAPTER_INFO_MEDIA_STATE LinkState;
- WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
- EFI_80211_CONNECT_NETWORK_TOKEN *ConnectToken;
+ EFI_STATUS Status;
+ EFI_TPL OldTpl;
+ EFI_ADAPTER_INFO_MEDIA_STATE LinkState;
+ WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
+ EFI_80211_CONNECT_NETWORK_TOKEN *ConnectToken;
- if (Nic == NULL || Nic->Wmp == NULL || Profile == NULL) {
+ if ((Nic == NULL) || (Nic->Wmp == NULL) || (Profile == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -945,6 +1045,7 @@ WifiMgrConnectToNetwork (
if (EFI_ERROR (Status)) {
return Status;
}
+
if (LinkState.MediaState == EFI_SUCCESS) {
return EFI_ALREADY_STARTED;
}
@@ -965,15 +1066,15 @@ WifiMgrConnectToNetwork (
goto Exit;
}
- ConfigToken->Type = TokenTypeConnectNetworkToken;
- ConfigToken->Nic = Nic;
- ConfigToken->Token.ConnectNetworkToken = AllocateZeroPool (sizeof (EFI_80211_CONNECT_NETWORK_TOKEN));
+ ConfigToken->Type = TokenTypeConnectNetworkToken;
+ ConfigToken->Nic = Nic;
+ ConfigToken->Token.ConnectNetworkToken = AllocateZeroPool (sizeof (EFI_80211_CONNECT_NETWORK_TOKEN));
if (ConfigToken->Token.ConnectNetworkToken == NULL) {
goto Exit;
}
- ConnectToken = ConfigToken->Token.ConnectNetworkToken;
- ConnectToken->Data = AllocateZeroPool (sizeof (EFI_80211_CONNECT_NETWORK_DATA));
+ ConnectToken = ConfigToken->Token.ConnectNetworkToken;
+ ConnectToken->Data = AllocateZeroPool (sizeof (EFI_80211_CONNECT_NETWORK_DATA));
if (ConnectToken->Data == NULL) {
goto Exit;
}
@@ -982,7 +1083,8 @@ WifiMgrConnectToNetwork (
if (ConnectToken->Data->Network == NULL) {
goto Exit;
}
- CopyMem(ConnectToken->Data->Network, &Profile->Network, sizeof (EFI_80211_NETWORK));
+
+ CopyMem (ConnectToken->Data->Network, &Profile->Network, sizeof (EFI_80211_NETWORK));
//
// Add event handle and start to connect
@@ -998,12 +1100,12 @@ WifiMgrConnectToNetwork (
goto Exit;
}
- Nic->ConnectState = WifiMgrConnectingToAp;
+ Nic->ConnectState = WifiMgrConnectingToAp;
Nic->CurrentOperateNetwork = Profile;
WifiMgrUpdateConnectMessage (Nic, FALSE, NULL);
//
- //Start Connecting ...
+ // Start Connecting ...
//
Status = Nic->Wmp->ConnectNetwork (Nic->Wmp, ConnectToken);
@@ -1017,7 +1119,6 @@ WifiMgrConnectToNetwork (
Nic->ConnectState = WifiMgrConnectedToAp;
WifiMgrUpdateConnectMessage (Nic, TRUE, NULL);
} else {
-
Nic->ConnectState = WifiMgrDisconnected;
Nic->CurrentOperateNetwork = NULL;
@@ -1029,6 +1130,7 @@ WifiMgrConnectToNetwork (
}
}
}
+
goto Exit;
}
@@ -1037,6 +1139,7 @@ Exit:
if (EFI_ERROR (Status)) {
WifiMgrFreeToken (ConfigToken);
}
+
gBS->RestoreTPL (OldTpl);
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] WifiMgrConnectToNetwork: %r\n", Status));
@@ -1055,21 +1158,21 @@ Exit:
VOID
EFIAPI
WifiMgrOnDisconnectFinished (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
- WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
+ WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
ASSERT (Context != NULL);
- ConfigToken = (WIFI_MGR_MAC_CONFIG_TOKEN*) Context;
+ ConfigToken = (WIFI_MGR_MAC_CONFIG_TOKEN *)Context;
ASSERT (ConfigToken->Nic != NULL);
ASSERT (ConfigToken->Type == TokenTypeDisconnectNetworkToken);
ASSERT (ConfigToken->Token.DisconnectNetworkToken != NULL);
if (ConfigToken->Token.DisconnectNetworkToken->Status != EFI_SUCCESS) {
- ConfigToken->Nic->ConnectState = WifiMgrConnectedToAp;
+ ConfigToken->Nic->ConnectState = WifiMgrConnectedToAp;
WifiMgrUpdateConnectMessage (ConfigToken->Nic, FALSE, NULL);
ConfigToken->Nic->OneTimeDisconnectRequest = FALSE;
goto Exit;
@@ -1083,11 +1186,11 @@ WifiMgrOnDisconnectFinished (
//
// Disconnected network may not be in network list now, trigger a scan again!
//
- ConfigToken->Nic->OneTimeScanRequest = TRUE;
+ ConfigToken->Nic->OneTimeScanRequest = TRUE;
- Exit:
- WifiMgrFreeToken(ConfigToken);
- return;
+Exit:
+ WifiMgrFreeToken (ConfigToken);
+ return;
}
/**
@@ -1104,13 +1207,13 @@ WifiMgrOnDisconnectFinished (
**/
EFI_STATUS
WifiMgrDisconnectToNetwork (
- IN WIFI_MGR_DEVICE_DATA *Nic
+ IN WIFI_MGR_DEVICE_DATA *Nic
)
{
- EFI_STATUS Status;
- EFI_TPL OldTpl;
- WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
- EFI_80211_DISCONNECT_NETWORK_TOKEN *DisconnectToken;
+ EFI_STATUS Status;
+ EFI_TPL OldTpl;
+ WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken;
+ EFI_80211_DISCONNECT_NETWORK_TOKEN *DisconnectToken;
if (Nic == NULL) {
return EFI_INVALID_PARAMETER;
@@ -1124,11 +1227,11 @@ WifiMgrDisconnectToNetwork (
return EFI_OUT_OF_RESOURCES;
}
- ConfigToken->Type = TokenTypeDisconnectNetworkToken;
- ConfigToken->Nic = Nic;
+ ConfigToken->Type = TokenTypeDisconnectNetworkToken;
+ ConfigToken->Nic = Nic;
ConfigToken->Token.DisconnectNetworkToken = AllocateZeroPool (sizeof (EFI_80211_DISCONNECT_NETWORK_TOKEN));
if (ConfigToken->Token.DisconnectNetworkToken == NULL) {
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
gBS->RestoreTPL (OldTpl);
return EFI_OUT_OF_RESOURCES;
}
@@ -1143,7 +1246,7 @@ WifiMgrDisconnectToNetwork (
&DisconnectToken->Event
);
if (EFI_ERROR (Status)) {
- WifiMgrFreeToken(ConfigToken);
+ WifiMgrFreeToken (ConfigToken);
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1154,30 +1257,29 @@ WifiMgrDisconnectToNetwork (
Status = Nic->Wmp->DisconnectNetwork (Nic->Wmp, DisconnectToken);
if (EFI_ERROR (Status)) {
if (Status == EFI_NOT_FOUND) {
-
Nic->ConnectState = WifiMgrDisconnected;
Nic->CurrentOperateNetwork = NULL;
//
// This network is not in network list now, trigger a scan again!
//
- Nic->OneTimeScanRequest = TRUE;
+ Nic->OneTimeScanRequest = TRUE;
//
// State has been changed from Connected to Disconnected
//
WifiMgrUpdateConnectMessage (ConfigToken->Nic, TRUE, NULL);
- Status = EFI_SUCCESS;
+ Status = EFI_SUCCESS;
} else {
if (Nic->OneTimeDisconnectRequest) {
-
WifiMgrUpdateConnectMessage (ConfigToken->Nic, FALSE, L"Disconnect Failed: Unexpected Error!");
}
- Nic->ConnectState = WifiMgrConnectedToAp;
+ Nic->ConnectState = WifiMgrConnectedToAp;
WifiMgrUpdateConnectMessage (ConfigToken->Nic, FALSE, NULL);
}
- WifiMgrFreeToken(ConfigToken);
+
+ WifiMgrFreeToken (ConfigToken);
}
gBS->RestoreTPL (OldTpl);
@@ -1195,20 +1297,20 @@ WifiMgrDisconnectToNetwork (
VOID
EFIAPI
WifiMgrOnTimerTick (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
- WIFI_MGR_DEVICE_DATA *Nic;
- EFI_STATUS Status;
- EFI_ADAPTER_INFO_MEDIA_STATE LinkState;
- WIFI_MGR_NETWORK_PROFILE *Profile;
+ WIFI_MGR_DEVICE_DATA *Nic;
+ EFI_STATUS Status;
+ EFI_ADAPTER_INFO_MEDIA_STATE LinkState;
+ WIFI_MGR_NETWORK_PROFILE *Profile;
if (Context == NULL) {
return;
}
- Nic = (WIFI_MGR_DEVICE_DATA*) Context;
+ Nic = (WIFI_MGR_DEVICE_DATA *)Context;
NET_CHECK_SIGNATURE (Nic, WIFI_MGR_DEVICE_DATA_SIGNATURE);
Status = WifiMgrGetLinkState (Nic, &LinkState);
@@ -1218,68 +1320,68 @@ WifiMgrOnTimerTick (
}
if (Nic->LastLinkState.MediaState != LinkState.MediaState) {
- if (Nic->LastLinkState.MediaState == EFI_SUCCESS && LinkState.MediaState == EFI_NO_MEDIA) {
+ if ((Nic->LastLinkState.MediaState == EFI_SUCCESS) && (LinkState.MediaState == EFI_NO_MEDIA)) {
Nic->HasDisconnectPendingNetwork = TRUE;
}
+
Nic->LastLinkState.MediaState = LinkState.MediaState;
}
- Nic->ScanTickTime ++;
- if ((Nic->ScanTickTime > WIFI_SCAN_FREQUENCY || Nic->OneTimeScanRequest) &&
- Nic->ScanState == WifiMgrScanFinished) {
-
+ Nic->ScanTickTime++;
+ if (((Nic->ScanTickTime > WIFI_SCAN_FREQUENCY) || Nic->OneTimeScanRequest) &&
+ (Nic->ScanState == WifiMgrScanFinished))
+ {
Nic->OneTimeScanRequest = FALSE;
- Nic->ScanTickTime = 0;
+ Nic->ScanTickTime = 0;
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Scan is triggered.\n"));
WifiMgrStartScan (Nic);
}
- if (Nic->AvailableCount > 0 && Nic->ScanState == WifiMgrScanFinished) {
-
+ if ((Nic->AvailableCount > 0) && (Nic->ScanState == WifiMgrScanFinished)) {
switch (Nic->ConnectState) {
- case WifiMgrDisconnected:
+ case WifiMgrDisconnected:
- if (Nic->HasDisconnectPendingNetwork) {
- Nic->HasDisconnectPendingNetwork = FALSE;
- }
-
- if (Nic->ConnectPendingNetwork != NULL) {
+ if (Nic->HasDisconnectPendingNetwork) {
+ Nic->HasDisconnectPendingNetwork = FALSE;
+ }
- Profile = Nic->ConnectPendingNetwork;
- Status = WifiMgrConnectToNetwork(Nic, Profile);
- Nic->ConnectPendingNetwork = NULL;
- if (EFI_ERROR (Status)) {
- //
- // Some error happened, don't wait for a return connect token!
- //
- Nic->OneTimeConnectRequest = FALSE;
+ if (Nic->ConnectPendingNetwork != NULL) {
+ Profile = Nic->ConnectPendingNetwork;
+ Status = WifiMgrConnectToNetwork (Nic, Profile);
+ Nic->ConnectPendingNetwork = NULL;
+ if (EFI_ERROR (Status)) {
+ //
+ // Some error happened, don't wait for a return connect token!
+ //
+ Nic->OneTimeConnectRequest = FALSE;
+ }
}
- }
- break;
- case WifiMgrConnectingToAp:
- break;
+ break;
- case WifiMgrDisconnectingToAp:
- break;
+ case WifiMgrConnectingToAp:
+ break;
- case WifiMgrConnectedToAp:
+ case WifiMgrDisconnectingToAp:
+ break;
- if (Nic->ConnectPendingNetwork != NULL || Nic->HasDisconnectPendingNetwork) {
+ case WifiMgrConnectedToAp:
- Status = WifiMgrDisconnectToNetwork(Nic);
- if (EFI_ERROR (Status)) {
- //
- // Some error happened, don't wait for a return disconnect token!
- //
- Nic->OneTimeDisconnectRequest = FALSE;
+ if ((Nic->ConnectPendingNetwork != NULL) || Nic->HasDisconnectPendingNetwork) {
+ Status = WifiMgrDisconnectToNetwork (Nic);
+ if (EFI_ERROR (Status)) {
+ //
+ // Some error happened, don't wait for a return disconnect token!
+ //
+ Nic->OneTimeDisconnectRequest = FALSE;
+ }
}
- }
- break;
- default:
- break;
+ break;
+
+ default:
+ break;
}
}
}
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.h b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.h
index d6b7ded8e6..b29150f7e9 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.h
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.h
@@ -24,7 +24,7 @@
**/
EFI_STATUS
WifiMgrStartScan (
- IN WIFI_MGR_DEVICE_DATA *Nic
+ IN WIFI_MGR_DEVICE_DATA *Nic
);
/**
@@ -61,8 +61,8 @@ WifiMgrGetLinkState (
**/
EFI_STATUS
WifiMgrConnectToNetwork (
- IN WIFI_MGR_DEVICE_DATA *Nic,
- IN WIFI_MGR_NETWORK_PROFILE *Profile
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ IN WIFI_MGR_NETWORK_PROFILE *Profile
);
/**
@@ -78,7 +78,7 @@ WifiMgrConnectToNetwork (
**/
EFI_STATUS
WifiMgrDisconnectToNetwork (
- IN WIFI_MGR_DEVICE_DATA *Nic
+ IN WIFI_MGR_DEVICE_DATA *Nic
);
/**
@@ -92,8 +92,8 @@ WifiMgrDisconnectToNetwork (
VOID
EFIAPI
WifiMgrOnTimerTick (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
);
#endif
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c
index 9295b8b33b..4e7c241718 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c
@@ -19,8 +19,8 @@
VOID
EFIAPI
WifiMgrInternalEmptyFunction (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
return;
@@ -41,7 +41,7 @@ WifiMgrMacAddrToStr (
OUT CHAR16 *Str
)
{
- if (Mac == NULL || Str == NULL) {
+ if ((Mac == NULL) || (Str == NULL)) {
return;
}
@@ -49,8 +49,12 @@ WifiMgrMacAddrToStr (
Str,
StrSize,
L"%02X:%02X:%02X:%02X:%02X:%02X",
- Mac->Addr[0], Mac->Addr[1], Mac->Addr[2],
- Mac->Addr[3], Mac->Addr[4], Mac->Addr[5]
+ Mac->Addr[0],
+ Mac->Addr[1],
+ Mac->Addr[2],
+ Mac->Addr[3],
+ Mac->Addr[4],
+ Mac->Addr[5]
);
}
@@ -68,15 +72,14 @@ WifiMgrMacAddrToStr (
**/
EFI_STATUS
WifiMgrReadFileToBuffer (
- IN WIFI_MGR_FILE_CONTEXT *FileContext,
- OUT VOID **DataAddr,
- OUT UINTN *DataSize
+ IN WIFI_MGR_FILE_CONTEXT *FileContext,
+ OUT VOID **DataAddr,
+ OUT UINTN *DataSize
)
{
- EFI_STATUS Status;
-
- if (FileContext != NULL && FileContext->FHandle != NULL) {
+ EFI_STATUS Status;
+ if ((FileContext != NULL) && (FileContext->FHandle != NULL)) {
Status = ReadFileContent (
FileContext->FHandle,
DataAddr,
@@ -87,6 +90,7 @@ WifiMgrReadFileToBuffer (
if (FileContext->FHandle != NULL) {
FileContext->FHandle->Close (FileContext->FHandle);
}
+
FileContext->FHandle = NULL;
return Status;
}
@@ -105,20 +109,24 @@ WifiMgrReadFileToBuffer (
**/
WIFI_MGR_DEVICE_DATA *
WifiMgrGetNicByIndex (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN UINT32 NicIndex
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN UINT32 NicIndex
)
{
- LIST_ENTRY *Entry;
- WIFI_MGR_DEVICE_DATA *Nic;
+ LIST_ENTRY *Entry;
+ WIFI_MGR_DEVICE_DATA *Nic;
if (Private == NULL) {
return NULL;
}
NET_LIST_FOR_EACH (Entry, &Private->NicList) {
- Nic = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_DEVICE_DATA,
- Link, WIFI_MGR_DEVICE_DATA_SIGNATURE);
+ Nic = NET_LIST_USER_STRUCT_S (
+ Entry,
+ WIFI_MGR_DEVICE_DATA,
+ Link,
+ WIFI_MGR_DEVICE_DATA_SIGNATURE
+ );
if (Nic->NicIndex == NicIndex) {
return Nic;
}
@@ -139,22 +147,26 @@ WifiMgrGetNicByIndex (
**/
WIFI_MGR_NETWORK_PROFILE *
WifiMgrGetProfileByUnicodeSSId (
- IN CHAR16 *SSId,
- IN UINT8 SecurityType,
- IN LIST_ENTRY *ProfileList
+ IN CHAR16 *SSId,
+ IN UINT8 SecurityType,
+ IN LIST_ENTRY *ProfileList
)
{
- LIST_ENTRY *Entry;
- WIFI_MGR_NETWORK_PROFILE *Profile;
+ LIST_ENTRY *Entry;
+ WIFI_MGR_NETWORK_PROFILE *Profile;
- if (SSId == NULL || ProfileList == NULL) {
+ if ((SSId == NULL) || (ProfileList == NULL)) {
return NULL;
}
NET_LIST_FOR_EACH (Entry, ProfileList) {
- Profile = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_NETWORK_PROFILE,
- Link, WIFI_MGR_PROFILE_SIGNATURE);
- if (StrCmp (SSId, Profile->SSId) == 0 && SecurityType == Profile->SecurityType) {
+ Profile = NET_LIST_USER_STRUCT_S (
+ Entry,
+ WIFI_MGR_NETWORK_PROFILE,
+ Link,
+ WIFI_MGR_PROFILE_SIGNATURE
+ );
+ if ((StrCmp (SSId, Profile->SSId) == 0) && (SecurityType == Profile->SecurityType)) {
return Profile;
}
}
@@ -174,16 +186,17 @@ WifiMgrGetProfileByUnicodeSSId (
**/
WIFI_MGR_NETWORK_PROFILE *
WifiMgrGetProfileByAsciiSSId (
- IN CHAR8 *SSId,
- IN UINT8 SecurityType,
- IN LIST_ENTRY *ProfileList
+ IN CHAR8 *SSId,
+ IN UINT8 SecurityType,
+ IN LIST_ENTRY *ProfileList
)
{
- CHAR16 SSIdUniCode[SSID_STORAGE_SIZE];
+ CHAR16 SSIdUniCode[SSID_STORAGE_SIZE];
if (SSId == NULL) {
return NULL;
}
+
if (AsciiStrToUnicodeStrS (SSId, SSIdUniCode, SSID_STORAGE_SIZE) != RETURN_SUCCESS) {
return NULL;
}
@@ -202,19 +215,24 @@ WifiMgrGetProfileByAsciiSSId (
**/
WIFI_MGR_NETWORK_PROFILE *
WifiMgrGetProfileByProfileIndex (
- IN UINT32 ProfileIndex,
- IN LIST_ENTRY *ProfileList
+ IN UINT32 ProfileIndex,
+ IN LIST_ENTRY *ProfileList
)
{
- WIFI_MGR_NETWORK_PROFILE *Profile;
- LIST_ENTRY *Entry;
+ WIFI_MGR_NETWORK_PROFILE *Profile;
+ LIST_ENTRY *Entry;
if (ProfileList == NULL) {
return NULL;
}
+
NET_LIST_FOR_EACH (Entry, ProfileList) {
- Profile = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_NETWORK_PROFILE,
- Link, WIFI_MGR_PROFILE_SIGNATURE);
+ Profile = NET_LIST_USER_STRUCT_S (
+ Entry,
+ WIFI_MGR_NETWORK_PROFILE,
+ Link,
+ WIFI_MGR_PROFILE_SIGNATURE
+ );
if (Profile->ProfileIndex == ProfileIndex) {
return Profile;
}
@@ -234,19 +252,20 @@ WifiMgrGetProfileByProfileIndex (
**/
BOOLEAN
WifiMgrSupportAKMSuite (
- IN UINT16 SupportedAKMSuiteCount,
- IN UINT32 *SupportedAKMSuiteList,
- IN UINT32 *AKMSuite
+ IN UINT16 SupportedAKMSuiteCount,
+ IN UINT32 *SupportedAKMSuiteList,
+ IN UINT32 *AKMSuite
)
{
- UINT16 Index;
+ UINT16 Index;
- if (AKMSuite == NULL || SupportedAKMSuiteList == NULL ||
- SupportedAKMSuiteCount == 0) {
+ if ((AKMSuite == NULL) || (SupportedAKMSuiteList == NULL) ||
+ (SupportedAKMSuiteCount == 0))
+ {
return FALSE;
}
- for (Index = 0; Index < SupportedAKMSuiteCount; Index ++) {
+ for (Index = 0; Index < SupportedAKMSuiteCount; Index++) {
if (SupportedAKMSuiteList[Index] == *AKMSuite) {
return TRUE;
}
@@ -267,19 +286,20 @@ WifiMgrSupportAKMSuite (
**/
BOOLEAN
WifiMgrSupportCipherSuite (
- IN UINT16 SupportedCipherSuiteCount,
- IN UINT32 *SupportedCipherSuiteList,
- IN UINT32 *CipherSuite
+ IN UINT16 SupportedCipherSuiteCount,
+ IN UINT32 *SupportedCipherSuiteList,
+ IN UINT32 *CipherSuite
)
{
UINT16 Index;
- if (CipherSuite == NULL || SupportedCipherSuiteCount == 0 ||
- SupportedCipherSuiteList == NULL) {
+ if ((CipherSuite == NULL) || (SupportedCipherSuiteCount == 0) ||
+ (SupportedCipherSuiteList == NULL))
+ {
return FALSE;
}
- for (Index = 0; Index < SupportedCipherSuiteCount; Index ++) {
+ for (Index = 0; Index < SupportedCipherSuiteCount; Index++) {
if (SupportedCipherSuiteList[Index] == *CipherSuite) {
return TRUE;
}
@@ -309,23 +329,23 @@ WifiMgrSupportCipherSuite (
**/
EFI_STATUS
WifiMgrCheckRSN (
- IN EFI_80211_AKM_SUITE_SELECTOR *AKMList,
- IN EFI_80211_CIPHER_SUITE_SELECTOR *CipherList,
- IN WIFI_MGR_DEVICE_DATA *Nic,
- OUT UINT8 *SecurityType,
- OUT BOOLEAN *AKMSuiteSupported,
- OUT BOOLEAN *CipherSuiteSupported
+ IN EFI_80211_AKM_SUITE_SELECTOR *AKMList,
+ IN EFI_80211_CIPHER_SUITE_SELECTOR *CipherList,
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ OUT UINT8 *SecurityType,
+ OUT BOOLEAN *AKMSuiteSupported,
+ OUT BOOLEAN *CipherSuiteSupported
)
{
- EFI_80211_AKM_SUITE_SELECTOR *SupportedAKMSuites;
- EFI_80211_CIPHER_SUITE_SELECTOR *SupportedSwCipherSuites;
- EFI_80211_CIPHER_SUITE_SELECTOR *SupportedHwCipherSuites;
- EFI_80211_SUITE_SELECTOR *AKMSuite;
- EFI_80211_SUITE_SELECTOR *CipherSuite;
- UINT16 AKMIndex;
- UINT16 CipherIndex;
-
- if (Nic == NULL || AKMList == NULL || CipherList == NULL|| SecurityType == NULL) {
+ EFI_80211_AKM_SUITE_SELECTOR *SupportedAKMSuites;
+ EFI_80211_CIPHER_SUITE_SELECTOR *SupportedSwCipherSuites;
+ EFI_80211_CIPHER_SUITE_SELECTOR *SupportedHwCipherSuites;
+ EFI_80211_SUITE_SELECTOR *AKMSuite;
+ EFI_80211_SUITE_SELECTOR *CipherSuite;
+ UINT16 AKMIndex;
+ UINT16 CipherIndex;
+
+ if ((Nic == NULL) || (AKMList == NULL) || (CipherList == NULL) || (SecurityType == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -334,7 +354,7 @@ WifiMgrCheckRSN (
SupportedHwCipherSuites = Nic->SupportedSuites.SupportedHwCipherSuites;
*SecurityType = SECURITY_TYPE_UNKNOWN;
- if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {
+ if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {
*AKMSuiteSupported = FALSE;
*CipherSuiteSupported = FALSE;
}
@@ -342,7 +362,7 @@ WifiMgrCheckRSN (
if (AKMList->AKMSuiteCount == 0) {
if (CipherList->CipherSuiteCount == 0) {
*SecurityType = SECURITY_TYPE_NONE;
- if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {
+ if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {
*AKMSuiteSupported = TRUE;
*CipherSuiteSupported = TRUE;
}
@@ -351,48 +371,54 @@ WifiMgrCheckRSN (
return EFI_SUCCESS;
}
- for (AKMIndex = 0; AKMIndex < AKMList->AKMSuiteCount; AKMIndex ++) {
-
+ for (AKMIndex = 0; AKMIndex < AKMList->AKMSuiteCount; AKMIndex++) {
AKMSuite = AKMList->AKMSuiteList + AKMIndex;
- if (WifiMgrSupportAKMSuite(SupportedAKMSuites->AKMSuiteCount,
- (UINT32*) SupportedAKMSuites->AKMSuiteList, (UINT32*) AKMSuite)) {
-
- if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {
+ if (WifiMgrSupportAKMSuite (
+ SupportedAKMSuites->AKMSuiteCount,
+ (UINT32 *)SupportedAKMSuites->AKMSuiteList,
+ (UINT32 *)AKMSuite
+ ))
+ {
+ if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {
*AKMSuiteSupported = TRUE;
}
- for (CipherIndex = 0; CipherIndex < CipherList->CipherSuiteCount; CipherIndex ++) {
+ for (CipherIndex = 0; CipherIndex < CipherList->CipherSuiteCount; CipherIndex++) {
CipherSuite = CipherList->CipherSuiteList + CipherIndex;
if (SupportedSwCipherSuites != NULL) {
-
- if (WifiMgrSupportCipherSuite(SupportedSwCipherSuites->CipherSuiteCount,
- (UINT32*) SupportedSwCipherSuites->CipherSuiteList, (UINT32*) CipherSuite)) {
-
- *SecurityType = WifiMgrGetSecurityType ((UINT32*) AKMSuite, (UINT32*) CipherSuite);
+ if (WifiMgrSupportCipherSuite (
+ SupportedSwCipherSuites->CipherSuiteCount,
+ (UINT32 *)SupportedSwCipherSuites->CipherSuiteList,
+ (UINT32 *)CipherSuite
+ ))
+ {
+ *SecurityType = WifiMgrGetSecurityType ((UINT32 *)AKMSuite, (UINT32 *)CipherSuite);
if (*SecurityType != SECURITY_TYPE_UNKNOWN) {
-
- if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {
+ if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {
*CipherSuiteSupported = TRUE;
}
+
return EFI_SUCCESS;
}
}
}
if (SupportedHwCipherSuites != NULL) {
-
- if (WifiMgrSupportCipherSuite(SupportedHwCipherSuites->CipherSuiteCount,
- (UINT32*) SupportedHwCipherSuites->CipherSuiteList, (UINT32*) CipherSuite)) {
-
- *SecurityType = WifiMgrGetSecurityType ((UINT32*) AKMSuite, (UINT32*) CipherSuite);
+ if (WifiMgrSupportCipherSuite (
+ SupportedHwCipherSuites->CipherSuiteCount,
+ (UINT32 *)SupportedHwCipherSuites->CipherSuiteList,
+ (UINT32 *)CipherSuite
+ ))
+ {
+ *SecurityType = WifiMgrGetSecurityType ((UINT32 *)AKMSuite, (UINT32 *)CipherSuite);
if (*SecurityType != SECURITY_TYPE_UNKNOWN) {
-
- if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {
+ if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {
*CipherSuiteSupported = TRUE;
}
+
return EFI_SUCCESS;
}
}
@@ -401,8 +427,10 @@ WifiMgrCheckRSN (
}
}
- *SecurityType = WifiMgrGetSecurityType ((UINT32*) AKMList->AKMSuiteList,
- (UINT32*) CipherList->CipherSuiteList);
+ *SecurityType = WifiMgrGetSecurityType (
+ (UINT32 *)AKMList->AKMSuiteList,
+ (UINT32 *)CipherList->CipherSuiteList
+ );
return EFI_SUCCESS;
}
@@ -418,60 +446,56 @@ WifiMgrCheckRSN (
**/
UINT8
WifiMgrGetSecurityType (
- IN UINT32 *AKMSuite,
- IN UINT32 *CipherSuite
+ IN UINT32 *AKMSuite,
+ IN UINT32 *CipherSuite
)
{
if (CipherSuite == NULL) {
-
if (AKMSuite == NULL) {
return SECURITY_TYPE_NONE;
} else {
return SECURITY_TYPE_UNKNOWN;
}
} else if (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_USE_GROUP) {
-
if (AKMSuite == NULL) {
return SECURITY_TYPE_NONE;
} else {
return SECURITY_TYPE_UNKNOWN;
}
- } else if (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP40 ||
- *CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP104) {
-
+ } else if ((*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP40) ||
+ (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP104))
+ {
return SECURITY_TYPE_WEP;
} else if (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_CCMP) {
-
if (AKMSuite == NULL) {
return SECURITY_TYPE_UNKNOWN;
}
- if (*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA ||
- *AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA_SHA256) {
-
+ if ((*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA) ||
+ (*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA_SHA256))
+ {
return SECURITY_TYPE_WPA2_ENTERPRISE;
- } else if (*AKMSuite == IEEE_80211_AKM_SUITE_PSK ||
- *AKMSuite == IEEE_80211_AKM_SUITE_PSK_SHA256){
-
+ } else if ((*AKMSuite == IEEE_80211_AKM_SUITE_PSK) ||
+ (*AKMSuite == IEEE_80211_AKM_SUITE_PSK_SHA256))
+ {
return SECURITY_TYPE_WPA2_PERSONAL;
- }else {
+ } else {
return SECURITY_TYPE_UNKNOWN;
}
} else if (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_TKIP) {
-
if (AKMSuite == NULL) {
return SECURITY_TYPE_UNKNOWN;
}
- if (*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA ||
- *AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA_SHA256) {
-
+ if ((*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA) ||
+ (*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA_SHA256))
+ {
return SECURITY_TYPE_WPA_ENTERPRISE;
- } else if (*AKMSuite == IEEE_80211_AKM_SUITE_PSK ||
- *AKMSuite == IEEE_80211_AKM_SUITE_PSK_SHA256){
-
+ } else if ((*AKMSuite == IEEE_80211_AKM_SUITE_PSK) ||
+ (*AKMSuite == IEEE_80211_AKM_SUITE_PSK_SHA256))
+ {
return SECURITY_TYPE_WPA_PERSONAL;
- }else {
+ } else {
return SECURITY_TYPE_UNKNOWN;
}
} else {
@@ -490,36 +514,40 @@ WifiMgrGetSecurityType (
**/
EFI_STATUS
WifiMgrGetSupportedSuites (
- IN WIFI_MGR_DEVICE_DATA *Nic
+ IN WIFI_MGR_DEVICE_DATA *Nic
)
{
- EFI_STATUS Status;
- EFI_SUPPLICANT_PROTOCOL *Supplicant;
- EFI_80211_AKM_SUITE_SELECTOR *SupportedAKMSuites;
- EFI_80211_CIPHER_SUITE_SELECTOR *SupportedSwCipherSuites;
- EFI_80211_CIPHER_SUITE_SELECTOR *SupportedHwCipherSuites;
- UINTN DataSize;
+ EFI_STATUS Status;
+ EFI_SUPPLICANT_PROTOCOL *Supplicant;
+ EFI_80211_AKM_SUITE_SELECTOR *SupportedAKMSuites;
+ EFI_80211_CIPHER_SUITE_SELECTOR *SupportedSwCipherSuites;
+ EFI_80211_CIPHER_SUITE_SELECTOR *SupportedHwCipherSuites;
+ UINTN DataSize;
SupportedAKMSuites = NULL;
SupportedSwCipherSuites = NULL;
SupportedHwCipherSuites = NULL;
- if (Nic == NULL || Nic->Supplicant == NULL) {
+ if ((Nic == NULL) || (Nic->Supplicant == NULL)) {
return EFI_INVALID_PARAMETER;
}
Supplicant = Nic->Supplicant;
- DataSize = 0;
- Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedAKMSuites, NULL, &DataSize);
- if (Status == EFI_BUFFER_TOO_SMALL && DataSize > 0) {
-
- SupportedAKMSuites = AllocateZeroPool(DataSize);
+ DataSize = 0;
+ Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedAKMSuites, NULL, &DataSize);
+ if ((Status == EFI_BUFFER_TOO_SMALL) && (DataSize > 0)) {
+ SupportedAKMSuites = AllocateZeroPool (DataSize);
if (SupportedAKMSuites == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedAKMSuites,
- (UINT8 *) SupportedAKMSuites, &DataSize);
+
+ Status = Supplicant->GetData (
+ Supplicant,
+ EfiSupplicant80211SupportedAKMSuites,
+ (UINT8 *)SupportedAKMSuites,
+ &DataSize
+ );
if (!EFI_ERROR (Status)) {
Nic->SupportedSuites.SupportedAKMSuites = SupportedAKMSuites;
} else {
@@ -529,17 +557,20 @@ WifiMgrGetSupportedSuites (
SupportedAKMSuites = NULL;
}
- DataSize = 0;
- Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedSoftwareCipherSuites, NULL, &DataSize);
- if (Status == EFI_BUFFER_TOO_SMALL && DataSize > 0) {
-
-
- SupportedSwCipherSuites = AllocateZeroPool(DataSize);
+ DataSize = 0;
+ Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedSoftwareCipherSuites, NULL, &DataSize);
+ if ((Status == EFI_BUFFER_TOO_SMALL) && (DataSize > 0)) {
+ SupportedSwCipherSuites = AllocateZeroPool (DataSize);
if (SupportedSwCipherSuites == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedSoftwareCipherSuites,
- (UINT8 *) SupportedSwCipherSuites, &DataSize);
+
+ Status = Supplicant->GetData (
+ Supplicant,
+ EfiSupplicant80211SupportedSoftwareCipherSuites,
+ (UINT8 *)SupportedSwCipherSuites,
+ &DataSize
+ );
if (!EFI_ERROR (Status)) {
Nic->SupportedSuites.SupportedSwCipherSuites = SupportedSwCipherSuites;
} else {
@@ -549,16 +580,20 @@ WifiMgrGetSupportedSuites (
SupportedSwCipherSuites = NULL;
}
- DataSize = 0;
- Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedHardwareCipherSuites, NULL, &DataSize);
- if (Status == EFI_BUFFER_TOO_SMALL && DataSize > 0) {
-
- SupportedHwCipherSuites = AllocateZeroPool(DataSize);
+ DataSize = 0;
+ Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedHardwareCipherSuites, NULL, &DataSize);
+ if ((Status == EFI_BUFFER_TOO_SMALL) && (DataSize > 0)) {
+ SupportedHwCipherSuites = AllocateZeroPool (DataSize);
if (SupportedHwCipherSuites == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedHardwareCipherSuites,
- (UINT8 *) SupportedHwCipherSuites, &DataSize);
+
+ Status = Supplicant->GetData (
+ Supplicant,
+ EfiSupplicant80211SupportedHardwareCipherSuites,
+ (UINT8 *)SupportedHwCipherSuites,
+ &DataSize
+ );
if (!EFI_ERROR (Status)) {
Nic->SupportedSuites.SupportedHwCipherSuites = SupportedHwCipherSuites;
} else {
@@ -579,7 +614,7 @@ WifiMgrGetSupportedSuites (
**/
VOID
WifiMgrCleanProfileSecrets (
- IN WIFI_MGR_NETWORK_PROFILE *Profile
+ IN WIFI_MGR_NETWORK_PROFILE *Profile
)
{
ZeroMem (Profile->Password, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE);
@@ -587,26 +622,26 @@ WifiMgrCleanProfileSecrets (
ZeroMem (Profile->PrivateKeyPassword, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE);
if (Profile->CACertData != NULL) {
-
ZeroMem (Profile->CACertData, Profile->CACertSize);
FreePool (Profile->CACertData);
}
+
Profile->CACertData = NULL;
Profile->CACertSize = 0;
if (Profile->ClientCertData != NULL) {
-
ZeroMem (Profile->ClientCertData, Profile->ClientCertSize);
FreePool (Profile->ClientCertData);
}
+
Profile->ClientCertData = NULL;
Profile->ClientCertSize = 0;
if (Profile->PrivateKeyData != NULL) {
-
ZeroMem (Profile->PrivateKeyData, Profile->PrivateKeyDataSize);
FreePool (Profile->PrivateKeyData);
}
+
Profile->PrivateKeyData = NULL;
Profile->PrivateKeyDataSize = 0;
}
@@ -619,30 +654,33 @@ WifiMgrCleanProfileSecrets (
**/
VOID
WifiMgrFreeProfileList (
- IN LIST_ENTRY *ProfileList
+ IN LIST_ENTRY *ProfileList
)
{
- WIFI_MGR_NETWORK_PROFILE *Profile;
- LIST_ENTRY *Entry;
- LIST_ENTRY *NextEntry;
+ WIFI_MGR_NETWORK_PROFILE *Profile;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *NextEntry;
if (ProfileList == NULL) {
return;
}
NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, ProfileList) {
-
- Profile = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_NETWORK_PROFILE,
- Link, WIFI_MGR_PROFILE_SIGNATURE);
+ Profile = NET_LIST_USER_STRUCT_S (
+ Entry,
+ WIFI_MGR_NETWORK_PROFILE,
+ Link,
+ WIFI_MGR_PROFILE_SIGNATURE
+ );
WifiMgrCleanProfileSecrets (Profile);
if (Profile->Network.AKMSuite != NULL) {
- FreePool(Profile->Network.AKMSuite);
+ FreePool (Profile->Network.AKMSuite);
}
if (Profile->Network.CipherSuite != NULL) {
- FreePool(Profile->Network.CipherSuite);
+ FreePool (Profile->Network.CipherSuite);
}
FreePool (Profile);
@@ -657,26 +695,28 @@ WifiMgrFreeProfileList (
**/
VOID
WifiMgrFreeHiddenList (
- IN LIST_ENTRY *HiddenList
+ IN LIST_ENTRY *HiddenList
)
{
- WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
- LIST_ENTRY *Entry;
- LIST_ENTRY *NextEntry;
+ WIFI_HIDDEN_NETWORK_DATA *HiddenNetwork;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *NextEntry;
if (HiddenList == NULL) {
return;
}
NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, HiddenList) {
-
- HiddenNetwork = NET_LIST_USER_STRUCT_S (Entry, WIFI_HIDDEN_NETWORK_DATA,
- Link, WIFI_MGR_HIDDEN_NETWORK_SIGNATURE);
+ HiddenNetwork = NET_LIST_USER_STRUCT_S (
+ Entry,
+ WIFI_HIDDEN_NETWORK_DATA,
+ Link,
+ WIFI_MGR_HIDDEN_NETWORK_SIGNATURE
+ );
FreePool (HiddenNetwork);
}
}
-
/**
Free the resources of a config token.
@@ -684,24 +724,22 @@ WifiMgrFreeHiddenList (
**/
VOID
WifiMgrFreeToken (
- IN WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken
+ IN WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken
)
{
- EFI_80211_GET_NETWORKS_RESULT *Result;
+ EFI_80211_GET_NETWORKS_RESULT *Result;
if (ConfigToken == NULL) {
return;
}
switch (ConfigToken->Type) {
-
case TokenTypeGetNetworksToken:
if (ConfigToken->Token.GetNetworksToken != NULL) {
-
gBS->CloseEvent (ConfigToken->Token.GetNetworksToken->Event);
if (ConfigToken->Token.GetNetworksToken->Data != NULL) {
- FreePool(ConfigToken->Token.GetNetworksToken->Data);
+ FreePool (ConfigToken->Token.GetNetworksToken->Data);
}
Result = ConfigToken->Token.GetNetworksToken->Result;
@@ -709,7 +747,7 @@ WifiMgrFreeToken (
FreePool (Result);
}
- FreePool(ConfigToken->Token.GetNetworksToken);
+ FreePool (ConfigToken->Token.GetNetworksToken);
}
FreePool (ConfigToken);
@@ -718,27 +756,27 @@ WifiMgrFreeToken (
case TokenTypeConnectNetworkToken:
if (ConfigToken->Token.ConnectNetworkToken != NULL) {
-
gBS->CloseEvent (ConfigToken->Token.ConnectNetworkToken->Event);
if (ConfigToken->Token.ConnectNetworkToken->Data != NULL) {
- FreePool(ConfigToken->Token.ConnectNetworkToken->Data);
+ FreePool (ConfigToken->Token.ConnectNetworkToken->Data);
}
- FreePool(ConfigToken->Token.ConnectNetworkToken);
+
+ FreePool (ConfigToken->Token.ConnectNetworkToken);
}
+
FreePool (ConfigToken);
break;
case TokenTypeDisconnectNetworkToken:
if (ConfigToken->Token.DisconnectNetworkToken != NULL) {
-
- FreePool(ConfigToken->Token.DisconnectNetworkToken);
+ FreePool (ConfigToken->Token.DisconnectNetworkToken);
}
FreePool (ConfigToken);
break;
- default :
+ default:
break;
}
}
diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.h b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.h
index ef5b9e5da6..71ad007ef6 100644
--- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.h
+++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.h
@@ -20,8 +20,8 @@
VOID
EFIAPI
WifiMgrInternalEmptyFunction (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
);
/**
@@ -34,9 +34,9 @@ WifiMgrInternalEmptyFunction (
**/
VOID
WifiMgrMacAddrToStr (
- IN EFI_80211_MAC_ADDRESS *Mac,
- IN UINT32 StrSize,
- OUT CHAR16 *Str
+ IN EFI_80211_MAC_ADDRESS *Mac,
+ IN UINT32 StrSize,
+ OUT CHAR16 *Str
);
/**
@@ -53,12 +53,11 @@ WifiMgrMacAddrToStr (
**/
EFI_STATUS
WifiMgrReadFileToBuffer (
- IN WIFI_MGR_FILE_CONTEXT *FileContext,
- OUT VOID **PrivateKeyDataAddr,
- OUT UINTN *PrivateKeyDataSize
+ IN WIFI_MGR_FILE_CONTEXT *FileContext,
+ OUT VOID **PrivateKeyDataAddr,
+ OUT UINTN *PrivateKeyDataSize
);
-
/**
Get the Nic data by the NicIndex.
@@ -70,8 +69,8 @@ WifiMgrReadFileToBuffer (
**/
WIFI_MGR_DEVICE_DATA *
WifiMgrGetNicByIndex (
- IN WIFI_MGR_PRIVATE_DATA *Private,
- IN UINT32 NicIndex
+ IN WIFI_MGR_PRIVATE_DATA *Private,
+ IN UINT32 NicIndex
);
/**
@@ -86,9 +85,9 @@ WifiMgrGetNicByIndex (
**/
WIFI_MGR_NETWORK_PROFILE *
WifiMgrGetProfileByUnicodeSSId (
- IN CHAR16 *SSId,
- IN UINT8 SecurityType,
- IN LIST_ENTRY *ProfileList
+ IN CHAR16 *SSId,
+ IN UINT8 SecurityType,
+ IN LIST_ENTRY *ProfileList
);
/**
@@ -103,9 +102,9 @@ WifiMgrGetProfileByUnicodeSSId (
**/
WIFI_MGR_NETWORK_PROFILE *
WifiMgrGetProfileByAsciiSSId (
- IN CHAR8 *SSId,
- IN UINT8 SecurityType,
- IN LIST_ENTRY *ProfileList
+ IN CHAR8 *SSId,
+ IN UINT8 SecurityType,
+ IN LIST_ENTRY *ProfileList
);
/**
@@ -119,8 +118,8 @@ WifiMgrGetProfileByAsciiSSId (
**/
WIFI_MGR_NETWORK_PROFILE *
WifiMgrGetProfileByProfileIndex (
- IN UINT32 ProfileIndex,
- IN LIST_ENTRY *ProfileList
+ IN UINT32 ProfileIndex,
+ IN LIST_ENTRY *ProfileList
);
/**
@@ -135,9 +134,9 @@ WifiMgrGetProfileByProfileIndex (
**/
BOOLEAN
WifiMgrSupportAKMSuite (
- IN UINT16 SupportedAKMSuiteCount,
- IN UINT32 *SupportedAKMSuiteList,
- IN UINT32 *AKMSuite
+ IN UINT16 SupportedAKMSuiteCount,
+ IN UINT32 *SupportedAKMSuiteList,
+ IN UINT32 *AKMSuite
);
/**
@@ -152,9 +151,9 @@ WifiMgrSupportAKMSuite (
**/
BOOLEAN
WifiMgrSupportCipherSuite (
- IN UINT16 SupportedCipherSuiteCount,
- IN UINT32 *SupportedCipherSuiteList,
- IN UINT32 *CipherSuite
+ IN UINT16 SupportedCipherSuiteCount,
+ IN UINT32 *SupportedCipherSuiteList,
+ IN UINT32 *CipherSuite
);
/**
@@ -178,12 +177,12 @@ WifiMgrSupportCipherSuite (
**/
EFI_STATUS
WifiMgrCheckRSN (
- IN EFI_80211_AKM_SUITE_SELECTOR *AKMList,
- IN EFI_80211_CIPHER_SUITE_SELECTOR *CipherList,
- IN WIFI_MGR_DEVICE_DATA *Nic,
- OUT UINT8 *SecurityType,
- OUT BOOLEAN *AKMSuiteSupported,
- OUT BOOLEAN *CipherSuiteSupported
+ IN EFI_80211_AKM_SUITE_SELECTOR *AKMList,
+ IN EFI_80211_CIPHER_SUITE_SELECTOR *CipherList,
+ IN WIFI_MGR_DEVICE_DATA *Nic,
+ OUT UINT8 *SecurityType,
+ OUT BOOLEAN *AKMSuiteSupported,
+ OUT BOOLEAN *CipherSuiteSupported
);
/**
@@ -197,8 +196,8 @@ WifiMgrCheckRSN (
**/
UINT8
WifiMgrGetSecurityType (
- IN UINT32 *AKMSuite,
- IN UINT32 *CipherSuite
+ IN UINT32 *AKMSuite,
+ IN UINT32 *CipherSuite
);
/**
@@ -212,7 +211,7 @@ WifiMgrGetSecurityType (
**/
EFI_STATUS
WifiMgrGetSupportedSuites (
- IN WIFI_MGR_DEVICE_DATA *Nic
+ IN WIFI_MGR_DEVICE_DATA *Nic
);
/**
@@ -223,7 +222,7 @@ WifiMgrGetSupportedSuites (
**/
VOID
WifiMgrCleanProfileSecrets (
- IN WIFI_MGR_NETWORK_PROFILE *Profile
+ IN WIFI_MGR_NETWORK_PROFILE *Profile
);
/**
@@ -234,7 +233,7 @@ WifiMgrCleanProfileSecrets (
**/
VOID
WifiMgrFreeProfileList (
- IN LIST_ENTRY *ProfileList
+ IN LIST_ENTRY *ProfileList
);
/**
@@ -245,7 +244,7 @@ WifiMgrFreeProfileList (
**/
VOID
WifiMgrFreeHiddenList (
- IN LIST_ENTRY *HiddenList
+ IN LIST_ENTRY *HiddenList
);
/**
@@ -256,7 +255,7 @@ WifiMgrFreeHiddenList (
**/
VOID
WifiMgrFreeToken (
- IN WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken
+ IN WIFI_MGR_MAC_CONFIG_TOKEN *ConfigToken
);
#endif