Module Name: src
Committed By: msaitoh
Date: Thu Jul 6 08:50:52 UTC 2017
Modified Files:
src/sys/dev/pci: if_wm.c
Log Message:
Move the location of wm_get_hw_control() in wm_init_locked() again. Doing
it "after" wm_reset() is required for some AMT based machines to linkup
1Gbps. Tested with HP dc7700.
To generate a diff of this commit:
cvs rdiff -u -r1.517 -r1.518 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.517 src/sys/dev/pci/if_wm.c:1.518
--- src/sys/dev/pci/if_wm.c:1.517 Mon Jun 26 04:22:46 2017
+++ src/sys/dev/pci/if_wm.c Thu Jul 6 08:50:52 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.517 2017/06/26 04:22:46 msaitoh Exp $ */
+/* $NetBSD: if_wm.c,v 1.518 2017/07/06 08:50:52 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.517 2017/06/26 04:22:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.518 2017/07/06 08:50:52 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -5129,10 +5129,6 @@ wm_init_locked(struct ifnet *ifp)
ifp->if_collisions += CSR_READ(sc, WMREG_COLC);
ifp->if_ierrors += CSR_READ(sc, WMREG_RXERRC);
- /* AMT based hardware can now take control from firmware */
- if ((sc->sc_flags & WM_F_HAS_AMT) != 0)
- wm_get_hw_control(sc);
-
/* PCH_SPT hardware workaround */
if (sc->sc_type == WM_T_PCH_SPT)
wm_flush_desc_rings(sc);
@@ -5140,6 +5136,13 @@ wm_init_locked(struct ifnet *ifp)
/* Reset the chip to a known state. */
wm_reset(sc);
+ /*
+ * AMT based hardware can now take control from firmware
+ * Do this after reset.
+ */
+ if ((sc->sc_flags & WM_F_HAS_AMT) != 0)
+ wm_get_hw_control(sc);
+
if ((sc->sc_type == WM_T_PCH_SPT) &&
pci_intr_type(sc->sc_pc, sc->sc_intrs[0]) == PCI_INTR_TYPE_INTX)
wm_legacy_irq_quirk_spt(sc);