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
62 Get the Nic data by the NicIndex.
64 @param[in] Private The pointer to the global private data structure.
65 @param[in] NicIndex The index indicates the position of wireless NIC.
67 @return Pointer to the Nic data, or NULL if not found.
70 WIFI_MGR_DEVICE_DATA
*
71 WifiMgrGetNicByIndex (
72 IN WIFI_MGR_PRIVATE_DATA
*Private
,
77 Find a network profile through its' SSId and securit type, and the SSId is an unicode string.
79 @param[in] SSId The target network's SSId.
80 @param[in] SecurityType The target network's security type.
81 @param[in] ProfileList The profile list on a Nic.
83 @return Pointer to a network profile, or NULL if not found.
86 WIFI_MGR_NETWORK_PROFILE
*
87 WifiMgrGetProfileByUnicodeSSId (
89 IN UINT8 SecurityType
,
90 IN LIST_ENTRY
*ProfileList
94 Find a network profile through its' SSId and securit type, and the SSId is an ascii string.
96 @param[in] SSId The target network's SSId.
97 @param[in] SecurityType The target network's security type.
98 @param[in] ProfileList The profile list on a Nic.
100 @return Pointer to a network profile, or NULL if not found.
103 WIFI_MGR_NETWORK_PROFILE
*
104 WifiMgrGetProfileByAsciiSSId (
106 IN UINT8 SecurityType
,
107 IN LIST_ENTRY
*ProfileList
111 Find a network profile through its' profile index.
113 @param[in] ProfileIndex The target network's profile index.
114 @param[in] ProfileList The profile list on a Nic.
116 @return Pointer to a network profile, or NULL if not found.
119 WIFI_MGR_NETWORK_PROFILE
*
120 WifiMgrGetProfileByProfileIndex (
121 IN UINT32 ProfileIndex
,
122 IN LIST_ENTRY
*ProfileList
126 To test if the AKMSuite is in supported AKMSuite list.
128 @param[in] SupportedAKMSuiteCount The count of the supported AKMSuites.
129 @param[in] SupportedAKMSuiteList The supported AKMSuite list.
130 @param[in] AKMSuite The AKMSuite to be tested.
132 @return True if this AKMSuite is supported, or False if not.
136 WifiMgrSupportAKMSuite (
137 IN UINT16 SupportedAKMSuiteCount
,
138 IN UINT32
*SupportedAKMSuiteList
,
143 To check if the CipherSuite is in supported CipherSuite list.
145 @param[in] SupportedCipherSuiteCount The count of the supported CipherSuites.
146 @param[in] SupportedCipherSuiteList The supported CipherSuite list.
147 @param[in] CipherSuite The CipherSuite to be tested.
149 @return True if this CipherSuite is supported, or False if not.
153 WifiMgrSupportCipherSuite (
154 IN UINT16 SupportedCipherSuiteCount
,
155 IN UINT32
*SupportedCipherSuiteList
,
156 IN UINT32
*CipherSuite
160 Check an AKM suite list and a Cipher suite list to see if one or more AKM suites or Cipher suites
161 are supported and find the matchable security type.
163 @param[in] AKMList The target AKM suite list to be checked.
164 @param[in] CipherList The target Cipher suite list to be checked
165 @param[in] Nic The Nic to operate, contains the supported AKMSuite list
166 and supported CipherSuite list
167 @param[out] SecurityType To identify a security type from the AKM suite list and
169 @param[out] AKMSuiteSupported To identify if this security type is supported. If it is
170 NULL, overcome this field
171 @param[out] CipherSuiteSupported To identify if this security type is supported. If it is
172 NULL, overcome this field
174 @retval EFI_SUCCESS This operation has completed successfully.
175 @retval EFI_INVALID_PARAMETER No Nic found or the suite list is null.
180 IN EFI_80211_AKM_SUITE_SELECTOR
*AKMList
,
181 IN EFI_80211_CIPHER_SUITE_SELECTOR
*CipherList
,
182 IN WIFI_MGR_DEVICE_DATA
*Nic
,
183 OUT UINT8
*SecurityType
,
184 OUT BOOLEAN
*AKMSuiteSupported
,
185 OUT BOOLEAN
*CipherSuiteSupported
189 To get the security type for a certain AKMSuite and CipherSuite.
191 @param[in] AKMSuite An certain AKMSuite.
192 @param[in] CipherSuite An certain CipherSuite.
194 @return a security type if found, or SECURITY_TYPE_UNKNOWN.
198 WifiMgrGetSecurityType (
200 IN UINT32
*CipherSuite
204 Get supported AKMSuites and CipherSuites from supplicant.
206 @param[in] Nic The Nic to operate.
208 @retval EFI_SUCCESS Get the supported suite list successfully.
209 @retval EFI_INVALID_PARAMETER No Nic found or supplicant is NULL.
213 WifiMgrGetSupportedSuites (
214 IN WIFI_MGR_DEVICE_DATA
*Nic
218 Clean secrets from a network profile.
220 @param[in] Profile The profile to be cleanned.
224 WifiMgrCleanProfileSecrets (
225 IN WIFI_MGR_NETWORK_PROFILE
*Profile
229 Free all network profiles in a profile list.
231 @param[in] ProfileList The profile list to be freed.
235 WifiMgrFreeProfileList (
236 IN LIST_ENTRY
*ProfileList
240 Free user configured hidden network list.
242 @param[in] HiddenList The hidden network list to be freed.
246 WifiMgrFreeHiddenList (
247 IN LIST_ENTRY
*HiddenList
251 Free the resources of a config token.
253 @param[in] ConfigToken The config token to be freed.
258 IN WIFI_MGR_MAC_CONFIG_TOKEN
*ConfigToken