Source-Changes-HG archive

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

[src/trunk]: src/sys IFM_FDX and IFM_HDX use different bit, so set IFM_HDX bi...



details:   https://anonhg.NetBSD.org/src/rev/1772b55ecb79
branches:  trunk
changeset: 329994:1772b55ecb79
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Jun 16 16:48:16 2014 +0000

description:
IFM_FDX and IFM_HDX use different bit, so set IFM_HDX bit if it's not full
duplex. For many drivers, it recognize half duplex if IFM_FDX isn't set,
but not for others. Same as {Free|Open}BSD.

diffstat:

 sys/arch/mips/adm5120/dev/if_admsw.c |   6 ++++--
 sys/dev/ic/rtl80x9.c                 |   6 ++++--
 sys/dev/mii/acphy.c                  |   7 +++++--
 sys/dev/mii/amhphy.c                 |   6 ++++--
 sys/dev/mii/brgphy.c                 |  12 ++++++------
 sys/dev/mii/ciphy.c                  |   6 ++++--
 sys/dev/mii/dmphy.c                  |   8 ++++----
 sys/dev/mii/gentbi.c                 |   6 ++++--
 sys/dev/mii/glxtphy.c                |   6 ++++--
 sys/dev/mii/gphyter.c                |   6 ++++--
 sys/dev/mii/icsphy.c                 |   7 +++++--
 sys/dev/mii/igphy.c                  |   6 ++++--
 sys/dev/mii/ihphy.c                  |   9 +++++----
 sys/dev/mii/ikphy.c                  |   6 ++++--
 sys/dev/mii/inphy.c                  |   7 +++++--
 sys/dev/mii/iophy.c                  |   6 ++++--
 sys/dev/mii/lxtphy.c                 |   7 +++++--
 sys/dev/mii/makphy.c                 |   6 ++++--
 sys/dev/mii/mvphy.c                  |   6 ++++--
 sys/dev/mii/nsphy.c                  |  15 ++++++---------
 sys/dev/mii/nsphyter.c               |   7 +++++--
 sys/dev/mii/qsphy.c                  |  10 +++++-----
 sys/dev/mii/rlphy.c                  |  12 ++++++------
 sys/dev/mii/sqphy.c                  |   6 ++++--
 sys/dev/mii/tlphy.c                  |   6 ++++--
 sys/dev/mii/tqphy.c                  |   7 +++++--
 sys/dev/mii/ukphy_subr.c             |  12 ++++++------
 sys/dev/mii/urlphy.c                 |   7 +++++--
 sys/dev/pci/if_kse.c                 |   8 ++++----
 sys/dev/pci/if_txp.c                 |  10 +++++-----
 sys/dev/pci/if_wm.c                  |   6 ++++--
 31 files changed, 142 insertions(+), 93 deletions(-)

diffs (truncated from 965 to 300 lines):

diff -r de6e3a524729 -r 1772b55ecb79 sys/arch/mips/adm5120/dev/if_admsw.c
--- a/sys/arch/mips/adm5120/dev/if_admsw.c      Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/arch/mips/adm5120/dev/if_admsw.c      Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_admsw.c,v 1.11 2012/10/27 17:18:01 chs Exp $ */
+/* $NetBSD: if_admsw.c,v 1.12 2014/06/16 16:48:16 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.11 2012/10/27 17:18:01 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.12 2014/06/16 16:48:16 msaitoh Exp $");
 
 
 #include <sys/param.h>
@@ -1277,4 +1277,6 @@
        ifmr->ifm_active |= (status & PHY_ST_100M) ? IFM_100_TX : IFM_10_T;
        if (status & PHY_ST_FDX)
                ifmr->ifm_active |= IFM_FDX;
+       else
+               ifmr->ifm_active |= IFM_HDX;
 }
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/ic/rtl80x9.c
--- a/sys/dev/ic/rtl80x9.c      Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/dev/ic/rtl80x9.c      Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl80x9.c,v 1.15 2009/03/14 15:36:17 dsl Exp $ */
+/*     $NetBSD: rtl80x9.c,v 1.16 2014/06/16 16:48:16 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl80x9.c,v 1.15 2009/03/14 15:36:17 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl80x9.c,v 1.16 2014/06/16 16:48:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -92,6 +92,8 @@
                if (NIC_GET(sc->sc_regt, sc->sc_regh, NERTL_RTL3_CONFIG3) &
                    RTL3_CONFIG3_FUDUP)
                        ifmr->ifm_active |= IFM_FDX;
+               else
+                       ifmr->ifm_active |= IFM_HDX;
        }
 
        /* Set NIC to page 0 registers. */
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/mii/acphy.c
--- a/sys/dev/mii/acphy.c       Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/dev/mii/acphy.c       Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acphy.c,v 1.23 2008/11/17 03:04:27 dyoung Exp $        */
+/*     $NetBSD: acphy.c,v 1.24 2014/06/16 16:48:16 msaitoh Exp $       */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.23 2008/11/17 03:04:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.24 2014/06/16 16:48:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -248,8 +248,11 @@
                        mii->mii_media_active |= IFM_100_TX;
                else
                        mii->mii_media_active |= IFM_10_T;
+
                if (dr & DR_DPLX)
                        mii->mii_media_active |= IFM_FDX;
+               else
+                       mii->mii_media_active |= IFM_HDX;
        } else
                mii->mii_media_active = ife->ifm_media;
 }
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/mii/amhphy.c
--- a/sys/dev/mii/amhphy.c      Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/dev/mii/amhphy.c      Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amhphy.c,v 1.19 2008/11/17 03:04:27 dyoung Exp $       */
+/*     $NetBSD: amhphy.c,v 1.20 2014/06/16 16:48:16 msaitoh Exp $      */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.19 2008/11/17 03:04:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.20 2014/06/16 16:48:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -230,6 +230,8 @@
                        mii->mii_media_active |= IFM_10_T;
                if (ssr & SSR_FD)
                        mii->mii_media_active |= IFM_FDX;
+               else
+                       mii->mii_media_active |= IFM_HDX;
        } else
                mii->mii_media_active = ife->ifm_media;
 }
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/mii/brgphy.c
--- a/sys/dev/mii/brgphy.c      Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/dev/mii/brgphy.c      Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: brgphy.c,v 1.69 2014/06/12 12:09:47 msaitoh Exp $      */
+/*     $NetBSD: brgphy.c,v 1.70 2014/06/16 16:48:16 msaitoh Exp $      */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.69 2014/06/12 12:09:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.70 2014/06/16 16:48:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -575,7 +575,7 @@
                                break;
 
                        case BRGPHY_RES_1000HD:
-                               mii->mii_media_active |= IFM_1000_T;
+                               mii->mii_media_active |= IFM_1000_T | IFM_HDX;
                                gtsr = PHY_READ(sc, MII_100T2SR);
                                if (gtsr & GTSR_MS_RES)
                                        mii->mii_media_active |= IFM_ETH_MASTER;
@@ -586,11 +586,11 @@
                                break;
 
                        case BRGPHY_RES_100T4:
-                               mii->mii_media_active |= IFM_100_T4;
+                               mii->mii_media_active |= IFM_100_T4 | IFM_HDX;
                                break;
 
                        case BRGPHY_RES_100HD:
-                               mii->mii_media_active |= IFM_100_TX;
+                               mii->mii_media_active |= IFM_100_TX | IFM_HDX;
                                break;
 
                        case BRGPHY_RES_10FD:
@@ -598,7 +598,7 @@
                                break;
 
                        case BRGPHY_RES_10HD:
-                               mii->mii_media_active |= IFM_10_T;
+                               mii->mii_media_active |= IFM_10_T | IFM_HDX;
                                break;
 
                        default:
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/mii/ciphy.c
--- a/sys/dev/mii/ciphy.c       Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/dev/mii/ciphy.c       Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.24 2013/06/11 07:22:08 msaitoh Exp $ */
+/* $NetBSD: ciphy.c,v 1.25 2014/06/16 16:48:16 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.24 2013/06/11 07:22:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.25 2014/06/16 16:48:16 msaitoh Exp $");
 
 /*
  * Driver for the Cicada CS8201 10/100/1000 copper PHY.
@@ -363,6 +363,8 @@
 
        if (bmsr & CIPHY_AUXCSR_FDX)
                mii->mii_media_active |= IFM_FDX;
+       else
+               mii->mii_media_active |= IFM_HDX;
 
        return;
 }
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/mii/dmphy.c
--- a/sys/dev/mii/dmphy.c       Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/dev/mii/dmphy.c       Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dmphy.c,v 1.34 2009/10/19 18:41:13 bouyer Exp $        */
+/*     $NetBSD: dmphy.c,v 1.35 2014/06/16 16:48:16 msaitoh Exp $       */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.34 2009/10/19 18:41:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.35 2014/06/16 16:48:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -247,11 +247,11 @@
                if (dscsr & DSCSR_100FDX)
                        mii->mii_media_active |= IFM_100_TX|IFM_FDX;
                else if (dscsr & DSCSR_100HDX)
-                       mii->mii_media_active |= IFM_100_TX;
+                       mii->mii_media_active |= IFM_100_TX|IFM_HDX;
                else if (dscsr & DSCSR_10FDX)
                        mii->mii_media_active |= IFM_10_T|IFM_FDX;
                else if (dscsr & DSCSR_10HDX)
-                       mii->mii_media_active |= IFM_10_T;
+                       mii->mii_media_active |= IFM_10_T|IFM_HDX;
                else
                        mii->mii_media_active |= IFM_NONE;
        } else
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/mii/gentbi.c
--- a/sys/dev/mii/gentbi.c      Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/dev/mii/gentbi.c      Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gentbi.c,v 1.26 2014/06/16 14:43:22 msaitoh Exp $      */
+/*     $NetBSD: gentbi.c,v 1.27 2014/06/16 16:48:16 msaitoh Exp $      */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gentbi.c,v 1.26 2014/06/16 14:43:22 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gentbi.c,v 1.27 2014/06/16 16:48:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -281,6 +281,8 @@
                    (anlpar & ANLPAR_X_FD) != 0)
                        mii->mii_media_active |=
                            IFM_FDX | mii_phy_flowstatus(sc);
+               else
+                       mii->mii_media_active |= IFM_HDX;
        } else
                mii->mii_media_active = ife->ifm_media;
 }
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/mii/glxtphy.c
--- a/sys/dev/mii/glxtphy.c     Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/dev/mii/glxtphy.c     Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: glxtphy.c,v 1.23 2009/10/19 18:41:13 bouyer Exp $      */
+/*     $NetBSD: glxtphy.c,v 1.24 2014/06/16 16:48:16 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.23 2009/10/19 18:41:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.24 2014/06/16 16:48:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -265,6 +265,8 @@
                if (qsr & QSR_DUPLEX)
                        mii->mii_media_active |=
                            IFM_FDX | mii_phy_flowstatus(sc);
+               else
+                       mii->mii_media_active |= IFM_HDX;
        } else
                mii->mii_media_active = ife->ifm_media;
 }
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/mii/gphyter.c
--- a/sys/dev/mii/gphyter.c     Mon Jun 16 16:29:30 2014 +0000
+++ b/sys/dev/mii/gphyter.c     Mon Jun 16 16:48:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gphyter.c,v 1.28 2010/01/07 09:30:28 jdc Exp $ */
+/*     $NetBSD: gphyter.c,v 1.29 2014/06/16 16:48:16 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.28 2010/01/07 09:30:28 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.29 2014/06/16 16:48:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -300,6 +300,8 @@
                if (physup & PHY_SUP_DUPLEX)
                        mii->mii_media_active |=
                            IFM_FDX | mii_phy_flowstatus(sc);
+               else
+                       mii->mii_media_active |= IFM_HDX;
        } else
                mii->mii_media_active = ife->ifm_media;
 }
diff -r de6e3a524729 -r 1772b55ecb79 sys/dev/mii/icsphy.c



Home | Main Index | Thread Index | Old Index