summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.h
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2013-04-19 18:07:00 +0200
committerAntonio Quartulli <ordex@autistici.org>2013-05-29 02:44:55 +0200
commiteb2deb6b39b1597577c1635e9ebf319f1ae02213 (patch)
tree94cea78183fa4e5da3245d8ac07ce8020f08ccc8 /net/batman-adv/main.h
parentaa27c31265f111ff73d948a5846a3f193376491e (diff)
downloadlinux-eb2deb6b39b1597577c1635e9ebf319f1ae02213.tar.bz2
batman-adv: change VID semantic in the BLA code
In order to make batman-adv fully vlan aware later, the semantic used for variables storing the VLAN ID values has to be changed in order to be adapted to the new one which will be used batman-adv wide. In particular, the VID has to be an "_unsigned_ short int" and its 4 MSB will be used as a flag bitfield, while the remaining 12 bits are used to store the real VID value Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Diffstat (limited to 'net/batman-adv/main.h')
-rw-r--r--net/batman-adv/main.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index ea1a3bafe9c3..6f25ef29f305 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -162,6 +162,17 @@ enum batadv_uev_type {
#include <linux/seq_file.h>
#include "types.h"
+/**
+ * batadv_vlan_flags - flags for the four MSB of any vlan ID field
+ * @BATADV_VLAN_HAS_TAG: whether the field contains a valid vlan tag or not
+ */
+enum batadv_vlan_flags {
+ BATADV_VLAN_HAS_TAG = BIT(15),
+};
+
+#define BATADV_PRINT_VID(vid) (vid & BATADV_VLAN_HAS_TAG ? \
+ (int)(vid & VLAN_VID_MASK) : -1)
+
extern char batadv_routing_algo[];
extern struct list_head batadv_hardif_list;