Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Dec 2008 02:24:11 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185903 - in head/sys: dev/re pci
Message-ID:  <200812110224.mBB2OBns049890@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <crahman <> 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
 };
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812110224.mBB2OBns049890>