From patchwork Thu Dec 16 09:33:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lv X-Patchwork-Id: 75727 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 565661007D3 for ; Thu, 16 Dec 2010 20:33:22 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753122Ab0LPJdR (ORCPT ); Thu, 16 Dec 2010 04:33:17 -0500 Received: from mail-fx0-f43.google.com ([209.85.161.43]:42746 "EHLO mail-fx0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441Ab0LPJdQ (ORCPT ); Thu, 16 Dec 2010 04:33:16 -0500 Received: by fxm18 with SMTP id 18so3046265fxm.2 for ; Thu, 16 Dec 2010 01:33:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=IMnLMksf6WgBg/3HXKEz6kY4uedRutY3aiilyuvmftA=; b=SKGMGMZJIUcCFQTHYiugxbSpFUM0js9XG28IMd6vzLsk4qz2S7cnUK6qTujJTB9Bhl HOpqRVBRkQNR+f1hw8FDuik/vvvFYCa7LtBdhbij3TApXrkeHb1lBDG5uI8cn/yHUWyO WH/zU37d3YXFOxz2QQu4yIr9Tp+1Mbv7f1iS8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=N1ejtYCtIXhyp5T+zO8guiUVVn3p8Ag6fbM7rHvO/+NT+LqwOAn34D7ke4FCTMjY3+ CnvpR3cldxLdi04pJCmRgN/kE8Y3xU4ZLl50rMIbOMGqlvU7gb41fpWYlZHBqk5tzk/s ZWN8mp/tHJISSFHwF3uExOIzlm4H6LTLgBL4k= MIME-Version: 1.0 Received: by 10.223.112.1 with SMTP id u1mr1072453fap.109.1292491995050; Thu, 16 Dec 2010 01:33:15 -0800 (PST) Received: by 10.223.79.77 with HTTP; Thu, 16 Dec 2010 01:33:15 -0800 (PST) Date: Thu, 16 Dec 2010 17:33:15 +0800 Message-ID: Subject: [PATCH] via-velocity: fix the WOL bug on 1000M full duplex forced mode From: David Lv To: netdev@vger.kernel.org, romieu@fr.zoreil.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Francois Romieu --- drivers/net/via-velocity.c | 37 +++++++++++++++++++++++-------------- 1 files changed, 23 insertions(+), 14 deletions(-) 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 != vptr->options.spd_dpx) { + if (SPD_DPX_AUTO == vptr->options.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); + } }