From 1aedb2af54577386986023aee0ad59d47d18600c Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 5 Apr 2026 10:17:00 +0200 Subject: [PATCH] realtek: dsa: drop soc_info usage The soc_info structure should only be used in the mach setup functions. Drop its usage in the dsa qos functions. Instead derive the data from the das private structure. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/22794 Signed-off-by: Robert Marko --- .../realtek/files-6.18/drivers/net/dsa/rtl83xx/qos.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/qos.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/qos.c index 8458003396..57687d5cd1 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/qos.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/qos.c @@ -298,14 +298,14 @@ void rtldsa_838x_qos_init(struct rtl838x_switch_priv *priv) sw_w32(v, RTL838X_PRI_SEL_IPRI_REMAP); /* On all ports set scheduler type to WFQ */ - for (int i = 0; i <= soc_info.cpu_port; i++) + for (int i = 0; i <= priv->r->cpu_port; i++) sw_w32(0, RTL838X_SCHED_P_TYPE_CTRL(i)); /* Enable egress scheduler for CPU-Port */ - sw_w32_mask(0, BIT(8), RTL838X_SCHED_LB_CTRL(soc_info.cpu_port)); + sw_w32_mask(0, BIT(8), RTL838X_SCHED_LB_CTRL(priv->r->cpu_port)); /* Enable egress drop allways on */ - sw_w32_mask(0, BIT(11), RTL838X_FC_P_EGR_DROP_CTRL(soc_info.cpu_port)); + sw_w32_mask(0, BIT(11), RTL838X_FC_P_EGR_DROP_CTRL(priv->r->cpu_port)); /* Give special trap frames priority 7 (BPDUs) and routing exceptions: */ sw_w32_mask(0, 7 << 3 | 7, RTL838X_QM_PKT2CPU_INTPRI_2); @@ -321,13 +321,13 @@ void rtldsa_839x_qos_init(struct rtl838x_switch_priv *priv) pr_info("RTL839X_PRI_SEL_TBL_CTRL(i): %08x\n", sw_r32(RTL839X_PRI_SEL_TBL_CTRL(0))); rtl839x_setup_default_prio2queue(); - for (int port = 0; port < soc_info.cpu_port; port++) + for (int port = 0; port < priv->r->cpu_port; port++) sw_w32(7, RTL839X_QM_PORT_QNUM(port)); /* CPU-port gets queue number 7 */ - sw_w32(7, RTL839X_QM_PORT_QNUM(soc_info.cpu_port)); + sw_w32(7, RTL839X_QM_PORT_QNUM(priv->r->cpu_port)); - for (int port = 0; port <= soc_info.cpu_port; port++) { + for (int port = 0; port <= priv->r->cpu_port; port++) { rtldsa_839x_set_ingress_priority(port, 0); rtl839x_set_scheduling_algorithm(priv, port, WEIGHTED_FAIR_QUEUE); rtl839x_set_scheduling_queue_weights(priv, port, rtldsa_default_queue_weights);