]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: dsa: drop soc_info usage
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 5 Apr 2026 08:17:00 +0000 (10:17 +0200)
committerRobert Marko <robimarko@gmail.com>
Tue, 7 Apr 2026 08:14:52 +0000 (10:14 +0200)
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 <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22794
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/qos.c

index 8458003396998e9c383a92f52ba73408e1b89b78..57687d5cd1426da25b217497625ae6fff2fed7d7 100644 (file)
@@ -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);