Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/dev/pci Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/8a0d37cfdab0
branches:  netbsd-7
changeset: 799429:8a0d37cfdab0
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Jun 10 16:43:51 2015 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #833):
        sys/dev/pci/if_wm.c: revisions 1.322, 1.323
        sys/dev/pci/if_wmreg.h: revision 1.72
- Currently, WM_F_EEE bit is not set on all chips. It's intened to not
  to use all of EEE fuctions but wm_set_eee_i350() leaves IPCNFG_10BASE_TE
  bit and it causes link negotiation problem on some old switches. Disable
  10BASE-Te function, too.
- Call wm_set_eee_i350() on some chips, too.
--
Fix a bug that flags related to semaphore were incorrectly checked in
wm_kmrn_{readreg,writereg}. i80003, ICH* and PCH* had this problem.

diffstat:

 sys/dev/pci/if_wm.c    |  23 ++++++++++++-----------
 sys/dev/pci/if_wmreg.h |   3 ++-
 2 files changed, 14 insertions(+), 12 deletions(-)

diffs (108 lines):

diff -r 3420461a1055 -r 8a0d37cfdab0 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Wed Jun 10 16:41:12 2015 +0000
+++ b/sys/dev/pci/if_wm.c       Wed Jun 10 16:43:51 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.289.2.7 2015/05/19 05:09:02 snj Exp $      */
+/*     $NetBSD: if_wm.c,v 1.289.2.8 2015/06/10 16:43:51 snj Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.289.2.7 2015/05/19 05:09:02 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.289.2.8 2015/06/10 16:43:51 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3766,7 +3766,7 @@
        /* reload sc_ctrl */
        sc->sc_ctrl = CSR_READ(sc, WMREG_CTRL);
 
-       if (sc->sc_type == WM_T_I350)
+       if ((sc->sc_type >= WM_T_I350) && (sc->sc_type <= WM_T_I211))
                wm_set_eee_i350(sc);
 
        /* dummy read from WUC */
@@ -7240,13 +7240,13 @@
 {
        int rv;
 
-       if (sc->sc_flags == WM_F_LOCK_SWFW) {
+       if (sc->sc_flags & WM_F_LOCK_SWFW) {
                if (wm_get_swfw_semaphore(sc, SWFW_MAC_CSR_SM)) {
                        aprint_error_dev(sc->sc_dev,
                            "%s: failed to get semaphore\n", __func__);
                        return 0;
                }
-       } else if (sc->sc_flags == WM_F_LOCK_EXTCNF) {
+       } else if (sc->sc_flags & WM_F_LOCK_EXTCNF) {
                if (wm_get_swfwhw_semaphore(sc)) {
                        aprint_error_dev(sc->sc_dev,
                            "%s: failed to get semaphore\n", __func__);
@@ -7262,9 +7262,9 @@
 
        rv = CSR_READ(sc, WMREG_KUMCTRLSTA) & KUMCTRLSTA_MASK;
 
-       if (sc->sc_flags == WM_F_LOCK_SWFW)
+       if (sc->sc_flags & WM_F_LOCK_SWFW)
                wm_put_swfw_semaphore(sc, SWFW_MAC_CSR_SM);
-       else if (sc->sc_flags == WM_F_LOCK_EXTCNF)
+       else if (sc->sc_flags & WM_F_LOCK_EXTCNF)
                wm_put_swfwhw_semaphore(sc);
 
        return rv;
@@ -7279,13 +7279,13 @@
 wm_kmrn_writereg(struct wm_softc *sc, int reg, int val)
 {
 
-       if (sc->sc_flags == WM_F_LOCK_SWFW) {
+       if (sc->sc_flags & WM_F_LOCK_SWFW) {
                if (wm_get_swfw_semaphore(sc, SWFW_MAC_CSR_SM)) {
                        aprint_error_dev(sc->sc_dev,
                            "%s: failed to get semaphore\n", __func__);
                        return;
                }
-       } else if (sc->sc_flags == WM_F_LOCK_EXTCNF) {
+       } else if (sc->sc_flags & WM_F_LOCK_EXTCNF) {
                if (wm_get_swfwhw_semaphore(sc)) {
                        aprint_error_dev(sc->sc_dev,
                            "%s: failed to get semaphore\n", __func__);
@@ -7297,9 +7297,9 @@
            ((reg << KUMCTRLSTA_OFFSET_SHIFT) & KUMCTRLSTA_OFFSET) |
            (val & KUMCTRLSTA_MASK));
 
-       if (sc->sc_flags == WM_F_LOCK_SWFW)
+       if (sc->sc_flags & WM_F_LOCK_SWFW)
                wm_put_swfw_semaphore(sc, SWFW_MAC_CSR_SM);
-       else if (sc->sc_flags == WM_F_LOCK_EXTCNF)
+       else if (sc->sc_flags & WM_F_LOCK_EXTCNF)
                wm_put_swfwhw_semaphore(sc);
 }
 
@@ -9535,6 +9535,7 @@
                    | EEER_LPI_FC);
        } else {
                ipcnfg &= ~(IPCNFG_EEE_1G_AN | IPCNFG_EEE_100M_AN);
+               ipcnfg &= ~IPCNFG_10BASE_TE;
                eeer &= ~(EEER_TX_LPI_EN | EEER_RX_LPI_EN
                    | EEER_LPI_FC);
        }
diff -r 3420461a1055 -r 8a0d37cfdab0 sys/dev/pci/if_wmreg.h
--- a/sys/dev/pci/if_wmreg.h    Wed Jun 10 16:41:12 2015 +0000
+++ b/sys/dev/pci/if_wmreg.h    Wed Jun 10 16:43:51 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wmreg.h,v 1.60.2.3 2015/05/19 05:09:02 snj Exp $    */
+/*     $NetBSD: if_wmreg.h,v 1.60.2.4 2015/06/10 16:43:51 snj Exp $    */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -642,6 +642,7 @@
 #define EEER_EEER_TX_LPI_STATUS        0x80000000 /* EEER Tx in LPI state */
 #define WMREG_EEE_SU   0x0e34  /* EEE Setup */
 #define WMREG_IPCNFG   0x0e38  /* Internal PHY Configuration */
+#define IPCNFG_10BASE_TE       0x00000002 /* IPCNFG 10BASE-Te low power op. */
 #define IPCNFG_EEE_100M_AN     0x00000004 /* IPCNFG EEE Ena 100M AN */
 #define IPCNFG_EEE_1G_AN       0x00000008 /* IPCNFG EEE Ena 1G AN */
 



Home | Main Index | Thread Index | Old Index