summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/vitesse-vsc73xx.h
diff options
context:
space:
mode:
authorPawel Dembicki <paweldembicki@gmail.com>2024-04-17 22:50:47 +0200
committerJakub Kicinski <kuba@kernel.org>2024-04-22 14:21:32 -0700
commit6cc5280a08899e704336446c300af2ca80da9e5f (patch)
treeb9460b475bd90584aeddc1420b81ebe8a44d3935 /drivers/net/dsa/vitesse-vsc73xx.h
parent12af94b2955fa74548001624839aadce505fe957 (diff)
net: dsa: vsc73xx: Add define for max num of ports
This patch introduces a new define: VSC73XX_MAX_NUM_PORTS, which can be used in the future instead of a hardcoded value. Currently, the only hardcoded value is vsc->ds->num_ports. It is being replaced with the new define. Suggested-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20240417205048.3542839-5-paweldembicki@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/vitesse-vsc73xx.h')
-rw-r--r--drivers/net/dsa/vitesse-vsc73xx.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/dsa/vitesse-vsc73xx.h b/drivers/net/dsa/vitesse-vsc73xx.h
index 30b1f0a36566..fee1378508b5 100644
--- a/drivers/net/dsa/vitesse-vsc73xx.h
+++ b/drivers/net/dsa/vitesse-vsc73xx.h
@@ -3,6 +3,17 @@
#include <linux/etherdevice.h>
#include <linux/gpio/driver.h>
+/* The VSC7395 switch chips have 5+1 ports which means 5 ordinary ports and
+ * a sixth CPU port facing the processor with an RGMII interface. These ports
+ * are numbered 0..4 and 6, so they leave a "hole" in the port map for port 5,
+ * which is invalid.
+ *
+ * The VSC7398 has 8 ports, port 7 is again the CPU port.
+ *
+ * We allocate 8 ports and avoid access to the nonexistent ports.
+ */
+#define VSC73XX_MAX_NUM_PORTS 8
+
/**
* struct vsc73xx - VSC73xx state container
*/