]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: enhance & harmonize dsa/phy max port patches 18846/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Mon, 19 May 2025 14:41:50 +0000 (10:41 -0400)
committerRobert Marko <robimarko@gmail.com>
Sat, 31 May 2025 10:28:14 +0000 (12:28 +0200)
commit9716f89df6ed0d158e7048f085d5449568a8f37f
tree5be5de25fae0fb93aef61e4db0c1794262f87dd1
parent22dc34e8c191400d25b43c67f18c9c5c3e6d149e
realtek: enhance & harmonize dsa/phy max port patches

DSA silently drops internal phy access to ports >= 32 in dsa_user_phy_read()
and dsa_user_phy_write(). The code shows:

static int dsa_user_phy_read(struct mii_bus *bus, int addr, int reg)
{
struct dsa_switch *ds = bus->priv;

if (ds->phys_mii_mask & (1 << addr))
return ds->ops->phy_read(ds, addr, reg);

return 0xffff;
}

With ds->phys_mii_mask being a 32 bit variable the reason is clear. So do
not only increase the max values but also adapt the needed bitmasks in
the dsa and phy code. This fixes the dsa_user_ports() and dsa_cpu_ports()
too.

While we are here combine the old separated patches because dsa, mdio and
phy are tigthly coupled.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18846
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/patches-6.6/700-dsa-mdio-increase-max-ports-for-rtl839x-rtl931x.patch [new file with mode: 0644]
target/linux/realtek/patches-6.6/700-net-dsa-increase-dsa-max-ports-for-rtl838x.patch [deleted file]
target/linux/realtek/patches-6.6/704-include-linux-phy-increase-phy-address-number-for-rtl839x.patch [deleted file]