summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-08-26 12:19:35 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-05-09 18:17:28 +0100
commitbfe9a6b5f0fa050b43dd29e89347ad4042ef3da6 (patch)
treee2e87a841113b1a13f6575a61ed3934a8b275d85 /drivers/net/phy/phy.c
parent7ac8a7b21ad12efa391fc79c09a9d5dca0f0fc31 (diff)
net: phy: provide phy driver start/stop hooks
Provide phy driver start/stop hooks so that the PHY driver knows when the network driver is starting or stopping. This will be used for the Marvell 10G driver so that we can sanely refuse to start if the PHYs firmware is not present, and also so that we can sanely support SFPs behind the PHY. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ef8b4c9e346a..2f77ab180db1 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1533,6 +1533,10 @@ void phy_stop(struct phy_device *phydev)
phy_process_state_change(phydev, old_state);
state_work = _phy_state_machine(phydev);
+
+ if (phydev->drv->stop)
+ phydev->drv->stop(phydev);
+
mutex_unlock(&phydev->lock);
_phy_state_machine_post_work(phydev, state_work);
@@ -1565,6 +1569,9 @@ void phy_start(struct phy_device *phydev)
goto out;
}
+ if (phydev->drv->start && phydev->drv->start(phydev))
+ goto out;
+
if (phydev->sfp_bus)
sfp_upstream_start(phydev->sfp_bus);