realtek: fix standalone ports in presence of static fdb entries
[openwrt/staging/wigyori.git] / target / linux / realtek / files-5.15 / drivers / net / dsa / rtl83xx / rtl838x.h
index a4bfc285a60ce2dfe3403491cfbee4d71ce139ea..bfab576e06ecedebe6f12eebd8a12fe0b4cba50f 100644 (file)
 #define RTL930X_L2_PORT_NEW_SA_FWD(p)          (0x8FF4 + (((p / 10) << 2)))
 #define RTL931X_L2_PORT_NEW_SA_FWD(p)          (0xC830 + (((p / 10) << 2)))
 
+#define RTL838X_L2_PORT_MV_ACT(p)              (0x335c + (((p >> 4) << 2)))
+#define RTL839X_L2_PORT_MV_ACT(p)              (0x3b80 + (((p >> 4) << 2)))
+
+#define RTL838X_L2_PORT_STATIC_MV_ACT(p)       (0x327c + (((p >> 4) << 2)))
+#define RTL839X_L2_PORT_STATIC_MV_ACT(p)       (0x38dc + (((p >> 4) << 2)))
+
+#define MV_ACT_PORT_SHIFT(p)                   ((p % 16) * 2)
+#define MV_ACT_MASK                            0x3
+#define MV_ACT_FORWARD                         0
+#define MV_ACT_DROP                            1
+#define MV_ACT_TRAP2CPU                                2
+#define MV_ACT_COPY2CPU                                3
+
 #define RTL930X_ST_CTRL                                (0x8798)
 
 #define RTL930X_L2_PORT_SABLK_CTRL             (0x905c)
@@ -978,6 +991,7 @@ struct rtl838x_reg {
        void (*enable_flood)(int port, bool enable);
        void (*enable_mcast_flood)(int port, bool enable);
        void (*enable_bcast_flood)(int port, bool enable);
+       void (*set_static_move_action)(int port, bool forward);
        void (*stp_get)(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[]);
        void (*stp_set)(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[]);
        int  (*mac_force_mode_ctrl)(int port);