All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/2] net: phy: add API to read 802.3-c45 IDs
@ 2021-06-28 14:29 Xu Liang
  2021-06-28 14:29 ` [PATCH v4 2/2] net: phy: add Maxlinear GPY115/21x/24x driver Xu Liang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Xu Liang @ 2021-06-28 14:29 UTC (permalink / raw)
  To: andrew, hkallweit1, netdev, davem, kuba, vee.khee.wong
  Cc: linux, hmehrtens, tmohren, mohammad.athari.ismail, Xu Liang

Add API to read 802.3-c45 IDs so that C22/C45 mixed device can use
C45 APIs without failing ID checks.

Signed-off-by: Xu Liang <lxu@maxlinear.com>
---
 drivers/net/phy/phy_device.c | 14 ++++++++++++++
 include/linux/phy.h          |  1 +
 2 files changed, 15 insertions(+)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 0a2d8bedf73d..c8969642076f 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -935,6 +935,20 @@ void phy_device_remove(struct phy_device *phydev)
 }
 EXPORT_SYMBOL(phy_device_remove);
 
+/**
+ * get_phy_c45_ids - Read 802.3-c45 IDs for phy device.
+ * @phydev: phy_device structure to read 802.3-c45 IDs
+ *
+ * Returns zero on success, %-EIO on bus access error, or %-ENODEV if
+ * the "devices in package" is invalid.
+ */
+int phy_get_c45_ids(struct phy_device *phydev)
+{
+	return get_phy_c45_ids(phydev->mdio.bus, phydev->mdio.addr,
+			       &phydev->c45_ids);
+}
+EXPORT_SYMBOL(phy_get_c45_ids);
+
 /**
  * phy_find_first - finds the first PHY device on the bus
  * @bus: the target MII bus
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 852743f07e3e..e46b23a2113b 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1391,6 +1391,7 @@ static inline int phy_device_register(struct phy_device *phy)
 static inline void phy_device_free(struct phy_device *phydev) { }
 #endif /* CONFIG_PHYLIB */
 void phy_device_remove(struct phy_device *phydev);
+int phy_get_c45_ids(struct phy_device *phydev);
 int phy_init_hw(struct phy_device *phydev);
 int phy_suspend(struct phy_device *phydev);
 int phy_resume(struct phy_device *phydev);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-29 16:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 14:29 [PATCH v4 1/2] net: phy: add API to read 802.3-c45 IDs Xu Liang
2021-06-28 14:29 ` [PATCH v4 2/2] net: phy: add Maxlinear GPY115/21x/24x driver Xu Liang
2021-06-29 14:58   ` Andrew Lunn
2021-06-29 16:05     ` Liang Xu
2021-06-28 16:22 ` [PATCH v4 1/2] net: phy: add API to read 802.3-c45 IDs kernel test robot
2021-06-28 16:22   ` kernel test robot
2021-06-28 21:14 ` kernel test robot
2021-06-28 21:14   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.