]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/VlanConfig.h
fe13c93e74a4b35fe519072eb4a76b23838cdf41
[mirror_edk2.git] / MdePkg / Include / 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
5 All rights reserved. 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 **/
14
15 #ifndef __EFI_VLANCONFIG_PROTOCOL_H__
16 #define __EFI_VLANCONFIG_PROTOCOL_H__
17
18
19 #define EFI_VLAN_CONFIG_PROTOCOL_GUID \
20 { \
21 0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74 } \
22 }
23
24 typedef struct _EFI_VLAN_CONFIG_PROTOCOL EFI_VLAN_CONFIG_PROTOCOL;
25
26
27 ///
28 /// EFI_VLAN_FIND_DATA
29 ///
30 typedef struct {
31 UINT16 VlanId; ///< Vlan Identifier.
32 UINT8 Priority; ///< Priority of this VLAN.
33 } EFI_VLAN_FIND_DATA;
34
35
36 /**
37 Create a VLAN device or modify the configuration parameter of an
38 already-configured VLAN.
39
40 The Set() function is used to create a new VLAN device or change the VLAN
41 configuration parameters. If the VlanId hasn't been configured in the
42 physical Ethernet device, a new VLAN device will be created. If a VLAN with
43 this VlanId is already configured, then related configuration will be updated
44 as the input parameters.
45
46 If VlanId is zero, the VLAN device will send and receive untagged frames.
47 Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId.
48 If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned.
49 If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned.
50 If there is not enough system memory to perform the registration, then
51 EFI_OUT_OF_RESOURCES is returned.
52
53 @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
54 @param[in] VlanId A unique identifier (1-4094) of the VLAN which is being created
55 or modified, or zero (0).
56 @param[in] Priority 3 bit priority in VLAN header. Priority 0 is default value. If
57 VlanId is zero (0), Priority is ignored.
58
59 @retval EFI_SUCCESS The VLAN is successfully configured.
60 @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
61 - This is NULL.
62 - VlanId is an invalid VLAN Identifier.
63 - Priority is invalid.
64 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.
65
66 **/
67 typedef
68 EFI_STATUS
69 (EFIAPI *EFI_VLAN_CONFIG_SET)(
70 IN EFI_VLAN_CONFIG_PROTOCOL *This,
71 IN UINT16 VlanId,
72 IN UINT8 Priority
73 );
74
75 /**
76 Find configuration information for specified VLAN or all configured VLANs.
77
78 The Find() function is used to find the configuration information for matching
79 VLAN and allocate a buffer into which those entries are copied.
80
81 @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
82 @param[in] VlanId Pointer to VLAN identifier. Set to NULL to find all
83 configured VLANs.
84 @param[out] NumberOfVlan The number of VLANs which is found by the specified criteria.
85 @param[out] Entries The buffer which receive the VLAN configuration.
86
87 @retval EFI_SUCCESS The VLAN is successfully found.
88 @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
89 - This is NULL.
90 - Specified VlanId is invalid.
91 @retval EFI_NOT_FOUND No matching VLAN is found.
92
93 **/
94 typedef
95 EFI_STATUS
96 (EFIAPI *EFI_VLAN_CONFIG_FIND)(
97 IN EFI_VLAN_CONFIG_PROTOCOL *This,
98 IN UINT16 *VlanId OPTIONAL,
99 OUT UINT16 *NumberOfVlan,
100 OUT EFI_VLAN_FIND_DATA **Entries
101 );
102
103 /**
104 Remove the configured VLAN device.
105
106 The Remove() function is used to remove the specified VLAN device.
107 If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned.
108 If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned.
109
110 @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
111 @param[in] VlanId Identifier (0-4094) of the VLAN to be removed.
112
113 @retval EFI_SUCCESS The VLAN is successfully removed.
114 @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
115 - This is NULL.
116 - VlanId is an invalid parameter.
117 @retval EFI_NOT_FOUND The to-be-removed VLAN does not exist.
118
119 **/
120 typedef
121 EFI_STATUS
122 (EFIAPI *EFI_VLAN_CONFIG_REMOVE)(
123 IN EFI_VLAN_CONFIG_PROTOCOL *This,
124 IN UINT16 VlanId
125 );
126
127 ///
128 /// EFI_VLAN_CONFIG_PROTOCOL
129 /// provide manageability interface for VLAN setting. The intended
130 /// VLAN tagging implementation is IEEE802.1Q.
131 ///
132 struct _EFI_VLAN_CONFIG_PROTOCOL {
133 EFI_VLAN_CONFIG_SET Set;
134 EFI_VLAN_CONFIG_FIND Find;
135 EFI_VLAN_CONFIG_REMOVE Remove;
136 };
137
138 extern EFI_GUID gEfiVlanConfigProtocolGuid;
139
140 #endif