NetBSD Problem Report #49259
From www@NetBSD.org Sun Oct 5 22:33:08 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id E9EAEA65B9
for <gnats-bugs@gnats.NetBSD.org>; Sun, 5 Oct 2014 22:33:07 +0000 (UTC)
Message-Id: <20141005223306.CD745A65C4@mollari.NetBSD.org>
Date: Sun, 5 Oct 2014 22:33:06 +0000 (UTC)
From: julien.lorec@gmail.com
Reply-To: julien.lorec@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Support for Realtek 8111G chipset into re(4)
X-Send-Pr-Version: www-1.0
>Number: 49259
>Category: kern
>Synopsis: Support for Realtek 8111G chipset into re(4)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Oct 05 22:35:00 +0000 2014
>Closed-Date: Tue May 31 06:25:19 +0000 2016
>Last-Modified: Tue May 31 06:25:19 +0000 2016
>Originator: J. Lorec
>Release: 6.1.5-RELEASE
>Organization:
>Environment:
>Description:
Please fully support Realtek 8168G/8111G Ethernet chipsets.
Both FreeBSD and OpenBSD already support it.
See here:
http://svnweb.freebsd.org/base?view=revision&revision=261531
and there:
http://permalink.gmane.org/gmane.os.openbsd.cvs/128054
>How-To-Repeat:
Run NetBSD on a Shuttle DS47 or DS437 system
>Fix:
Taken from OpenBSD src changes summary for 2014-03-08:
> Add the RX earlyoff support for older chips (8168{E-VL,EP, F}) and RXDV
> GATED
> bits for the 8168G controller. This fixes operation of the 8168G
> controllers.
> This makes reception of packets work with the 8168G controllers in the
> Shuttle
> DS47 and other systems.
> From FreeBSD, based on the Realtek Linux driver.
>Release-Note:
>Audit-Trail:
From: Julien Lorec <julien.lorec@gmail.com>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/49259
Date: Wed, 08 Oct 2014 23:04:10 +0200
This is a multi-part message in MIME format.
--------------030804080700080806090602
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Patch included against 6.1.5-RELEASE.
Ported from OpenBSD source code.
Tested OK on a Shuttle DS437 running NetBSD 6.1.5-RELEASE.
--------------030804080700080806090602
Content-Type: text/plain; charset=windows-1252;
name="rtl8169.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="rtl8169.c.diff"
--- /cygdrive/c/Users/Julien/Desktop/usr/src/sys/dev/ic/rtl8169.c 2012-03-05 21:31:49.000000000 +0100
+++ /cygdrive/c/Users/Julien/Desktop/usr/src/sys/dev/ic/rtl8169.c.PATCHED 2014-10-08 22:51:29.800378700 +0200
@@ -610,6 +610,15 @@
sc->sc_quirk |= RTKQ_DESCV2 | RTKQ_NOEECMD |
RTKQ_MACSTAT | RTKQ_CMDSTOP | RTKQ_NOJUMBO;
break;
+ case RTK_HWREV_8168G:
+ case RTK_HWREV_8168G_SPIN1:
+ case RTK_HWREV_8168G_SPIN2:
+ case RTK_HWREV_8168G_SPIN4:
+ sc->sc_quirk |=
+ RTKQ_NOEECMD | RTKQ_DESCV2 |
+ RTKQ_CMDSTOP | RTKQ_NOJUMBO |
+ RTKQ_MACSTAT | RTKQ_RXDV_GATED;
+ break;
case RTK_HWREV_8100E:
case RTK_HWREV_8100E_SPIN2:
case RTK_HWREV_8101E:
@@ -1807,6 +1816,9 @@
CSR_WRITE_4(sc, RTK_TXLIST_ADDR_LO,
RE_ADDR_LO(sc->re_ldata.re_tx_list_map->dm_segs[0].ds_addr));
+ if (sc->sc_quirk & RTKQ_RXDV_GATED)
+ CSR_WRITE_4(sc, RTK_MISC, CSR_READ_4(sc, RTK_MISC) & ~0x00080000);
+
/*
* Enable transmit and receive.
*/
--------------030804080700080806090602
Content-Type: text/plain; charset=windows-1252;
name="rtl81x9var.h.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="rtl81x9var.h.diff"
--- /cygdrive/c/Users/Julien/Desktop/usr/src/sys/dev/ic/rtl81x9var.h 2012-02-02 20:43:03.000000000 +0100
+++ /cygdrive/c/Users/Julien/Desktop/usr/src/sys/dev/ic/rtl81x9var.h.PATCHED 2014-10-08 22:51:48.429195500 +0200
@@ -192,6 +192,7 @@
#define RTKQ_MACSTAT 0x00000100 /* set MACSTAT_DIS on init */
#define RTKQ_CMDSTOP 0x00000200 /* set STOPREQ on stop */
#define RTKQ_PHYWAKE_PM 0x00000400 /* wake PHY from power down */
+#define RTKQ_RXDV_GATED 0x00080000
bus_dma_tag_t sc_dmat;
--------------030804080700080806090602
Content-Type: text/plain; charset=windows-1252;
name="rtl81x9reg.h.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="rtl81x9reg.h.diff"
--- /cygdrive/c/Users/Julien/Desktop/usr/src/sys/dev/ic/rtl81x9reg.h 2012-03-05 21:31:49.000000000 +0100
+++ /cygdrive/c/Users/Julien/Desktop/usr/src/sys/dev/ic/rtl81x9reg.h.PATCHED 2014-10-08 22:52:01.280725500 +0200
@@ -136,6 +136,7 @@
#define RTK_DBG_REG 0x00D1
#define RTK_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */
#define RTK_IM 0x00E2
+#define RTK_MISC 0x00F0
/*
* TX config register bits
@@ -165,6 +166,11 @@
#define RTK_HWREV_8168E 0x2C000000
#define RTK_HWREV_8168E_VL 0x2C800000
#define RTK_HWREV_8168_SPIN1 0x30000000
+#define RTK_HWREV_8168G 0x4c000000
+#define RTK_HWREV_8168G_SPIN1 0x4c100000
+#define RTK_HWREV_8168G_SPIN2 0x50900000
+#define RTK_HWREV_8168G_SPIN4 0x5c800000
+#define RTK_HWREV_8168GU 0x50800000
#define RTK_HWREV_8100E 0x30800000
#define RTK_HWREV_8101E 0x34000000
#define RTK_HWREV_8102E 0x34800000
@@ -264,7 +270,6 @@
#define RTK_RXCFG_WRAP 0x00000080
#define RTK_RXCFG_MAXDMA 0x00000700
#define RTK_RXCFG_BUFSZ 0x00001800
-#define RTK_RXCFG_FIFOTHRESH 0x0000E000
#define RTK_RXCFG_EARLYTHRESH 0x07000000
#define RTK_RXDMA_16BYTES 0x00000000
--------------030804080700080806090602--
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/49259 CVS commit: src/sys/dev/ic
Date: Fri, 10 Oct 2014 13:41:05 -0400
Module Name: src
Committed By: christos
Date: Fri Oct 10 17:41:05 UTC 2014
Modified Files:
src/sys/dev/ic: rtl8169.c rtl81x9reg.h rtl81x9var.h
Log Message:
PR/49259: J. Lorec: Add support for Realtek 8111G chipset into re(4)
To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/sys/dev/ic/rtl8169.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/ic/rtl81x9reg.h
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/ic/rtl81x9var.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Tue, 31 May 2016 06:25:19 +0000
State-Changed-Why:
Fix committed by Christos on Oct 10 17:41:05 UTC 2014
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.