Various problems with re(4) on a PCIe 8168/8111B onboard NIC
Pyun YongHyeon
pyunyh at gmail.com
Tue Jul 31 00:55:55 UTC 2007
On Tue, Jul 31, 2007 at 01:31:59AM +0200, Michael Nottebrock wrote:
> On Monday, 30. July 2007, Pyun YongHyeon wrote:
>
> > Thanks for reporting. I don't have these hardware models so I couldn't
> > verify the issue. After reading the vendor's code I've made attached
> > patch. I don't know whether it works or not, it's just guess work.
>
> Works fine here!
>
Since HEAD is in code freeze I guess minimal patch would be more
preferable. Would you try attached patch again?
--
Regards,
Pyun YongHyeon
-------------- next part --------------
Index: if_re.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/re/if_re.c,v
retrieving revision 1.92
diff -u -r1.92 if_re.c
--- if_re.c 24 Jul 2007 01:24:02 -0000 1.92
+++ if_re.c 31 Jul 2007 00:49:34 -0000
@@ -1300,6 +1300,28 @@
goto fail;
}
+ /* Take PHY out of power down mode. */
+ if (sc->rl_type == RL_8169) {
+ uint32_t rev;
+
+ rev = CSR_READ_4(sc, RL_TXCFG);
+ /* HWVERID 0, 1 and 2 : bit26-30, bit23 */
+ rev &= 0x7c800000;
+ if (rev != 0) {
+ /* RTL8169S single chip */
+ switch (rev) {
+ case RL_HWREV_8169_8110SB:
+ case RL_HWREV_8169_8110SC:
+ case RL_HWREV_8168_SPIN2:
+ re_gmii_writereg(dev, 1, 0x1f, 0);
+ re_gmii_writereg(dev, 1, 0x0e, 0);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
ifp->if_softc = sc;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
More information about the freebsd-stable
mailing list