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>
This commit is contained in:
Milan Krstic 2019-01-20 12:44:37 +01:00 committed by Jo-Philipp Wich
parent 76a629ee35
commit 39ede7bc67

View File

@ -730,6 +730,10 @@ static void ar7240sw_setup_port(struct ar7240sw *as, unsigned port, u8 portmask)
portmask = ar7240sw_port_mask(as, AR7240_PORT_CPU); 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 /* allow the port to talk to all other ports, but exclude its
* own ID to prevent frames from being reflected back to the * own ID to prevent frames from being reflected back to the
* port that they came from */ * port that they came from */