realtek: 6.12: rename dsa functions/structures to conduit/user

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>
This commit is contained in:
Markus Stockhausen
2025-05-27 14:59:13 -04:00
committed by Robert Marko
parent a4a40ab6ea
commit 7234c7757c
4 changed files with 27 additions and 28 deletions

View 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); snprintf(bus->id, MII_BUS_ID_SIZE, "%s-%d", bus->name, dev->id);
bus->parent = dev; bus->parent = dev;
priv->ds->slave_mii_bus = bus; priv->ds->user_mii_bus = bus;
priv->ds->slave_mii_bus->priv = priv; 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) { if (ret && mii_np) {
of_node_put(dn); of_node_put(dn);
return ret; return ret;
@ -736,7 +736,7 @@ static int rtl83xx_handle_changeupper(struct rtl838x_switch_priv *priv,
break; break;
} }
for (j = 0; j < priv->cpu_port; j++) { for (j = 0; j < priv->cpu_port; j++) {
if (priv->ports[j].dp->slave == ndev) if (priv->ports[j].dp->user == ndev)
break; break;
} }
if (j >= priv->cpu_port) { if (j >= priv->cpu_port) {
@ -771,23 +771,22 @@ out:
return 0; 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) int rtl83xx_port_is_under(const struct net_device * dev, struct rtl838x_switch_priv *priv)
{ {
/* TODO: On 5.12: /* Is the lower network device a DSA user network device of our RTL930X-switch?
* if(!dsa_slave_dev_check(dev)) { * Unfortunately we cannot just follow dev->dsa_prt as this is only set for the
* netdev_info(dev, "%s: not a DSA device.\n", __func__); * DSA conduit device. TODO: since 6.12:
* return -EINVAL; *
* } * 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++) { for (int i = 0; i < priv->cpu_port; i++) {
if (!priv->ports[i].dp) if (!priv->ports[i].dp)
continue; continue;
if (priv->ports[i].dp->slave == dev) if (priv->ports[i].dp->user == dev)
return i; return i;
} }

View File

@ -1726,7 +1726,7 @@ static void rtl839x_setup_port_macs(struct rtl838x_switch_priv *priv)
u64 mac; u64 mac;
pr_debug("%s: got port %08x\n", __func__, (u32)priv->ports[priv->cpu_port].dp); 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); mac = ether_addr_to_u64(dev->dev_addr);
for (int i = 0; i < 15; i++) { for (int i = 0; i < 15; i++) {

View File

@ -24,7 +24,7 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
--- a/drivers/net/mdio/fwnode_mdio.c --- a/drivers/net/mdio/fwnode_mdio.c
+++ b/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")) 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); &phy->mdio.reset_assert_delay);
--- a/include/linux/phy.h --- a/include/linux/phy.h
+++ b/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_INIT_TIMEOUT 100000
#define PHY_FORCE_TIMEOUT 10 #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) */ /* Used when trying to connect to a specific phy (mii bus id:phy device id) */
#define PHY_ID_FMT "%s:%02x" #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]; struct mdio_device *mdio_map[PHY_MAX_ADDR];
/** @phy_mask: PHY addresses to be ignored when probing */ /** @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 { struct dsa_chip_data {
--- a/include/net/dsa.h --- a/include/net/dsa.h
+++ b/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; - u32 phys_mii_mask;
+ u64 phys_mii_mask; + u64 phys_mii_mask;
struct mii_bus *slave_mii_bus; struct mii_bus *user_mii_bus;
/* Ageing Time limits in msecs */ /* 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)) \ dsa_switch_for_each_port_continue_reverse((_dp), (_ds)) \
if (dsa_port_is_cpu((_dp))) if (dsa_port_is_cpu((_dp)))
@ -110,9 +110,9 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
return mask; return mask;
} }
--- a/net/dsa/slave.c --- a/net/dsa/user.c
+++ b/net/dsa/slave.c +++ b/net/dsa/user.c
@@ -320,7 +320,7 @@ static int dsa_slave_phy_read(struct mii @@ -320,7 +320,7 @@ static int dsa_user_phy_read(struct mii_
{ {
struct dsa_switch *ds = bus->priv; 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 ds->ops->phy_read(ds, addr, reg);
return 0xffff; 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; struct dsa_switch *ds = bus->priv;

View File

@ -56,6 +56,6 @@ Submitted-by: John Crispin <john@phrozen.org>
source_port = trailer[1] & 7; source_port = trailer[1] & 7;
- -
+#endif +#endif
skb->dev = dsa_master_find_slave(dev, 0, source_port); skb->dev = dsa_conduit_find_user(dev, 0, source_port);
if (!skb->dev) if (!skb->dev)
return NULL; return NULL;