]> git.proxmox.com Git - mirror_edk2.git/commitdiff
import VlanConfig.h, EFI VLAN Config protocol defined in UEFI 2.3
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 Aug 2009 07:13:25 +0000 (07:13 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 Aug 2009 07:13:25 +0000 (07:13 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9089 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Protocol/VlanConfig.h [new file with mode: 0644]

diff --git a/MdePkg/Include/Protocol/VlanConfig.h b/MdePkg/Include/Protocol/VlanConfig.h
new file mode 100644 (file)
index 0000000..fe13c93
--- /dev/null
@@ -0,0 +1,140 @@
+/** @file\r
+  EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.\r
+\r
+  Copyright (c) 2009, Intel Corporation\r
+  All rights reserved. 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
+**/\r
+\r
+#ifndef __EFI_VLANCONFIG_PROTOCOL_H__\r
+#define __EFI_VLANCONFIG_PROTOCOL_H__\r
+\r
+\r
+#define EFI_VLAN_CONFIG_PROTOCOL_GUID \\r
+  { \\r
+    0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74 } \\r
+  }\r
+\r
+typedef struct _EFI_VLAN_CONFIG_PROTOCOL EFI_VLAN_CONFIG_PROTOCOL;\r
+\r
+\r
+///\r
+/// EFI_VLAN_FIND_DATA\r
+///\r
+typedef struct {\r
+  UINT16          VlanId;     ///< Vlan Identifier.\r
+  UINT8           Priority;   ///< Priority of this VLAN.\r
+} EFI_VLAN_FIND_DATA;\r
+\r
+\r
+/**\r
+  Create a VLAN device or modify the configuration parameter of an \r
+  already-configured VLAN.\r
+\r
+  The Set() function is used to create a new VLAN device or change the VLAN\r
+  configuration parameters. If the VlanId hasn't been configured in the \r
+  physical Ethernet device, a new VLAN device will be created. If a VLAN with\r
+  this VlanId is already configured, then related configuration will be updated\r
+  as the input parameters. \r
\r
+  If VlanId is zero, the VLAN device will send and receive untagged frames.\r
+  Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId.\r
+  If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned.\r
+  If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned. \r
+  If there is not enough system memory to perform the registration, then \r
+  EFI_OUT_OF_RESOURCES is returned.\r
+\r
+  @param[in] This                Points to the EFI_VLAN_CONFIG_PROTOCOL.\r
+  @param[in] VlanId              A unique identifier (1-4094) of the VLAN which is being created \r
+                                 or modified, or zero (0).\r
+  @param[in] Priority            3 bit priority in VLAN header. Priority 0 is default value. If \r
+                                 VlanId is zero (0), Priority is ignored.\r
+                                 \r
+  @retval EFI_SUCCESS            The VLAN is successfully configured.\r
+  @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:\r
+                                 - This is NULL.\r
+                                 - VlanId is an invalid VLAN Identifier.\r
+                                 - Priority is invalid.\r
+  @retval EFI_OUT_OF_RESOURCES   There is not enough system memory to perform the registration.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_VLAN_CONFIG_SET)(\r
+  IN  EFI_VLAN_CONFIG_PROTOCOL     *This,\r
+  IN  UINT16                       VlanId,\r
+  IN  UINT8                        Priority\r
+  );\r
+\r
+/**\r
+  Find configuration information for specified VLAN or all configured VLANs.\r
+\r
+  The Find() function is used to find the configuration information for matching\r
+  VLAN and allocate a buffer into which those entries are copied. \r
+\r
+  @param[in]  This               Points to the EFI_VLAN_CONFIG_PROTOCOL.\r
+  @param[in]  VlanId             Pointer to VLAN identifier. Set to NULL to find all\r
+                                 configured VLANs.\r
+  @param[out] NumberOfVlan       The number of VLANs which is found by the specified criteria.\r
+  @param[out] Entries            The buffer which receive the VLAN configuration.\r
+                                 \r
+  @retval EFI_SUCCESS            The VLAN is successfully found.\r
+  @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:\r
+                                 - This is NULL.\r
+                                 - Specified VlanId is invalid.\r
+  @retval EFI_NOT_FOUND          No matching VLAN is found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_VLAN_CONFIG_FIND)(\r
+  IN  EFI_VLAN_CONFIG_PROTOCOL     *This,\r
+  IN  UINT16                       *VlanId  OPTIONAL,\r
+  OUT UINT16                       *NumberOfVlan,\r
+  OUT EFI_VLAN_FIND_DATA           **Entries\r
+  );\r
+\r
+/**\r
+  Remove the configured VLAN device.\r
+\r
+  The Remove() function is used to remove the specified VLAN device. \r
+  If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned.\r
+  If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned.   \r
+\r
+  @param[in] This                Points to the EFI_VLAN_CONFIG_PROTOCOL.\r
+  @param[in] VlanId              Identifier (0-4094) of the VLAN to be removed.\r
+                                 \r
+  @retval EFI_SUCCESS            The VLAN is successfully removed.\r
+  @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:\r
+                                 - This is NULL.\r
+                                 - VlanId  is an invalid parameter.\r
+  @retval EFI_NOT_FOUND          The to-be-removed VLAN does not exist.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_VLAN_CONFIG_REMOVE)(\r
+  IN  EFI_VLAN_CONFIG_PROTOCOL     *This,\r
+  IN  UINT16                       VlanId\r
+  );\r
+\r
+///\r
+/// EFI_VLAN_CONFIG_PROTOCOL\r
+/// provide manageability interface for VLAN setting. The intended \r
+/// VLAN tagging implementation is IEEE802.1Q.\r
+///\r
+struct _EFI_VLAN_CONFIG_PROTOCOL {\r
+  EFI_VLAN_CONFIG_SET              Set;\r
+  EFI_VLAN_CONFIG_FIND             Find;\r
+  EFI_VLAN_CONFIG_REMOVE           Remove;\r
+};\r
+\r
+extern EFI_GUID gEfiVlanConfigProtocolGuid;\r
+\r
+#endif\r