Module Name:    src
Committed By:   msaitoh
Date:           Wed Nov 16 09:27:49 UTC 2016

Modified Files:
        src/sys/dev/pci: if_wm.c

Log Message:
Move the location of wm_smbustopci() call.


To generate a diff of this commit:
cvs rdiff -u -r1.447 -r1.448 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.447 src/sys/dev/pci/if_wm.c:1.448
--- src/sys/dev/pci/if_wm.c:1.447	Wed Nov 16 08:56:17 2016
+++ src/sys/dev/pci/if_wm.c	Wed Nov 16 09:27:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.447 2016/11/16 08:56:17 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.448 2016/11/16 09:27:49 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.447 2016/11/16 08:56:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.448 2016/11/16 09:27:49 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1935,11 +1935,6 @@ alloc_retry:
 	CSR_READ(sc, WMREG_COLC);
 	CSR_READ(sc, WMREG_RXERRC);
 
-	/* get PHY control from SMBus to PCIe */
-	if ((sc->sc_type == WM_T_PCH) || (sc->sc_type == WM_T_PCH2)
-	    || (sc->sc_type == WM_T_PCH_LPT) || (sc->sc_type == WM_T_PCH_SPT))
-		wm_smbustopci(sc);
-
 	if ((sc->sc_type == WM_T_82574) || (sc->sc_type == WM_T_82583)
 	    || (sc->sc_type >= WM_T_ICH8))
 		sc->sc_ich_phymtx = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NET);
@@ -8365,6 +8360,11 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 	}
 	mii->mii_statchg = wm_gmii_statchg;
 
+	/* get PHY control from SMBus to PCIe */
+	if ((sc->sc_type == WM_T_PCH) || (sc->sc_type == WM_T_PCH2)
+	    || (sc->sc_type == WM_T_PCH_LPT) || (sc->sc_type == WM_T_PCH_SPT))
+		wm_smbustopci(sc);
+
 	wm_gmii_reset(sc);
 
 	sc->sc_ethercom.ec_mii = &sc->sc_mii;

Reply via email to