]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: provide a hook for link up/link down events
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 25 Jul 2017 14:02:58 +0000 (15:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Aug 2017 03:55:28 +0000 (20:55 -0700)
commitabf8dd3970c160a905a733acae86e775c509f8bf
tree86d4706f49c3ea8a718e412dc366a3d4a4777911
parenteaf9060320ab50f19237f5adeb76559319ea9087
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>
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c
include/linux/phy.h