diff options
| author | Michael Brown | 2022-12-09 15:40:54 +0100 |
|---|---|---|
| committer | Michael Brown | 2022-12-14 12:05:37 +0100 |
| commit | 5e62b4bc6c7bd7c6929b3fe540fb1ba8744fd16c (patch) | |
| tree | 2092637af99dc3396ce2d949fe327b30d4c9160c /src/include | |
| parent | [build] Disable dangling pointer checking for GCC (diff) | |
| download | ipxe-5e62b4bc6c7bd7c6929b3fe540fb1ba8744fd16c.tar.gz ipxe-5e62b4bc6c7bd7c6929b3fe540fb1ba8744fd16c.tar.xz ipxe-5e62b4bc6c7bd7c6929b3fe540fb1ba8744fd16c.zip | |
[vlan] Allow external code to identify VLAN priority as well as tag
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/ipxe/vlan.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/include/ipxe/vlan.h b/src/include/ipxe/vlan.h index 7f93439b3..e4baf4cf0 100644 --- a/src/include/ipxe/vlan.h +++ b/src/include/ipxe/vlan.h @@ -61,7 +61,19 @@ struct vlan_header { */ #define VLAN_PRIORITY_IS_VALID( priority ) ( (priority) <= 7 ) -extern unsigned int vlan_tag ( struct net_device *netdev ); +extern unsigned int vlan_tci ( struct net_device *netdev ); + +/** + * Get the VLAN tag + * + * @v netdev Network device + * @ret tag VLAN tag, or 0 if device is not a VLAN device + */ +static inline __attribute__ (( always_inline )) unsigned int +vlan_tag ( struct net_device *netdev ) { + return VLAN_TAG ( vlan_tci ( netdev ) ); +} + extern int vlan_can_be_trunk ( struct net_device *trunk ); extern int vlan_create ( struct net_device *trunk, unsigned int tag, unsigned int priority ); |
