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