Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_vlan_var.h
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
struct vlanreq { | struct vlanreq { | ||||
char vlr_parent[IFNAMSIZ]; | char vlr_parent[IFNAMSIZ]; | ||||
u_short vlr_tag; | u_short vlr_tag; | ||||
}; | }; | ||||
#define SIOCSETVLAN SIOCSIFGENERIC | #define SIOCSETVLAN SIOCSIFGENERIC | ||||
#define SIOCGETVLAN SIOCGIFGENERIC | #define SIOCGETVLAN SIOCGIFGENERIC | ||||
#define SIOCGVLANPCP _IOWR('i', 152, struct ifreq) /* Get VLAN PCP */ | |||||
#define SIOCSVLANPCP _IOW('i', 153, struct ifreq) /* Set VLAN PCP */ | |||||
/* | |||||
* Names for 802.1q priorities ("802.1p"). Notice that in this scheme, | |||||
* (0 < 1), allowing default 0-tagged traffic to take priority over background | |||||
* tagged traffic. | |||||
*/ | |||||
#define IEEE8021Q_PCP_BK 1 /* Background (lowest) */ | |||||
#define IEEE8021Q_PCP_BE 0 /* Best effort (default) */ | |||||
#define IEEE8021Q_PCP_EE 2 /* Excellent effort */ | |||||
#define IEEE8021Q_PCP_CA 3 /* Critical applications */ | |||||
#define IEEE8021Q_PCP_VI 4 /* Video, < 100ms latency */ | |||||
#define IEEE8021Q_PCP_VO 5 /* Video, < 10ms latency */ | |||||
#define IEEE8021Q_PCP_IC 6 /* Internetwork control */ | |||||
#define IEEE8021Q_PCP_NC 7 /* Network control (highest) */ | |||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* | /* | ||||
* Drivers that are capable of adding and removing the VLAN header | * Drivers that are capable of adding and removing the VLAN header | ||||
* in hardware indicate they support this by marking IFCAP_VLAN_HWTAGGING | * in hardware indicate they support this by marking IFCAP_VLAN_HWTAGGING | ||||
* in if_capabilities. Drivers for hardware that is capable | * in if_capabilities. Drivers for hardware that is capable | ||||
* of handling larger MTU's that may include a software-appended | * of handling larger MTU's that may include a software-appended | ||||
* VLAN header w/o lowering the normal MTU should mark IFCAP_VLAN_MTU | * VLAN header w/o lowering the normal MTU should mark IFCAP_VLAN_MTU | ||||
* in if_capabilities; this notifies the VLAN code it can leave the | * in if_capabilities; this notifies the VLAN code it can leave the | ||||
Show All 20 Lines | |||||
* ... = m->m_pkthdr.ether_vtag; // htons()? | * ... = m->m_pkthdr.ether_vtag; // htons()? | ||||
* ... pass tag to hardware ... | * ... pass tag to hardware ... | ||||
* } | * } | ||||
* | * | ||||
* Note that a driver must indicate it supports hardware VLAN | * Note that a driver must indicate it supports hardware VLAN | ||||
* stripping/insertion by marking IFCAP_VLAN_HWTAGGING in | * stripping/insertion by marking IFCAP_VLAN_HWTAGGING in | ||||
* if_capabilities. | * if_capabilities. | ||||
*/ | */ | ||||
/* | |||||
* The 802.1q code may also tag mbufs with the PCP (priority) field for use in | |||||
* other layers of the stack, in which case an m_tag will be used. This is | |||||
* semantically quite different from use of the ether_vtag field, which is | |||||
* defined only between the device driver and VLAN layer. | |||||
*/ | |||||
#define MTAG_8021Q 1326104895 | |||||
#define MTAG_8021Q_PCP_IN 0 /* Input priority. */ | |||||
#define MTAG_8021Q_PCP_OUT 1 /* Output priority. */ | |||||
#define VLAN_CAPABILITIES(_ifp) do { \ | #define VLAN_CAPABILITIES(_ifp) do { \ | ||||
if ((_ifp)->if_vlantrunk != NULL) \ | if ((_ifp)->if_vlantrunk != NULL) \ | ||||
(*vlan_trunk_cap_p)(_ifp); \ | (*vlan_trunk_cap_p)(_ifp); \ | ||||
} while (0) | } while (0) | ||||
#define VLAN_TRUNKDEV(_ifp) \ | #define VLAN_TRUNKDEV(_ifp) \ | ||||
(_ifp)->if_type == IFT_L2VLAN ? (*vlan_trunkdev_p)((_ifp)) : NULL | (_ifp)->if_type == IFT_L2VLAN ? (*vlan_trunkdev_p)((_ifp)) : NULL | ||||
Show All 28 Lines |