diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2017-07-25 15:02:58 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-06 20:55:28 -0700 |
commit | a81497bee70eb15039594b3116913133aa9c9b29 (patch) | |
tree | 86d4706f49c3ea8a718e412dc366a3d4a4777911 /include/linux/phy.h | |
parent | 1f3645bb41f2e2b15fe5799476284bf2cd138722 (diff) | |
download | linux-stable-a81497bee70eb15039594b3116913133aa9c9b29.tar.gz linux-stable-a81497bee70eb15039594b3116913133aa9c9b29.tar.bz2 linux-stable-a81497bee70eb15039594b3116913133aa9c9b29.zip |
net: phy: provide a hook for link up/link down events
Sometimes, we need to do additional work between the PHY coming up and
marking the carrier present - for example, we may need to wait for the
PHY to MAC link to finish negotiation. This changes phylib to provide
a notification function pointer which avoids the built-in
netif_carrier_on() and netif_carrier_off() functions.
Standard ->adjust_link functionality is provided by hooking a helper
into the new ->phy_link_change method.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r-- | include/linux/phy.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index 8a280257778c..0a5e8e62c9e0 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -474,6 +474,7 @@ struct phy_device { u8 mdix; u8 mdix_ctrl; + void (*phy_link_change)(struct phy_device *, bool up, bool do_carrier); void (*adjust_link)(struct net_device *dev); }; #define to_phy_device(d) container_of(to_mdio_device(d), \ |