On Sun, Dec 15, 2013 at 09:57:59AM -0600, Jonathan A. Kollasch wrote: > > I ported the changes in FreeBSD SVN r257305 that add support for > RTL8168G. This works except for the RX path. When I netboot; an > unpatched NetBSD re(4) works for TX and RX. Any ideas? > > Jonathan Kollasch
This (attached) patch works. I'm completely aware it's uncommittable as it it is.
Index: sys/dev/ic/rtl8169.c =================================================================== RCS file: /cvsroot/src/sys/dev/ic/rtl8169.c,v retrieving revision 1.139 diff -d -u -a -p -r1.139 rtl8169.c --- sys/dev/ic/rtl8169.c 10 May 2013 14:55:08 -0000 1.139 +++ sys/dev/ic/rtl8169.c 16 Dec 2013 23:26:59 -0000 @@ -392,6 +392,8 @@ re_reset(struct rtk_softc *sc) if ((sc->sc_quirk & RTKQ_MACLDPS) != 0) CSR_WRITE_1(sc, RTK_LDPS, 1); + if ((CSR_READ_4(sc, RTK_TXCFG) & RTK_TXCFG_HWREV) == RTK_HWREV_8168G) + CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~__BIT(3)); } /* @@ -608,6 +610,7 @@ re_attach(struct rtk_softc *sc) break; case RTK_HWREV_8168E_VL: case RTK_HWREV_8168F: + case RTK_HWREV_8168G: sc->sc_quirk |= RTKQ_DESCV2 | RTKQ_NOEECMD | RTKQ_MACSTAT | RTKQ_CMDSTOP | RTKQ_NOJUMBO; break; Index: sys/dev/ic/rtl81x9reg.h =================================================================== RCS file: /cvsroot/src/sys/dev/ic/rtl81x9reg.h,v retrieving revision 1.45 diff -d -u -a -p -r1.45 rtl81x9reg.h --- sys/dev/ic/rtl81x9reg.h 13 Dec 2013 20:52:48 -0000 1.45 +++ sys/dev/ic/rtl81x9reg.h 16 Dec 2013 23:26:59 -0000 @@ -175,6 +175,7 @@ #define RTK_HWREV_8168C_SPIN2 0x3C400000 #define RTK_HWREV_8168CP 0x3C800000 #define RTK_HWREV_8168F 0x48000000 +#define RTK_HWREV_8168G 0x4C000000 #define RTK_HWREV_8139 0x60000000 #define RTK_HWREV_8139A 0x70000000 #define RTK_HWREV_8139AG 0x70800000