iPXE
VlanConfig.h
Go to the documentation of this file.
1 /** @file
2  EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.
3 
4  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5  SPDX-License-Identifier: BSD-2-Clause-Patent
6 
7  @par Revision Reference:
8  This Protocol is introduced in UEFI Specification 2.2
9 
10 **/
11 
12 #ifndef __EFI_VLANCONFIG_PROTOCOL_H__
13 #define __EFI_VLANCONFIG_PROTOCOL_H__
14 
15 FILE_LICENCE ( BSD2_PATENT );
16 
17 #define EFI_VLAN_CONFIG_PROTOCOL_GUID \
18  { \
19  0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74 } \
20  }
21 
23 
24 ///
25 /// EFI_VLAN_FIND_DATA
26 ///
27 typedef struct {
28  UINT16 VlanId; ///< Vlan Identifier.
29  UINT8 Priority; ///< Priority of this VLAN.
31 
32 /**
33  Create a VLAN device or modify the configuration parameter of an
34  already-configured VLAN.
35 
36  The Set() function is used to create a new VLAN device or change the VLAN
37  configuration parameters. If the VlanId hasn't been configured in the
38  physical Ethernet device, a new VLAN device will be created. If a VLAN with
39  this VlanId is already configured, then related configuration will be updated
40  as the input parameters.
41 
42  If VlanId is zero, the VLAN device will send and receive untagged frames.
43  Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId.
44  If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned.
45  If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned.
46  If there is not enough system memory to perform the registration, then
47  EFI_OUT_OF_RESOURCES is returned.
48 
49  @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
50  @param[in] VlanId A unique identifier (1-4094) of the VLAN which is being created
51  or modified, or zero (0).
52  @param[in] Priority 3 bit priority in VLAN header. Priority 0 is default value. If
53  VlanId is zero (0), Priority is ignored.
54 
55  @retval EFI_SUCCESS The VLAN is successfully configured.
56  @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
57  - This is NULL.
58  - VlanId is an invalid VLAN Identifier.
59  - Priority is invalid.
60  @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.
61 
62 **/
63 typedef
67  IN UINT16 VlanId,
68  IN UINT8 Priority
69  );
70 
71 /**
72  Find configuration information for specified VLAN or all configured VLANs.
73 
74  The Find() function is used to find the configuration information for matching
75  VLAN and allocate a buffer into which those entries are copied.
76 
77  @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
78  @param[in] VlanId Pointer to VLAN identifier. Set to NULL to find all
79  configured VLANs.
80  @param[out] NumberOfVlan The number of VLANs which is found by the specified criteria.
81  @param[out] Entries The buffer which receive the VLAN configuration.
82 
83  @retval EFI_SUCCESS The VLAN is successfully found.
84  @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
85  - This is NULL.
86  - Specified VlanId is invalid.
87  @retval EFI_NOT_FOUND No matching VLAN is found.
88 
89 **/
90 typedef
94  IN UINT16 *VlanId OPTIONAL,
95  OUT UINT16 *NumberOfVlan,
96  OUT EFI_VLAN_FIND_DATA **Entries
97  );
98 
99 /**
100  Remove the configured VLAN device.
101 
102  The Remove() function is used to remove the specified VLAN device.
103  If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned.
104  If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned.
105 
106  @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
107  @param[in] VlanId Identifier (0-4094) of the VLAN to be removed.
108 
109  @retval EFI_SUCCESS The VLAN is successfully removed.
110  @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
111  - This is NULL.
112  - VlanId is an invalid parameter.
113  @retval EFI_NOT_FOUND The to-be-removed VLAN does not exist.
114 
115 **/
116 typedef
120  IN UINT16 VlanId
121  );
122 
123 ///
124 /// EFI_VLAN_CONFIG_PROTOCOL
125 /// provide manageability interface for VLAN setting. The intended
126 /// VLAN tagging implementation is IEEE802.1Q.
127 ///
132 };
133 
135 
136 #endif
#define OPTIONAL
Passing the datum to the function is optional, and a NULL is passed if the value is not supplied.
Definition: Base.h:292
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
unsigned char UINT8
UINT16 VlanId
Vlan Identifier.
Definition: VlanConfig.h:28
EFI_GUID gEfiVlanConfigProtocolGuid
EFI_VLAN_CONFIG_SET Set
Definition: VlanConfig.h:129
#define OUT
Definition: mlx_utils.h:29
EFI_VLAN_CONFIG_FIND Find
Definition: VlanConfig.h:130
unsigned short UINT16
#define EFIAPI
EFI_VLAN_CONFIG_PROTOCOL provide manageability interface for VLAN setting.
Definition: VlanConfig.h:128
EFI_VLAN_FIND_DATA.
Definition: VlanConfig.h:27
EFI_STATUS(EFIAPI * EFI_VLAN_CONFIG_REMOVE)(IN EFI_VLAN_CONFIG_PROTOCOL *This, IN UINT16 VlanId)
Remove the configured VLAN device.
Definition: VlanConfig.h:118
#define IN
Definition: mlx_utils.h:28
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_STATUS(EFIAPI * EFI_VLAN_CONFIG_FIND)(IN EFI_VLAN_CONFIG_PROTOCOL *This, IN UINT16 *VlanId OPTIONAL, OUT UINT16 *NumberOfVlan, OUT EFI_VLAN_FIND_DATA **Entries)
Find configuration information for specified VLAN or all configured VLANs.
Definition: VlanConfig.h:92
EFI_STATUS(EFIAPI * EFI_VLAN_CONFIG_SET)(IN EFI_VLAN_CONFIG_PROTOCOL *This, IN UINT16 VlanId, IN UINT8 Priority)
Create a VLAN device or modify the configuration parameter of an already-configured VLAN.
Definition: VlanConfig.h:65
FILE_LICENCE(BSD2_PATENT)
UINT8 Priority
Priority of this VLAN.
Definition: VlanConfig.h:29
EFI_VLAN_CONFIG_REMOVE Remove
Definition: VlanConfig.h:131