Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145470
b: refs/heads/master
c: 5a9a8e3
h: refs/heads/master
v: v3
  • Loading branch information
Ed Swierk authored and David S. Miller committed Jun 2, 2009
1 parent de7ab7b commit 0b8a122
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc23ffe075365d2f21b1046048ad0d342bbb41be
refs/heads/master: 5a9a8e32ebe269c71d8d3e78f9435fe7729f38e9
15 changes: 13 additions & 2 deletions trunk/drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,12 @@ enum {
};
static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED;

/*
* Power down phy when interface is down (persists through reboot;
* older Linux and other OSes may not power it up again)
*/
static int phy_power_down = 0;

static inline struct fe_priv *get_nvpriv(struct net_device *dev)
{
return netdev_priv(dev);
Expand Down Expand Up @@ -1485,7 +1491,10 @@ static int phy_init(struct net_device *dev)

/* restart auto negotiation, power down phy */
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);
mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
if (phy_power_down) {
mii_control |= BMCR_PDOWN;
}
if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
return PHY_ERROR;
}
Expand Down Expand Up @@ -5513,7 +5522,7 @@ static int nv_close(struct net_device *dev)

nv_drain_rxtx(dev);

if (np->wolenabled) {
if (np->wolenabled || !phy_power_down) {
writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
nv_start_rx(dev);
} else {
Expand Down Expand Up @@ -6367,6 +6376,8 @@ module_param(dma_64bit, int, 0);
MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0.");
module_param(phy_cross, int, 0);
MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0.");
module_param(phy_power_down, int, 0);
MODULE_PARM_DESC(phy_power_down, "Power down phy and disable link when interface is down (1), or leave phy powered up (0).");

MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>");
MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver");
Expand Down

0 comments on commit 0b8a122

Please sign in to comment.