2
0
forked from Ivasoft/openwrt

ar8216: add ARL table flushing per port

Adds functions for flushing ARL table entries per port.

Successfully tested on AR8327. Implementation for AR8216/AR8236/AR8316
is based on the AR8236 datasheet and assumes that the three chips
share a common ATU register layout.
Compile-tested only for AR8216/AR8236/AR8316.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

SVN-Revision: 46380
This commit is contained in:
Felix Fietkau
2015-07-15 08:17:28 +00:00
parent 2666403c3a
commit 00e599b0b7
4 changed files with 47 additions and 4 deletions

View File

@@ -765,6 +765,24 @@ ar8327_atu_flush(struct ar8xxx_priv *priv)
return ret;
}
static int
ar8327_atu_flush_port(struct ar8xxx_priv *priv, int port)
{
u32 t;
int ret;
ret = ar8216_wait_bit(priv, AR8327_REG_ATU_FUNC,
AR8327_ATU_FUNC_BUSY, 0);
if (!ret) {
t = (port << AR8327_ATU_PORT_NUM_S);
t |= AR8327_ATU_FUNC_OP_FLUSH_PORT;
t |= AR8327_ATU_FUNC_BUSY;
ar8xxx_write(priv, AR8327_REG_ATU_FUNC, t);
}
return ret;
}
static void
ar8327_vtu_op(struct ar8xxx_priv *priv, u32 op, u32 val)
{
@@ -1189,6 +1207,7 @@ const struct ar8xxx_chip ar8327_chip = {
.read_port_status = ar8327_read_port_status,
.read_port_eee_status = ar8327_read_port_eee_status,
.atu_flush = ar8327_atu_flush,
.atu_flush_port = ar8327_atu_flush_port,
.vtu_flush = ar8327_vtu_flush,
.vtu_load_vlan = ar8327_vtu_load_vlan,
.phy_fixup = ar8327_phy_fixup,
@@ -1222,6 +1241,7 @@ const struct ar8xxx_chip ar8337_chip = {
.read_port_status = ar8327_read_port_status,
.read_port_eee_status = ar8327_read_port_eee_status,
.atu_flush = ar8327_atu_flush,
.atu_flush_port = ar8327_atu_flush_port,
.vtu_flush = ar8327_vtu_flush,
.vtu_load_vlan = ar8327_vtu_load_vlan,
.phy_fixup = ar8327_phy_fixup,