From owner-svn-src-head@FreeBSD.ORG Thu Dec 11 01:41:38 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 A9A151065673; Thu, 11 Dec 2008 01:41:38 +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 958F58FC1A; Thu, 11 Dec 2008 01:41:38 +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 mBB1fcEK048994; Thu, 11 Dec 2008 01:41:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB1fc5K048992; Thu, 11 Dec 2008 01:41:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812110141.mBB1fc5K048992@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 11 Dec 2008 01:41:38 +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: r185901 - 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 01:41:38 -0000 Author: yongari Date: Thu Dec 11 01:41:38 2008 New Revision: 185901 URL: http://svn.freebsd.org/changeset/base/185901 Log: Don't access undocumented register 0x82 on controllers that have no such register. While here clear undocumented PHY register 0x0B for RTL8110S. Obtained from: RealTek FreeBSD driver 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 01:26:18 2008 (r185900) +++ head/sys/dev/re/if_re.c Thu Dec 11 01:41:38 2008 (r185901) @@ -700,7 +700,12 @@ re_reset(struct rl_softc *sc) if (i == RL_TIMEOUT) device_printf(sc->rl_dev, "reset never completed!\n"); - CSR_WRITE_1(sc, 0x82, 1); + if ((sc->rl_flags & RL_FLAG_PHY8169) != 0) + CSR_WRITE_1(sc, 0x82, 1); + if ((sc->rl_flags & RL_FLAG_PHY8110S) != 0) { + CSR_WRITE_1(sc, 0x82, 1); + re_gmii_writereg(sc->rl_dev, 1, 0x0B, 0); + } } #ifdef RE_DIAG @@ -1235,6 +1240,9 @@ re_attach(device_t dev) case RL_HWREV_8139CPLUS: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER; break; + case RL_HWREV_8110S: + sc->rl_flags |= RL_FLAG_PHY8110S; + break; case RL_HWREV_8100E: case RL_HWREV_8101E: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | @@ -1271,10 +1279,14 @@ re_attach(device_t dev) */ sc->rl_flags |= RL_FLAG_NOJUMBO; break; + case RL_HWREV_8169: + case RL_HWREV_8169S: + sc->rl_flags |= RL_FLAG_PHY8169; + break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SC: case RL_HWREV_8169_8110SBL: - sc->rl_flags |= RL_FLAG_PHYWAKE; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHY8169; break; default: break; Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Thu Dec 11 01:26:18 2008 (r185900) +++ head/sys/pci/if_rlreg.h Thu Dec 11 01:41:38 2008 (r185901) @@ -885,6 +885,8 @@ struct rl_softc { #define RL_FLAG_MACSTAT 0x0080 #define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_CMDSTOP 0x0200 +#define RL_FLAG_PHY8169 0x0400 +#define RL_FLAG_PHY8110S 0x0800 #define RL_FLAG_LINK 0x8000 };