diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-07-15 08:17:28 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-07-15 08:17:28 +0000 |
commit | 00e599b0b7ff50c78a1b6ac2f2db1478f6bca358 (patch) | |
tree | 023aaced6bddb939dd27edae4d5b234993b9d74a /target/linux/generic/files/drivers/net/phy/ar8327.c | |
parent | 2666403c3a850088a440d65f1a49004f1e9d926c (diff) | |
download | mtk-20170518-00e599b0b7ff50c78a1b6ac2f2db1478f6bca358.zip mtk-20170518-00e599b0b7ff50c78a1b6ac2f2db1478f6bca358.tar.gz mtk-20170518-00e599b0b7ff50c78a1b6ac2f2db1478f6bca358.tar.bz2 |
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
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/ar8327.c')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8327.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index a6dd7d8..fd4a262 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, |