From owner-freebsd-stable@FreeBSD.ORG Fri Apr 9 17:32:38 2010 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99D781065674 for ; Fri, 9 Apr 2010 17:32:38 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id 242F18FC12 for ; Fri, 9 Apr 2010 17:32:37 +0000 (UTC) Received: by ewy24 with SMTP id 24so399533ewy.33 for ; Fri, 09 Apr 2010 10:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=PaMtiOq1UpZ1QTt0YrOoOE98hpJx2Z7knznRzLuCNSY=; b=whbSG5welh/kT0lkbfdgpwBYGLc+gXYz0/zz3BMWQcVhqb1d5ANskAmGJkdN6K8GMk zV45/CcTbGhzvclmZYSNjwS8951DLe+AqWnxwEbEU5hBudRV98ttL45eiSiq3mPi4vK5 EoV2EoskchNFffBIGg1Yi67cNSXSr53qKAYLo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=UoQAxcAuZoh/SkLyQj5RyPxv3ndxhFCCDBKrVUYKi+bTbloo3ZrmsF9QkdM7non8lR 8AcXABybfSlFNL3EApfnsq/TjXaDC79y+bMOX3eTNzBDgkeI02Ac3dih8nmycysPXz70 gRo3V/GFJZN5mhzT7MCTdGCZ7dRcbQ7AJ1lNU= Received: by 10.213.46.208 with SMTP id k16mr207203ebf.8.1270834356948; Fri, 09 Apr 2010 10:32:36 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 14sm895584ewy.6.2010.04.09.10.32.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Apr 2010 10:32:34 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 9 Apr 2010 10:32:28 -0700 From: Pyun YongHyeon Date: Fri, 9 Apr 2010 10:32:28 -0700 To: Michael Beckmann Message-ID: <20100409173228.GC1085@michelle.cdnetworks.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: stable@freebsd.org Subject: Re: Realtek Ethernet not functioning on Asus M4A89GTD PRO X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2010 17:32:38 -0000 --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 09, 2010 at 01:50:02AM +0200, Michael Beckmann wrote: > Greetings, > > > > the onboard Realtek Ethernet on my Asus M4A89GTD PRO is not functioning. > > > > I use FreeBSD 8.0-STABLE with a generic kernel (amd64). Everything was > updated March 27, 2010. > > > > Is it a bug? > > > > Thanks, > > > > Michael > > > > > > pcib4: at device 21.0 on pci0 > > pci4: on pcib4 > > re0: PCIe Gigabit Ethernet> port 0xe800-0xe8ff mem > 0xfdfff000-0xfdffffff,0xfdff8000-0xfdffbfff irq 16 at device 0.0 on pci4 > > re0: Using 1 MSI messages > > re0: Chip rev. 0x2c000000 > > re0: MAC rev. 0x00000000 > > re0: Unknown H/W revision: 0x2c000000 > > device_attach: re0 attach returned 6 > Try attached patch and let me know how it goes. --4Ckj6UjgE2iN1+kY Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="re.8168E.diff" Index: sys/dev/re/if_re.c =================================================================== --- sys/dev/re/if_re.c (revision 206426) +++ sys/dev/re/if_re.c (working copy) @@ -174,8 +174,7 @@ { RT_VENDORID, RT_DEVICEID_8101E, 0, "RealTek 8101E/8102E/8102EL/8103E PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, - "RealTek 8168/8168B/8168C/8168CP/8168D/8168DP/" - "8111B/8111C/8111CP/8111DP PCIe Gigabit Ethernet" }, + "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, "RealTek 8169/8169S/8169SB(L)/8110S/8110SB(L) Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169SC, 0, @@ -220,6 +219,7 @@ { RL_HWREV_8168CP, RL_8169, "8168CP/8111CP"}, { RL_HWREV_8168D, RL_8169, "8168D/8111D"}, { RL_HWREV_8168DP, RL_8169, "8168DP/8111DP"}, + { RL_HWREV_8168E, RL_8169, "8168E/8111E"}, { 0, 0, NULL } }; @@ -1310,6 +1310,11 @@ */ sc->rl_flags |= RL_FLAG_NOJUMBO; break; + case RL_HWREV_8168E: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_NOJUMBO; + break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SBL: case RL_HWREV_8169_8110SC: @@ -1393,6 +1398,8 @@ } /* Take PHY out of power down mode. */ + if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) + CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80); if ((sc->rl_flags & RL_FLAG_PHYWAKE) != 0) { re_gmii_writereg(dev, 1, 0x1f, 0); re_gmii_writereg(dev, 1, 0x0e, 0); @@ -3135,6 +3142,9 @@ v |= RL_CFG5_WOL_LANWAKE; CSR_WRITE_1(sc, RL_CFG5, v); + if ((ifp->if_capenable & IFCAP_WOL) != 0 && + (sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) + CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) & ~0x80); /* * It seems that hardware resets its link speed to 100Mbps in * power down mode so switching to 100Mbps in driver is not Index: sys/pci/if_rlreg.h =================================================================== --- sys/pci/if_rlreg.h (revision 206426) +++ sys/pci/if_rlreg.h (working copy) @@ -133,6 +133,7 @@ #define RL_GMEDIASTAT 0x006C /* 8 bits */ #define RL_MACDBG 0x006D /* 8 bits, 8168C SPIN2 only */ #define RL_GPIO 0x006E /* 8 bits, 8168C SPIN2 only */ +#define RL_PMCH 0x006F /* 8 bits */ #define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ #define RL_GTXSTART 0x0038 /* 8 bits */ @@ -162,6 +163,7 @@ #define RL_HWREV_8102EL_SPIN1 0x24c00000 #define RL_HWREV_8168D 0x28000000 #define RL_HWREV_8168DP 0x28800000 +#define RL_HWREV_8168E 0x2C000000 #define RL_HWREV_8168_SPIN1 0x30000000 #define RL_HWREV_8100E 0x30800000 #define RL_HWREV_8101E 0x34000000 @@ -884,6 +886,7 @@ uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 #define RL_FLAG_AUTOPAD 0x0002 +#define RL_FLAG_PHYWAKE_PM 0x0004 #define RL_FLAG_PHYWAKE 0x0008 #define RL_FLAG_NOJUMBO 0x0010 #define RL_FLAG_PAR 0x0020 --4Ckj6UjgE2iN1+kY--