net/vlan: add some macro for vlan

Refer:
https://github.com/torvalds/linux/blob/v6.8/include/linux/if_vlan.h#L73-L76

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
This commit is contained in:
gaohedong
2024-11-20 09:03:21 +08:00
committed by Xiang Xiao
parent 3f553999da
commit 44bc5ed635
2 changed files with 88 additions and 1 deletions
+12 -1
View File
@@ -2,7 +2,8 @@
* include/nuttx/net/ethernet.h
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2007, 2009-2012, 2015 Gregory Nutt. All rights reserved.
* SPDX-FileCopyrightText: 2007, 2009-2012, 2015 Gregory Nutt. All rights
* reserved.
* SPDX-FileCopyrightText: 2001-2003, Adam Dunkels. All rights reserved.
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* SPDX-FileContributor: Adam Dunkels <adam@dunkels.com>
@@ -63,6 +64,16 @@
#define TPID_8021QVLAN ETHERTYPE_VLAN
/* These are some control information associated with QVLAN tagged
* Ethernet packets.
*/
#define VLAN_PRIO_MASK 0xe000 /* Priority Code Point */
#define VLAN_PRIO_SHIFT 13
#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator / Drop Eligible Indicator */
#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */
#define VLAN_N_VID 4096
/* These are some of the types associated with QVLAN tagged
* Ethernet packets.
*/