iPXE
VlanConfig.h
Go to the documentation of this file.
00001 /** @file
00002   EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.
00003 
00004   Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
00005   This program and the accompanying materials
00006   are licensed and made available under the terms and conditions of the BSD License
00007   which accompanies this distribution.  The full text of the license may be found at
00008   http://opensource.org/licenses/bsd-license.php
00009 
00010   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00011   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00012 
00013   @par Revision Reference:
00014   This Protocol is introduced in UEFI Specification 2.2
00015 
00016 **/
00017 
00018 #ifndef __EFI_VLANCONFIG_PROTOCOL_H__
00019 #define __EFI_VLANCONFIG_PROTOCOL_H__
00020 
00021 FILE_LICENCE ( BSD3 );
00022 
00023 
00024 #define EFI_VLAN_CONFIG_PROTOCOL_GUID \
00025   { \
00026     0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74 } \
00027   }
00028 
00029 typedef struct _EFI_VLAN_CONFIG_PROTOCOL EFI_VLAN_CONFIG_PROTOCOL;
00030 
00031 
00032 ///
00033 /// EFI_VLAN_FIND_DATA
00034 ///
00035 typedef struct {
00036   UINT16          VlanId;     ///< Vlan Identifier.
00037   UINT8           Priority;   ///< Priority of this VLAN.
00038 } EFI_VLAN_FIND_DATA;
00039 
00040 
00041 /**
00042   Create a VLAN device or modify the configuration parameter of an
00043   already-configured VLAN.
00044 
00045   The Set() function is used to create a new VLAN device or change the VLAN
00046   configuration parameters. If the VlanId hasn't been configured in the
00047   physical Ethernet device, a new VLAN device will be created. If a VLAN with
00048   this VlanId is already configured, then related configuration will be updated
00049   as the input parameters.
00050 
00051   If VlanId is zero, the VLAN device will send and receive untagged frames.
00052   Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId.
00053   If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned.
00054   If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned.
00055   If there is not enough system memory to perform the registration, then
00056   EFI_OUT_OF_RESOURCES is returned.
00057 
00058   @param[in] This                Points to the EFI_VLAN_CONFIG_PROTOCOL.
00059   @param[in] VlanId              A unique identifier (1-4094) of the VLAN which is being created
00060                                  or modified, or zero (0).
00061   @param[in] Priority            3 bit priority in VLAN header. Priority 0 is default value. If
00062                                  VlanId is zero (0), Priority is ignored.
00063 
00064   @retval EFI_SUCCESS            The VLAN is successfully configured.
00065   @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:
00066                                  - This is NULL.
00067                                  - VlanId is an invalid VLAN Identifier.
00068                                  - Priority is invalid.
00069   @retval EFI_OUT_OF_RESOURCES   There is not enough system memory to perform the registration.
00070 
00071 **/
00072 typedef
00073 EFI_STATUS
00074 (EFIAPI *EFI_VLAN_CONFIG_SET)(
00075   IN  EFI_VLAN_CONFIG_PROTOCOL     *This,
00076   IN  UINT16                       VlanId,
00077   IN  UINT8                        Priority
00078   );
00079 
00080 /**
00081   Find configuration information for specified VLAN or all configured VLANs.
00082 
00083   The Find() function is used to find the configuration information for matching
00084   VLAN and allocate a buffer into which those entries are copied.
00085 
00086   @param[in]  This               Points to the EFI_VLAN_CONFIG_PROTOCOL.
00087   @param[in]  VlanId             Pointer to VLAN identifier. Set to NULL to find all
00088                                  configured VLANs.
00089   @param[out] NumberOfVlan       The number of VLANs which is found by the specified criteria.
00090   @param[out] Entries            The buffer which receive the VLAN configuration.
00091 
00092   @retval EFI_SUCCESS            The VLAN is successfully found.
00093   @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:
00094                                  - This is NULL.
00095                                  - Specified VlanId is invalid.
00096   @retval EFI_NOT_FOUND          No matching VLAN is found.
00097 
00098 **/
00099 typedef
00100 EFI_STATUS
00101 (EFIAPI *EFI_VLAN_CONFIG_FIND)(
00102   IN  EFI_VLAN_CONFIG_PROTOCOL     *This,
00103   IN  UINT16                       *VlanId  OPTIONAL,
00104   OUT UINT16                       *NumberOfVlan,
00105   OUT EFI_VLAN_FIND_DATA           **Entries
00106   );
00107 
00108 /**
00109   Remove the configured VLAN device.
00110 
00111   The Remove() function is used to remove the specified VLAN device.
00112   If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned.
00113   If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned.
00114 
00115   @param[in] This                Points to the EFI_VLAN_CONFIG_PROTOCOL.
00116   @param[in] VlanId              Identifier (0-4094) of the VLAN to be removed.
00117 
00118   @retval EFI_SUCCESS            The VLAN is successfully removed.
00119   @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:
00120                                  - This is NULL.
00121                                  - VlanId  is an invalid parameter.
00122   @retval EFI_NOT_FOUND          The to-be-removed VLAN does not exist.
00123 
00124 **/
00125 typedef
00126 EFI_STATUS
00127 (EFIAPI *EFI_VLAN_CONFIG_REMOVE)(
00128   IN  EFI_VLAN_CONFIG_PROTOCOL     *This,
00129   IN  UINT16                       VlanId
00130   );
00131 
00132 ///
00133 /// EFI_VLAN_CONFIG_PROTOCOL
00134 /// provide manageability interface for VLAN setting. The intended
00135 /// VLAN tagging implementation is IEEE802.1Q.
00136 ///
00137 struct _EFI_VLAN_CONFIG_PROTOCOL {
00138   EFI_VLAN_CONFIG_SET              Set;
00139   EFI_VLAN_CONFIG_FIND             Find;
00140   EFI_VLAN_CONFIG_REMOVE           Remove;
00141 };
00142 
00143 extern EFI_GUID gEfiVlanConfigProtocolGuid;
00144 
00145 #endif