diff options
author | Xu Liang <lxu@maxlinear.com> | 2021-07-19 13:32:11 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-20 06:55:20 -0700 |
commit | 8b72b301b442907742c1af1b8fcb52e351a2aac1 (patch) | |
tree | 37e585f589fdfe73faba67e2ba8f8b10338103bd /drivers/net/phy/phy_device.c | |
parent | 08f329fcddd50dc6f12f9bdbf7e4c9afce6e0d82 (diff) | |
download | linux-stable-8b72b301b442907742c1af1b8fcb52e351a2aac1.tar.gz linux-stable-8b72b301b442907742c1af1b8fcb52e351a2aac1.tar.bz2 linux-stable-8b72b301b442907742c1af1b8fcb52e351a2aac1.zip |
net: phy: add API to read 802.3-c45 IDs
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>
Acked-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r-- | drivers/net/phy/phy_device.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 5d5f9a9ee768..107aa6d7bc6b 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -969,6 +969,20 @@ void phy_device_remove(struct phy_device *phydev) EXPORT_SYMBOL(phy_device_remove); /** + * phy_get_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 */ |