aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorMilan Krstic <milan.krstic@gmail.com>2019-01-20 12:44:37 +0100
committerJo-Philipp Wich <jo@mein.io>2019-01-22 09:05:59 +0100
commit39ede7bc67bbb54ae1645fba9f6b7a2bcc9b8c0f (patch)
tree600f6bc6883b53b9703c7625cd6657ea70af2182 /target/linux
parent76a629ee35d6f3b0d428acc2674fa49caddf3745 (diff)
downloadupstream-39ede7bc67bbb54ae1645fba9f6b7a2bcc9b8c0f.tar.gz
upstream-39ede7bc67bbb54ae1645fba9f6b7a2bcc9b8c0f.tar.bz2
upstream-39ede7bc67bbb54ae1645fba9f6b7a2bcc9b8c0f.zip
ar71xx: ag71xx: preserve port mirror flags during swconfig apply
The swconfig load operation always triggers 'apply' function which in this driver currently clears port mirroring flags effectively undoing port mirroring configuration. This fix preserves port mirroring flags during apply. Signed-off-by: Milan Krstic <milan.krstic@gmail.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
index 3f2f64e2ae..2859c0dbe1 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
@@ -730,6 +730,10 @@ static void ar7240sw_setup_port(struct ar7240sw *as, unsigned port, u8 portmask)
portmask = ar7240sw_port_mask(as, AR7240_PORT_CPU);
}
+ /* preserve mirror rx&tx flags */
+ ctrl |= ar7240sw_reg_read(mii, AR7240_REG_PORT_CTRL(port)) &
+ (AR7240_PORT_CTRL_MIRROR_RX | AR7240_PORT_CTRL_MIRROR_TX);
+
/* allow the port to talk to all other ports, but exclude its
* own ID to prevent frames from being reflected back to the
* port that they came from */