summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-09-18 14:42:16 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2017-07-07 16:12:14 +0100
commiteeb4c838b94958a77f6fa1339e051a23c4941e9f (patch)
treeb2859081bdeaf8863bc4f90772db36adfbb358ee /include
parent402aa363542294b89e1db534dda779dc8830b2c0 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/phy.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index baf59fb5fa31..6f55f6ee3ef8 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -470,6 +470,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), \