]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c
NetworkPkg: Apply uncrustify changes
[mirror_edk2.git] / NetworkPkg / WifiConnectionManagerDxe / WifiConnectionMgrMisc.c
index 9295b8b33b25eb4cfd416bcf950437143a88a0eb..4e7c2417186a4e98d0f7a7cebb40811e56604695 100644 (file)
@@ -19,8 +19,8 @@
 VOID\r
 EFIAPI\r
 WifiMgrInternalEmptyFunction (\r
-  IN  EFI_EVENT    Event,\r
-  IN  VOID         *Context\r
+  IN  EFI_EVENT  Event,\r
+  IN  VOID       *Context\r
   )\r
 {\r
   return;\r
@@ -41,7 +41,7 @@ WifiMgrMacAddrToStr (
   OUT CHAR16                 *Str\r
   )\r
 {\r
-  if (Mac == NULL || Str == NULL) {\r
+  if ((Mac == NULL) || (Str == NULL)) {\r
     return;\r
   }\r
 \r
@@ -49,8 +49,12 @@ WifiMgrMacAddrToStr (
     Str,\r
     StrSize,\r
     L"%02X:%02X:%02X:%02X:%02X:%02X",\r
-    Mac->Addr[0], Mac->Addr[1], Mac->Addr[2],\r
-    Mac->Addr[3], Mac->Addr[4], Mac->Addr[5]\r
+    Mac->Addr[0],\r
+    Mac->Addr[1],\r
+    Mac->Addr[2],\r
+    Mac->Addr[3],\r
+    Mac->Addr[4],\r
+    Mac->Addr[5]\r
     );\r
 }\r
 \r
@@ -68,15 +72,14 @@ WifiMgrMacAddrToStr (
 **/\r
 EFI_STATUS\r
 WifiMgrReadFileToBuffer (\r
-  IN   WIFI_MGR_FILE_CONTEXT          *FileContext,\r
-  OUT  VOID                           **DataAddr,\r
-  OUT  UINTN                          *DataSize\r
+  IN   WIFI_MGR_FILE_CONTEXT  *FileContext,\r
+  OUT  VOID                   **DataAddr,\r
+  OUT  UINTN                  *DataSize\r
   )\r
 {\r
-  EFI_STATUS    Status;\r
-\r
-  if (FileContext != NULL && FileContext->FHandle != NULL) {\r
+  EFI_STATUS  Status;\r
 \r
+  if ((FileContext != NULL) && (FileContext->FHandle != NULL)) {\r
     Status = ReadFileContent (\r
                FileContext->FHandle,\r
                DataAddr,\r
@@ -87,6 +90,7 @@ WifiMgrReadFileToBuffer (
     if (FileContext->FHandle != NULL) {\r
       FileContext->FHandle->Close (FileContext->FHandle);\r
     }\r
+\r
     FileContext->FHandle = NULL;\r
     return Status;\r
   }\r
@@ -105,20 +109,24 @@ WifiMgrReadFileToBuffer (
 **/\r
 WIFI_MGR_DEVICE_DATA *\r
 WifiMgrGetNicByIndex (\r
-  IN WIFI_MGR_PRIVATE_DATA   *Private,\r
-  IN UINT32                  NicIndex\r
+  IN WIFI_MGR_PRIVATE_DATA  *Private,\r
+  IN UINT32                 NicIndex\r
   )\r
 {\r
-  LIST_ENTRY             *Entry;\r
-  WIFI_MGR_DEVICE_DATA   *Nic;\r
+  LIST_ENTRY            *Entry;\r
+  WIFI_MGR_DEVICE_DATA  *Nic;\r
 \r
   if (Private == NULL) {\r
     return NULL;\r
   }\r
 \r
   NET_LIST_FOR_EACH (Entry, &Private->NicList) {\r
-    Nic = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_DEVICE_DATA,\r
-            Link, WIFI_MGR_DEVICE_DATA_SIGNATURE);\r
+    Nic = NET_LIST_USER_STRUCT_S (\r
+            Entry,\r
+            WIFI_MGR_DEVICE_DATA,\r
+            Link,\r
+            WIFI_MGR_DEVICE_DATA_SIGNATURE\r
+            );\r
     if (Nic->NicIndex == NicIndex) {\r
       return Nic;\r
     }\r
@@ -139,22 +147,26 @@ WifiMgrGetNicByIndex (
 **/\r
 WIFI_MGR_NETWORK_PROFILE *\r
 WifiMgrGetProfileByUnicodeSSId (\r
-  IN  CHAR16                         *SSId,\r
-  IN  UINT8                          SecurityType,\r
-  IN  LIST_ENTRY                     *ProfileList\r
+  IN  CHAR16      *SSId,\r
+  IN  UINT8       SecurityType,\r
+  IN  LIST_ENTRY  *ProfileList\r
   )\r
 {\r
-  LIST_ENTRY                         *Entry;\r
-  WIFI_MGR_NETWORK_PROFILE           *Profile;\r
+  LIST_ENTRY                *Entry;\r
+  WIFI_MGR_NETWORK_PROFILE  *Profile;\r
 \r
-  if (SSId == NULL || ProfileList == NULL) {\r
+  if ((SSId == NULL) || (ProfileList == NULL)) {\r
     return NULL;\r
   }\r
 \r
   NET_LIST_FOR_EACH (Entry, ProfileList) {\r
-    Profile = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_NETWORK_PROFILE,\r
-                Link, WIFI_MGR_PROFILE_SIGNATURE);\r
-    if (StrCmp (SSId, Profile->SSId) == 0 && SecurityType == Profile->SecurityType) {\r
+    Profile = NET_LIST_USER_STRUCT_S (\r
+                Entry,\r
+                WIFI_MGR_NETWORK_PROFILE,\r
+                Link,\r
+                WIFI_MGR_PROFILE_SIGNATURE\r
+                );\r
+    if ((StrCmp (SSId, Profile->SSId) == 0) && (SecurityType == Profile->SecurityType)) {\r
       return Profile;\r
     }\r
   }\r
@@ -174,16 +186,17 @@ WifiMgrGetProfileByUnicodeSSId (
 **/\r
 WIFI_MGR_NETWORK_PROFILE *\r
 WifiMgrGetProfileByAsciiSSId (\r
-  IN  CHAR8                      *SSId,\r
-  IN  UINT8                      SecurityType,\r
-  IN  LIST_ENTRY                 *ProfileList\r
+  IN  CHAR8       *SSId,\r
+  IN  UINT8       SecurityType,\r
+  IN  LIST_ENTRY  *ProfileList\r
   )\r
 {\r
-  CHAR16   SSIdUniCode[SSID_STORAGE_SIZE];\r
+  CHAR16  SSIdUniCode[SSID_STORAGE_SIZE];\r
 \r
   if (SSId == NULL) {\r
     return NULL;\r
   }\r
+\r
   if (AsciiStrToUnicodeStrS (SSId, SSIdUniCode, SSID_STORAGE_SIZE) != RETURN_SUCCESS) {\r
     return NULL;\r
   }\r
@@ -202,19 +215,24 @@ WifiMgrGetProfileByAsciiSSId (
 **/\r
 WIFI_MGR_NETWORK_PROFILE *\r
 WifiMgrGetProfileByProfileIndex (\r
-  IN  UINT32                         ProfileIndex,\r
-  IN  LIST_ENTRY                     *ProfileList\r
+  IN  UINT32      ProfileIndex,\r
+  IN  LIST_ENTRY  *ProfileList\r
   )\r
 {\r
-  WIFI_MGR_NETWORK_PROFILE           *Profile;\r
-  LIST_ENTRY                         *Entry;\r
+  WIFI_MGR_NETWORK_PROFILE  *Profile;\r
+  LIST_ENTRY                *Entry;\r
 \r
   if (ProfileList == NULL) {\r
     return NULL;\r
   }\r
+\r
   NET_LIST_FOR_EACH (Entry, ProfileList) {\r
-    Profile = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_NETWORK_PROFILE,\r
-                Link, WIFI_MGR_PROFILE_SIGNATURE);\r
+    Profile = NET_LIST_USER_STRUCT_S (\r
+                Entry,\r
+                WIFI_MGR_NETWORK_PROFILE,\r
+                Link,\r
+                WIFI_MGR_PROFILE_SIGNATURE\r
+                );\r
     if (Profile->ProfileIndex == ProfileIndex) {\r
       return Profile;\r
     }\r
@@ -234,19 +252,20 @@ WifiMgrGetProfileByProfileIndex (
 **/\r
 BOOLEAN\r
 WifiMgrSupportAKMSuite (\r
-  IN  UINT16                               SupportedAKMSuiteCount,\r
-  IN  UINT32                               *SupportedAKMSuiteList,\r
-  IN  UINT32                               *AKMSuite\r
+  IN  UINT16  SupportedAKMSuiteCount,\r
+  IN  UINT32  *SupportedAKMSuiteList,\r
+  IN  UINT32  *AKMSuite\r
   )\r
 {\r
-  UINT16    Index;\r
+  UINT16  Index;\r
 \r
-  if (AKMSuite == NULL || SupportedAKMSuiteList == NULL ||\r
-    SupportedAKMSuiteCount == 0) {\r
+  if ((AKMSuite == NULL) || (SupportedAKMSuiteList == NULL) ||\r
+      (SupportedAKMSuiteCount == 0))\r
+  {\r
     return FALSE;\r
   }\r
 \r
-  for (Index = 0; Index < SupportedAKMSuiteCount; Index ++) {\r
+  for (Index = 0; Index < SupportedAKMSuiteCount; Index++) {\r
     if (SupportedAKMSuiteList[Index] == *AKMSuite) {\r
       return TRUE;\r
     }\r
@@ -267,19 +286,20 @@ WifiMgrSupportAKMSuite (
 **/\r
 BOOLEAN\r
 WifiMgrSupportCipherSuite (\r
-  IN  UINT16                                  SupportedCipherSuiteCount,\r
-  IN  UINT32                                  *SupportedCipherSuiteList,\r
-  IN  UINT32                                  *CipherSuite\r
+  IN  UINT16  SupportedCipherSuiteCount,\r
+  IN  UINT32  *SupportedCipherSuiteList,\r
+  IN  UINT32  *CipherSuite\r
   )\r
 {\r
   UINT16  Index;\r
 \r
-  if (CipherSuite == NULL || SupportedCipherSuiteCount == 0 ||\r
-    SupportedCipherSuiteList == NULL) {\r
+  if ((CipherSuite == NULL) || (SupportedCipherSuiteCount == 0) ||\r
+      (SupportedCipherSuiteList == NULL))\r
+  {\r
     return FALSE;\r
   }\r
 \r
-  for (Index = 0; Index < SupportedCipherSuiteCount; Index ++) {\r
+  for (Index = 0; Index < SupportedCipherSuiteCount; Index++) {\r
     if (SupportedCipherSuiteList[Index] == *CipherSuite) {\r
       return TRUE;\r
     }\r
@@ -309,23 +329,23 @@ WifiMgrSupportCipherSuite (
 **/\r
 EFI_STATUS\r
 WifiMgrCheckRSN (\r
-  IN    EFI_80211_AKM_SUITE_SELECTOR       *AKMList,\r
-  IN    EFI_80211_CIPHER_SUITE_SELECTOR    *CipherList,\r
-  IN    WIFI_MGR_DEVICE_DATA               *Nic,\r
-  OUT   UINT8                              *SecurityType,\r
-  OUT   BOOLEAN                            *AKMSuiteSupported,\r
-  OUT   BOOLEAN                            *CipherSuiteSupported\r
+  IN    EFI_80211_AKM_SUITE_SELECTOR     *AKMList,\r
+  IN    EFI_80211_CIPHER_SUITE_SELECTOR  *CipherList,\r
+  IN    WIFI_MGR_DEVICE_DATA             *Nic,\r
+  OUT   UINT8                            *SecurityType,\r
+  OUT   BOOLEAN                          *AKMSuiteSupported,\r
+  OUT   BOOLEAN                          *CipherSuiteSupported\r
   )\r
 {\r
-  EFI_80211_AKM_SUITE_SELECTOR             *SupportedAKMSuites;\r
-  EFI_80211_CIPHER_SUITE_SELECTOR          *SupportedSwCipherSuites;\r
-  EFI_80211_CIPHER_SUITE_SELECTOR          *SupportedHwCipherSuites;\r
-  EFI_80211_SUITE_SELECTOR                 *AKMSuite;\r
-  EFI_80211_SUITE_SELECTOR                 *CipherSuite;\r
-  UINT16                                   AKMIndex;\r
-  UINT16                                   CipherIndex;\r
-\r
-  if (Nic == NULL || AKMList == NULL || CipherList == NULL|| SecurityType == NULL) {\r
+  EFI_80211_AKM_SUITE_SELECTOR     *SupportedAKMSuites;\r
+  EFI_80211_CIPHER_SUITE_SELECTOR  *SupportedSwCipherSuites;\r
+  EFI_80211_CIPHER_SUITE_SELECTOR  *SupportedHwCipherSuites;\r
+  EFI_80211_SUITE_SELECTOR         *AKMSuite;\r
+  EFI_80211_SUITE_SELECTOR         *CipherSuite;\r
+  UINT16                           AKMIndex;\r
+  UINT16                           CipherIndex;\r
+\r
+  if ((Nic == NULL) || (AKMList == NULL) || (CipherList == NULL) || (SecurityType == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -334,7 +354,7 @@ WifiMgrCheckRSN (
   SupportedHwCipherSuites = Nic->SupportedSuites.SupportedHwCipherSuites;\r
 \r
   *SecurityType = SECURITY_TYPE_UNKNOWN;\r
-  if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {\r
+  if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {\r
     *AKMSuiteSupported    = FALSE;\r
     *CipherSuiteSupported = FALSE;\r
   }\r
@@ -342,7 +362,7 @@ WifiMgrCheckRSN (
   if (AKMList->AKMSuiteCount == 0) {\r
     if (CipherList->CipherSuiteCount == 0) {\r
       *SecurityType = SECURITY_TYPE_NONE;\r
-      if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {\r
+      if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {\r
         *AKMSuiteSupported    = TRUE;\r
         *CipherSuiteSupported = TRUE;\r
       }\r
@@ -351,48 +371,54 @@ WifiMgrCheckRSN (
     return EFI_SUCCESS;\r
   }\r
 \r
-  for (AKMIndex = 0; AKMIndex < AKMList->AKMSuiteCount; AKMIndex ++) {\r
-\r
+  for (AKMIndex = 0; AKMIndex < AKMList->AKMSuiteCount; AKMIndex++) {\r
     AKMSuite = AKMList->AKMSuiteList + AKMIndex;\r
-    if (WifiMgrSupportAKMSuite(SupportedAKMSuites->AKMSuiteCount,\r
-      (UINT32*) SupportedAKMSuites->AKMSuiteList, (UINT32*) AKMSuite)) {\r
-\r
-      if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {\r
+    if (WifiMgrSupportAKMSuite (\r
+          SupportedAKMSuites->AKMSuiteCount,\r
+          (UINT32 *)SupportedAKMSuites->AKMSuiteList,\r
+          (UINT32 *)AKMSuite\r
+          ))\r
+    {\r
+      if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {\r
         *AKMSuiteSupported = TRUE;\r
       }\r
-      for (CipherIndex = 0; CipherIndex < CipherList->CipherSuiteCount; CipherIndex ++) {\r
 \r
+      for (CipherIndex = 0; CipherIndex < CipherList->CipherSuiteCount; CipherIndex++) {\r
         CipherSuite = CipherList->CipherSuiteList + CipherIndex;\r
 \r
         if (SupportedSwCipherSuites != NULL) {\r
-\r
-          if (WifiMgrSupportCipherSuite(SupportedSwCipherSuites->CipherSuiteCount,\r
-            (UINT32*) SupportedSwCipherSuites->CipherSuiteList, (UINT32*) CipherSuite)) {\r
-\r
-            *SecurityType = WifiMgrGetSecurityType ((UINT32*) AKMSuite, (UINT32*) CipherSuite);\r
+          if (WifiMgrSupportCipherSuite (\r
+                SupportedSwCipherSuites->CipherSuiteCount,\r
+                (UINT32 *)SupportedSwCipherSuites->CipherSuiteList,\r
+                (UINT32 *)CipherSuite\r
+                ))\r
+          {\r
+            *SecurityType = WifiMgrGetSecurityType ((UINT32 *)AKMSuite, (UINT32 *)CipherSuite);\r
 \r
             if (*SecurityType != SECURITY_TYPE_UNKNOWN) {\r
-\r
-              if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {\r
+              if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {\r
                 *CipherSuiteSupported = TRUE;\r
               }\r
+\r
               return EFI_SUCCESS;\r
             }\r
           }\r
         }\r
 \r
         if (SupportedHwCipherSuites != NULL) {\r
-\r
-          if (WifiMgrSupportCipherSuite(SupportedHwCipherSuites->CipherSuiteCount,\r
-            (UINT32*) SupportedHwCipherSuites->CipherSuiteList, (UINT32*) CipherSuite)) {\r
-\r
-            *SecurityType = WifiMgrGetSecurityType ((UINT32*) AKMSuite, (UINT32*) CipherSuite);\r
+          if (WifiMgrSupportCipherSuite (\r
+                SupportedHwCipherSuites->CipherSuiteCount,\r
+                (UINT32 *)SupportedHwCipherSuites->CipherSuiteList,\r
+                (UINT32 *)CipherSuite\r
+                ))\r
+          {\r
+            *SecurityType = WifiMgrGetSecurityType ((UINT32 *)AKMSuite, (UINT32 *)CipherSuite);\r
 \r
             if (*SecurityType != SECURITY_TYPE_UNKNOWN) {\r
-\r
-              if (AKMSuiteSupported != NULL && CipherSuiteSupported != NULL) {\r
+              if ((AKMSuiteSupported != NULL) && (CipherSuiteSupported != NULL)) {\r
                 *CipherSuiteSupported = TRUE;\r
               }\r
+\r
               return EFI_SUCCESS;\r
             }\r
           }\r
@@ -401,8 +427,10 @@ WifiMgrCheckRSN (
     }\r
   }\r
 \r
-  *SecurityType = WifiMgrGetSecurityType ((UINT32*) AKMList->AKMSuiteList,\r
-                    (UINT32*) CipherList->CipherSuiteList);\r
+  *SecurityType = WifiMgrGetSecurityType (\r
+                    (UINT32 *)AKMList->AKMSuiteList,\r
+                    (UINT32 *)CipherList->CipherSuiteList\r
+                    );\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -418,60 +446,56 @@ WifiMgrCheckRSN (
 **/\r
 UINT8\r
 WifiMgrGetSecurityType (\r
-  IN  UINT32    *AKMSuite,\r
-  IN  UINT32    *CipherSuite\r
+  IN  UINT32  *AKMSuite,\r
+  IN  UINT32  *CipherSuite\r
   )\r
 {\r
   if (CipherSuite == NULL) {\r
-\r
     if (AKMSuite == NULL) {\r
       return SECURITY_TYPE_NONE;\r
     } else {\r
       return SECURITY_TYPE_UNKNOWN;\r
     }\r
   } else if (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_USE_GROUP) {\r
-\r
     if (AKMSuite == NULL) {\r
       return SECURITY_TYPE_NONE;\r
     } else {\r
       return SECURITY_TYPE_UNKNOWN;\r
     }\r
-  } else if (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP40 ||\r
-    *CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP104) {\r
-\r
+  } else if ((*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP40) ||\r
+             (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_WEP104))\r
+  {\r
     return SECURITY_TYPE_WEP;\r
   } else if (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_CCMP) {\r
-\r
     if (AKMSuite == NULL) {\r
       return SECURITY_TYPE_UNKNOWN;\r
     }\r
 \r
-    if (*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA ||\r
-      *AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA_SHA256) {\r
-\r
+    if ((*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA) ||\r
+        (*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA_SHA256))\r
+    {\r
       return SECURITY_TYPE_WPA2_ENTERPRISE;\r
-    } else if (*AKMSuite == IEEE_80211_AKM_SUITE_PSK ||\r
-        *AKMSuite == IEEE_80211_AKM_SUITE_PSK_SHA256){\r
-\r
+    } else if ((*AKMSuite == IEEE_80211_AKM_SUITE_PSK) ||\r
+               (*AKMSuite == IEEE_80211_AKM_SUITE_PSK_SHA256))\r
+    {\r
       return SECURITY_TYPE_WPA2_PERSONAL;\r
-    }else {\r
+    } else {\r
       return SECURITY_TYPE_UNKNOWN;\r
     }\r
   } else if (*CipherSuite == IEEE_80211_PAIRWISE_CIPHER_SUITE_TKIP) {\r
-\r
     if (AKMSuite == NULL) {\r
       return SECURITY_TYPE_UNKNOWN;\r
     }\r
 \r
-    if (*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA ||\r
-      *AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA_SHA256) {\r
-\r
+    if ((*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA) ||\r
+        (*AKMSuite == IEEE_80211_AKM_SUITE_8021X_OR_PMKSA_SHA256))\r
+    {\r
       return SECURITY_TYPE_WPA_ENTERPRISE;\r
-    } else if (*AKMSuite == IEEE_80211_AKM_SUITE_PSK ||\r
-        *AKMSuite == IEEE_80211_AKM_SUITE_PSK_SHA256){\r
-\r
+    } else if ((*AKMSuite == IEEE_80211_AKM_SUITE_PSK) ||\r
+               (*AKMSuite == IEEE_80211_AKM_SUITE_PSK_SHA256))\r
+    {\r
       return SECURITY_TYPE_WPA_PERSONAL;\r
-    }else {\r
+    } else {\r
       return SECURITY_TYPE_UNKNOWN;\r
     }\r
   } else {\r
@@ -490,36 +514,40 @@ WifiMgrGetSecurityType (
 **/\r
 EFI_STATUS\r
 WifiMgrGetSupportedSuites (\r
-  IN    WIFI_MGR_DEVICE_DATA            *Nic\r
+  IN    WIFI_MGR_DEVICE_DATA  *Nic\r
   )\r
 {\r
-  EFI_STATUS                            Status;\r
-  EFI_SUPPLICANT_PROTOCOL               *Supplicant;\r
-  EFI_80211_AKM_SUITE_SELECTOR          *SupportedAKMSuites;\r
-  EFI_80211_CIPHER_SUITE_SELECTOR       *SupportedSwCipherSuites;\r
-  EFI_80211_CIPHER_SUITE_SELECTOR       *SupportedHwCipherSuites;\r
-  UINTN                                 DataSize;\r
+  EFI_STATUS                       Status;\r
+  EFI_SUPPLICANT_PROTOCOL          *Supplicant;\r
+  EFI_80211_AKM_SUITE_SELECTOR     *SupportedAKMSuites;\r
+  EFI_80211_CIPHER_SUITE_SELECTOR  *SupportedSwCipherSuites;\r
+  EFI_80211_CIPHER_SUITE_SELECTOR  *SupportedHwCipherSuites;\r
+  UINTN                            DataSize;\r
 \r
   SupportedAKMSuites      = NULL;\r
   SupportedSwCipherSuites = NULL;\r
   SupportedHwCipherSuites = NULL;\r
 \r
-  if (Nic == NULL || Nic->Supplicant == NULL) {\r
+  if ((Nic == NULL) || (Nic->Supplicant == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
   Supplicant = Nic->Supplicant;\r
 \r
-  DataSize  = 0;\r
-  Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedAKMSuites, NULL, &DataSize);\r
-  if (Status == EFI_BUFFER_TOO_SMALL && DataSize > 0) {\r
-\r
-    SupportedAKMSuites = AllocateZeroPool(DataSize);\r
+  DataSize = 0;\r
+  Status   = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedAKMSuites, NULL, &DataSize);\r
+  if ((Status == EFI_BUFFER_TOO_SMALL) && (DataSize > 0)) {\r
+    SupportedAKMSuites = AllocateZeroPool (DataSize);\r
     if (SupportedAKMSuites == NULL) {\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
-    Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedAKMSuites,\r
-                           (UINT8 *) SupportedAKMSuites, &DataSize);\r
+\r
+    Status = Supplicant->GetData (\r
+                           Supplicant,\r
+                           EfiSupplicant80211SupportedAKMSuites,\r
+                           (UINT8 *)SupportedAKMSuites,\r
+                           &DataSize\r
+                           );\r
     if (!EFI_ERROR (Status)) {\r
       Nic->SupportedSuites.SupportedAKMSuites = SupportedAKMSuites;\r
     } else {\r
@@ -529,17 +557,20 @@ WifiMgrGetSupportedSuites (
     SupportedAKMSuites = NULL;\r
   }\r
 \r
-  DataSize  = 0;\r
-  Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedSoftwareCipherSuites, NULL, &DataSize);\r
-  if (Status == EFI_BUFFER_TOO_SMALL && DataSize > 0) {\r
-\r
-\r
-    SupportedSwCipherSuites = AllocateZeroPool(DataSize);\r
+  DataSize = 0;\r
+  Status   = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedSoftwareCipherSuites, NULL, &DataSize);\r
+  if ((Status == EFI_BUFFER_TOO_SMALL) && (DataSize > 0)) {\r
+    SupportedSwCipherSuites = AllocateZeroPool (DataSize);\r
     if (SupportedSwCipherSuites == NULL) {\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
-    Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedSoftwareCipherSuites,\r
-                           (UINT8 *) SupportedSwCipherSuites, &DataSize);\r
+\r
+    Status = Supplicant->GetData (\r
+                           Supplicant,\r
+                           EfiSupplicant80211SupportedSoftwareCipherSuites,\r
+                           (UINT8 *)SupportedSwCipherSuites,\r
+                           &DataSize\r
+                           );\r
     if (!EFI_ERROR (Status)) {\r
       Nic->SupportedSuites.SupportedSwCipherSuites = SupportedSwCipherSuites;\r
     } else {\r
@@ -549,16 +580,20 @@ WifiMgrGetSupportedSuites (
     SupportedSwCipherSuites = NULL;\r
   }\r
 \r
-  DataSize  = 0;\r
-  Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedHardwareCipherSuites, NULL, &DataSize);\r
-  if (Status == EFI_BUFFER_TOO_SMALL && DataSize > 0) {\r
-\r
-    SupportedHwCipherSuites = AllocateZeroPool(DataSize);\r
+  DataSize = 0;\r
+  Status   = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedHardwareCipherSuites, NULL, &DataSize);\r
+  if ((Status == EFI_BUFFER_TOO_SMALL) && (DataSize > 0)) {\r
+    SupportedHwCipherSuites = AllocateZeroPool (DataSize);\r
     if (SupportedHwCipherSuites == NULL) {\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
-    Status = Supplicant->GetData (Supplicant, EfiSupplicant80211SupportedHardwareCipherSuites,\r
-                           (UINT8 *) SupportedHwCipherSuites, &DataSize);\r
+\r
+    Status = Supplicant->GetData (\r
+                           Supplicant,\r
+                           EfiSupplicant80211SupportedHardwareCipherSuites,\r
+                           (UINT8 *)SupportedHwCipherSuites,\r
+                           &DataSize\r
+                           );\r
     if (!EFI_ERROR (Status)) {\r
       Nic->SupportedSuites.SupportedHwCipherSuites = SupportedHwCipherSuites;\r
     } else {\r
@@ -579,7 +614,7 @@ WifiMgrGetSupportedSuites (
 **/\r
 VOID\r
 WifiMgrCleanProfileSecrets (\r
-  IN  WIFI_MGR_NETWORK_PROFILE       *Profile\r
+  IN  WIFI_MGR_NETWORK_PROFILE  *Profile\r
   )\r
 {\r
   ZeroMem (Profile->Password, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE);\r
@@ -587,26 +622,26 @@ WifiMgrCleanProfileSecrets (
   ZeroMem (Profile->PrivateKeyPassword, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE);\r
 \r
   if (Profile->CACertData != NULL) {\r
-\r
     ZeroMem (Profile->CACertData, Profile->CACertSize);\r
     FreePool (Profile->CACertData);\r
   }\r
+\r
   Profile->CACertData = NULL;\r
   Profile->CACertSize = 0;\r
 \r
   if (Profile->ClientCertData != NULL) {\r
-\r
     ZeroMem (Profile->ClientCertData, Profile->ClientCertSize);\r
     FreePool (Profile->ClientCertData);\r
   }\r
+\r
   Profile->ClientCertData = NULL;\r
   Profile->ClientCertSize = 0;\r
 \r
   if (Profile->PrivateKeyData != NULL) {\r
-\r
     ZeroMem (Profile->PrivateKeyData, Profile->PrivateKeyDataSize);\r
     FreePool (Profile->PrivateKeyData);\r
   }\r
+\r
   Profile->PrivateKeyData     = NULL;\r
   Profile->PrivateKeyDataSize = 0;\r
 }\r
@@ -619,30 +654,33 @@ WifiMgrCleanProfileSecrets (
 **/\r
 VOID\r
 WifiMgrFreeProfileList (\r
-  IN  LIST_ENTRY                     *ProfileList\r
+  IN  LIST_ENTRY  *ProfileList\r
   )\r
 {\r
-  WIFI_MGR_NETWORK_PROFILE           *Profile;\r
-  LIST_ENTRY                         *Entry;\r
-  LIST_ENTRY                         *NextEntry;\r
+  WIFI_MGR_NETWORK_PROFILE  *Profile;\r
+  LIST_ENTRY                *Entry;\r
+  LIST_ENTRY                *NextEntry;\r
 \r
   if (ProfileList == NULL) {\r
     return;\r
   }\r
 \r
   NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, ProfileList) {\r
-\r
-    Profile = NET_LIST_USER_STRUCT_S (Entry, WIFI_MGR_NETWORK_PROFILE,\r
-                Link, WIFI_MGR_PROFILE_SIGNATURE);\r
+    Profile = NET_LIST_USER_STRUCT_S (\r
+                Entry,\r
+                WIFI_MGR_NETWORK_PROFILE,\r
+                Link,\r
+                WIFI_MGR_PROFILE_SIGNATURE\r
+                );\r
 \r
     WifiMgrCleanProfileSecrets (Profile);\r
 \r
     if (Profile->Network.AKMSuite != NULL) {\r
-      FreePool(Profile->Network.AKMSuite);\r
+      FreePool (Profile->Network.AKMSuite);\r
     }\r
 \r
     if (Profile->Network.CipherSuite != NULL) {\r
-      FreePool(Profile->Network.CipherSuite);\r
+      FreePool (Profile->Network.CipherSuite);\r
     }\r
 \r
     FreePool (Profile);\r
@@ -657,26 +695,28 @@ WifiMgrFreeProfileList (
 **/\r
 VOID\r
 WifiMgrFreeHiddenList (\r
-  IN  LIST_ENTRY                     *HiddenList\r
+  IN  LIST_ENTRY  *HiddenList\r
   )\r
 {\r
-  WIFI_HIDDEN_NETWORK_DATA           *HiddenNetwork;\r
-  LIST_ENTRY                         *Entry;\r
-  LIST_ENTRY                         *NextEntry;\r
+  WIFI_HIDDEN_NETWORK_DATA  *HiddenNetwork;\r
+  LIST_ENTRY                *Entry;\r
+  LIST_ENTRY                *NextEntry;\r
 \r
   if (HiddenList == NULL) {\r
     return;\r
   }\r
 \r
   NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, HiddenList) {\r
-\r
-    HiddenNetwork = NET_LIST_USER_STRUCT_S (Entry, WIFI_HIDDEN_NETWORK_DATA,\r
-                      Link, WIFI_MGR_HIDDEN_NETWORK_SIGNATURE);\r
+    HiddenNetwork = NET_LIST_USER_STRUCT_S (\r
+                      Entry,\r
+                      WIFI_HIDDEN_NETWORK_DATA,\r
+                      Link,\r
+                      WIFI_MGR_HIDDEN_NETWORK_SIGNATURE\r
+                      );\r
     FreePool (HiddenNetwork);\r
   }\r
 }\r
 \r
-\r
 /**\r
   Free the resources of a config token.\r
 \r
@@ -684,24 +724,22 @@ WifiMgrFreeHiddenList (
 **/\r
 VOID\r
 WifiMgrFreeToken (\r
-  IN   WIFI_MGR_MAC_CONFIG_TOKEN    *ConfigToken\r
+  IN   WIFI_MGR_MAC_CONFIG_TOKEN  *ConfigToken\r
   )\r
 {\r
-  EFI_80211_GET_NETWORKS_RESULT     *Result;\r
+  EFI_80211_GET_NETWORKS_RESULT  *Result;\r
 \r
   if (ConfigToken == NULL) {\r
     return;\r
   }\r
 \r
   switch (ConfigToken->Type) {\r
-\r
     case TokenTypeGetNetworksToken:\r
 \r
       if (ConfigToken->Token.GetNetworksToken != NULL) {\r
-\r
         gBS->CloseEvent (ConfigToken->Token.GetNetworksToken->Event);\r
         if (ConfigToken->Token.GetNetworksToken->Data != NULL) {\r
-          FreePool(ConfigToken->Token.GetNetworksToken->Data);\r
+          FreePool (ConfigToken->Token.GetNetworksToken->Data);\r
         }\r
 \r
         Result = ConfigToken->Token.GetNetworksToken->Result;\r
@@ -709,7 +747,7 @@ WifiMgrFreeToken (
           FreePool (Result);\r
         }\r
 \r
-        FreePool(ConfigToken->Token.GetNetworksToken);\r
+        FreePool (ConfigToken->Token.GetNetworksToken);\r
       }\r
 \r
       FreePool (ConfigToken);\r
@@ -718,27 +756,27 @@ WifiMgrFreeToken (
     case TokenTypeConnectNetworkToken:\r
 \r
       if (ConfigToken->Token.ConnectNetworkToken != NULL) {\r
-\r
         gBS->CloseEvent (ConfigToken->Token.ConnectNetworkToken->Event);\r
         if (ConfigToken->Token.ConnectNetworkToken->Data != NULL) {\r
-          FreePool(ConfigToken->Token.ConnectNetworkToken->Data);\r
+          FreePool (ConfigToken->Token.ConnectNetworkToken->Data);\r
         }\r
-        FreePool(ConfigToken->Token.ConnectNetworkToken);\r
+\r
+        FreePool (ConfigToken->Token.ConnectNetworkToken);\r
       }\r
+\r
       FreePool (ConfigToken);\r
       break;\r
 \r
     case TokenTypeDisconnectNetworkToken:\r
 \r
       if (ConfigToken->Token.DisconnectNetworkToken != NULL) {\r
-\r
-        FreePool(ConfigToken->Token.DisconnectNetworkToken);\r
+        FreePool (ConfigToken->Token.DisconnectNetworkToken);\r
       }\r
 \r
       FreePool (ConfigToken);\r
       break;\r
 \r
-    default :\r
+    default:\r
       break;\r
   }\r
 }\r