From 00e599b0b7ff50c78a1b6ac2f2db1478f6bca358 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 15 Jul 2015 08:17:28 +0000 Subject: 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 SVN-Revision: 46380 --- target/linux/generic/files/drivers/net/phy/ar8327.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'target/linux/generic/files/drivers/net/phy/ar8327.c') diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index a6dd7d8e26..fd4a2626ed 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -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, -- cgit v1.2.3