kernel: 5.15: backport v6.1 PHY changes required for Aquantia
[openwrt/staging/jow.git] / target / linux / realtek / patches-5.15 / 800-net-mdio-support-hardware-assisted-indirect-access.patch
index b0a8fadb5f4fbbe9f51e1be79a94e4c11e426a07..937e5d3161f472c0eca65273d556ad612dc753e5 100644 (file)
@@ -443,7 +443,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
   * @dev: target MDIO device
 --- a/drivers/net/phy/phy-core.c
 +++ b/drivers/net/phy/phy-core.c
-@@ -482,10 +482,16 @@ int __phy_read_mmd(struct phy_device *ph
+@@ -556,10 +556,16 @@ int __phy_read_mmd(struct phy_device *ph
                struct mii_bus *bus = phydev->mdio.bus;
                int phy_addr = phydev->mdio.addr;
  
@@ -464,7 +464,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        }
        return val;
  }
-@@ -538,12 +544,18 @@ int __phy_write_mmd(struct phy_device *p
+@@ -612,12 +618,18 @@ int __phy_write_mmd(struct phy_device *p
                struct mii_bus *bus = phydev->mdio.bus;
                int phy_addr = phydev->mdio.addr;
  
@@ -487,7 +487,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        }
        return ret;
  }
-@@ -749,6 +761,13 @@ EXPORT_SYMBOL_GPL(phy_modify_mmd);
+@@ -823,6 +835,13 @@ EXPORT_SYMBOL_GPL(phy_modify_mmd);
  
  static int __phy_read_page(struct phy_device *phydev)
  {
@@ -501,7 +501,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        if (WARN_ONCE(!phydev->drv->read_page, "read_page callback not available, PHY driver not loaded?\n"))
                return -EOPNOTSUPP;
  
-@@ -757,6 +776,13 @@ static int __phy_read_page(struct phy_de
+@@ -831,6 +850,13 @@ static int __phy_read_page(struct phy_de
  
  static int __phy_write_page(struct phy_device *phydev, int page)
  {
@@ -515,7 +515,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        if (WARN_ONCE(!phydev->drv->write_page, "write_page callback not available, PHY driver not loaded?\n"))
                return -EOPNOTSUPP;
  
-@@ -858,6 +884,18 @@ int phy_read_paged(struct phy_device *ph
+@@ -932,6 +958,18 @@ int phy_read_paged(struct phy_device *ph
  {
        int ret = 0, oldpage;
  
@@ -534,7 +534,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        oldpage = phy_select_page(phydev, page);
        if (oldpage >= 0)
                ret = __phy_read(phydev, regnum);
-@@ -879,6 +917,18 @@ int phy_write_paged(struct phy_device *p
+@@ -953,6 +991,18 @@ int phy_write_paged(struct phy_device *p
  {
        int ret = 0, oldpage;
  
@@ -665,7 +665,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  #define MDIO_DEVICE_IS_PHY    0x80000000
  
  /**
-@@ -421,6 +422,22 @@ struct mii_bus {
+@@ -428,6 +429,22 @@ struct mii_bus {
  
        /** @shared: shared state across different PHYs */
        struct phy_package_shared *shared[PHY_MAX_ADDR];
@@ -688,7 +688,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  };
  #define to_mii_bus(d) container_of(d, struct mii_bus, dev)
  
-@@ -1795,6 +1812,66 @@ static inline int __phy_package_read(str
+@@ -1825,6 +1842,66 @@ static inline int __phy_package_read(str
        return __mdiobus_read(phydev->mdio.bus, shared->addr, regnum);
  }
  
@@ -755,7 +755,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  static inline int phy_package_write(struct phy_device *phydev,
                                    u32 regnum, u16 val)
  {
-@@ -1817,6 +1894,72 @@ static inline int __phy_package_write(st
+@@ -1847,6 +1924,72 @@ static inline int __phy_package_write(st
        return __mdiobus_write(phydev->mdio.bus, shared->addr, regnum, val);
  }