2 The Miscellaneous Routines for WiFi Connection Manager.
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __EFI_WIFI_MGR_MISC_H__
17 #define __EFI_WIFI_MGR_MISC_H__
20 Empty function for event process function.
22 @param[in] Event The Event needs to be processed
23 @param[in] Context The context of the event
28 WifiMgrInternalEmptyFunction (
34 Convert the mac address into a hexadecimal encoded ":" seperated string.
36 @param[in] Mac The mac address
37 @param[in] StrSize The size, in bytes, of the output buffer specified by Str
38 @param[out] Str The storage to return the mac string
43 IN EFI_80211_MAC_ADDRESS
*Mac
,
49 Read private key file to buffer.
51 @param[in] FileContext The file context of private key file.
52 @param[out] PrivateKeyDataAddr The buffer address to restore private key file, should be
54 @param[out] PrivateKeyDataSize The size of read private key file.
56 @retval EFI_SUCCESS Successfully read the private key file.
57 @retval EFI_INVALID_PARAMETER One or more of the parameters is invalid.
61 WifiMgrReadFileToBuffer (
62 IN WIFI_MGR_FILE_CONTEXT
*FileContext
,
63 OUT VOID
**PrivateKeyDataAddr
,
64 OUT UINTN
*PrivateKeyDataSize
69 Get the Nic data by the NicIndex.
71 @param[in] Private The pointer to the global private data structure.
72 @param[in] NicIndex The index indicates the position of wireless NIC.
74 @return Pointer to the Nic data, or NULL if not found.
77 WIFI_MGR_DEVICE_DATA
*
78 WifiMgrGetNicByIndex (
79 IN WIFI_MGR_PRIVATE_DATA
*Private
,
84 Find a network profile through its' SSId and securit type, and the SSId is an unicode string.
86 @param[in] SSId The target network's SSId.
87 @param[in] SecurityType The target network's security type.
88 @param[in] ProfileList The profile list on a Nic.
90 @return Pointer to a network profile, or NULL if not found.
93 WIFI_MGR_NETWORK_PROFILE
*
94 WifiMgrGetProfileByUnicodeSSId (
96 IN UINT8 SecurityType
,
97 IN LIST_ENTRY
*ProfileList
101 Find a network profile through its' SSId and securit type, and the SSId is an ascii string.
103 @param[in] SSId The target network's SSId.
104 @param[in] SecurityType The target network's security type.
105 @param[in] ProfileList The profile list on a Nic.
107 @return Pointer to a network profile, or NULL if not found.
110 WIFI_MGR_NETWORK_PROFILE
*
111 WifiMgrGetProfileByAsciiSSId (
113 IN UINT8 SecurityType
,
114 IN LIST_ENTRY
*ProfileList
118 Find a network profile through its' profile index.
120 @param[in] ProfileIndex The target network's profile index.
121 @param[in] ProfileList The profile list on a Nic.
123 @return Pointer to a network profile, or NULL if not found.
126 WIFI_MGR_NETWORK_PROFILE
*
127 WifiMgrGetProfileByProfileIndex (
128 IN UINT32 ProfileIndex
,
129 IN LIST_ENTRY
*ProfileList
133 To test if the AKMSuite is in supported AKMSuite list.
135 @param[in] SupportedAKMSuiteCount The count of the supported AKMSuites.
136 @param[in] SupportedAKMSuiteList The supported AKMSuite list.
137 @param[in] AKMSuite The AKMSuite to be tested.
139 @return True if this AKMSuite is supported, or False if not.
143 WifiMgrSupportAKMSuite (
144 IN UINT16 SupportedAKMSuiteCount
,
145 IN UINT32
*SupportedAKMSuiteList
,
150 To check if the CipherSuite is in supported CipherSuite list.
152 @param[in] SupportedCipherSuiteCount The count of the supported CipherSuites.
153 @param[in] SupportedCipherSuiteList The supported CipherSuite list.
154 @param[in] CipherSuite The CipherSuite to be tested.
156 @return True if this CipherSuite is supported, or False if not.
160 WifiMgrSupportCipherSuite (
161 IN UINT16 SupportedCipherSuiteCount
,
162 IN UINT32
*SupportedCipherSuiteList
,
163 IN UINT32
*CipherSuite
167 Check an AKM suite list and a Cipher suite list to see if one or more AKM suites or Cipher suites
168 are supported and find the matchable security type.
170 @param[in] AKMList The target AKM suite list to be checked.
171 @param[in] CipherList The target Cipher suite list to be checked
172 @param[in] Nic The Nic to operate, contains the supported AKMSuite list
173 and supported CipherSuite list
174 @param[out] SecurityType To identify a security type from the AKM suite list and
176 @param[out] AKMSuiteSupported To identify if this security type is supported. If it is
177 NULL, overcome this field
178 @param[out] CipherSuiteSupported To identify if this security type is supported. If it is
179 NULL, overcome this field
181 @retval EFI_SUCCESS This operation has completed successfully.
182 @retval EFI_INVALID_PARAMETER No Nic found or the suite list is null.
187 IN EFI_80211_AKM_SUITE_SELECTOR
*AKMList
,
188 IN EFI_80211_CIPHER_SUITE_SELECTOR
*CipherList
,
189 IN WIFI_MGR_DEVICE_DATA
*Nic
,
190 OUT UINT8
*SecurityType
,
191 OUT BOOLEAN
*AKMSuiteSupported
,
192 OUT BOOLEAN
*CipherSuiteSupported
196 To get the security type for a certain AKMSuite and CipherSuite.
198 @param[in] AKMSuite An certain AKMSuite.
199 @param[in] CipherSuite An certain CipherSuite.
201 @return a security type if found, or SECURITY_TYPE_UNKNOWN.
205 WifiMgrGetSecurityType (
207 IN UINT32
*CipherSuite
211 Get supported AKMSuites and CipherSuites from supplicant.
213 @param[in] Nic The Nic to operate.
215 @retval EFI_SUCCESS Get the supported suite list successfully.
216 @retval EFI_INVALID_PARAMETER No Nic found or supplicant is NULL.
220 WifiMgrGetSupportedSuites (
221 IN WIFI_MGR_DEVICE_DATA
*Nic
225 Clean secrets from a network profile.
227 @param[in] Profile The profile to be cleanned.
231 WifiMgrCleanProfileSecrets (
232 IN WIFI_MGR_NETWORK_PROFILE
*Profile
236 Free all network profiles in a profile list.
238 @param[in] ProfileList The profile list to be freed.
242 WifiMgrFreeProfileList (
243 IN LIST_ENTRY
*ProfileList
247 Free user configured hidden network list.
249 @param[in] HiddenList The hidden network list to be freed.
253 WifiMgrFreeHiddenList (
254 IN LIST_ENTRY
*HiddenList
258 Free the resources of a config token.
260 @param[in] ConfigToken The config token to be freed.
265 IN WIFI_MGR_MAC_CONFIG_TOKEN
*ConfigToken