+/** @file\r
+ This file defines the EFI Wireless MAC Connection II Protocol.\r
+\r
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ @par Revision Reference:\r
+ This Protocol is introduced in UEFI Specification 2.6\r
+\r
+**/\r
+\r
+#ifndef __EFI_WIFI2_PROTOCOL_H__\r
+#define __EFI_WIFI2_PROTOCOL_H__\r
+\r
+#define EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL_GUID \\r
+ { \\r
+ 0x1b0fb9bf, 0x699d, 0x4fdd, { 0xa7, 0xc3, 0x25, 0x46, 0x68, 0x1b, 0xf6, 0x3b } \\r
+ }\r
+\r
+typedef struct _EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL;\r
+\r
+///\r
+/// EFI_80211_BSS_TYPE\r
+///\r
+typedef enum {\r
+ IeeeInfrastructureBSS,\r
+ IeeeIndependentBSS,\r
+ IeeeMeshBSS,\r
+ IeeeAnyBss\r
+} EFI_80211_BSS_TYPE;\r
+\r
+///\r
+/// EFI_80211_CONNECT_NETWORK_RESULT_CODE\r
+///\r
+typedef enum {\r
+ //\r
+ // The connection establishment operation finished successfully.\r
+ //\r
+ ConnectSuccess,\r
+ //\r
+ // The connection was refused by the Network.\r
+ //\r
+ ConnectRefused,\r
+ //\r
+ // The connection establishment operation failed (i.e, Network is not\r
+ // detected).\r
+ //\r
+ ConnectFailed,\r
+ //\r
+ // The connection establishment operation was terminated on timeout.\r
+ //\r
+ ConnectFailureTimeout,\r
+ //\r
+ // The connection establishment operation failed on other reason.\r
+ //\r
+ ConnectFailedReasonUnspecified\r
+} EFI_80211_CONNECT_NETWORK_RESULT_CODE;\r
+\r
+///\r
+/// EFI_80211_MAC_ADDRESS\r
+///\r
+typedef struct {\r
+ UINT8 Addr[6];\r
+} EFI_80211_MAC_ADDRESS;\r
+\r
+#define EFI_MAX_SSID_LEN 32\r
+\r
+///\r
+/// EFI_80211_SSID\r
+///\r
+typedef struct {\r
+ //\r
+ // Length in bytes of the SSId. If zero, ignore SSId field.\r
+ //\r
+ UINT8 SSIdLen;\r
+ //\r
+ // Specifies the service set identifier.\r
+ //\r
+ UINT8 SSId[EFI_MAX_SSID_LEN];\r
+} EFI_80211_SSID;\r
+\r
+///\r
+/// EFI_80211_GET_NETWORKS_DATA\r
+///\r
+typedef struct {\r
+ //\r
+ // The number of EFI_80211_SSID in SSIDList. If zero, SSIDList should be\r
+ // ignored.\r
+ //\r
+ UINT32 NumOfSSID;\r
+ //\r
+ // The SSIDList is a pointer to an array of EFI_80211_SSID instances. The\r
+ // number of entries is specified by NumOfSSID. The array should only include\r
+ // SSIDs of hidden networks. It is suggested that the caller inputs less than\r
+ // 10 elements in the SSIDList. It is the caller's responsibility to free\r
+ // this buffer.\r
+ //\r
+ EFI_80211_SSID SSIDList[1];\r
+} EFI_80211_GET_NETWORKS_DATA;\r
+\r
+///\r
+/// EFI_80211_SUITE_SELECTOR\r
+///\r
+typedef struct {\r
+ //\r
+ // Organization Unique Identifier, as defined in IEEE 802.11 standard,\r
+ // usually set to 00-0F-AC.\r
+ //\r
+ UINT8 Oui[3];\r
+ //\r
+ // Suites types, as defined in IEEE 802.11 standard.\r
+ //\r
+ UINT8 SuiteType;\r
+} EFI_80211_SUITE_SELECTOR;\r
+\r
+///\r
+/// EFI_80211_AKM_SUITE_SELECTOR\r
+///\r
+typedef struct {\r
+ //\r
+ // Indicates the number of AKM suite selectors that are contained in\r
+ // AKMSuiteList. If zero, the AKMSuiteList is ignored.\r
+ //\r
+ UINT16 AKMSuiteCount;\r
+ //\r
+ // A variable-length array of AKM suites, as defined in IEEE 802.11 standard,\r
+ // Table 8-101. The number of entries is specified by AKMSuiteCount.\r
+ //\r
+ EFI_80211_SUITE_SELECTOR AKMSuiteList[1];\r
+} EFI_80211_AKM_SUITE_SELECTOR;\r
+\r
+///\r
+/// EFI_80211_CIPHER_SUITE_SELECTOR\r
+///\r
+typedef struct {\r
+ //\r
+ // Indicates the number of cipher suites that are contained in\r
+ // CipherSuiteList. If zero, the CipherSuiteList is ignored.\r
+ //\r
+ UINT16 CipherSuiteCount;\r
+ //\r
+ // A variable-length array of cipher suites, as defined in IEEE 802.11\r
+ // standard, Table 8-99. The number of entries is specified by\r
+ // CipherSuiteCount.\r
+ //\r
+ EFI_80211_SUITE_SELECTOR CipherSuiteList[1];\r
+} EFI_80211_CIPHER_SUITE_SELECTOR;\r
+\r
+///\r
+/// EFI_80211_NETWORK\r
+///\r
+typedef struct {\r
+ //\r
+ // Specifies the type of the BSS.\r
+ //\r
+ EFI_80211_BSS_TYPE BSSType;\r
+ //\r
+ // Specifies the SSID of the BSS.\r
+ //\r
+ EFI_80211_SSID SSId;\r
+ //\r
+ // Pointer to the AKM suites supported in the wireless network.\r
+ //\r
+ EFI_80211_AKM_SUITE_SELECTOR *AKMSuite;\r
+ //\r
+ // Pointer to the cipher suites supported in the wireless network.\r
+ //\r
+ EFI_80211_CIPHER_SUITE_SELECTOR *CipherSuite;\r
+} EFI_80211_NETWORK;\r
+\r
+///\r
+/// EFI_80211_NETWORK_DESCRIPTION\r
+///\r
+typedef struct {\r
+ //\r
+ // Specifies the found wireless network.\r
+ //\r
+ EFI_80211_NETWORK Network;\r
+ //\r
+ // Indicates the network quality as a value between 0 to 100, where 100\r
+ // indicates the highest network quality.\r
+ //\r
+ UINT8 NetworkQuality;\r
+} EFI_80211_NETWORK_DESCRIPTION;\r
+\r
+///\r
+/// EFI_80211_GET_NETWORKS_RESULT\r
+///\r
+typedef struct {\r
+ //\r
+ // The number of EFI_80211_NETWORK_DESCRIPTION in NetworkDesc. If zero,\r
+ // NetworkDesc should be ignored.\r
+ //\r
+ UINT8 NumOfNetworkDesc;\r
+ //\r
+ // The NetworkDesc is a pointer to an array of EFI_80211_NETWORK_DESCRIPTION\r
+ // instances. It is caller's responsibility to free this buffer.\r
+ //\r
+ EFI_80211_NETWORK_DESCRIPTION **NetworkDesc;\r
+} EFI_80211_GET_NETWORKS_RESULT;\r
+\r
+///\r
+/// EFI_80211_GET_NETWORKS_TOKEN\r
+///\r
+typedef struct {\r
+ //\r
+ // If the status code returned by GetNetworks() is EFI_SUCCESS, then this\r
+ // Event will be signaled after the Status field is updated by the EFI\r
+ // Wireless MAC Connection Protocol II driver. The type of Event must be\r
+ // EFI_NOTIFY_SIGNAL.\r
+ //\r
+ EFI_EVENT Event;\r
+ //\r
+ // Will be set to one of the following values:\r
+ // EFI_SUCCESS: The operation completed successfully.\r
+ // EFI_NOT_FOUND: Failed to find available wireless networks.\r
+ // EFI_DEVICE_ERROR: An unexpected network or system error occurred.\r
+ // EFI_ACCESS_DENIED: The operation is not completed due to some underlying\r
+ // hardware or software state.\r
+ // EFI_NOT_READY: The operation is started but not yet completed.\r
+ //\r
+ EFI_STATUS Status;\r
+ //\r
+ // Pointer to the input data for getting networks.\r
+ //\r
+ EFI_80211_GET_NETWORKS_DATA *Data;\r
+ //\r
+ // Indicates the scan result. It is caller's responsibility to free this\r
+ // buffer.\r
+ //\r
+ EFI_80211_GET_NETWORKS_RESULT *Result;\r
+} EFI_80211_GET_NETWORKS_TOKEN;\r
+\r
+///\r
+/// EFI_80211_CONNECT_NETWORK_DATA\r
+///\r
+typedef struct {\r
+ //\r
+ // Specifies the wireless network to connect to.\r
+ //\r
+ EFI_80211_NETWORK *Network;\r
+ //\r
+ // Specifies a time limit in seconds that is optionally present, after which\r
+ // the connection establishment procedure is terminated by the UNDI driver.\r
+ // This is an optional parameter and may be 0. Values of 5 seconds or higher\r
+ // are recommended.\r
+ //\r
+ UINT32 FailureTimeout;\r
+} EFI_80211_CONNECT_NETWORK_DATA;\r
+\r
+///\r
+/// EFI_80211_CONNECT_NETWORK_TOKEN\r
+///\r
+typedef struct {\r
+ //\r
+ // If the status code returned by ConnectNetwork() is EFI_SUCCESS, then this\r
+ // Event will be signaled after the Status field is updated by the EFI\r
+ // Wireless MAC Connection Protocol II driver. The type of Event must be\r
+ // EFI_NOTIFY_SIGNAL.\r
+ //\r
+ EFI_EVENT Event;\r
+ //\r
+ // Will be set to one of the following values:\r
+ // EFI_SUCCESS: The operation completed successfully.\r
+ // EFI_DEVICE_ERROR: An unexpected network or system error occurred.\r
+ // EFI_ACCESS_DENIED: The operation is not completed due to some underlying\r
+ // hardware or software state.\r
+ // EFI_NOT_READY: The operation is started but not yet completed.\r
+ //\r
+ EFI_STATUS Status;\r
+ //\r
+ // Pointer to the connection data.\r
+ //\r
+ EFI_80211_CONNECT_NETWORK_DATA *Data;\r
+ //\r
+ // Indicates the connection state.\r
+ //\r
+ EFI_80211_CONNECT_NETWORK_RESULT_CODE ResultCode;\r
+} EFI_80211_CONNECT_NETWORK_TOKEN;\r
+\r
+///\r
+/// EFI_80211_DISCONNECT_NETWORK_TOKEN\r
+///\r
+typedef struct {\r
+ //\r
+ // If the status code returned by DisconnectNetwork() is EFI_SUCCESS, then\r
+ // this Event will be signaled after the Status field is updated by the EFI\r
+ // Wireless MAC Connection Protocol II driver. The type of Event must be\r
+ // EFI_NOTIFY_SIGNAL.\r
+ //\r
+ EFI_EVENT Event;\r
+ //\r
+ // Will be set to one of the following values:\r
+ // EFI_SUCCESS: The operation completed successfully\r
+ // EFI_DEVICE_ERROR: An unexpected network or system error occurred.\r
+ // EFI_ACCESS_DENIED: The operation is not completed due to some underlying\r
+ // hardware or software state.\r
+ //\r
+ EFI_STATUS Status;\r
+} EFI_80211_DISCONNECT_NETWORK_TOKEN;\r
+\r
+/**\r
+ Request a survey of potential wireless networks that administrator can later\r
+ elect to try to join.\r
+\r
+ @param[in] This Pointer to the\r
+ EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL\r
+ instance.\r
+ @param[in] Token Pointer to the token for getting wireless\r
+ network.\r
+\r
+ @retval EFI_SUCCESS The operation started, and an event will\r
+ eventually be raised for the caller.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is\r
+ TRUE:\r
+ This is NULL.\r
+ Token is NULL.\r
+ @retval EFI_UNSUPPORTED One or more of the input parameters is not\r
+ supported by this implementation.\r
+ @retval EFI_ALREADY_STARTED The operation of getting wireless network is\r
+ already started.\r
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be\r
+ allocated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_II_GET_NETWORKS) (\r
+ IN EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *This,\r
+ IN EFI_80211_GET_NETWORKS_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ Connect a wireless network specified by a particular SSID, BSS type and\r
+ Security type.\r
+\r
+ @param[in] This Pointer to the\r
+ EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL\r
+ instance.\r
+ @param[in] Token Pointer to the token for connecting wireless\r
+ network.\r
+\r
+ @retval EFI_SUCCESS The operation started successfully. Results\r
+ will be notified eventually.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is\r
+ TRUE:\r
+ This is NULL.\r
+ Token is NULL.\r
+ @retval EFI_UNSUPPORTED One or more of the input parameters are not\r
+ supported by this implementation.\r
+ @retval EFI_ALREADY_STARTED The connection process is already started.\r
+ @retval EFI_NOT_FOUND The specified wireless network is not found.\r
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be\r
+ allocated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_II_CONNECT_NETWORK) (\r
+ IN EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *This,\r
+ IN EFI_80211_CONNECT_NETWORK_TOKEN *Token\r
+ );\r
+\r
+/**\r
+ Request a disconnection with current connected wireless network.\r
+\r
+ @param[in] This Pointer to the\r
+ EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL\r
+ instance.\r
+ @param[in] Token Pointer to the token for disconnecting\r
+ wireless network.\r
+\r
+ @retval EFI_SUCCESS The operation started successfully. Results\r
+ will be notified eventually.\r
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is\r
+ TRUE:\r
+ This is NULL.\r
+ Token is NULL.\r
+ @retval EFI_UNSUPPORTED One or more of the input parameters are not\r
+ supported by this implementation.\r
+ @retval EFI_NOT_FOUND Not connected to a wireless network.\r
+ @retval EFI_OUT_OF_RESOURCES Required system resources could not be\r
+ allocated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WIRELESS_MAC_CONNECTION_II_DISCONNECT_NETWORK) (\r
+ IN EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL *This,\r
+ IN EFI_80211_DISCONNECT_NETWORK_TOKEN *Token\r
+ );\r
+\r
+///\r
+/// The EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL provides network management\r
+/// service interfaces for 802.11 network stack. It is used by network\r
+/// applications (and drivers) to establish wireless connection with a wireless\r
+/// network.\r
+///\r
+struct _EFI_WIRELESS_MAC_CONNECTION_II_PROTOCOL {\r
+ EFI_WIRELESS_MAC_CONNECTION_II_GET_NETWORKS GetNetworks;\r
+ EFI_WIRELESS_MAC_CONNECTION_II_CONNECT_NETWORK ConnectNetwork;\r
+ EFI_WIRELESS_MAC_CONNECTION_II_DISCONNECT_NETWORK DisconnectNetwork;\r
+};\r
+\r
+extern EFI_GUID gEfiWiFi2ProtocolGuid;\r
+\r
+#endif\r