ar71xx: ag71xx: preserve port mirror flags during swconfig apply
[openwrt/openwrt.git] / target / linux / ar71xx / files / drivers / net / ethernet / atheros / ag71xx / ag71xx_ar7240.c
index 3f2f64e2aef80075b8ca804af1cb90d248b913f7..2859c0dbe1641f6215006063248bc8a3810cbd4c 100644 (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);
        }
 
+       /* 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 */