diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-11-24 12:27:52 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-11-27 18:04:11 -0800 |
commit | 243ad8df7a1bd24c2e01bd99d9f0bb88844dae91 (patch) | |
tree | 56d2a48a96f945398cc1d6d91b2059481d6348a3 /drivers/net/phy/phy_device.c | |
parent | e1df5202e879bce09845ac62bae30206e1edfb80 (diff) | |
download | linux-243ad8df7a1bd24c2e01bd99d9f0bb88844dae91.tar.gz linux-243ad8df7a1bd24c2e01bd99d9f0bb88844dae91.tar.bz2 linux-243ad8df7a1bd24c2e01bd99d9f0bb88844dae91.zip |
net: phy: add possible interfaces
Add a possible_interfaces member to struct phy_device to indicate which
interfaces a clause 45 PHY may switch between depending on the media.
This must be populated by the PHY driver by the time the .config_init()
method completes according to the PHYs host-side configuration.
For example, the Marvell 88x3310 PHY can switch between 10GBASE-R,
5GBASE-R, 2500BASE-X, and SGMII on the host side depending on the media
side speed, so all these interface modes are set in the
possible_interfaces member.
This allows phylib users (such as phylink) to know in advance which
interface modes to expect, which allows them to appropriately restrict
the advertised link modes according to the capabilities of other parts
of the link.
Tested-by: Luo Jie <quic_luoj@quicinc.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/E1r6VHk-00DDLN-I7@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r-- | drivers/net/phy/phy_device.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 478126f6b5bc..400fb09d9cd6 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1246,6 +1246,8 @@ int phy_init_hw(struct phy_device *phydev) if (ret < 0) return ret; + phy_interface_zero(phydev->possible_interfaces); + if (phydev->drv->config_init) { ret = phydev->drv->config_init(phydev); if (ret < 0) |