diff options
author | Ed Swierk <eswierk@aristanetworks.com> | 2009-06-02 03:19:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-02 03:19:52 -0400 |
commit | 5a9a8e32ebe269c71d8d3e78f9435fe7729f38e9 (patch) | |
tree | 37d22a060fd62528d028cba40b2278c289736cea /drivers/net/forcedeth.c | |
parent | fc23ffe075365d2f21b1046048ad0d342bbb41be (diff) |
forcedeth: add phy_power_down parameter, leave phy powered up by default (v2)
Add a phy_power_down parameter to forcedeth: set to 1 to power down the
phy and disable the link when an interface goes down; set to 0 to always
leave the phy powered up.
The phy power state persists across reboots; Windows, some BIOSes, and
older versions of Linux don't bother to power up the phy again, forcing
users to remove all power to get the interface working (see
http://bugzilla.kernel.org/show_bug.cgi?id=13072). Leaving the phy
powered on is the safest default behavior. Users accustomed to seeing
the link state reflect the interface state and/or wanting to minimize
power consumption can set phy_power_down=1 if compatibility with other
OSes is not an issue.
Signed-off-by: Ed Swierk <eswierk@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r-- | drivers/net/forcedeth.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index f9a846b1b92f..9f6a68fb7b45 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -897,6 +897,12 @@ enum { | |||
897 | }; | 897 | }; |
898 | static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED; | 898 | static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED; |
899 | 899 | ||
900 | /* | ||
901 | * Power down phy when interface is down (persists through reboot; | ||
902 | * older Linux and other OSes may not power it up again) | ||
903 | */ | ||
904 | static int phy_power_down = 0; | ||
905 | |||
900 | static inline struct fe_priv *get_nvpriv(struct net_device *dev) | 906 | static inline struct fe_priv *get_nvpriv(struct net_device *dev) |
901 | { | 907 | { |
902 | return netdev_priv(dev); | 908 | return netdev_priv(dev); |
@@ -1485,7 +1491,10 @@ static int phy_init(struct net_device *dev) | |||
1485 | 1491 | ||
1486 | /* restart auto negotiation, power down phy */ | 1492 | /* restart auto negotiation, power down phy */ |
1487 | mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ); | 1493 | mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ); |
1488 | mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN); | 1494 | mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE); |
1495 | if (phy_power_down) { | ||
1496 | mii_control |= BMCR_PDOWN; | ||
1497 | } | ||
1489 | if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) { | 1498 | if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) { |
1490 | return PHY_ERROR; | 1499 | return PHY_ERROR; |
1491 | } | 1500 | } |
@@ -5513,7 +5522,7 @@ static int nv_close(struct net_device *dev) | |||
5513 | 5522 | ||
5514 | nv_drain_rxtx(dev); | 5523 | nv_drain_rxtx(dev); |
5515 | 5524 | ||
5516 | if (np->wolenabled) { | 5525 | if (np->wolenabled || !phy_power_down) { |
5517 | writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags); | 5526 | writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags); |
5518 | nv_start_rx(dev); | 5527 | nv_start_rx(dev); |
5519 | } else { | 5528 | } else { |
@@ -6367,6 +6376,8 @@ module_param(dma_64bit, int, 0); | |||
6367 | MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0."); | 6376 | MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0."); |
6368 | module_param(phy_cross, int, 0); | 6377 | module_param(phy_cross, int, 0); |
6369 | MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0."); | 6378 | MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0."); |
6379 | module_param(phy_power_down, int, 0); | ||
6380 | MODULE_PARM_DESC(phy_power_down, "Power down phy and disable link when interface is down (1), or leave phy powered up (0)."); | ||
6370 | 6381 | ||
6371 | MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>"); | 6382 | MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>"); |
6372 | MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver"); | 6383 | MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver"); |