summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/b53/b53_regs.h
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2020-04-20 20:26:54 -0700
committerDavid S. Miller <davem@davemloft.net>2020-04-22 12:50:41 -0700
commit6344dbde6a27d10d16246d734b968f84887841e2 (patch)
tree6fe692713d684f290ee80ed9a1d99d30a0b283f1 /drivers/net/dsa/b53/b53_regs.h
parentc2e77a18a7ed65eb48f6e389b6a59a0fd753646a (diff)
net: dsa: b53: Rework ARL bin logic
When asking the ARL to read a MAC address, we will get a number of bins returned in a single read. Out of those bins, there can essentially be 3 states: - all bins are full, we have no space left, and we can either replace an existing address or return that full condition - the MAC address was found, then we need to return its bin index and modify that one, and only that one - the MAC address was not found and we have a least one bin free, we use that bin index location then The code would unfortunately fail on all counts. Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/b53/b53_regs.h')
-rw-r--r--drivers/net/dsa/b53/b53_regs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h
index d914e756cdab..14f617e9173d 100644
--- a/drivers/net/dsa/b53/b53_regs.h
+++ b/drivers/net/dsa/b53/b53_regs.h
@@ -323,6 +323,9 @@
#define ARLTBL_STATIC BIT(15)
#define ARLTBL_VALID BIT(16)
+/* Maximum number of bin entries in the ARL for all switches */
+#define B53_ARLTBL_MAX_BIN_ENTRIES 4
+
/* ARL Search Control Register (8 bit) */
#define B53_ARL_SRCH_CTL 0x50
#define B53_ARL_SRCH_CTL_25 0x20