Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / ipxe / src / include / ipxe / efi / Protocol / VlanConfig.h
1 /** @file
2   EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.
3
4   Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
5   This program and the accompanying materials
6   are licensed and made available under the terms and conditions of the BSD License
7   which accompanies this distribution.  The full text of the license may be found at
8   http://opensource.org/licenses/bsd-license.php
9
10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13   @par Revision Reference:
14   This Protocol is introduced in UEFI Specification 2.2
15
16 **/
17
18 #ifndef __EFI_VLANCONFIG_PROTOCOL_H__
19 #define __EFI_VLANCONFIG_PROTOCOL_H__
20
21 FILE_LICENCE ( BSD3 );
22
23
24 #define EFI_VLAN_CONFIG_PROTOCOL_GUID \
25   { \
26     0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74 } \
27   }
28
29 typedef struct _EFI_VLAN_CONFIG_PROTOCOL EFI_VLAN_CONFIG_PROTOCOL;
30
31
32 ///
33 /// EFI_VLAN_FIND_DATA
34 ///
35 typedef struct {
36   UINT16          VlanId;     ///< Vlan Identifier.
37   UINT8           Priority;   ///< Priority of this VLAN.
38 } EFI_VLAN_FIND_DATA;
39
40
41 /**
42   Create a VLAN device or modify the configuration parameter of an
43   already-configured VLAN.
44
45   The Set() function is used to create a new VLAN device or change the VLAN
46   configuration parameters. If the VlanId hasn't been configured in the
47   physical Ethernet device, a new VLAN device will be created. If a VLAN with
48   this VlanId is already configured, then related configuration will be updated
49   as the input parameters.
50
51   If VlanId is zero, the VLAN device will send and receive untagged frames.
52   Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId.
53   If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned.
54   If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned.
55   If there is not enough system memory to perform the registration, then
56   EFI_OUT_OF_RESOURCES is returned.
57
58   @param[in] This                Points to the EFI_VLAN_CONFIG_PROTOCOL.
59   @param[in] VlanId              A unique identifier (1-4094) of the VLAN which is being created
60                                  or modified, or zero (0).
61   @param[in] Priority            3 bit priority in VLAN header. Priority 0 is default value. If
62                                  VlanId is zero (0), Priority is ignored.
63
64   @retval EFI_SUCCESS            The VLAN is successfully configured.
65   @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:
66                                  - This is NULL.
67                                  - VlanId is an invalid VLAN Identifier.
68                                  - Priority is invalid.
69   @retval EFI_OUT_OF_RESOURCES   There is not enough system memory to perform the registration.
70
71 **/
72 typedef
73 EFI_STATUS
74 (EFIAPI *EFI_VLAN_CONFIG_SET)(
75   IN  EFI_VLAN_CONFIG_PROTOCOL     *This,
76   IN  UINT16                       VlanId,
77   IN  UINT8                        Priority
78   );
79
80 /**
81   Find configuration information for specified VLAN or all configured VLANs.
82
83   The Find() function is used to find the configuration information for matching
84   VLAN and allocate a buffer into which those entries are copied.
85
86   @param[in]  This               Points to the EFI_VLAN_CONFIG_PROTOCOL.
87   @param[in]  VlanId             Pointer to VLAN identifier. Set to NULL to find all
88                                  configured VLANs.
89   @param[out] NumberOfVlan       The number of VLANs which is found by the specified criteria.
90   @param[out] Entries            The buffer which receive the VLAN configuration.
91
92   @retval EFI_SUCCESS            The VLAN is successfully found.
93   @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:
94                                  - This is NULL.
95                                  - Specified VlanId is invalid.
96   @retval EFI_NOT_FOUND          No matching VLAN is found.
97
98 **/
99 typedef
100 EFI_STATUS
101 (EFIAPI *EFI_VLAN_CONFIG_FIND)(
102   IN  EFI_VLAN_CONFIG_PROTOCOL     *This,
103   IN  UINT16                       *VlanId  OPTIONAL,
104   OUT UINT16                       *NumberOfVlan,
105   OUT EFI_VLAN_FIND_DATA           **Entries
106   );
107
108 /**
109   Remove the configured VLAN device.
110
111   The Remove() function is used to remove the specified VLAN device.
112   If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned.
113   If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned.
114
115   @param[in] This                Points to the EFI_VLAN_CONFIG_PROTOCOL.
116   @param[in] VlanId              Identifier (0-4094) of the VLAN to be removed.
117
118   @retval EFI_SUCCESS            The VLAN is successfully removed.
119   @retval EFI_INVALID_PARAMETER  One or more of following conditions is TRUE:
120                                  - This is NULL.
121                                  - VlanId  is an invalid parameter.
122   @retval EFI_NOT_FOUND          The to-be-removed VLAN does not exist.
123
124 **/
125 typedef
126 EFI_STATUS
127 (EFIAPI *EFI_VLAN_CONFIG_REMOVE)(
128   IN  EFI_VLAN_CONFIG_PROTOCOL     *This,
129   IN  UINT16                       VlanId
130   );
131
132 ///
133 /// EFI_VLAN_CONFIG_PROTOCOL
134 /// provide manageability interface for VLAN setting. The intended
135 /// VLAN tagging implementation is IEEE802.1Q.
136 ///
137 struct _EFI_VLAN_CONFIG_PROTOCOL {
138   EFI_VLAN_CONFIG_SET              Set;
139   EFI_VLAN_CONFIG_FIND             Find;
140   EFI_VLAN_CONFIG_REMOVE           Remove;
141 };
142
143 extern EFI_GUID gEfiVlanConfigProtocolGuid;
144
145 #endif