]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/MnpDxe/MnpVlan.h
NetworkPkg: Apply uncrustify changes
[mirror_edk2.git] / NetworkPkg / MnpDxe / MnpVlan.h
CommitLineData
779ae357 1/** @file\r
2 Header file to be included by MnpVlan.c.\r
3\r
bdebd2ce 4Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
779ae357 6\r
7**/\r
8\r
9#ifndef __MNP_VLAN_H__\r
10#define __MNP_VLAN_H__\r
11\r
12#include "MnpDriver.h"\r
13\r
d1050b9d 14extern EFI_VLAN_CONFIG_PROTOCOL mVlanConfigProtocolTemplate;\r
779ae357 15\r
16/**\r
17 Create a child handle for the VLAN ID.\r
18\r
19 @param[in] ImageHandle The driver image handle.\r
20 @param[in] ControllerHandle Handle of device to bind driver to.\r
21 @param[in] VlanId The VLAN ID.\r
22 @param[out] Devicepath Pointer to returned device path for child handle.\r
23\r
24 @return The handle of VLAN child or NULL if failed to create VLAN child.\r
25\r
26**/\r
27EFI_HANDLE\r
28MnpCreateVlanChild (\r
d1050b9d
MK
29 IN EFI_HANDLE ImageHandle,\r
30 IN EFI_HANDLE ControllerHandle,\r
31 IN UINT16 VlanId,\r
32 OUT EFI_DEVICE_PATH_PROTOCOL **Devicepath OPTIONAL\r
779ae357 33 );\r
34\r
35/**\r
36 Remove VLAN tag of a packet.\r
37\r
38 @param[in, out] MnpDeviceData Pointer to the mnp device context data.\r
39 @param[in, out] Nbuf Pointer to the NET_BUF to remove VLAN tag.\r
40 @param[out] VlanId Pointer to the returned VLAN ID.\r
41\r
42 @retval TRUE VLAN tag is removed from this packet.\r
43 @retval FALSE There is no VLAN tag in this packet.\r
44\r
45**/\r
46BOOLEAN\r
47MnpRemoveVlanTag (\r
d1050b9d
MK
48 IN OUT MNP_DEVICE_DATA *MnpDeviceData,\r
49 IN OUT NET_BUF *Nbuf,\r
50 OUT UINT16 *VlanId\r
779ae357 51 );\r
52\r
53/**\r
bdebd2ce 54 Build the vlan packet to transmit from the TxData passed in.\r
779ae357 55\r
56 @param MnpServiceData Pointer to the mnp service context data.\r
57 @param TxData Pointer to the transmit data containing the\r
58 information to build the packet.\r
59 @param ProtocolType Pointer to the Ethernet protocol type.\r
60 @param Packet Pointer to record the address of the packet.\r
61 @param Length Pointer to a UINT32 variable used to record the\r
62 packet's length.\r
63\r
64**/\r
65VOID\r
66MnpInsertVlanTag (\r
d1050b9d
MK
67 IN MNP_SERVICE_DATA *MnpServiceData,\r
68 IN EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData,\r
69 OUT UINT16 *ProtocolType,\r
70 IN OUT UINT8 **Packet,\r
71 IN OUT UINT32 *Length\r
779ae357 72 );\r
73\r
74/**\r
75 Get VLAN configuration variable.\r
76\r
77 @param[in] MnpDeviceData Pointer to the MNP device context data.\r
78 @param[out] NumberOfVlan Pointer to number of VLAN to be returned.\r
79 @param[out] VlanVariable Pointer to the buffer to return requested\r
80 array of VLAN_TCI.\r
81\r
82 @retval EFI_SUCCESS The array of VLAN_TCI was returned in VlanVariable\r
83 and number of VLAN was returned in NumberOfVlan.\r
84 @retval EFI_NOT_FOUND VLAN configuration variable not found.\r
85 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the configuration.\r
86\r
87**/\r
88EFI_STATUS\r
89MnpGetVlanVariable (\r
d1050b9d
MK
90 IN MNP_DEVICE_DATA *MnpDeviceData,\r
91 OUT UINTN *NumberOfVlan,\r
92 OUT VLAN_TCI **VlanVariable\r
779ae357 93 );\r
94\r
95/**\r
96 Set VLAN configuration variable.\r
97\r
98 @param[in] MnpDeviceData Pointer to the MNP device context data.\r
99 @param[in] NumberOfVlan Number of VLAN in array VlanVariable.\r
100 @param[in] VlanVariable Pointer to array of VLAN_TCI.\r
101\r
102 @retval EFI_SUCCESS The VLAN variable is successfully set.\r
103 @retval EFI_OUT_OF_RESOURCES There is not enough resource to set the configuration.\r
104\r
105**/\r
106EFI_STATUS\r
107MnpSetVlanVariable (\r
d1050b9d
MK
108 IN MNP_DEVICE_DATA *MnpDeviceData,\r
109 IN UINTN NumberOfVlan,\r
110 IN VLAN_TCI *VlanVariable\r
779ae357 111 );\r
112\r
113/**\r
114 Create a VLAN device or modify the configuration parameter of an\r
115 already-configured VLAN.\r
116\r
117 The Set() function is used to create a new VLAN device or change the VLAN\r
118 configuration parameters. If the VlanId hasn't been configured in the\r
119 physical Ethernet device, a new VLAN device will be created. If a VLAN with\r
120 this VlanId is already configured, then related configuration will be updated\r
121 as the input parameters.\r
122\r
123 If VlanId is zero, the VLAN device will send and receive untagged frames.\r
124 Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId.\r
125 If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned.\r
126 If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned.\r
127 If there is not enough system memory to perform the registration, then\r
128 EFI_OUT_OF_RESOURCES is returned.\r
129\r
130 @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.\r
131 @param[in] VlanId A unique identifier (1-4094) of the VLAN which is being created\r
132 or modified, or zero (0).\r
133 @param[in] Priority 3 bit priority in VLAN header. Priority 0 is default value. If\r
134 VlanId is zero (0), Priority is ignored.\r
135\r
136 @retval EFI_SUCCESS The VLAN is successfully configured.\r
137 @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:\r
138 - This is NULL.\r
139 - VlanId is an invalid VLAN Identifier.\r
140 - Priority is invalid.\r
141 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.\r
142\r
143**/\r
144EFI_STATUS\r
145EFIAPI\r
146VlanConfigSet (\r
d1050b9d
MK
147 IN EFI_VLAN_CONFIG_PROTOCOL *This,\r
148 IN UINT16 VlanId,\r
149 IN UINT8 Priority\r
779ae357 150 );\r
151\r
152/**\r
153 Find configuration information for specified VLAN or all configured VLANs.\r
154\r
155 The Find() function is used to find the configuration information for matching\r
156 VLAN and allocate a buffer into which those entries are copied.\r
157\r
158 @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.\r
159 @param[in] VlanId Pointer to VLAN identifier. Set to NULL to find all\r
160 configured VLANs.\r
161 @param[out] NumberOfVlan The number of VLANs which is found by the specified criteria.\r
162 @param[out] Entries The buffer which receive the VLAN configuration.\r
163\r
164 @retval EFI_SUCCESS The VLAN is successfully found.\r
165 @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:\r
166 - This is NULL.\r
167 - Specified VlanId is invalid.\r
168 @retval EFI_NOT_FOUND No matching VLAN is found.\r
169\r
170**/\r
171EFI_STATUS\r
172EFIAPI\r
173VlanConfigFind (\r
d1050b9d
MK
174 IN EFI_VLAN_CONFIG_PROTOCOL *This,\r
175 IN UINT16 *VlanId OPTIONAL,\r
176 OUT UINT16 *NumberOfVlan,\r
177 OUT EFI_VLAN_FIND_DATA **Entries\r
779ae357 178 );\r
179\r
180/**\r
181 Remove the configured VLAN device.\r
182\r
183 The Remove() function is used to remove the specified VLAN device.\r
184 If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned.\r
185 If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned.\r
186\r
187 @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.\r
188 @param[in] VlanId Identifier (0-4094) of the VLAN to be removed.\r
189\r
190 @retval EFI_SUCCESS The VLAN is successfully removed.\r
191 @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:\r
192 - This is NULL.\r
193 - VlanId is an invalid parameter.\r
194 @retval EFI_NOT_FOUND The to-be-removed VLAN does not exist.\r
195\r
196**/\r
197EFI_STATUS\r
198EFIAPI\r
199VlanConfigRemove (\r
d1050b9d
MK
200 IN EFI_VLAN_CONFIG_PROTOCOL *This,\r
201 IN UINT16 VlanId\r
779ae357 202 );\r
203\r
204#endif\r