Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Set if_baudrate for non-MII device. Before this ...



details:   https://anonhg.NetBSD.org/src/rev/7d81d84df2a7
branches:  trunk
changeset: 937007:7d81d84df2a7
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Aug 05 03:17:18 2020 +0000

description:
Set if_baudrate for non-MII device. Before this commit, it was 0.

diffstat:

 sys/dev/pci/if_wm.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 96bf1bf73bfd -r 7d81d84df2a7 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Wed Aug 05 01:58:42 2020 +0000
+++ b/sys/dev/pci/if_wm.c       Wed Aug 05 03:17:18 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.684 2020/08/05 01:58:42 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.685 2020/08/05 03:17:18 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.684 2020/08/05 01:58:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.685 2020/08/05 03:17:18 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -12019,6 +12019,7 @@
        sc->sc_mii.mii_ifp = ifp;
        sc->sc_ethercom.ec_mii = &sc->sc_mii;
 
+       ifp->if_baudrate = IF_Gbps(1);
        if (((sc->sc_type >= WM_T_82575) && (sc->sc_type <= WM_T_I211))
            && (sc->sc_mediatype == WM_MEDIATYPE_SERDES)) {
                ifmedia_init_with_lock(&sc->sc_mii.mii_media, IFM_IMASK,
@@ -12553,6 +12554,7 @@
                        break;
                }
        }
+       ifp->if_baudrate = ifmedia_baudrate(ifmr->ifm_active);
        if ((reg & PCS_LSTS_FDX) != 0)
                ifmr->ifm_active |= IFM_FDX;
        else



Home | Main Index | Thread Index | Old Index