[<prev] [next>] [day] [month] [year] [list]
Message-ID: <AANLkTin-43cHgB=oVxYw4QjuyQdqFsw=o1bEQYnvuSzx@mail.gmail.com>
Date: Tue, 14 Dec 2010 15:36:47 +0800
From: David Lv <davidlv.linux@...il.com>
To: netdev@...r.kernel.org, romieu@...zoreil.com,
DavidLv@...tech.com.cn, ShirleyHu@...tech.com.cn,
AndersMa@...tech.com.cn
Subject: [PATCH] via-velocity: fix the WOL bug on 1000M full duplex forced mode
This patch isn't based on the first patch of the sleep speed 10M.
The VIA velocity card can't be waken up by WOL tool on 1000M full
duplex forced mode.
This patch fixes the bug.
Thanks!
Signed-off-by: David Lv <DavidLv@...tech.com.cn>
Acked-by: Francois Romieu <romieu@...zoreil.com>
---
drivers/net/via-velocity.c | 37 +++++++++++++++++++++++--------------
1 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index cab96ad..947af49 100755
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -2925,6 +2925,7 @@ static int velocity_set_wol(struct velocity_info *vptr)
struct mac_regs __iomem *regs = vptr->mac_regs;
static u8 buf[256];
int i;
+ u8 GCR;
static u32 mask_pattern[2][4] = {
{0x00203000, 0x000003C0, 0x00000000, 0x0000000}, /* ARP */
@@ -2968,23 +2969,31 @@ static int velocity_set_wol(struct velocity_info *vptr)
writew(0x0FFF, ®s->WOLSRClr);
- if (vptr->mii_status & VELOCITY_AUTONEG_ENABLE) {
- if (PHYID_GET_PHY_ID(vptr->phy_id) == PHYID_CICADA_CS8201)
- MII_REG_BITS_ON(AUXCR_MDPPS, MII_NCONFIG, vptr->mac_regs);
-
- MII_REG_BITS_OFF(ADVERTISE_1000FULL | ADVERTISE_1000HALF,
MII_CTRL1000, vptr->mac_regs);
- }
+ if (SPD_DPX_1000_FULL != pInfo->hw.sOpts.spd_dpx) {
+ if (SPD_DPX_AUTO == pInfo->hw.sOpts.spd_dpx) {
+ if (vptr->mii_status & VELOCITY_AUTONEG_ENABLE) {
+ if (PHYID_GET_PHY_ID(vptr->phy_id) ==
+ PHYID_CICADA_CS8201)
+ MII_REG_BITS_ON(AUXCR_MDPPS,
+ MII_NCONFIG, vptr->mac_regs);
+
+ MII_REG_BITS_OFF(ADVERTISE_1000FULL |
+ ADVERTISE_1000HALF, MII_CTRL1000,
+ vptr->mac_regs);
+ }
- if (vptr->mii_status & VELOCITY_SPEED_1000)
- MII_REG_BITS_ON(BMCR_ANRESTART, MII_BMCR, vptr->mac_regs);
+ if (vptr->mii_status & VELOCITY_SPEED_1000)
+ MII_REG_BITS_ON(BMCR_ANRESTART, MII_BMCR,
+ vptr->mac_regs);
+ }
- BYTE_REG_BITS_ON(CHIPGCR_FCMODE, ®s->CHIPGCR);
+ BYTE_REG_BITS_ON(CHIPGCR_FCMODE, ®s->CHIPGCR);
- {
- u8 GCR;
- GCR = readb(®s->CHIPGCR);
- GCR = (GCR & ~CHIPGCR_FCGMII) | CHIPGCR_FCFDX;
- writeb(GCR, ®s->CHIPGCR);
+ {
+ GCR = readb(®s->CHIPGCR);
+ GCR = (GCR & ~CHIPGCR_FCGMII) | CHIPGCR_FCFDX;
+ writeb(GCR, ®s->CHIPGCR);
+ }
}
BYTE_REG_BITS_OFF(ISR_PWEI, ®s->ISR);
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists