sys/net: move DOT1Q_VID_* constants to ethernet.h

These are generally useful to anything dealing with 802.1q and aren't
specific to if_vlan, so move them to <net/ethernet.h> and remove the
_KERNEL gate.

While here, document what they actually mean.

Reviewed by:	kp, des
Approved by:	des (mentor)
Differential Revision:	https://reviews.freebsd.org/D50570
This commit is contained in:
Lexi Winter
2025-07-02 02:19:34 +01:00
parent 9c2509f831
commit 533c0d345b
2 changed files with 17 additions and 7 deletions
+17
View File
@@ -80,6 +80,23 @@ struct ether_addr {
(((addr)[0] | (addr)[1] | (addr)[2] | \
(addr)[3] | (addr)[4] | (addr)[5]) == 0x00)
/*
* 802.1q VID constants from IEEE 802.1Q-2014, table 9-2.
*/
/* Null VID: The tag contains only PCP (priority) and DEI information. */
#define DOT1Q_VID_NULL 0x0
/* The default PVID for a bridge port. NB: bridge(4) does not honor this. */
#define DOT1Q_VID_DEF_PVID 0x1
/* The default SR_PVID for SRP Stream related traffic. */
#define DOT1Q_VID_DEF_SR_PVID 0x2
/* A VID reserved for implementation use, not permitted on the wire. */
#define DOT1Q_VID_RSVD_IMPL 0xfff
/* The lowest valid VID. */
#define DOT1Q_VID_MIN 0x1
/* The highest valid VID. */
#define DOT1Q_VID_MAX 0xffe
/*
* This is the type of the VLAN ID inside the tag, not the tag itself.
*/
-7
View File
@@ -126,13 +126,6 @@ struct vlanreq {
#define VLAN_PCP_MAX 7
#define DOT1Q_VID_NULL 0x0
#define DOT1Q_VID_DEF_PVID 0x1
#define DOT1Q_VID_DEF_SR_PVID 0x2
#define DOT1Q_VID_RSVD_IMPL 0xfff
#define DOT1Q_VID_MIN 1 /* minimum valid vlan id */
#define DOT1Q_VID_MAX 4094 /* maximum valid vlan id */
/*
* 802.1q full tag. Proto and vid are stored in host byte order.
*/