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