aboutsummaryrefslogtreecommitdiff
path: root/include/linux/dsa
diff options
context:
space:
mode:
authorPawel Dembicki <paweldembicki@gmail.com>2024-07-13 23:16:15 +0200
committerJakub Kicinski <kuba@kernel.org>2024-07-15 06:55:16 -0700
commitce20fdd670ac375a4e3dff91c2888ad9ff9eef56 (patch)
tree85e2130dd6f958093f7e75139b8a48ed4067b8dc /include/linux/dsa
parente3386ec4ec9083522c36ab0ddfc638c90395c741 (diff)
net: dsa: Define max num of bridges in tag8021q implementation
Max number of bridges in tag8021q implementation is strictly limited by VBID size: 3 bits. But zero is reserved and only 7 values can be used. This patch adds define which describe maximum possible value. Suggested-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/20240713211620.1125910-10-paweldembicki@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/dsa')
-rw-r--r--include/linux/dsa/8021q.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/dsa/8021q.h b/include/linux/dsa/8021q.h
index f3664ee12170..1dda2a13b832 100644
--- a/include/linux/dsa/8021q.h
+++ b/include/linux/dsa/8021q.h
@@ -8,6 +8,11 @@
#include <net/dsa.h>
#include <linux/types.h>
+/* VBID is limited to three bits only and zero is reserved.
+ * Only 7 bridges can be enumerated.
+ */
+#define DSA_TAG_8021Q_MAX_NUM_BRIDGES 7
+
int dsa_tag_8021q_register(struct dsa_switch *ds, __be16 proto);
void dsa_tag_8021q_unregister(struct dsa_switch *ds);