index = n - (pos >> 4) - 1;
bit = (pos << 1) % 32;
- priv->r->stp_get(priv, msti, port_state);
+ priv->r->stp_get(priv, msti, port, port_state);
mutex_unlock(&priv->reg_mutex);
index = n - (pos >> 4) - 1;
bit = (pos << 1) % 32;
- priv->r->stp_get(priv, mst_slot, port_state);
+ priv->r->stp_get(priv, mst_slot, port, port_state);
pr_debug("Current state, port %d: %d\n", port, (port_state[index] >> bit) & 3);
port_state[index] &= ~(3 << bit);
RTL838X_L2_PORT_STATIC_MV_ACT(port));
}
-static void rtl838x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
+static int rtldsa_838x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[])
{
u32 cmd = 1 << 15 | /* Execute cmd */
1 << 14 | /* Read */
for (int i = 0; i < 2; i++)
port_state[i] = sw_r32(priv->r->tbl_access_data_0(i));
+
+ return 0;
}
static void rtl838x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
.enable_mcast_flood = rtl838x_enable_mcast_flood,
.enable_bcast_flood = rtl838x_enable_bcast_flood,
.set_static_move_action = rtl838x_set_static_move_action,
- .stp_get = rtl838x_stp_get,
+ .stp_get = rtldsa_838x_stp_get,
.stp_set = rtl838x_stp_set,
.mac_port_ctrl = rtl838x_mac_port_ctrl,
.l2_port_new_salrn = rtl838x_l2_port_new_salrn,
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[]);
+ int (*stp_get)(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[]);
void (*stp_set)(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[]);
int (*mac_force_mode_ctrl)(int port);
int (*mac_port_ctrl)(int port);
pr_debug("VLAN profile %d: raw %08x, %08x\n", profile, p[0], p[1]);
}
-static void rtl839x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
+static int rtldsa_839x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[])
{
u32 cmd = 1 << 16 | /* Execute cmd */
0 << 15 | /* Read */
for (int i = 0; i < 4; i++)
port_state[i] = sw_r32(priv->r->tbl_access_data_0(i));
+
+ return 0;
}
static void rtl839x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
.enable_mcast_flood = rtl839x_enable_mcast_flood,
.enable_bcast_flood = rtl839x_enable_bcast_flood,
.set_static_move_action = rtl839x_set_static_move_action,
- .stp_get = rtl839x_stp_get,
+ .stp_get = rtldsa_839x_stp_get,
.stp_set = rtl839x_stp_set,
.mac_force_mode_ctrl = rtl839x_mac_force_mode_ctrl,
.mac_port_ctrl = rtl839x_mac_port_ctrl,
RTL930X_L2_LRN_PORT_CONSTRT_CTRL + port * 4);
}
-static void rtl930x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
+static int rtldsa_930x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[])
{
u32 cmd = 1 << 17 | /* Execute cmd */
0 << 16 | /* Read */
for (int i = 0; i < 2; i++)
port_state[i] = sw_r32(RTL930X_TBL_ACCESS_DATA_0(i));
pr_debug("MSTI: %d STATE: %08x, %08x\n", msti, port_state[0], port_state[1]);
+
+ return 0;
}
static void rtl930x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
.vlan_fwd_on_inner = rtl930x_vlan_fwd_on_inner,
.set_vlan_igr_filter = rtl930x_set_igr_filter,
.set_vlan_egr_filter = rtl930x_set_egr_filter,
- .stp_get = rtl930x_stp_get,
+ .stp_get = rtldsa_930x_stp_get,
.stp_set = rtl930x_stp_set,
.mac_force_mode_ctrl = rtl930x_mac_force_mode_ctrl,
.mac_port_ctrl = rtl930x_mac_port_ctrl,
index, (u32)(profile[0] & (3 << 14)), profile[1], profile[2], profile[3]);
}
-static void rtl931x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
+static int rtldsa_931x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[])
{
u32 cmd = 1 << 20 | /* Execute cmd */
0 << 19 | /* Read */
for (int i = 0; i < 4; i++)
port_state[i] = sw_r32(priv->r->tbl_access_data_0(i));
+
+ return 0;
}
static void rtl931x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
.vlan_profile_dump = rtl931x_vlan_profile_dump,
.vlan_profile_setup = rtl931x_vlan_profile_setup,
.vlan_fwd_on_inner = rtl931x_vlan_fwd_on_inner,
- .stp_get = rtl931x_stp_get,
+ .stp_get = rtldsa_931x_stp_get,
.stp_set = rtl931x_stp_set,
.mac_force_mode_ctrl = rtl931x_mac_force_mode_ctrl,
.mac_port_ctrl = rtl931x_mac_port_ctrl,