Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Fix a bug that the duplex of manual media settin...



details:   https://anonhg.NetBSD.org/src/rev/0618ae993409
branches:  trunk
changeset: 998234:0618ae993409
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Apr 11 08:50:59 2019 +0000

description:
Fix a bug that the duplex of manual media setting may be wrong
when the IFM_GMASK bit other than IFM_[FH]DX is set.

diffstat:

 sys/arch/arm/imx/if_enet.c           |  8 ++++----
 sys/arch/mips/adm5120/dev/if_admsw.c |  6 +++---
 sys/dev/pci/if_bge.c                 |  6 +++---
 sys/dev/pci/if_bnx.c                 |  6 +++---
 sys/dev/pci/if_et.c                  |  6 +++---
 sys/dev/pci/if_lii.c                 |  6 +++---
 sys/dev/pci/if_msk.c                 |  6 +++---
 sys/dev/pci/if_nfe.c                 |  6 +++---
 sys/dev/pci/if_sk.c                  |  6 +++---
 sys/dev/pci/if_ti.c                  |  8 ++++----
 sys/dev/pci/if_txp.c                 |  8 ++++----
 sys/dev/pci/if_vge.c                 |  6 +++---
 sys/dev/usb/if_axen.c                |  6 +++---
 13 files changed, 42 insertions(+), 42 deletions(-)

diffs (truncated from 376 to 300 lines):

diff -r 857b5eeafc66 -r 0618ae993409 sys/arch/arm/imx/if_enet.c
--- a/sys/arch/arm/imx/if_enet.c        Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/arch/arm/imx/if_enet.c        Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_enet.c,v 1.17 2019/01/22 03:42:25 msaitoh Exp $     */
+/*     $NetBSD: if_enet.c,v 1.18 2019/04/11 08:50:59 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2014 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.17 2019/01/22 03:42:25 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.18 2019/04/11 08:50:59 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -1172,7 +1172,7 @@
                mii->mii_media_active &= ~IFM_ETH_FMASK;
        }
 
-       if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) {
+       if ((ife->ifm_media & IFM_FDX) != 0) {
                tcr |= ENET_TCR_FDEN;   /* full duplex */
                rcr &= ~ENET_RCR_DRT;;  /* enable receive on transmit */
        } else {
@@ -1787,7 +1787,7 @@
                mii = &sc->sc_mii;
                ife = mii->mii_media.ifm_cur;
 
-               if ((ife->ifm_media & IFM_GMASK) == IFM_FDX)
+               if ((ife->ifm_media & IFM_FDX) != 0)
                        fulldup = 1;
                else
                        fulldup = 0;
diff -r 857b5eeafc66 -r 0618ae993409 sys/arch/mips/adm5120/dev/if_admsw.c
--- a/sys/arch/mips/adm5120/dev/if_admsw.c      Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/arch/mips/adm5120/dev/if_admsw.c      Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_admsw.c,v 1.18 2018/09/03 16:29:25 riastradh Exp $ */
+/* $NetBSD: if_admsw.c,v 1.19 2019/04/11 08:50:59 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.18 2018/09/03 16:29:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.19 2019/04/11 08:50:59 msaitoh Exp $");
 
 
 #include <sys/param.h>
@@ -1232,7 +1232,7 @@
        if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) {
                val = PHY_CNTL2_AUTONEG|PHY_CNTL2_100M|PHY_CNTL2_FDX;
        } else if (IFM_SUBTYPE(ifm->ifm_media) == IFM_100_TX) {
-               if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX)
+               if ((ifm->ifm_media & IFM_FDX) != 0)
                        val = PHY_CNTL2_100M|PHY_CNTL2_FDX;
                else
                        val = PHY_CNTL2_100M;
diff -r 857b5eeafc66 -r 0618ae993409 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/dev/pci/if_bge.c      Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.328 2019/04/05 18:14:54 bouyer Exp $      */
+/*     $NetBSD: if_bge.c,v 1.329 2019/04/11 08:50:59 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.328 2019/04/05 18:14:54 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.329 2019/04/11 08:50:59 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -5677,7 +5677,7 @@
                        }
                        break;
                case IFM_1000_SX:
-                       if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
+                       if ((ifm->ifm_media & IFM_FDX) != 0) {
                                BGE_CLRBIT(sc, BGE_MAC_MODE,
                                    BGE_MACMODE_HALF_DUPLEX);
                        } else {
diff -r 857b5eeafc66 -r 0618ae993409 sys/dev/pci/if_bnx.c
--- a/sys/dev/pci/if_bnx.c      Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/dev/pci/if_bnx.c      Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bnx.c,v 1.80 2019/04/08 03:56:08 msaitoh Exp $      */
+/*     $NetBSD: if_bnx.c,v 1.81 2019/04/11 08:50:59 msaitoh Exp $      */
 /*     $OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $       */
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.80 2019/04/08 03:56:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.81 2019/04/11 08:50:59 msaitoh Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -1305,7 +1305,7 @@
        /* Set half or full duplex based on the duplicity
         * negotiated by the PHY.
         */
-       if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) {
+       if ((mii->mii_media_active & IFM_HDX) != 0) {
                DBPRINT(sc, BNX_INFO, "Setting Half-Duplex interface.\n");
                val |= BNX_EMAC_MODE_HALF_DUPLEX;
        } else
diff -r 857b5eeafc66 -r 0618ae993409 sys/dev/pci/if_et.c
--- a/sys/dev/pci/if_et.c       Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/dev/pci/if_et.c       Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_et.c,v 1.20 2019/01/22 03:42:27 msaitoh Exp $       */
+/*     $NetBSD: if_et.c,v 1.21 2019/04/11 08:50:59 msaitoh Exp $       */
 /*     $OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $  */
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.20 2019/01/22 03:42:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.21 2019/04/11 08:50:59 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -468,7 +468,7 @@
                ctrl |= ET_MAC_CTRL_MODE_MII;
        }
 
-       if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX)
+       if ((mii->mii_media_active & IFM_FDX) != 0)
                cfg2 |= ET_MAC_CFG2_FDX;
        else
                ctrl |= ET_MAC_CTRL_GHDX;
diff -r 857b5eeafc66 -r 0618ae993409 sys/dev/pci/if_lii.c
--- a/sys/dev/pci/if_lii.c      Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/dev/pci/if_lii.c      Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_lii.c,v 1.20 2019/01/22 03:42:27 msaitoh Exp $      */
+/*     $NetBSD: if_lii.c,v 1.21 2019/04/11 08:50:59 msaitoh Exp $      */
 
 /*
  *  Copyright (c) 2008 The NetBSD Foundation.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.20 2019/01/22 03:42:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.21 2019/04/11 08:50:59 msaitoh Exp $");
 
 
 #include <sys/param.h>
@@ -654,7 +654,7 @@
 
        val = AT_READ_4(sc, ATL2_MACC);
 
-       if ((sc->sc_mii.mii_media_active & IFM_GMASK) == IFM_FDX)
+       if ((sc->sc_mii.mii_media_active & IFM_FDX) != 0)
                val |= MACC_FDX;
        else
                val &= ~MACC_FDX;
diff -r 857b5eeafc66 -r 0618ae993409 sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c      Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/dev/pci/if_msk.c      Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.86 2019/02/03 03:19:27 mrg Exp $ */
+/* $NetBSD: if_msk.c,v 1.87 2019/04/11 08:50:59 msaitoh Exp $ */
 /*     $OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $     */
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.86 2019/02/03 03:19:27 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.87 2019/04/11 08:50:59 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -326,7 +326,7 @@
 
                /* Set duplex. */
                gpcr |= YU_GPCR_DPLX_DIS;
-               if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX)
+               if ((mii->mii_media_active & IFM_FDX) != 0)
                        gpcr |= YU_GPCR_DUPLEX;
 
                /* Disable flow control. */
diff -r 857b5eeafc66 -r 0618ae993409 sys/dev/pci/if_nfe.c
--- a/sys/dev/pci/if_nfe.c      Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/dev/pci/if_nfe.c      Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_nfe.c,v 1.67 2019/01/22 03:42:27 msaitoh Exp $      */
+/*     $NetBSD: if_nfe.c,v 1.68 2019/04/11 08:50:59 msaitoh Exp $      */
 /*     $OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $        */
 
 /*-
@@ -21,7 +21,7 @@
 /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.67 2019/01/22 03:42:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.68 2019/04/11 08:50:59 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -494,7 +494,7 @@
        seed = NFE_READ(sc, NFE_RNDSEED);
        seed &= ~NFE_SEED_MASK;
 
-       if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) {
+       if ((mii->mii_media_active & IFM_HDX) != 0) {
                phy  |= NFE_PHY_HDX;    /* half-duplex */
                misc |= NFE_MISC1_HDX;
        }
diff -r 857b5eeafc66 -r 0618ae993409 sys/dev/pci/if_sk.c
--- a/sys/dev/pci/if_sk.c       Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/dev/pci/if_sk.c       Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sk.c,v 1.94 2019/02/03 03:19:27 mrg Exp $   */
+/*     $NetBSD: if_sk.c,v 1.95 2019/04/11 08:50:59 msaitoh Exp $       */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -115,7 +115,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.94 2019/02/03 03:19:27 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.95 2019/04/11 08:50:59 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -477,7 +477,7 @@
         * duplex mode accordingly.
         */
        if (sc_if->sk_phytype != SK_PHYTYPE_XMAC) {
-               if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX)
+               if ((mii->mii_media_active & IFM_FDX) != 0)
                        SK_XM_SETBIT_2(sc_if, XM_MMUCMD, XM_MMUCMD_GMIIFDX);
                else
                        SK_XM_CLRBIT_2(sc_if, XM_MMUCMD, XM_MMUCMD_GMIIFDX);
diff -r 857b5eeafc66 -r 0618ae993409 sys/dev/pci/if_ti.c
--- a/sys/dev/pci/if_ti.c       Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/dev/pci/if_ti.c       Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ti.c,v 1.106 2018/12/09 11:14:02 jdolecek Exp $ */
+/* $NetBSD: if_ti.c,v 1.107 2019/04/11 08:50:59 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.106 2018/12/09 11:14:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.107 2019/04/11 08:50:59 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -2582,7 +2582,7 @@
                break;
        case IFM_1000_SX:
        case IFM_1000_T:
-               if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
+               if ((ifm->ifm_media & IFM_FDX) != 0) {
                        CSR_WRITE_4(sc, TI_GCR_GLINK,
                            TI_GLNK_PREF|TI_GLNK_1000MB|TI_GLNK_FULL_DUPLEX|
                            TI_GLNK_RX_FLOWCTL_Y|TI_GLNK_ENB);
@@ -2607,7 +2607,7 @@
                } else {
                        TI_SETBIT(sc, TI_GCR_LINK, TI_LNK_10MB);
                }
-               if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
+               if ((ifm->ifm_media & IFM_FDX) != 0) {
                        TI_SETBIT(sc, TI_GCR_LINK, TI_LNK_FULL_DUPLEX);
                } else {
                        TI_SETBIT(sc, TI_GCR_LINK, TI_LNK_HALF_DUPLEX);
diff -r 857b5eeafc66 -r 0618ae993409 sys/dev/pci/if_txp.c
--- a/sys/dev/pci/if_txp.c      Thu Apr 11 08:50:20 2019 +0000
+++ b/sys/dev/pci/if_txp.c      Thu Apr 11 08:50:59 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_txp.c,v 1.51 2018/12/09 11:14:02 jdolecek Exp $ */
+/* $NetBSD: if_txp.c,v 1.52 2019/04/11 08:50:59 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001
@@ -32,7 +32,7 @@
  */
 



Home | Main Index | Thread Index | Old Index