aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/forcedeth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r--drivers/net/forcedeth.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index d0b1d9f17a5d..1dce5550f553 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -898,6 +898,12 @@ enum {
898}; 898};
899static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED; 899static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED;
900 900
901/*
902 * Power down phy when interface is down (persists through reboot;
903 * older Linux and other OSes may not power it up again)
904 */
905static int phy_power_down = 0;
906
901static inline struct fe_priv *get_nvpriv(struct net_device *dev) 907static inline struct fe_priv *get_nvpriv(struct net_device *dev)
902{ 908{
903 return netdev_priv(dev); 909 return netdev_priv(dev);
@@ -1503,7 +1509,10 @@ static int phy_init(struct net_device *dev)
1503 1509
1504 /* restart auto negotiation, power down phy */ 1510 /* restart auto negotiation, power down phy */
1505 mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ); 1511 mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
1506 mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN); 1512 mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
1513 if (phy_power_down) {
1514 mii_control |= BMCR_PDOWN;
1515 }
1507 if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) { 1516 if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
1508 return PHY_ERROR; 1517 return PHY_ERROR;
1509 } 1518 }
@@ -5534,7 +5543,7 @@ static int nv_close(struct net_device *dev)
5534 5543
5535 nv_drain_rxtx(dev); 5544 nv_drain_rxtx(dev);
5536 5545
5537 if (np->wolenabled) { 5546 if (np->wolenabled || !phy_power_down) {
5538 nv_txrx_gate(dev, false); 5547 nv_txrx_gate(dev, false);
5539 writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags); 5548 writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
5540 nv_start_rx(dev); 5549 nv_start_rx(dev);
@@ -6390,6 +6399,8 @@ module_param(dma_64bit, int, 0);
6390MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0."); 6399MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0.");
6391module_param(phy_cross, int, 0); 6400module_param(phy_cross, int, 0);
6392MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0."); 6401MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0.");
6402module_param(phy_power_down, int, 0);
6403MODULE_PARM_DESC(phy_power_down, "Power down phy and disable link when interface is down (1), or leave phy powered up (0).");
6393 6404
6394MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>"); 6405MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>");
6395MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver"); 6406MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver");