]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: 6.12: rename dsa functions/structures to conduit/user
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Tue, 27 May 2025 18:59:13 +0000 (14:59 -0400)
committerRobert Marko <robimarko@gmail.com>
Wed, 11 Jun 2025 20:27:22 +0000 (22:27 +0200)
The old upstream notation has been changed to something not so racist.

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/common.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl839x.c
target/linux/realtek/patches-6.12/700-dsa-mdio-increase-max-ports-for-rtl839x-rtl931x.patch
target/linux/realtek/patches-6.12/722-net-dsa-add-rtl838x-support-for-tag-trailer.patch

index ecea1601d85fdbcf1ec1956335513c7081b62d4b..876ae4fd9b4d225d1ac4d84738a27b0af5201e31 100644 (file)
@@ -320,10 +320,10 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
        snprintf(bus->id, MII_BUS_ID_SIZE, "%s-%d", bus->name, dev->id);
 
        bus->parent = dev;
-       priv->ds->slave_mii_bus = bus;
-       priv->ds->slave_mii_bus->priv = priv;
+       priv->ds->user_mii_bus = bus;
+       priv->ds->user_mii_bus->priv = priv;
 
-       ret = mdiobus_register(priv->ds->slave_mii_bus);
+       ret = mdiobus_register(priv->ds->user_mii_bus);
        if (ret && mii_np) {
                of_node_put(dn);
                return ret;
@@ -736,7 +736,7 @@ static int rtl83xx_handle_changeupper(struct rtl838x_switch_priv *priv,
                        break;
        }
        for (j = 0; j < priv->cpu_port; j++) {
-               if (priv->ports[j].dp->slave == ndev)
+               if (priv->ports[j].dp->user == ndev)
                        break;
        }
        if (j >= priv->cpu_port) {
@@ -771,23 +771,22 @@ out:
        return 0;
 }
 
-/* Is the lower network device a DSA slave network device of our RTL930X-switch?
- * Unfortunately we cannot just follow dev->dsa_prt as this is only set for the
- * DSA master device.
- */
 int rtl83xx_port_is_under(const struct net_device * dev, struct rtl838x_switch_priv *priv)
 {
-/* TODO: On 5.12:
- *     if(!dsa_slave_dev_check(dev)) {
- *             netdev_info(dev, "%s: not a DSA device.\n", __func__);
- *             return -EINVAL;
- *     }
- */
+       /* Is the lower network device a DSA user network device of our RTL930X-switch?
+        * Unfortunately we cannot just follow dev->dsa_prt as this is only set for the
+        * DSA conduit device. TODO: since 6.12:
+        *
+        * if(!dsa_user_dev_check(dev)) {
+        *   netdev_info(dev, "%s: not a DSA device.\n", __func__);
+        *   return -EINVAL;
+        * }
+        */
 
        for (int i = 0; i < priv->cpu_port; i++) {
                if (!priv->ports[i].dp)
                        continue;
-               if (priv->ports[i].dp->slave == dev)
+               if (priv->ports[i].dp->user == dev)
                        return i;
        }
 
index 29905964c467424271f32a824832f6596b3eac1f..f2fe08682123355e38213ba0c01264f449b7ac12 100644 (file)
@@ -1726,7 +1726,7 @@ static void rtl839x_setup_port_macs(struct rtl838x_switch_priv *priv)
        u64 mac;
 
        pr_debug("%s: got port %08x\n", __func__, (u32)priv->ports[priv->cpu_port].dp);
-       dev = priv->ports[priv->cpu_port].dp->slave;
+       dev = priv->ports[priv->cpu_port].dp->user;
        mac = ether_addr_to_u64(dev->dev_addr);
 
        for (int i = 0; i < 15; i++) {
index 147e2c587b42cfad3403662899583de3877ea2c7..3db46a22853b57086be34ec4b56e701c148fd583 100644 (file)
@@ -24,7 +24,7 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
 
 --- a/drivers/net/mdio/fwnode_mdio.c
 +++ b/drivers/net/mdio/fwnode_mdio.c
-@@ -87,7 +87,7 @@ int fwnode_mdiobus_phy_device_register(s
+@@ -89,7 +89,7 @@ int fwnode_mdiobus_phy_device_register(s
        }
  
        if (fwnode_property_read_bool(child, "broken-turn-around"))
@@ -35,7 +35,7 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
                                 &phy->mdio.reset_assert_delay);
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -294,7 +294,7 @@ static inline const char *phy_modes(phy_
+@@ -301,7 +301,7 @@ static inline const char *phy_modes(phy_
  #define PHY_INIT_TIMEOUT      100000
  #define PHY_FORCE_TIMEOUT     10
  
@@ -44,7 +44,7 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
  
  /* Used when trying to connect to a specific phy (mii bus id:phy device id) */
  #define PHY_ID_FMT "%s:%02x"
-@@ -414,10 +414,10 @@ struct mii_bus {
+@@ -421,10 +421,10 @@ struct mii_bus {
        struct mdio_device *mdio_map[PHY_MAX_ADDR];
  
        /** @phy_mask: PHY addresses to be ignored when probing */
@@ -70,16 +70,16 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
  struct dsa_chip_data {
 --- a/include/net/dsa.h
 +++ b/include/net/dsa.h
-@@ -465,7 +465,7 @@ struct dsa_switch {
+@@ -473,7 +473,7 @@ struct dsa_switch {
        /*
-        * Slave mii_bus and devices for the individual ports.
+        * User mii_bus and devices for the individual ports.
         */
 -      u32                     phys_mii_mask;
 +      u64                     phys_mii_mask;
-       struct mii_bus          *slave_mii_bus;
+       struct mii_bus          *user_mii_bus;
  
        /* Ageing Time limits in msecs */
-@@ -597,24 +597,24 @@ static inline bool dsa_is_user_port(stru
+@@ -609,24 +609,24 @@ static inline bool dsa_is_user_port(stru
        dsa_switch_for_each_port_continue_reverse((_dp), (_ds)) \
                if (dsa_port_is_cpu((_dp)))
  
@@ -110,9 +110,9 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
  
        return mask;
  }
---- a/net/dsa/slave.c
-+++ b/net/dsa/slave.c
-@@ -320,7 +320,7 @@ static int dsa_slave_phy_read(struct mii
+--- a/net/dsa/user.c
++++ b/net/dsa/user.c
+@@ -320,7 +320,7 @@ static int dsa_user_phy_read(struct mii_
  {
        struct dsa_switch *ds = bus->priv;
  
@@ -121,7 +121,7 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
                return ds->ops->phy_read(ds, addr, reg);
  
        return 0xffff;
-@@ -330,7 +330,7 @@ static int dsa_slave_phy_write(struct mi
+@@ -330,7 +330,7 @@ static int dsa_user_phy_write(struct mii
  {
        struct dsa_switch *ds = bus->priv;
  
index 348c59092aa057dd5e0fd1896d5130b65aa60086..8f02f03b51075be6d1c7a801ecef48970ad89650 100644 (file)
@@ -56,6 +56,6 @@ Submitted-by: John Crispin <john@phrozen.org>
        source_port = trailer[1] & 7;
 -
 +#endif
-       skb->dev = dsa_master_find_slave(dev, 0, source_port);
+       skb->dev = dsa_conduit_find_user(dev, 0, source_port);
        if (!skb->dev)
                return NULL;