From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 02:24:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B42C1065749; Thu, 11 Dec 2008 02:24:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 275DD8FC12; Thu, 11 Dec 2008 02:24:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB2OBi9049892; Thu, 11 Dec 2008 02:24:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB2OBns049890; Thu, 11 Dec 2008 02:24:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812110224.mBB2OBns049890@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 11 Dec 2008 02:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185903 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 02:24:12 -0000 Author: yongari Date: Thu Dec 11 02:24:11 2008 New Revision: 185903 URL: http://svn.freebsd.org/changeset/base/185903 Log: Make WOL work on RTL8168B. This controller seems to require explicit command to enable Rx MAC prior to entering D3. Tested by: Cyrus Rahman gmail DOT com> Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Thu Dec 11 02:23:49 2008 (r185902) +++ head/sys/dev/re/if_re.c Thu Dec 11 02:24:11 2008 (r185903) @@ -1256,6 +1256,8 @@ re_attach(device_t dev) break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: + sc->rl_flags |= RL_FLAG_WOLRXENB; + /* FALLTHROUGH */ case RL_HWREV_8168_SPIN3: sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | RL_FLAG_MACSTAT; @@ -3016,6 +3018,9 @@ re_setwol(struct rl_softc *sc) return; ifp = sc->rl_ifp; + if ((ifp->if_capenable & IFCAP_WOL) != 0 && + (sc->rl_flags & RL_FLAG_WOLRXENB) != 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RX_ENB); /* Enable config register write. */ CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Thu Dec 11 02:23:49 2008 (r185902) +++ head/sys/pci/if_rlreg.h Thu Dec 11 02:24:11 2008 (r185903) @@ -887,6 +887,7 @@ struct rl_softc { #define RL_FLAG_CMDSTOP 0x0200 #define RL_FLAG_PHY8169 0x0400 #define RL_FLAG_PHY8110S 0x0800 +#define RL_FLAG_WOLRXENB 0x1000 #define RL_FLAG_LINK 0x8000 };