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