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