提交 384649e7 编写于 作者: D David S. Miller

Merge branch 'WoL-fixes-for-DP83822-and-DP83tc811'

Dan Murphy says:

====================
WoL fixes for DP83822 and DP83tc811

The WoL feature for each device was enabled during boot or when the PHY was
brought up which may be undesired.  These patches disable the WoL in the
config_init.  The disabling and enabling of the WoL is now done though the
set_wol call.
====================
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
...@@ -137,19 +137,18 @@ static int dp83822_set_wol(struct phy_device *phydev, ...@@ -137,19 +137,18 @@ static int dp83822_set_wol(struct phy_device *phydev,
value &= ~DP83822_WOL_SECURE_ON; value &= ~DP83822_WOL_SECURE_ON;
} }
value |= (DP83822_WOL_EN | DP83822_WOL_INDICATION_SEL | /* Clear any pending WoL interrupt */
DP83822_WOL_CLR_INDICATION); phy_read(phydev, MII_DP83822_MISR2);
phy_write_mmd(phydev, DP83822_DEVADDR, MII_DP83822_WOL_CFG,
value); value |= DP83822_WOL_EN | DP83822_WOL_INDICATION_SEL |
DP83822_WOL_CLR_INDICATION;
return phy_write_mmd(phydev, DP83822_DEVADDR,
MII_DP83822_WOL_CFG, value);
} else { } else {
value = phy_read_mmd(phydev, DP83822_DEVADDR, return phy_clear_bits_mmd(phydev, DP83822_DEVADDR,
MII_DP83822_WOL_CFG); MII_DP83822_WOL_CFG, DP83822_WOL_EN);
value &= ~DP83822_WOL_EN;
phy_write_mmd(phydev, DP83822_DEVADDR, MII_DP83822_WOL_CFG,
value);
} }
return 0;
} }
static void dp83822_get_wol(struct phy_device *phydev, static void dp83822_get_wol(struct phy_device *phydev,
...@@ -258,12 +257,11 @@ static int dp83822_config_intr(struct phy_device *phydev) ...@@ -258,12 +257,11 @@ static int dp83822_config_intr(struct phy_device *phydev)
static int dp83822_config_init(struct phy_device *phydev) static int dp83822_config_init(struct phy_device *phydev)
{ {
int value; int value = DP83822_WOL_EN | DP83822_WOL_MAGIC_EN |
DP83822_WOL_SECURE_ON;
value = DP83822_WOL_MAGIC_EN | DP83822_WOL_SECURE_ON | DP83822_WOL_EN;
return phy_write_mmd(phydev, DP83822_DEVADDR, MII_DP83822_WOL_CFG, return phy_clear_bits_mmd(phydev, DP83822_DEVADDR,
value); MII_DP83822_WOL_CFG, value);
} }
static int dp83822_phy_reset(struct phy_device *phydev) static int dp83822_phy_reset(struct phy_device *phydev)
......
...@@ -139,16 +139,19 @@ static int dp83811_set_wol(struct phy_device *phydev, ...@@ -139,16 +139,19 @@ static int dp83811_set_wol(struct phy_device *phydev,
value &= ~DP83811_WOL_SECURE_ON; value &= ~DP83811_WOL_SECURE_ON;
} }
value |= (DP83811_WOL_EN | DP83811_WOL_INDICATION_SEL | /* Clear any pending WoL interrupt */
DP83811_WOL_CLR_INDICATION); phy_read(phydev, MII_DP83811_INT_STAT1);
phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,
value); value |= DP83811_WOL_EN | DP83811_WOL_INDICATION_SEL |
DP83811_WOL_CLR_INDICATION;
return phy_write_mmd(phydev, DP83811_DEVADDR,
MII_DP83811_WOL_CFG, value);
} else { } else {
phy_clear_bits_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, return phy_clear_bits_mmd(phydev, DP83811_DEVADDR,
DP83811_WOL_EN); MII_DP83811_WOL_CFG, DP83811_WOL_EN);
} }
return 0;
} }
static void dp83811_get_wol(struct phy_device *phydev, static void dp83811_get_wol(struct phy_device *phydev,
...@@ -292,8 +295,8 @@ static int dp83811_config_init(struct phy_device *phydev) ...@@ -292,8 +295,8 @@ static int dp83811_config_init(struct phy_device *phydev)
value = DP83811_WOL_MAGIC_EN | DP83811_WOL_SECURE_ON | DP83811_WOL_EN; value = DP83811_WOL_MAGIC_EN | DP83811_WOL_SECURE_ON | DP83811_WOL_EN;
return phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, return phy_clear_bits_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,
value); value);
} }
static int dp83811_phy_reset(struct phy_device *phydev) static int dp83811_phy_reset(struct phy_device *phydev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册