11 FILE_LICENCE ( GPL2_OR_LATER );
15 /** Tag control information */
17 /** Encapsulated protocol */
19 } __attribute__ (( packed ));
22 * Extract VLAN tag from tag control information
24 * @v tci Tag control information
27 #define VLAN_TAG( tci ) ( (tci) & 0x0fff )
30 * Extract VLAN priority from tag control information
32 * @v tci Tag control information
33 * @ret priority Priority
35 #define VLAN_PRIORITY( tci ) ( (tci) >> 13 )
38 * Construct VLAN tag control information
41 * @v priority Priority
42 * @ret tci Tag control information
44 #define VLAN_TCI( tag, priority ) ( ( (priority) << 13 ) | (tag) )
47 * Check VLAN tag is valid
50 * @ret is_valid VLAN tag is valid
52 #define VLAN_TAG_IS_VALID( tag ) ( (tag) < 0xfff )
55 * Check VLAN priority is valid
57 * @v priority VLAN priority
58 * @ret is_valid VLAN priority is valid
60 #define VLAN_PRIORITY_IS_VALID( priority ) ( (priority) <= 7 )
62 extern struct net_device * vlan_find ( struct net_device *trunk,
64 extern unsigned int vlan_tag ( struct net_device *netdev );
65 extern int vlan_can_be_trunk ( struct net_device *trunk );
66 extern int vlan_create ( struct net_device *trunk, unsigned int tag,
67 unsigned int priority );
68 extern int vlan_destroy ( struct net_device *netdev );
70 #endif /* _IPXE_VLAN_H */