2 The Miscellaneous Routines for WiFi Connection Manager.
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __EFI_WIFI_MGR_MISC_H__
11 #define __EFI_WIFI_MGR_MISC_H__
14 Empty function for event process function.
16 @param[in] Event The Event needs to be processed
17 @param[in] Context The context of the event
22 WifiMgrInternalEmptyFunction (
28 Convert the mac address into a hexadecimal encoded ":" seperated string.
30 @param[in] Mac The mac address
31 @param[in] StrSize The size, in bytes, of the output buffer specified by Str
32 @param[out] Str The storage to return the mac string
37 IN EFI_80211_MAC_ADDRESS
*Mac
,
43 Read private key file to buffer.
45 @param[in] FileContext The file context of private key file.
46 @param[out] PrivateKeyDataAddr The buffer address to restore private key file, should be
48 @param[out] PrivateKeyDataSize The size of read private key file.
50 @retval EFI_SUCCESS Successfully read the private key file.
51 @retval EFI_INVALID_PARAMETER One or more of the parameters is invalid.
55 WifiMgrReadFileToBuffer (
56 IN WIFI_MGR_FILE_CONTEXT
*FileContext
,
57 OUT VOID
**PrivateKeyDataAddr
,
58 OUT UINTN
*PrivateKeyDataSize
63 Get the Nic data by the NicIndex.
65 @param[in] Private The pointer to the global private data structure.
66 @param[in] NicIndex The index indicates the position of wireless NIC.
68 @return Pointer to the Nic data, or NULL if not found.
71 WIFI_MGR_DEVICE_DATA
*
72 WifiMgrGetNicByIndex (
73 IN WIFI_MGR_PRIVATE_DATA
*Private
,
78 Find a network profile through its' SSId and securit type, and the SSId is an unicode string.
80 @param[in] SSId The target network's SSId.
81 @param[in] SecurityType The target network's security type.
82 @param[in] ProfileList The profile list on a Nic.
84 @return Pointer to a network profile, or NULL if not found.
87 WIFI_MGR_NETWORK_PROFILE
*
88 WifiMgrGetProfileByUnicodeSSId (
90 IN UINT8 SecurityType
,
91 IN LIST_ENTRY
*ProfileList
95 Find a network profile through its' SSId and securit type, and the SSId is an ascii string.
97 @param[in] SSId The target network's SSId.
98 @param[in] SecurityType The target network's security type.
99 @param[in] ProfileList The profile list on a Nic.
101 @return Pointer to a network profile, or NULL if not found.
104 WIFI_MGR_NETWORK_PROFILE
*
105 WifiMgrGetProfileByAsciiSSId (
107 IN UINT8 SecurityType
,
108 IN LIST_ENTRY
*ProfileList
112 Find a network profile through its' profile index.
114 @param[in] ProfileIndex The target network's profile index.
115 @param[in] ProfileList The profile list on a Nic.
117 @return Pointer to a network profile, or NULL if not found.
120 WIFI_MGR_NETWORK_PROFILE
*
121 WifiMgrGetProfileByProfileIndex (
122 IN UINT32 ProfileIndex
,
123 IN LIST_ENTRY
*ProfileList
127 To test if the AKMSuite is in supported AKMSuite list.
129 @param[in] SupportedAKMSuiteCount The count of the supported AKMSuites.
130 @param[in] SupportedAKMSuiteList The supported AKMSuite list.
131 @param[in] AKMSuite The AKMSuite to be tested.
133 @return True if this AKMSuite is supported, or False if not.
137 WifiMgrSupportAKMSuite (
138 IN UINT16 SupportedAKMSuiteCount
,
139 IN UINT32
*SupportedAKMSuiteList
,
144 To check if the CipherSuite is in supported CipherSuite list.
146 @param[in] SupportedCipherSuiteCount The count of the supported CipherSuites.
147 @param[in] SupportedCipherSuiteList The supported CipherSuite list.
148 @param[in] CipherSuite The CipherSuite to be tested.
150 @return True if this CipherSuite is supported, or False if not.
154 WifiMgrSupportCipherSuite (
155 IN UINT16 SupportedCipherSuiteCount
,
156 IN UINT32
*SupportedCipherSuiteList
,
157 IN UINT32
*CipherSuite
161 Check an AKM suite list and a Cipher suite list to see if one or more AKM suites or Cipher suites
162 are supported and find the matchable security type.
164 @param[in] AKMList The target AKM suite list to be checked.
165 @param[in] CipherList The target Cipher suite list to be checked
166 @param[in] Nic The Nic to operate, contains the supported AKMSuite list
167 and supported CipherSuite list
168 @param[out] SecurityType To identify a security type from the AKM suite list and
170 @param[out] AKMSuiteSupported To identify if this security type is supported. If it is
171 NULL, overcome this field
172 @param[out] CipherSuiteSupported To identify if this security type is supported. If it is
173 NULL, overcome this field
175 @retval EFI_SUCCESS This operation has completed successfully.
176 @retval EFI_INVALID_PARAMETER No Nic found or the suite list is null.
181 IN EFI_80211_AKM_SUITE_SELECTOR
*AKMList
,
182 IN EFI_80211_CIPHER_SUITE_SELECTOR
*CipherList
,
183 IN WIFI_MGR_DEVICE_DATA
*Nic
,
184 OUT UINT8
*SecurityType
,
185 OUT BOOLEAN
*AKMSuiteSupported
,
186 OUT BOOLEAN
*CipherSuiteSupported
190 To get the security type for a certain AKMSuite and CipherSuite.
192 @param[in] AKMSuite An certain AKMSuite.
193 @param[in] CipherSuite An certain CipherSuite.
195 @return a security type if found, or SECURITY_TYPE_UNKNOWN.
199 WifiMgrGetSecurityType (
201 IN UINT32
*CipherSuite
205 Get supported AKMSuites and CipherSuites from supplicant.
207 @param[in] Nic The Nic to operate.
209 @retval EFI_SUCCESS Get the supported suite list successfully.
210 @retval EFI_INVALID_PARAMETER No Nic found or supplicant is NULL.
214 WifiMgrGetSupportedSuites (
215 IN WIFI_MGR_DEVICE_DATA
*Nic
219 Clean secrets from a network profile.
221 @param[in] Profile The profile to be cleanned.
225 WifiMgrCleanProfileSecrets (
226 IN WIFI_MGR_NETWORK_PROFILE
*Profile
230 Free all network profiles in a profile list.
232 @param[in] ProfileList The profile list to be freed.
236 WifiMgrFreeProfileList (
237 IN LIST_ENTRY
*ProfileList
241 Free user configured hidden network list.
243 @param[in] HiddenList The hidden network list to be freed.
247 WifiMgrFreeHiddenList (
248 IN LIST_ENTRY
*HiddenList
252 Free the resources of a config token.
254 @param[in] ConfigToken The config token to be freed.
259 IN WIFI_MGR_MAC_CONFIG_TOKEN
*ConfigToken