]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: 6.12: align internal/external mac eee function names
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Thu, 29 May 2025 18:04:37 +0000 (14:04 -0400)
committerRobert Marko <robimarko@gmail.com>
Wed, 11 Jun 2025 20:27:22 +0000 (22:27 +0200)
The DSA driver uses set_mac_eee() for the outside API while
the interal helper is called port_eee_set(). Align that.
Additionally do not call the internal helpers directly by
the function names but use the register assignments.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18935
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl839x.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c

index d501b7d2c48f9e5c8f2c70ab9eb2a1ed170f141d..961b82e5224f8fce645b051fe89d0913c505daad 100644 (file)
@@ -1115,7 +1115,7 @@ static void rtl83xx_port_disable(struct dsa_switch *ds, int port)
        priv->ports[port].enable = false;
 }
 
-static int rtl83xx_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
+static int rtldsa_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
 {
        struct rtl838x_switch_priv *priv = ds->priv;
 
@@ -1124,7 +1124,7 @@ static int rtl83xx_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_k
                priv->r->init_eee(priv, true);
        }
 
-       priv->r->port_eee_set(priv, port, e->eee_enabled);
+       priv->r->set_mac_eee(priv, port, e->eee_enabled);
 
        if (e->eee_enabled)
                pr_info("Enabled EEE for port %d\n", port);
@@ -2217,7 +2217,7 @@ const struct dsa_switch_ops rtl83xx_switch_ops = {
        .port_disable           = rtl83xx_port_disable,
 
        .get_mac_eee            = rtldsa_get_mac_eee,
-       .set_mac_eee            = rtl83xx_set_mac_eee,
+       .set_mac_eee            = rtldsa_set_mac_eee,
 
        .set_ageing_time        = rtl83xx_set_ageing_time,
        .port_bridge_join       = rtl83xx_port_bridge_join,
@@ -2275,7 +2275,7 @@ const struct dsa_switch_ops rtl930x_switch_ops = {
        .port_disable           = rtl83xx_port_disable,
 
        .get_mac_eee            = rtldsa_get_mac_eee,
-       .set_mac_eee            = rtl83xx_set_mac_eee,
+       .set_mac_eee            = rtldsa_set_mac_eee,
 
        .set_ageing_time        = rtl83xx_set_ageing_time,
        .port_bridge_join       = rtl83xx_port_bridge_join,
index 3c21ac60b2babf0a4232cba4445ad3a97cfcb823..2941b1ac80ec8cc92f60017f8da553fba4653108 100644 (file)
@@ -598,7 +598,7 @@ static void rtl838x_traffic_disable(int source, int dest)
 }
 
 /* Enables or disables the EEE/EEEP capability of a port */
-static void rtl838x_port_eee_set(struct rtl838x_switch_priv *priv, int port, bool enable)
+static void rtldsa_838x_set_mac_eee(struct rtl838x_switch_priv *priv, int port, bool enable)
 {
        u32 v;
 
@@ -635,7 +635,7 @@ static void rtl838x_init_eee(struct rtl838x_switch_priv *priv, bool enable)
        /* Enable EEE MAC support on ports */
        for (int i = 0; i < priv->cpu_port; i++) {
                if (priv->ports[i].phy)
-                       rtl838x_port_eee_set(priv, i, enable);
+                       priv->r->set_mac_eee(priv, i, enable);
        }
        priv->eee_enabled = enable;
 }
@@ -1724,7 +1724,7 @@ const struct rtl838x_reg rtl838x_reg = {
        .rma_bpdu_fld_pmask = RTL838X_RMA_BPDU_FLD_PMSK,
        .spcl_trap_eapol_ctrl = RTL838X_SPCL_TRAP_EAPOL_CTRL,
        .init_eee = rtl838x_init_eee,
-       .port_eee_set = rtl838x_port_eee_set,
+       .set_mac_eee = rtldsa_838x_set_mac_eee,
        .l2_hash_seed = rtl838x_l2_hash_seed,
        .l2_hash_key = rtl838x_l2_hash_key,
        .read_mcast_pmask = rtl838x_read_mcast_pmask,
index 0b9be3b442d289d4098920c094b71b1c6e3bd505..598ea3f73f0e07d506a66378a9b79b2c24879fa7 100644 (file)
@@ -1036,7 +1036,7 @@ struct rtl838x_reg {
        int rma_bpdu_fld_pmask;
        int spcl_trap_eapol_ctrl;
        void (*init_eee)(struct rtl838x_switch_priv *priv, bool enable);
-       void (*port_eee_set)(struct rtl838x_switch_priv *priv, int port, bool enable);
+       void (*set_mac_eee)(struct rtl838x_switch_priv *priv, int port, bool enable);
        u64 (*l2_hash_seed)(u64 mac, u32 vid);
        u32 (*l2_hash_key)(struct rtl838x_switch_priv *priv, u64 seed);
        u64 (*read_mcast_pmask)(int idx);
index edafbf71b8368cbe1a426eb67b7dbcb817861488..48c83812b49e2fa2e11e7c4c29d8371d1c553f1b 100644 (file)
@@ -858,7 +858,7 @@ static void rtl839x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port
 }
 
 /* Enables or disables the EEE/EEEP capability of a port */
-static void rtl839x_port_eee_set(struct rtl838x_switch_priv *priv, int port, bool enable)
+static void rtldsa_839x_set_mac_eee(struct rtl838x_switch_priv *priv, int port, bool enable)
 {
        u32 v;
 
@@ -894,7 +894,7 @@ static void rtl839x_init_eee(struct rtl838x_switch_priv *priv, bool enable)
        /* Setup EEE on all ports */
        for (int i = 0; i < priv->cpu_port; i++) {
                if (priv->ports[i].phy)
-                       rtl839x_port_eee_set(priv, i, enable);
+                       priv->r->set_mac_eee(priv, i, enable);
        }
        priv->eee_enabled = enable;
 }
@@ -1860,7 +1860,7 @@ const struct rtl838x_reg rtl839x_reg = {
        .rma_bpdu_fld_pmask = RTL839X_RMA_BPDU_FLD_PMSK,
        .spcl_trap_eapol_ctrl = RTL839X_SPCL_TRAP_EAPOL_CTRL,
        .init_eee = rtl839x_init_eee,
-       .port_eee_set = rtl839x_port_eee_set,
+       .set_mac_eee = rtldsa_839x_set_mac_eee,
        .l2_hash_seed = rtl839x_l2_hash_seed,
        .l2_hash_key = rtl839x_l2_hash_key,
        .read_mcast_pmask = rtl839x_read_mcast_pmask,
index cb6460dec4a9c76458af3d664b53bd19a78febf4..944b8bbcea8653e20f73d7c4e32063221b1d1462 100644 (file)
@@ -892,7 +892,7 @@ u32 rtl930x_hash(struct rtl838x_switch_priv *priv, u64 seed)
 }
 
 /* Enables or disables the EEE/EEEP capability of a port */
-static void rtl930x_port_eee_set(struct rtl838x_switch_priv *priv, int port, bool enable)
+static void rtldsa_930x_set_mac_eee(struct rtl838x_switch_priv *priv, int port, bool enable)
 {
        u32 v;
 
@@ -920,7 +920,7 @@ static void rtl930x_init_eee(struct rtl838x_switch_priv *priv, bool enable)
        /* Setup EEE on all ports */
        for (int i = 0; i < priv->cpu_port; i++) {
                if (priv->ports[i].phy)
-                       rtl930x_port_eee_set(priv, i, enable);
+                       priv->r->set_mac_eee(priv, i, enable);
        }
 
        priv->eee_enabled = enable;
@@ -2488,7 +2488,7 @@ const struct rtl838x_reg rtl930x_reg = {
        .trk_mbr_ctr = rtl930x_trk_mbr_ctr,
        .rma_bpdu_fld_pmask = RTL930X_RMA_BPDU_FLD_PMSK,
        .init_eee = rtl930x_init_eee,
-       .port_eee_set = rtl930x_port_eee_set,
+       .set_mac_eee = rtldsa_930x_set_mac_eee,
        .l2_hash_seed = rtl930x_l2_hash_seed,
        .l2_hash_key = rtl930x_l2_hash_key,
        .read_mcast_pmask = rtl930x_read_mcast_pmask,