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