]>
Commit | Line | Data |
---|---|---|
4e858edb HW |
1 | /** @file\r |
2 | This file defines the EFI Wireless MAC Connection II Protocol.\r | |
3 | \r | |
b941c34e | 4 | Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
4e858edb HW |
6 | \r |
7 | @par Revision Reference:\r | |
8 | This Protocol is introduced in UEFI Specification 2.6\r | |
9 | \r | |
10 | **/\r | |
11 | \r | |
12 | #ifndef __EFI_WIFI2_PROTOCOL_H__\r | |
13 | #define __EFI_WIFI2_PROTOCOL_H__\r | |
14 | \r | |
15 | #define EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL_GUID \\r | |
16 | { \\r | |
17 | 0x1b0fb9bf, 0x699d, 0x4fdd, { 0xa7, 0xc3, 0x25, 0x46, 0x68, 0x1b, 0xf6, 0x3b } \\r | |
18 | }\r | |
19 | \r | |
20 | typedef struct _EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL;\r | |
21 | \r | |
22 | ///\r | |
23 | /// EFI_80211_BSS_TYPE\r | |
24 | ///\r | |
25 | typedef enum {\r | |
26 | IeeeInfrastructureBSS,\r | |
27 | IeeeIndependentBSS,\r | |
28 | IeeeMeshBSS,\r | |
29 | IeeeAnyBss\r | |
30 | } EFI_80211_BSS_TYPE;\r | |
31 | \r | |
32 | ///\r | |
33 | /// EFI_80211_CONNECT_NETWORK_RESULT_CODE\r | |
34 | ///\r | |
35 | typedef enum {\r | |
36 | //\r | |
37 | // The connection establishment operation finished successfully.\r | |
38 | //\r | |
39 | ConnectSuccess,\r | |
40 | //\r | |
41 | // The connection was refused by the Network.\r | |
42 | //\r | |
43 | ConnectRefused,\r | |
44 | //\r | |
45 | // The connection establishment operation failed (i.e, Network is not\r | |
46 | // detected).\r | |
47 | //\r | |
48 | ConnectFailed,\r | |
49 | //\r | |
50 | // The connection establishment operation was terminated on timeout.\r | |
51 | //\r | |
52 | ConnectFailureTimeout,\r | |
53 | //\r | |
54 | // The connection establishment operation failed on other reason.\r | |
55 | //\r | |
56 | ConnectFailedReasonUnspecified\r | |
57 | } EFI_80211_CONNECT_NETWORK_RESULT_CODE;\r | |
58 | \r | |
59 | ///\r | |
60 | /// EFI_80211_MAC_ADDRESS\r | |
61 | ///\r | |
62 | typedef struct {\r | |
63 | UINT8 Addr[6];\r | |
64 | } EFI_80211_MAC_ADDRESS;\r | |
65 | \r | |
66 | #define EFI_MAX_SSID_LEN 32\r | |
67 | \r | |
68 | ///\r | |
69 | /// EFI_80211_SSID\r | |
70 | ///\r | |
71 | typedef struct {\r | |
72 | //\r | |
73 | // Length in bytes of the SSId. If zero, ignore SSId field.\r | |
74 | //\r | |
75 | UINT8 SSIdLen;\r | |
76 | //\r | |
77 | // Specifies the service set identifier.\r | |
78 | //\r | |
79 | UINT8 SSId[EFI_MAX_SSID_LEN];\r | |
80 | } EFI_80211_SSID;\r | |
81 | \r | |
82 | ///\r | |
83 | /// EFI_80211_GET_NETWORKS_DATA\r | |
84 | ///\r | |
85 | typedef struct {\r | |
86 | //\r | |
87 | // The number of EFI_80211_SSID in SSIDList. If zero, SSIDList should be\r | |
88 | // ignored.\r | |
89 | //\r | |
90 | UINT32 NumOfSSID;\r | |
91 | //\r | |
92 | // The SSIDList is a pointer to an array of EFI_80211_SSID instances. The\r | |
93 | // number of entries is specified by NumOfSSID. The array should only include\r | |
94 | // SSIDs of hidden networks. It is suggested that the caller inputs less than\r | |
95 | // 10 elements in the SSIDList. It is the caller's responsibility to free\r | |
96 | // this buffer.\r | |
97 | //\r | |
98 | EFI_80211_SSID SSIDList[1];\r | |
99 | } EFI_80211_GET_NETWORKS_DATA;\r | |
100 | \r | |
101 | ///\r | |
102 | /// EFI_80211_SUITE_SELECTOR\r | |
103 | ///\r | |
104 | typedef struct {\r | |
105 | //\r | |
106 | // Organization Unique Identifier, as defined in IEEE 802.11 standard,\r | |
107 | // usually set to 00-0F-AC.\r | |
108 | //\r | |
109 | UINT8 Oui[3];\r | |
110 | //\r | |
111 | // Suites types, as defined in IEEE 802.11 standard.\r | |
112 | //\r | |
113 | UINT8 SuiteType;\r | |
114 | } EFI_80211_SUITE_SELECTOR;\r | |
115 | \r | |
116 | ///\r | |
117 | /// EFI_80211_AKM_SUITE_SELECTOR\r | |
118 | ///\r | |
119 | typedef struct {\r | |
120 | //\r | |
121 | // Indicates the number of AKM suite selectors that are contained in\r | |
122 | // AKMSuiteList. If zero, the AKMSuiteList is ignored.\r | |
123 | //\r | |
124 | UINT16 AKMSuiteCount;\r | |
125 | //\r | |
126 | // A variable-length array of AKM suites, as defined in IEEE 802.11 standard,\r | |
127 | // Table 8-101. The number of entries is specified by AKMSuiteCount.\r | |
128 | //\r | |
129 | EFI_80211_SUITE_SELECTOR AKMSuiteList[1];\r | |
130 | } EFI_80211_AKM_SUITE_SELECTOR;\r | |
131 | \r | |
132 | ///\r | |
133 | /// EFI_80211_CIPHER_SUITE_SELECTOR\r | |
134 | ///\r | |
135 | typedef struct {\r | |
136 | //\r | |
137 | // Indicates the number of cipher suites that are contained in\r | |
138 | // CipherSuiteList. If zero, the CipherSuiteList is ignored.\r | |
139 | //\r | |
140 | UINT16 CipherSuiteCount;\r | |
141 | //\r | |
142 | // A variable-length array of cipher suites, as defined in IEEE 802.11\r | |
143 | // standard, Table 8-99. The number of entries is specified by\r | |
144 | // CipherSuiteCount.\r | |
145 | //\r | |
146 | EFI_80211_SUITE_SELECTOR CipherSuiteList[1];\r | |
147 | } EFI_80211_CIPHER_SUITE_SELECTOR;\r | |
148 | \r | |
149 | ///\r | |
150 | /// EFI_80211_NETWORK\r | |
151 | ///\r | |
152 | typedef struct {\r | |
153 | //\r | |
154 | // Specifies the type of the BSS.\r | |
155 | //\r | |
156 | EFI_80211_BSS_TYPE BSSType;\r | |
157 | //\r | |
158 | // Specifies the SSID of the BSS.\r | |
159 | //\r | |
160 | EFI_80211_SSID SSId;\r | |
161 | //\r | |
162 | // Pointer to the AKM suites supported in the wireless network.\r | |
163 | //\r | |
164 | EFI_80211_AKM_SUITE_SELECTOR *AKMSuite;\r | |
165 | //\r | |
166 | // Pointer to the cipher suites supported in the wireless network.\r | |
167 | //\r | |
168 | EFI_80211_CIPHER_SUITE_SELECTOR *CipherSuite;\r | |
169 | } EFI_80211_NETWORK;\r | |
170 | \r | |
171 | ///\r | |
172 | /// EFI_80211_NETWORK_DESCRIPTION\r | |
173 | ///\r | |
174 | typedef struct {\r | |
175 | //\r | |
176 | // Specifies the found wireless network.\r | |
177 | //\r | |
178 | EFI_80211_NETWORK Network;\r | |
179 | //\r | |
180 | // Indicates the network quality as a value between 0 to 100, where 100\r | |
181 | // indicates the highest network quality.\r | |
182 | //\r | |
183 | UINT8 NetworkQuality;\r | |
184 | } EFI_80211_NETWORK_DESCRIPTION;\r | |
185 | \r | |
186 | ///\r | |
187 | /// EFI_80211_GET_NETWORKS_RESULT\r | |
188 | ///\r | |
189 | typedef struct {\r | |
190 | //\r | |
191 | // The number of EFI_80211_NETWORK_DESCRIPTION in NetworkDesc. If zero,\r | |
192 | // NetworkDesc should be ignored.\r | |
193 | //\r | |
194 | UINT8 NumOfNetworkDesc;\r | |
195 | //\r | |
196 | // The NetworkDesc is a pointer to an array of EFI_80211_NETWORK_DESCRIPTION\r | |
197 | // instances. It is caller's responsibility to free this buffer.\r | |
198 | //\r | |
b941c34e | 199 | EFI_80211_NETWORK_DESCRIPTION NetworkDesc[1];\r |
4e858edb HW |
200 | } EFI_80211_GET_NETWORKS_RESULT;\r |
201 | \r | |
202 | ///\r | |
203 | /// EFI_80211_GET_NETWORKS_TOKEN\r | |
204 | ///\r | |
205 | typedef struct {\r | |
206 | //\r | |
207 | // If the status code returned by GetNetworks() is EFI_SUCCESS, then this\r | |
208 | // Event will be signaled after the Status field is updated by the EFI\r | |
209 | // Wireless MAC Connection Protocol II driver. The type of Event must be\r | |
210 | // EFI_NOTIFY_SIGNAL.\r | |
211 | //\r | |
212 | EFI_EVENT Event;\r | |
213 | //\r | |
214 | // Will be set to one of the following values:\r | |
215 | // EFI_SUCCESS: The operation completed successfully.\r | |
216 | // EFI_NOT_FOUND: Failed to find available wireless networks.\r | |
217 | // EFI_DEVICE_ERROR: An unexpected network or system error occurred.\r | |
218 | // EFI_ACCESS_DENIED: The operation is not completed due to some underlying\r | |
219 | // hardware or software state.\r | |
220 | // EFI_NOT_READY: The operation is started but not yet completed.\r | |
221 | //\r | |
222 | EFI_STATUS Status;\r | |
223 | //\r | |
224 | // Pointer to the input data for getting networks.\r | |
225 | //\r | |
226 | EFI_80211_GET_NETWORKS_DATA *Data;\r | |
227 | //\r | |
228 | // Indicates the scan result. It is caller's responsibility to free this\r | |
229 | // buffer.\r | |
230 | //\r | |
231 | EFI_80211_GET_NETWORKS_RESULT *Result;\r | |
232 | } EFI_80211_GET_NETWORKS_TOKEN;\r | |
233 | \r | |
234 | ///\r | |
235 | /// EFI_80211_CONNECT_NETWORK_DATA\r | |
236 | ///\r | |
237 | typedef struct {\r | |
238 | //\r | |
239 | // Specifies the wireless network to connect to.\r | |
240 | //\r | |
241 | EFI_80211_NETWORK *Network;\r | |
242 | //\r | |
243 | // Specifies a time limit in seconds that is optionally present, after which\r | |
244 | // the connection establishment procedure is terminated by the UNDI driver.\r | |
245 | // This is an optional parameter and may be 0. Values of 5 seconds or higher\r | |
246 | // are recommended.\r | |
247 | //\r | |
248 | UINT32 FailureTimeout;\r | |
249 | } EFI_80211_CONNECT_NETWORK_DATA;\r | |
250 | \r | |
251 | ///\r | |
252 | /// EFI_80211_CONNECT_NETWORK_TOKEN\r | |
253 | ///\r | |
254 | typedef struct {\r | |
255 | //\r | |
256 | // If the status code returned by ConnectNetwork() is EFI_SUCCESS, then this\r | |
257 | // Event will be signaled after the Status field is updated by the EFI\r | |
258 | // Wireless MAC Connection Protocol II driver. The type of Event must be\r | |
259 | // EFI_NOTIFY_SIGNAL.\r | |
260 | //\r | |
261 | EFI_EVENT Event;\r | |
262 | //\r | |
263 | // Will be set to one of the following values:\r | |
264 | // EFI_SUCCESS: The operation completed successfully.\r | |
265 | // EFI_DEVICE_ERROR: An unexpected network or system error occurred.\r | |
266 | // EFI_ACCESS_DENIED: The operation is not completed due to some underlying\r | |
267 | // hardware or software state.\r | |
268 | // EFI_NOT_READY: The operation is started but not yet completed.\r | |
269 | //\r | |
270 | EFI_STATUS Status;\r | |
271 | //\r | |
272 | // Pointer to the connection data.\r | |
273 | //\r | |
274 | EFI_80211_CONNECT_NETWORK_DATA *Data;\r | |
275 | //\r | |
276 | // Indicates the connection state.\r | |
277 | //\r | |
278 | EFI_80211_CONNECT_NETWORK_RESULT_CODE ResultCode;\r | |
279 | } EFI_80211_CONNECT_NETWORK_TOKEN;\r | |
280 | \r | |
281 | ///\r | |
282 | /// EFI_80211_DISCONNECT_NETWORK_TOKEN\r | |
283 | ///\r | |
284 | typedef struct {\r | |
285 | //\r | |
286 | // If the status code returned by DisconnectNetwork() is EFI_SUCCESS, then\r | |
287 | // this Event will be signaled after the Status field is updated by the EFI\r | |
288 | // Wireless MAC Connection Protocol II driver. The type of Event must be\r | |
289 | // EFI_NOTIFY_SIGNAL.\r | |
290 | //\r | |
291 | EFI_EVENT Event;\r | |
292 | //\r | |
293 | // Will be set to one of the following values:\r | |
294 | // EFI_SUCCESS: The operation completed successfully\r | |
295 | // EFI_DEVICE_ERROR: An unexpected network or system error occurred.\r | |
296 | // EFI_ACCESS_DENIED: The operation is not completed due to some underlying\r | |
297 | // hardware or software state.\r | |
298 | //\r | |
299 | EFI_STATUS Status;\r | |
300 | } EFI_80211_DISCONNECT_NETWORK_TOKEN;\r | |
301 | \r | |
302 | /**\r | |
303 | Request a survey of potential wireless networks that administrator can later\r | |
304 | elect to try to join.\r | |
305 | \r | |
306 | @param[in] This Pointer to the\r | |
307 | EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL\r | |
308 | instance.\r | |
309 | @param[in] Token Pointer to the token for getting wireless\r | |
310 | network.\r | |
311 | \r | |
312 | @retval EFI_SUCCESS The operation started, and an event will\r | |
313 | eventually be raised for the caller.\r | |
314 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is\r | |
315 | TRUE:\r | |
316 | This is NULL.\r | |
317 | Token is NULL.\r | |
318 | @retval EFI_UNSUPPORTED One or more of the input parameters is not\r | |
319 | supported by this implementation.\r | |
320 | @retval EFI_ALREADY_STARTED The operation of getting wireless network is\r | |
321 | already started.\r | |
322 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be\r | |
323 | allocated.\r | |
324 | \r | |
325 | **/\r | |
326 | typedef\r | |
327 | EFI_STATUS\r | |
328 | (EFIAPI *EFI_WIRELESS_MAC_CONNECTION_II_GET_NETWORKS) (\r | |
329 | IN EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *This,\r | |
330 | IN EFI_80211_GET_NETWORKS_TOKEN *Token\r | |
331 | );\r | |
332 | \r | |
333 | /**\r | |
334 | Connect a wireless network specified by a particular SSID, BSS type and\r | |
335 | Security type.\r | |
336 | \r | |
337 | @param[in] This Pointer to the\r | |
338 | EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL\r | |
339 | instance.\r | |
340 | @param[in] Token Pointer to the token for connecting wireless\r | |
341 | network.\r | |
342 | \r | |
343 | @retval EFI_SUCCESS The operation started successfully. Results\r | |
344 | will be notified eventually.\r | |
345 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is\r | |
346 | TRUE:\r | |
347 | This is NULL.\r | |
348 | Token is NULL.\r | |
349 | @retval EFI_UNSUPPORTED One or more of the input parameters are not\r | |
350 | supported by this implementation.\r | |
351 | @retval EFI_ALREADY_STARTED The connection process is already started.\r | |
352 | @retval EFI_NOT_FOUND The specified wireless network is not found.\r | |
353 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be\r | |
354 | allocated.\r | |
355 | \r | |
356 | **/\r | |
357 | typedef\r | |
358 | EFI_STATUS\r | |
359 | (EFIAPI *EFI_WIRELESS_MAC_CONNECTION_II_CONNECT_NETWORK) (\r | |
360 | IN EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *This,\r | |
361 | IN EFI_80211_CONNECT_NETWORK_TOKEN *Token\r | |
362 | );\r | |
363 | \r | |
364 | /**\r | |
365 | Request a disconnection with current connected wireless network.\r | |
366 | \r | |
367 | @param[in] This Pointer to the\r | |
368 | EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL\r | |
369 | instance.\r | |
370 | @param[in] Token Pointer to the token for disconnecting\r | |
371 | wireless network.\r | |
372 | \r | |
373 | @retval EFI_SUCCESS The operation started successfully. Results\r | |
374 | will be notified eventually.\r | |
375 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is\r | |
376 | TRUE:\r | |
377 | This is NULL.\r | |
378 | Token is NULL.\r | |
379 | @retval EFI_UNSUPPORTED One or more of the input parameters are not\r | |
380 | supported by this implementation.\r | |
381 | @retval EFI_NOT_FOUND Not connected to a wireless network.\r | |
382 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be\r | |
383 | allocated.\r | |
384 | \r | |
385 | **/\r | |
386 | typedef\r | |
387 | EFI_STATUS\r | |
388 | (EFIAPI *EFI_WIRELESS_MAC_CONNECTION_II_DISCONNECT_NETWORK) (\r | |
389 | IN EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *This,\r | |
390 | IN EFI_80211_DISCONNECT_NETWORK_TOKEN *Token\r | |
391 | );\r | |
392 | \r | |
393 | ///\r | |
394 | /// The EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL provides network management\r | |
395 | /// service interfaces for 802.11 network stack. It is used by network\r | |
396 | /// applications (and drivers) to establish wireless connection with a wireless\r | |
397 | /// network.\r | |
398 | ///\r | |
399 | struct _EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL {\r | |
400 | EFI_WIRELESS_MAC_CONNECTION_II_GET_NETWORKS GetNetworks;\r | |
401 | EFI_WIRELESS_MAC_CONNECTION_II_CONNECT_NETWORK ConnectNetwork;\r | |
402 | EFI_WIRELESS_MAC_CONNECTION_II_DISCONNECT_NETWORK DisconnectNetwork;\r | |
403 | };\r | |
404 | \r | |
405 | extern EFI_GUID gEfiWiFi2ProtocolGuid;\r | |
406 | \r | |
407 | #endif\r |