Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Call wm_get_hw_control() correctly. This change ...



details:   https://anonhg.NetBSD.org/src/rev/08252005b1d5
branches:  trunk
changeset: 811449:08252005b1d5
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Oct 30 18:23:37 2015 +0000

description:
Call wm_get_hw_control() correctly. This change fixes a bug that some AMT
based systems doesn't linkup at 1000BaseT. The problem was observed on
HP Compaq dc7700.

 A lot of fixes have been done to wm(4) and igphy(4). Now PR#44893 should be
fixed.

diffstat:

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

diffs (67 lines):

diff -r ed95baa796c0 -r 08252005b1d5 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Fri Oct 30 18:20:16 2015 +0000
+++ b/sys/dev/pci/if_wm.c       Fri Oct 30 18:23:37 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.377 2015/10/30 07:44:52 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.378 2015/10/30 18:23:37 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.377 2015/10/30 07:44:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.378 2015/10/30 18:23:37 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -720,10 +720,12 @@
  * Management mode and power management related subroutines.
  * BMC, AMT, suspend/resume and EEE.
  */
+#ifdef WM_WOL
 static int     wm_check_mng_mode(struct wm_softc *);
 static int     wm_check_mng_mode_ich8lan(struct wm_softc *);
 static int     wm_check_mng_mode_82574(struct wm_softc *);
 static int     wm_check_mng_mode_generic(struct wm_softc *);
+#endif
 static int     wm_enable_mng_pass_thru(struct wm_softc *);
 static int     wm_check_reset_block(struct wm_softc *);
 static void    wm_get_hw_control(struct wm_softc *);
@@ -2028,7 +2030,8 @@
        case WM_T_PCH:
        case WM_T_PCH2:
        case WM_T_PCH_LPT:
-               if (wm_check_mng_mode(sc) != 0)
+               /* Non-AMT based hardware can now take control from firmware */
+               if ((sc->sc_flags & WM_F_HAS_AMT) == 0)
                        wm_get_hw_control(sc);
                break;
        default:
@@ -4458,7 +4461,8 @@
        case WM_T_PCH:
        case WM_T_PCH2:
        case WM_T_PCH_LPT:
-               if (wm_check_mng_mode(sc) != 0)
+               /* AMT based hardware can now take control from firmware */
+               if ((sc->sc_flags & WM_F_HAS_AMT) != 0)
                        wm_get_hw_control(sc);
                break;
        default:
@@ -10917,6 +10921,7 @@
  * BMC, AMT, suspend/resume and EEE.
  */
 
+#ifdef WM_WOL
 static int
 wm_check_mng_mode(struct wm_softc *sc)
 {
@@ -10988,6 +10993,7 @@
 
        return 0;
 }
+#endif /* WM_WOL */
 
 static int
 wm_enable_mng_pass_thru(struct wm_softc *sc)



Home | Main Index | Thread Index | Old Index