Skip to content

Commit 196de82

Browse files
committed
realtek: dsa: drop stp_get() and stp_set() helpers
Remove unused code. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
1 parent 2c471ed commit 196de82

File tree

5 files changed

+0
-120
lines changed

5 files changed

+0
-120
lines changed

target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl838x.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -682,34 +682,6 @@ static int rtldsa_838x_stp_access(struct rtl838x_switch_priv *priv,
682682
return old_state;
683683
}
684684

685-
static int rtldsa_838x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[])
686-
{
687-
int idx = 1 - (port / 16);
688-
int bit = 2 * (port % 16);
689-
u32 cmd = 1 << 15 | /* Execute cmd */
690-
1 << 14 | /* Read */
691-
2 << 12 | /* Table type 0b10 */
692-
(msti & 0xfff);
693-
694-
priv->r->exec_tbl0_cmd(cmd);
695-
for (int i = 0; i < 2; i++)
696-
port_state[i] = sw_r32(priv->r->tbl_access_data_0(i));
697-
698-
return (port_state[idx] >> bit) & 3;
699-
}
700-
701-
static void rtl838x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
702-
{
703-
u32 cmd = 1 << 15 | /* Execute cmd */
704-
0 << 14 | /* Write */
705-
2 << 12 | /* Table type 0b10 */
706-
(msti & 0xfff);
707-
708-
for (int i = 0; i < 2; i++)
709-
sw_w32(port_state[i], priv->r->tbl_access_data_0(i));
710-
priv->r->exec_tbl0_cmd(cmd);
711-
}
712-
713685
static void rtl838x_traffic_set(int source, u64 dest_matrix)
714686
{
715687
rtl838x_set_port_reg(dest_matrix, rtl838x_port_iso_ctrl(source));
@@ -1890,8 +1862,6 @@ const struct rtldsa_config rtldsa_838x_cfg = {
18901862
.enable_bcast_flood = rtl838x_enable_bcast_flood,
18911863
.set_static_move_action = rtl838x_set_static_move_action,
18921864
.stp_access = rtldsa_838x_stp_access,
1893-
.stp_get = rtldsa_838x_stp_get,
1894-
.stp_set = rtl838x_stp_set,
18951865
.mac_port_ctrl = rtl838x_mac_port_ctrl,
18961866
.l2_port_new_salrn = rtl838x_l2_port_new_salrn,
18971867
.l2_port_new_sa_fwd = rtl838x_l2_port_new_sa_fwd,

target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl838x.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,8 +1443,6 @@ struct rtldsa_config {
14431443
void (*enable_bcast_flood)(int port, bool enable);
14441444
void (*set_static_move_action)(int port, bool forward);
14451445
int (*stp_access)(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 *new_state);
1446-
int (*stp_get)(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[]);
1447-
void (*stp_set)(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[]);
14481446
int mac_link_sts;
14491447
int (*mac_force_mode_ctrl)(int port);
14501448
int (*mac_port_ctrl)(int port);

target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl839x.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -749,33 +749,6 @@ static int rtldsa_839x_stp_access(struct rtl838x_switch_priv *priv,
749749
return old_state;
750750
}
751751

752-
static int rtldsa_839x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[])
753-
{
754-
int idx = 3 - ((port + 12) / 16);
755-
int bit = 2 * ((port + 12) % 16);
756-
u32 cmd = 1 << 16 | /* Execute cmd */
757-
0 << 15 | /* Read */
758-
5 << 12 | /* Table type 0b101 */
759-
(msti & 0xfff);
760-
761-
priv->r->exec_tbl0_cmd(cmd);
762-
for (int i = 0; i < 4; i++)
763-
port_state[i] = sw_r32(priv->r->tbl_access_data_0(i));
764-
765-
return (port_state[idx] >> bit) & 3;
766-
}
767-
768-
static void rtl839x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
769-
{
770-
u32 cmd = 1 << 16 | /* Execute cmd */
771-
1 << 15 | /* Write */
772-
5 << 12 | /* Table type 0b101 */
773-
(msti & 0xfff);
774-
for (int i = 0; i < 4; i++)
775-
sw_w32(port_state[i], priv->r->tbl_access_data_0(i));
776-
priv->r->exec_tbl0_cmd(cmd);
777-
}
778-
779752
/* Enables or disables the EEE/EEEP capability of a port */
780753
static void rtldsa_839x_set_mac_eee(struct rtl838x_switch_priv *priv, int port, bool enable)
781754
{
@@ -1806,8 +1779,6 @@ const struct rtldsa_config rtldsa_839x_cfg = {
18061779
.enable_bcast_flood = rtl839x_enable_bcast_flood,
18071780
.set_static_move_action = rtl839x_set_static_move_action,
18081781
.stp_access = rtldsa_839x_stp_access,
1809-
.stp_get = rtldsa_839x_stp_get,
1810-
.stp_set = rtl839x_stp_set,
18111782
.mac_force_mode_ctrl = rtl839x_mac_force_mode_ctrl,
18121783
.mac_link_sts = RTL839X_MAC_LINK_STS,
18131784
.mac_port_ctrl = rtl839x_mac_port_ctrl,

target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -668,34 +668,6 @@ static int rtldsa_930x_stp_access(struct rtl838x_switch_priv *priv,
668668
return old_state;
669669
}
670670

671-
static int rtldsa_930x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[])
672-
{
673-
int idx = 1 - ((port + 3) / 16);
674-
int bit = 2 * ((port + 3) % 16);
675-
u32 cmd = 1 << 17 | /* Execute cmd */
676-
0 << 16 | /* Read */
677-
4 << 12 | /* Table type 0b10 */
678-
(msti & 0xfff);
679-
680-
priv->r->exec_tbl0_cmd(cmd);
681-
for (int i = 0; i < 2; i++)
682-
port_state[i] = sw_r32(priv->r->tbl_access_data_0(i));
683-
684-
return (port_state[idx] >> bit) & 3;
685-
}
686-
687-
static void rtl930x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
688-
{
689-
u32 cmd = 1 << 17 | /* Execute cmd */
690-
1 << 16 | /* Write */
691-
4 << 12 | /* Table type 4 */
692-
(msti & 0xfff);
693-
694-
for (int i = 0; i < 2; i++)
695-
sw_w32(port_state[i], RTL930X_TBL_ACCESS_DATA_0(i));
696-
priv->r->exec_tbl0_cmd(cmd);
697-
}
698-
699671
static inline int rtl930x_mac_force_mode_ctrl(int p)
700672
{
701673
return RTL930X_MAC_FORCE_MODE_CTRL + (p << 2);
@@ -2869,8 +2841,6 @@ const struct rtldsa_config rtldsa_930x_cfg = {
28692841
.set_vlan_igr_filter = rtl930x_set_igr_filter,
28702842
.set_vlan_egr_filter = rtl930x_set_egr_filter,
28712843
.stp_access = rtldsa_930x_stp_access,
2872-
.stp_get = rtldsa_930x_stp_get,
2873-
.stp_set = rtl930x_stp_set,
28742844
.mac_link_sts = RTL930X_MAC_LINK_STS,
28752845
.mac_force_mode_ctrl = rtl930x_mac_force_mode_ctrl,
28762846
.mac_port_ctrl = rtl930x_mac_port_ctrl,

target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl931x.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -291,33 +291,6 @@ static int rtldsa_931x_stp_access(struct rtl838x_switch_priv *priv,
291291
return old_state;
292292
}
293293

294-
static int rtldsa_931x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, int port, u32 port_state[])
295-
{
296-
int idx = 3 - ((port + 8) / 16);
297-
int bit = 2 * ((port + 8) % 16);
298-
u32 cmd = 1 << 20 | /* Execute cmd */
299-
0 << 19 | /* Read */
300-
5 << 15 | /* Table type 0b101 */
301-
(msti & 0x3fff);
302-
303-
priv->r->exec_tbl0_cmd(cmd);
304-
for (int i = 0; i < 4; i++)
305-
port_state[i] = sw_r32(priv->r->tbl_access_data_0(i));
306-
307-
return (port_state[idx] >> bit) & 3;
308-
}
309-
310-
static void rtl931x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
311-
{
312-
u32 cmd = 1 << 20 | /* Execute cmd */
313-
1 << 19 | /* Write */
314-
5 << 15 | /* Table type 0b101 */
315-
(msti & 0x3fff);
316-
for (int i = 0; i < 4; i++)
317-
sw_w32(port_state[i], priv->r->tbl_access_data_0(i));
318-
priv->r->exec_tbl0_cmd(cmd);
319-
}
320-
321294
static inline int rtldsa_931x_trk_mbr_ctr(int group)
322295
{
323296
return RTL931X_TRK_MBR_CTRL + (group << 3);
@@ -2007,8 +1980,6 @@ const struct rtldsa_config rtldsa_931x_cfg = {
20071980
.vlan_profile_setup = rtl931x_vlan_profile_setup,
20081981
.vlan_fwd_on_inner = rtl931x_vlan_fwd_on_inner,
20091982
.stp_access = rtldsa_931x_stp_access,
2010-
.stp_get = rtldsa_931x_stp_get,
2011-
.stp_set = rtl931x_stp_set,
20121983
.mac_force_mode_ctrl = rtl931x_mac_force_mode_ctrl,
20131984
.mac_link_sts = RTL931X_MAC_LINK_STS,
20141985
.mac_port_ctrl = rtl931x_mac_port_ctrl,

0 commit comments

Comments
 (0)