Skip to content

Commit

Permalink
net: phy: add API to read 802.3-c45 IDs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xu Liang authored and David S. Miller committed Jul 20, 2021
1 parent 08f329f commit 8b72b30
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,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
Expand Down
1 change: 1 addition & 0 deletions include/linux/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,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);
Expand Down

0 comments on commit 8b72b30

Please sign in to comment.