netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net: phylib: add adjust_state callback to phy device
@ 2013-11-13 21:07 Daniel Mack
  2013-11-13 21:07 ` [PATCH 2/2] net: phy: at803x: soft-reset PHY when link goes down Daniel Mack
  2013-11-14 21:32 ` [PATCH 1/2] net: phylib: add adjust_state callback to phy device David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Mack @ 2013-11-13 21:07 UTC (permalink / raw)
  To: netdev; +Cc: davem, marek.belisko, ujhelyi.m, Daniel Mack

Allow phy drivers to take action when the core does its link adjustment.
No change for drivers that do not implement this callback.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/net/phy/phy.c | 3 +++
 include/linux/phy.h   | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 36c6994..240e33f 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -748,6 +748,9 @@ void phy_state_machine(struct work_struct *work)
 	if (phydev->adjust_state)
 		phydev->adjust_state(phydev->attached_dev);
 
+	if (phydev->drv->adjust_state)
+		phydev->drv->adjust_state(phydev);
+
 	switch(phydev->state) {
 		case PHY_DOWN:
 		case PHY_STARTING:
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 64ab823..85826eb 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -467,6 +467,8 @@ struct phy_driver {
 	/* See set_wol, but for checking whether Wake on LAN is enabled. */
 	void (*get_wol)(struct phy_device *dev, struct ethtool_wolinfo *wol);
 
+	void (*adjust_state)(struct phy_device *dev);
+
 	struct device_driver driver;
 };
 #define to_phy_driver(d) container_of(d, struct phy_driver, driver)
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-15  7:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13 21:07 [PATCH 1/2] net: phylib: add adjust_state callback to phy device Daniel Mack
2013-11-13 21:07 ` [PATCH 2/2] net: phy: at803x: soft-reset PHY when link goes down Daniel Mack
2013-11-15  0:03   ` Sergei Shtylyov
2013-11-14 21:32 ` [PATCH 1/2] net: phylib: add adjust_state callback to phy device David Miller
2013-11-15  7:35   ` Daniel Mack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).