]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add EFI Wireless MAC Connection II Protocol definitions
authorHao Wu <hao.a.wu@intel.com>
Fri, 29 Jan 2016 03:27:53 +0000 (11:27 +0800)
committerHao Wu <hao.a.wu@intel.com>
Mon, 15 Feb 2016 05:15:43 +0000 (13:15 +0800)
This commit also removes common structure definitions between EFI Wireless
MAC Connection Protocol and EFI Wireless MAC Connection II Protocol from
WiFi.h and place them in WiFi2.h.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Include/Protocol/WiFi.h
MdePkg/Include/Protocol/WiFi2.h [new file with mode: 0644]
MdePkg/MdePkg.dec

index 8e9fb3835d44cd049f978ea3acd29e78665ca83b..394634bc2f2c94bccc5463e7c98b46ffbe2ad9d3 100644 (file)
@@ -3,7 +3,7 @@
   network applications (and drivers) to establish wireless connection with an access\r
   point (AP).\r
 \r
   network applications (and drivers) to establish wireless connection with an access\r
   point (AP).\r
 \r
-  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 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
   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
@@ -20,6 +20,8 @@
 #ifndef __EFI_WIFI_PROTOCOL_H__\r
 #define __EFI_WIFI_PROTOCOL_H__\r
 \r
 #ifndef __EFI_WIFI_PROTOCOL_H__\r
 #define __EFI_WIFI_PROTOCOL_H__\r
 \r
+#include <Protocol/WiFi2.h>\r
+\r
 #define EFI_WIRELESS_MAC_CONNECTION_PROTOCOL_GUID \\r
   { \\r
     0xda55bc9, 0x45f8, 0x4bb4, {0x87, 0x19, 0x52, 0x24, 0xf1, 0x8a, 0x4d, 0x45 } \\r
 #define EFI_WIRELESS_MAC_CONNECTION_PROTOCOL_GUID \\r
   { \\r
     0xda55bc9, 0x45f8, 0x4bb4, {0x87, 0x19, 0x52, 0x24, 0xf1, 0x8a, 0x4d, 0x45 } \\r
 \r
 typedef struct _EFI_WIRELESS_MAC_CONNECTION_PROTOCOL EFI_WIRELESS_MAC_CONNECTION_PROTOCOL;\r
 \r
 \r
 typedef struct _EFI_WIRELESS_MAC_CONNECTION_PROTOCOL EFI_WIRELESS_MAC_CONNECTION_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_ACC_NET_TYPE\r
 ///\r
 ///\r
 /// EFI_80211_ACC_NET_TYPE\r
 ///\r
@@ -145,13 +137,6 @@ typedef enum {
   AuthenticateInvalidParameter\r
 } EFI_80211_AUTHENTICATE_RESULT_CODE;\r
 \r
   AuthenticateInvalidParameter\r
 } EFI_80211_AUTHENTICATE_RESULT_CODE;\r
 \r
-///\r
-/// EFI_80211_MAC_ADDRESS\r
-///\r
-typedef struct {\r
-  UINT8                              Addr[6];\r
-} EFI_80211_MAC_ADDRESS;\r
-\r
 ///\r
 /// EFI_80211_ELEMENT_HEADER\r
 ///\r
 ///\r
 /// EFI_80211_ELEMENT_HEADER\r
 ///\r
diff --git a/MdePkg/Include/Protocol/WiFi2.h b/MdePkg/Include/Protocol/WiFi2.h
new file mode 100644 (file)
index 0000000..fc4da5c
--- /dev/null
@@ -0,0 +1,413 @@
+/** @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
index 7ab0cbbcfbfbe24fe71a85bdd3759d905ba045e4..fe2971ea3e33f56898b19cf201beca0c60d737cf 100644 (file)
@@ -2,9 +2,9 @@
 # This Package provides all definitions, library classes and libraries instances.\r
 #\r
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of\r
 # This Package provides all definitions, library classes and libraries instances.\r
 #\r
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of\r
-# EFI1.10/UEFI2.5/PI1.4 and some Industry Standards.\r
+# EFI1.10/UEFI2.6/PI1.4 and some Industry Standards.\r
 #\r
 #\r
-# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available under\r
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available under\r
   ## Include/Protocol/Rest.h\r
   gEfiRestProtocolGuid                 =  { 0x0db48a36, 0x4e54, 0xea9c, {0x9b, 0x09, 0x1e, 0xa5, 0xbe, 0x3a, 0x66, 0x0b }}\r
 \r
   ## Include/Protocol/Rest.h\r
   gEfiRestProtocolGuid                 =  { 0x0db48a36, 0x4e54, 0xea9c, {0x9b, 0x09, 0x1e, 0xa5, 0xbe, 0x3a, 0x66, 0x0b }}\r
 \r
+  #\r
+  # Protocols defined in UEFI2.6\r
+  #\r
+  ## Include/Protocol/WiFi2.h\r
+  gEfiWiFi2ProtocolGuid                = { 0x1b0fb9bf, 0x699d, 0x4fdd, {0xa7, 0xc3, 0x25, 0x46, 0x68, 0x1b, 0xf6, 0x3b }}\r
+\r
 #\r
 # [Error.gEfiMdePkgTokenSpaceGuid]\r
 #   0x80000001 | Invalid value provided.\r
 #\r
 # [Error.gEfiMdePkgTokenSpaceGuid]\r
 #   0x80000001 | Invalid value provided.\r