]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add EFI EAP Configuration Protocol definitions
authorHao Wu <hao.a.wu@intel.com>
Wed, 27 May 2015 02:48:28 +0000 (02:48 +0000)
committerhwu1225 <hwu1225@Edk2>
Wed, 27 May 2015 02:48:28 +0000 (02:48 +0000)
Add UEFI2.5 EFI EAP Configuration Protocol definitions.

MdePkg/Include/Protocol/Eap.h is also modified for backward compatibility.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17518 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Protocol/Eap.h
MdePkg/Include/Protocol/EapConfiguration.h [new file with mode: 0644]
MdePkg/MdePkg.dec

index 9b445e25a0c857b1fca72624064739eaed09f19c..eac2d5e5642a601039336fee8f9714dadb3d760d 100644 (file)
@@ -5,7 +5,7 @@
   The definitions in this file are defined in UEFI Specification 2.3.1B, which have\r
   not been verified by one implementation yet.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2015, 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
@@ -44,10 +44,11 @@ typedef VOID *  EFI_PORT_HANDLE;
 \r
 //\r
 // EAP_TYPE MD5, OTP and TOEKN_CARD has been removed from UEFI2.3.1B.\r
+// Definitions are kept for backward compatibility.\r
 //\r
-#define EFI_EAP_TYPE_MD5                0x4\r
-#define EFI_EAP_TYPE_OTP                0x5\r
-#define EFI_EAP_TYPE_TOKEN_CARD         0x6\r
+#define EFI_EAP_TYPE_MD5                4\r
+#define EFI_EAP_TYPE_OTP                5\r
+#define EFI_EAP_TYPE_TOKEN_CARD         6\r
 \r
 /**\r
   One user provided EAP authentication method.\r
diff --git a/MdePkg/Include/Protocol/EapConfiguration.h b/MdePkg/Include/Protocol/EapConfiguration.h
new file mode 100644 (file)
index 0000000..1dc5efe
--- /dev/null
@@ -0,0 +1,159 @@
+/** @file\r
+  This file defines the EFI EAP Configuration protocol.\r
+\r
+  Copyright (c) 2015, 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.5\r
+\r
+**/\r
+\r
+#ifndef __EFI_EAP_CONFIGURATION_PROTOCOL_H__\r
+#define __EFI_EAP_CONFIGURATION_PROTOCOL_H__\r
+\r
+///\r
+/// EFI EAP Configuration protocol provides a way to set and get EAP configuration.\r
+///\r
+#define EFI_EAP_CONFIGURATION_PROTOCOL_GUID \\r
+  { \\r
+    0xe5b58dbb, 0x7688, 0x44b4, {0x97, 0xbf, 0x5f, 0x1d, 0x4b, 0x7c, 0xc8, 0xdb } \\r
+  }\r
+\r
+typedef struct _EFI_EAP_CONFIGURATION_PROTOCOL EFI_EAP_CONFIGURATION_PROTOCOL;\r
+\r
+///\r
+/// Make sure it not conflict with any real EapTypeXXX\r
+///\r
+#define EFI_EAP_TYPE_ATTRIBUTE 0\r
+\r
+typedef enum {\r
+  ///\r
+  /// EFI_EAP_TYPE_ATTRIBUTE\r
+  ///\r
+  EfiEapConfigEapAuthMethod,\r
+  EfiEapConfigEapSupportedAuthMethod,\r
+  ///\r
+  /// EapTypeIdentity\r
+  ///\r
+  EfiEapConfigIdentityString,\r
+  ///\r
+  /// EapTypeEAPTLS/EapTypePEAP\r
+  ///\r
+  EfiEapConfigEapTlsCACert,\r
+  EfiEapConfigEapTlsClientCert,\r
+  EfiEapConfigEapTlsClientPrivateKeyFile,\r
+  EfiEapConfigEapTlsClientPrivateKeyFilePassword, // ASCII format, Volatile\r
+  EfiEapConfigEapTlsCipherSuite,\r
+  EfiEapConfigEapTlsSupportedCipherSuite,\r
+  ///\r
+  /// EapTypeMSChapV2\r
+  ///\r
+  EfiEapConfigEapMSChapV2Password, // UNICODE format, Volatile\r
+  ///\r
+  /// EapTypePEAP\r
+  ///\r
+  EfiEapConfigEap2ndAuthMethod,\r
+  ///\r
+  /// More...\r
+  ///\r
+} EFI_EAP_CONFIG_DATA_TYPE;\r
+\r
+///\r
+/// EFI_EAP_TYPE\r
+///\r
+typedef UINT8 EFI_EAP_TYPE;\r
+#define EFI_EAP_TYPE_ATTRIBUTE      0\r
+#define EFI_EAP_TYPE_IDENTITY       1\r
+#define EFI_EAP_TYPE_NOTIFICATION   2\r
+#define EFI_EAP_TYPE_NAK            3\r
+#define EFI_EAP_TYPE_MD5CHALLENGE   4\r
+#define EFI_EAP_TYPE_OTP            5\r
+#define EFI_EAP_TYPE_GTC            6\r
+#define EFI_EAP_TYPE_EAPTLS         13\r
+#define EFI_EAP_TYPE_EAPSIM         18\r
+#define EFI_EAP_TYPE_TTLS           21\r
+#define EFI_EAP_TYPE_PEAP           25\r
+#define EFI_EAP_TYPE_MSCHAPV2       26\r
+#define EFI_EAP_TYPE_EAP_EXTENSION  33\r
+\r
+/**\r
+  Set EAP configuration data.\r
+\r
+  The SetData() function sets EAP configuration to non-volatile storage or volatile\r
+  storage.\r
+\r
+  @param[in]  This                Pointer to the EFI_EAP_CONFIGURATION_PROTOCOL instance.\r
+  @param[in]  EapType             EAP type.\r
+  @param[in]  DataType            Configuration data type.\r
+  @param[in]  Data                Pointer to configuration data.\r
+  @param[in]  DataSize            Total size of configuration data.\r
+\r
+  @retval EFI_SUCCESS             The EAP configuration data is set successfully.\r
+  @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:\r
+                                  Data is NULL.\r
+                                  DataSize is 0.\r
+  @retval EFI_UNSUPPORTED         The EapType or DataType is unsupported.\r
+  @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EAP_CONFIGURATION_SET_DATA) (\r
+  IN EFI_EAP_CONFIGURATION_PROTOCOL       *This,\r
+  IN EFI_EAP_TYPE                         EapType,\r
+  IN EFI_EAP_CONFIG_DATA_TYPE             DataType,\r
+  IN VOID                                 *Data,\r
+  IN UINTN                                DataSize\r
+  );\r
+\r
+/**\r
+  Get EAP configuration data.\r
+\r
+  The GetData() function gets EAP configuration.\r
+\r
+  @param[in]       This           Pointer to the EFI_EAP_CONFIGURATION_PROTOCOL instance.\r
+  @param[in]       EapType        EAP type.\r
+  @param[in]       DataType       Configuration data type.\r
+  @param[in, out]  Data           Pointer to configuration data.\r
+  @param[in, out]  DataSize       Total size of configuration data. On input, it means\r
+                                  the size of Data buffer. On output, it means the size\r
+                                  of copied Data buffer if EFI_SUCCESS, and means the\r
+                                  size of desired Data buffer if EFI_BUFFER_TOO_SMALL.\r
+\r
+  @retval EFI_SUCCESS             The EAP configuration data is got successfully.\r
+  @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:\r
+                                  Data is NULL.\r
+                                  DataSize is NULL.\r
+  @retval EFI_UNSUPPORTED         The EapType or DataType is unsupported.\r
+  @retval EFI_NOT_FOUND           The EAP configuration data is not found.\r
+  @retval EFI_BUFFER_TOO_SMALL    The buffer is too small to hold the buffer.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EAP_CONFIGURATION_GET_DATA) (\r
+  IN EFI_EAP_CONFIGURATION_PROTOCOL       *This,\r
+  IN EFI_EAP_TYPE                         EapType,\r
+  IN EFI_EAP_CONFIG_DATA_TYPE             DataType,\r
+  IN OUT VOID                             *Data,\r
+  IN OUT UINTN                            *DataSize\r
+  );\r
+\r
+///\r
+/// The EFI_EAP_CONFIGURATION_PROTOCOL\r
+/// is designed to provide a way to set and get EAP configuration, such as Certificate,\r
+/// private key file.\r
+///\r
+struct _EFI_EAP_CONFIGURATION_PROTOCOL {\r
+  EFI_EAP_CONFIGURATION_SET_DATA          SetData;\r
+  EFI_EAP_CONFIGURATION_GET_DATA          GetData;\r
+};\r
+\r
+extern EFI_GUID gEfiEapConfigurationProtocolGuid;\r
+\r
+#endif
\ No newline at end of file
index 4879d19ac06736b434a46bbba93578c1cc76c3b2..a6f8b4fe26513977d5ca1ba4fff9d703f35d8f9c 100644 (file)
   ## Include/Protocol/EapManagement2.h\r
   gEfiEapManagement2ProtocolGuid       = { 0x5e93c847, 0x456d, 0x40b3, {0xa6, 0xb4, 0x78, 0xb0, 0xc9, 0xcf, 0x7f, 0x20 }}\r
 \r
+  ## Include/Protocol/EapConfiguration.h\r
+  gEfiEapConfigurationProtocolGuid     = { 0xe5b58dbb, 0x7688, 0x44b4, {0x97, 0xbf, 0x5f, 0x1d, 0x4b, 0x7c, 0xc8, 0xdb }}\r
+\r
 #\r
 # [Error.gEfiMdePkgTokenSpaceGuid]\r
 #   0x80000001 | Invalid value provided.\r