diff options
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"); |