Module Name: src Committed By: martin Date: Sun Nov 9 12:13:16 UTC 2014
Modified Files: src/sys/arch/mips/adm5120/dev [netbsd-6]: if_admsw.c src/sys/dev/ic [netbsd-6]: rtl80x9.c src/sys/dev/mii [netbsd-6]: acphy.c amhphy.c bmtphy.c brgphy.c brgphyreg.h ciphy.c ciphyreg.h dmphy.c gentbi.c glxtphy.c gphyter.c icsphy.c igphy.c ihphy.c ikphy.c inphy.c iophy.c lxtphy.c makphy.c mii.h mvphy.c nsphy.c nsphyter.c qsphy.c rlphy.c sqphy.c tlphy.c tqphy.c ukphy_subr.c urlphy.c src/sys/dev/pci [netbsd-6]: if_kse.c if_txp.c if_wm.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #1189): sys/dev/pci/if_wm.c: revision 1.270 sys/dev/mii/inphy.c: revision 1.53 sys/dev/mii/glxtphy.c: revision 1.24 sys/dev/mii/tlphy.c: revision 1.62 sys/dev/mii/iophy.c: revision 1.37 sys/dev/mii/brgphy.c: revision 1.70 sys/dev/mii/ihphy.c: revision 1.8 sys/dev/mii/bmtphy.c: revision 1.31 sys/dev/mii/urlphy.c: revision 1.30 sys/dev/mii/makphy.c: revision 1.40 sys/dev/mii/qsphy.c: revision 1.48 sys/dev/mii/igphy.c: revision 1.23 sys/dev/mii/nsphy.c: revision 1.58 sys/dev/mii/mvphy.c: revision 1.10 sys/dev/pci/if_txp.c: revision 1.41 sys/dev/mii/nsphy.c: revision 1.59 sys/dev/mii/rlphy.c: revision 1.28 sys/dev/mii/icsphy.c: revision 1.49 sys/dev/mii/rlphy.c: revision 1.29 sys/dev/mii/lxtphy.c: revision 1.49 sys/dev/mii/ciphyreg.h: revision 1.5 sys/dev/mii/nsphyter.c: revision 1.38 sys/dev/mii/sqphy.c: revision 1.50 sys/dev/mii/gentbi.c: revision 1.26 sys/dev/mii/gentbi.c: revision 1.27 sys/dev/mii/tqphy.c: revision 1.39 sys/dev/mii/ikphy.c: revision 1.10 sys/dev/mii/dmphy.c: revision 1.35 sys/dev/mii/amhphy.c: revision 1.20 sys/dev/mii/acphy.c: revision 1.24 sys/dev/mii/ciphy.c: revision 1.25 sys/dev/mii/brgphyreg.h: revision 1.8 sys/dev/mii/ukphy_subr.c: revision 1.12 sys/dev/ic/rtl80x9.c: revision 1.16 sys/arch/mips/adm5120/dev/if_admsw.c: revision 1.12 sys/dev/pci/if_kse.c: revision 1.28 sys/dev/mii/ukphy_subr.c: revision 1.13 sys/dev/mii/mii.h: revision 1.18 sys/dev/mii/gphyter.c: revision 1.29 No functional change: - Fix typo. - Remove trailing white spaces. - Capitalize comments. - Tabify. - KNF. 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. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.8.1 src/sys/arch/mips/adm5120/dev/if_admsw.c cvs rdiff -u -r1.15 -r1.15.18.1 src/sys/dev/ic/rtl80x9.c cvs rdiff -u -r1.23 -r1.23.22.1 src/sys/dev/mii/acphy.c cvs rdiff -u -r1.19 -r1.19.22.1 src/sys/dev/mii/amhphy.c cvs rdiff -u -r1.30 -r1.30.18.1 src/sys/dev/mii/bmtphy.c cvs rdiff -u -r1.59.8.5 -r1.59.8.6 src/sys/dev/mii/brgphy.c cvs rdiff -u -r1.5 -r1.5.14.1 src/sys/dev/mii/brgphyreg.h cvs rdiff -u -r1.19 -r1.19.18.1 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.4 -r1.4.106.1 src/sys/dev/mii/ciphyreg.h cvs rdiff -u -r1.34 -r1.34.18.1 src/sys/dev/mii/dmphy.c cvs rdiff -u -r1.24 -r1.24.18.1 src/sys/dev/mii/gentbi.c cvs rdiff -u -r1.23 -r1.23.18.1 src/sys/dev/mii/glxtphy.c cvs rdiff -u -r1.28 -r1.28.18.1 src/sys/dev/mii/gphyter.c cvs rdiff -u -r1.48 -r1.48.18.1 src/sys/dev/mii/icsphy.c \ src/sys/dev/mii/lxtphy.c cvs rdiff -u -r1.21 -r1.21.16.1 src/sys/dev/mii/igphy.c cvs rdiff -u -r1.2 -r1.2.10.1 src/sys/dev/mii/ihphy.c cvs rdiff -u -r1.9 -r1.9.18.1 src/sys/dev/mii/ikphy.c src/sys/dev/mii/mvphy.c cvs rdiff -u -r1.52 -r1.52.18.1 src/sys/dev/mii/inphy.c cvs rdiff -u -r1.36 -r1.36.18.1 src/sys/dev/mii/iophy.c cvs rdiff -u -r1.37 -r1.37.2.1 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.14.18.1 -r1.14.18.2 src/sys/dev/mii/mii.h cvs rdiff -u -r1.57 -r1.57.18.1 src/sys/dev/mii/nsphy.c cvs rdiff -u -r1.36 -r1.36.4.1 src/sys/dev/mii/nsphyter.c cvs rdiff -u -r1.47 -r1.47.18.1 src/sys/dev/mii/qsphy.c cvs rdiff -u -r1.27 -r1.27.10.1 src/sys/dev/mii/rlphy.c cvs rdiff -u -r1.49 -r1.49.18.1 src/sys/dev/mii/sqphy.c cvs rdiff -u -r1.59 -r1.59.18.1 src/sys/dev/mii/tlphy.c cvs rdiff -u -r1.38 -r1.38.18.1 src/sys/dev/mii/tqphy.c cvs rdiff -u -r1.11 -r1.11.18.1 src/sys/dev/mii/ukphy_subr.c cvs rdiff -u -r1.25 -r1.25.20.1 src/sys/dev/mii/urlphy.c cvs rdiff -u -r1.22 -r1.22.14.1 src/sys/dev/pci/if_kse.c cvs rdiff -u -r1.38 -r1.38.14.1 src/sys/dev/pci/if_txp.c cvs rdiff -u -r1.227.2.12 -r1.227.2.13 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/arch/mips/adm5120/dev/if_admsw.c diff -u src/sys/arch/mips/adm5120/dev/if_admsw.c:1.10 src/sys/arch/mips/adm5120/dev/if_admsw.c:1.10.8.1 --- src/sys/arch/mips/adm5120/dev/if_admsw.c:1.10 Sun Jul 10 23:13:23 2011 +++ src/sys/arch/mips/adm5120/dev/if_admsw.c Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_admsw.c,v 1.10 2011/07/10 23:13:23 matt Exp $ */ +/* $NetBSD: if_admsw.c,v 1.10.8.1 2014/11/09 12:13:16 martin 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.10 2011/07/10 23:13:23 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.10.8.1 2014/11/09 12:13:16 martin Exp $"); #include <sys/param.h> @@ -1276,4 +1276,6 @@ admsw_mediastatus(struct ifnet *ifp, str 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; } Index: src/sys/dev/ic/rtl80x9.c diff -u src/sys/dev/ic/rtl80x9.c:1.15 src/sys/dev/ic/rtl80x9.c:1.15.18.1 --- src/sys/dev/ic/rtl80x9.c:1.15 Sat Mar 14 15:36:17 2009 +++ src/sys/dev/ic/rtl80x9.c Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rtl80x9.c,v 1.15 2009/03/14 15:36:17 dsl Exp $ */ +/* $NetBSD: rtl80x9.c,v 1.15.18.1 2014/11/09 12:13:16 martin 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.15.18.1 2014/11/09 12:13:16 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,6 +92,8 @@ rtl80x9_mediastatus(struct dp8390_softc 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. */ Index: src/sys/dev/mii/acphy.c diff -u src/sys/dev/mii/acphy.c:1.23 src/sys/dev/mii/acphy.c:1.23.22.1 --- src/sys/dev/mii/acphy.c:1.23 Mon Nov 17 03:04:27 2008 +++ src/sys/dev/mii/acphy.c Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: acphy.c,v 1.23 2008/11/17 03:04:27 dyoung Exp $ */ +/* $NetBSD: acphy.c,v 1.23.22.1 2014/11/09 12:13:16 martin 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.23.22.1 2014/11/09 12:13:16 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -248,8 +248,11 @@ acphy_status(struct mii_softc *sc) 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; } Index: src/sys/dev/mii/amhphy.c diff -u src/sys/dev/mii/amhphy.c:1.19 src/sys/dev/mii/amhphy.c:1.19.22.1 --- src/sys/dev/mii/amhphy.c:1.19 Mon Nov 17 03:04:27 2008 +++ src/sys/dev/mii/amhphy.c Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: amhphy.c,v 1.19 2008/11/17 03:04:27 dyoung Exp $ */ +/* $NetBSD: amhphy.c,v 1.19.22.1 2014/11/09 12:13:16 martin 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.19.22.1 2014/11/09 12:13:16 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -230,6 +230,8 @@ amhphy_status(struct mii_softc *sc) 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; } Index: src/sys/dev/mii/bmtphy.c diff -u src/sys/dev/mii/bmtphy.c:1.30 src/sys/dev/mii/bmtphy.c:1.30.18.1 --- src/sys/dev/mii/bmtphy.c:1.30 Mon Oct 19 18:41:13 2009 +++ src/sys/dev/mii/bmtphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bmtphy.c,v 1.30 2009/10/19 18:41:13 bouyer Exp $ */ +/* $NetBSD: bmtphy.c,v 1.30.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bmtphy.c,v 1.30 2009/10/19 18:41:13 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bmtphy.c,v 1.30.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -247,7 +247,7 @@ bmtphy_status(struct mii_softc *sc) if (bmcr & BMCR_AUTOEN) { /* - * The media status bits are only valid of autonegotiation + * The media status bits are only valid if autonegotiation * has completed (or it's disabled). */ if ((bmsr & BMSR_ACOMP) == 0) { @@ -272,7 +272,7 @@ bmtphy_status(struct mii_softc *sc) mii->mii_media_active = ife->ifm_media; } -static void +static void bmtphy_reset(struct mii_softc *sc) { u_int16_t data; @@ -288,8 +288,7 @@ bmtphy_reset(struct mii_softc *sc) data = PHY_READ(sc, MII_BMTPHY_AUX2); PHY_WRITE(sc, MII_BMTPHY_AUX2, data | 0x0020); - /* Enable clocks across APD for - * Auto-MDIX functionality */ + /* Enable clocks across APD for Auto-MDIX functionality */ data = PHY_READ(sc, MII_BMTPHY_INTR); PHY_WRITE(sc, MII_BMTPHY_INTR, data | 0x0004); @@ -297,4 +296,4 @@ bmtphy_reset(struct mii_softc *sc) data = PHY_READ(sc, 0x1f); PHY_WRITE(sc, 0x1f, data & ~0x0080); } -} +} Index: src/sys/dev/mii/brgphy.c diff -u src/sys/dev/mii/brgphy.c:1.59.8.5 src/sys/dev/mii/brgphy.c:1.59.8.6 --- src/sys/dev/mii/brgphy.c:1.59.8.5 Tue Nov 4 09:23:20 2014 +++ src/sys/dev/mii/brgphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphy.c,v 1.59.8.5 2014/11/04 09:23:20 martin Exp $ */ +/* $NetBSD: brgphy.c,v 1.59.8.6 2014/11/09 12:13:15 martin 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.59.8.5 2014/11/04 09:23:20 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.59.8.6 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -576,7 +576,7 @@ brgphy_status(struct mii_softc *sc) 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; @@ -587,11 +587,11 @@ brgphy_status(struct mii_softc *sc) 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: @@ -599,7 +599,7 @@ brgphy_status(struct mii_softc *sc) break; case BRGPHY_RES_10HD: - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T | IFM_HDX; break; default: Index: src/sys/dev/mii/brgphyreg.h diff -u src/sys/dev/mii/brgphyreg.h:1.5 src/sys/dev/mii/brgphyreg.h:1.5.14.1 --- src/sys/dev/mii/brgphyreg.h:1.5 Thu Dec 9 23:25:49 2010 +++ src/sys/dev/mii/brgphyreg.h Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphyreg.h,v 1.5 2010/12/09 23:25:49 jym Exp $ */ +/* $NetBSD: brgphyreg.h,v 1.5.14.1 2014/11/09 12:13:16 martin Exp $ */ /* * Copyright (c) 2000 @@ -44,7 +44,7 @@ #define BRGPHY_MII_PHY_EXTCTL 0x10 /* PHY extended control */ #define BRGPHY_PHY_EXTCTL_MAC_PHY 0x8000 /* 10BIT/GMI-interface */ #define BRGPHY_PHY_EXTCTL_DIS_CROSS 0x4000 /* Disable MDI crossover */ -#define BRGPHY_PHY_EXTCTL_TX_DIS 0x2000 /* Tx output disable d*/ +#define BRGPHY_PHY_EXTCTL_TX_DIS 0x2000 /* Tx output disabled */ #define BRGPHY_PHY_EXTCTL_INT_DIS 0x1000 /* Interrupts disabled */ #define BRGPHY_PHY_EXTCTL_F_INT 0x0800 /* Force interrupt */ #define BRGPHY_PHY_EXTCTL_BY_45 0x0400 /* Bypass 4B5B-Decoder */ @@ -85,7 +85,7 @@ #define BRGPHY_MII_RXERRCNT 0x12 /* RX error counter */ -#define BRGPHY_MII_FCERRCNT 0x13 /* false carrier sense counter */ +#define BRGPHY_MII_FCERRCNT 0x13 /* False carrier sense counter */ #define BGRPHY_FCERRCNT 0x00FF /* False carrier counter */ #define BRGPHY_MII_RXNOCNT 0x14 /* RX not OK counter */ @@ -140,14 +140,14 @@ #define BRGPHY_AUXCTL_DIAG_MODE 0x0004 /* Diagnostic mode */ #define BRGPHY_MII_AUXSTS 0x19 /* AUX status */ -#define BRGPHY_AUXSTS_ACOMP 0x8000 /* autoneg complete */ -#define BRGPHY_AUXSTS_AN_ACK 0x4000 /* autoneg complete ack */ -#define BRGPHY_AUXSTS_AN_ACK_D 0x2000 /* autoneg complete ack detect */ -#define BRGPHY_AUXSTS_AN_NPW 0x1000 /* autoneg next page wait */ -#define BRGPHY_AUXSTS_AN_RES 0x0700 /* AN HDC */ +#define BRGPHY_AUXSTS_ACOMP 0x8000 /* Autoneg complete */ +#define BRGPHY_AUXSTS_AN_ACK 0x4000 /* Autoneg complete ack */ +#define BRGPHY_AUXSTS_AN_ACK_D 0x2000 /* Autoneg complete ack detect */ +#define BRGPHY_AUXSTS_AN_NPW 0x1000 /* Autoneg next page wait */ +#define BRGPHY_AUXSTS_AN_RES 0x0700 /* Autoneg HCD */ #define BRGPHY_AUXSTS_PDF 0x0080 /* Parallel detect. fault */ -#define BRGPHY_AUXSTS_RF 0x0040 /* remote fault */ -#define BRGPHY_AUXSTS_ANP_R 0x0020 /* AN page received */ +#define BRGPHY_AUXSTS_RF 0x0040 /* Remote fault */ +#define BRGPHY_AUXSTS_ANP_R 0x0020 /* Autoneg page received */ #define BRGPHY_AUXSTS_LP_ANAB 0x0010 /* LP AN ability */ #define BRGPHY_AUXSTS_LP_NPAB 0x0008 /* LP Next page ability */ #define BRGPHY_AUXSTS_LINK 0x0004 /* Link status */ @@ -162,11 +162,11 @@ #define BRGPHY_RES_10FD 0x0200 /* 10baseT full duplex */ #define BRGPHY_RES_10HD 0x0100 /* 10baseT half duplex */ -#define BRGPHY_MII_ISR 0x1A /* interrupt status */ +#define BRGPHY_MII_ISR 0x1A /* Interrupt status */ #define BRGPHY_ISR_PSERR 0x4000 /* Pair swap error */ #define BRGPHY_ISR_MDXI_SC 0x2000 /* MDIX Status Change */ -#define BRGPHY_ISR_HCT 0x1000 /* counter above 32K */ -#define BRGPHY_ISR_LCT 0x0800 /* all counter below 128 */ +#define BRGPHY_ISR_HCT 0x1000 /* Counter above 32K */ +#define BRGPHY_ISR_LCT 0x0800 /* All counter below 128 */ #define BRGPHY_ISR_AN_PR 0x0400 /* Autoneg page received */ #define BRGPHY_ISR_NO_HDCL 0x0200 /* No HCD Link */ #define BRGPHY_ISR_NO_HDC 0x0100 /* No HCD */ @@ -177,13 +177,13 @@ #define BRGPHY_ISR_DUP_CHG 0x0008 /* Duplex mode change */ #define BRGPHY_ISR_LSP_CHG 0x0004 /* Link speed changed */ #define BRGPHY_ISR_LNK_CHG 0x0002 /* Link status change */ -#define BRGPHY_ISR_CRCERR 0x0001 /* CEC error */ +#define BRGPHY_ISR_CRCERR 0x0001 /* CRC error */ -#define BRGPHY_MII_IMR 0x1B /* interrupt mask */ +#define BRGPHY_MII_IMR 0x1B /* Interrupt mask */ #define BRGPHY_IMR_PSERR 0x4000 /* Pair swap error */ #define BRGPHY_IMR_MDXI_SC 0x2000 /* MDIX Status Change */ -#define BRGPHY_IMR_HCT 0x1000 /* counter above 32K */ -#define BRGPHY_IMR_LCT 0x0800 /* all counter below 128 */ +#define BRGPHY_IMR_HCT 0x1000 /* Counter above 32K */ +#define BRGPHY_IMR_LCT 0x0800 /* All counter below 128 */ #define BRGPHY_IMR_AN_PR 0x0400 /* Autoneg page received */ #define BRGPHY_IMR_NO_HDCL 0x0200 /* No HCD Link */ #define BRGPHY_IMR_NO_HDC 0x0100 /* No HCD */ @@ -194,7 +194,7 @@ #define BRGPHY_IMR_DUP_CHG 0x0008 /* Duplex mode change */ #define BRGPHY_IMR_LSP_CHG 0x0004 /* Link speed changed */ #define BRGPHY_IMR_LNK_CHG 0x0002 /* Link status change */ -#define BRGPHY_IMR_CRCERR 0x0001 /* CEC error */ +#define BRGPHY_IMR_CRCERR 0x0001 /* CRC error */ /*******************************************************/ /* Begin: Shared SerDes PHY register definitions */ Index: src/sys/dev/mii/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.19 src/sys/dev/mii/ciphy.c:1.19.18.1 --- src/sys/dev/mii/ciphy.c:1.19 Tue May 12 14:31:27 2009 +++ src/sys/dev/mii/ciphy.c Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.19 2009/05/12 14:31:27 cegger Exp $ */ +/* $NetBSD: ciphy.c,v 1.19.18.1 2014/11/09 12:13:16 martin Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.19 2009/05/12 14:31:27 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.19.18.1 2014/11/09 12:13:16 martin Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -342,6 +342,8 @@ ciphy_status(struct mii_softc *sc) if (bmsr & CIPHY_AUXCSR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; return; } Index: src/sys/dev/mii/ciphyreg.h diff -u src/sys/dev/mii/ciphyreg.h:1.4 src/sys/dev/mii/ciphyreg.h:1.4.106.1 --- src/sys/dev/mii/ciphyreg.h:1.4 Sun Mar 12 22:41:41 2006 +++ src/sys/dev/mii/ciphyreg.h Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphyreg.h,v 1.4 2006/03/12 22:41:41 chs Exp $ */ +/* $NetBSD: ciphyreg.h,v 1.4.106.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 2004 @@ -172,7 +172,7 @@ /* Vendor-specific PHY registers */ -/* 100baseTX status extention register */ +/* 100baseTX status extension register */ #define CIPHY_MII_100STS 0x10 #define CIPHY_100STS_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_100STS_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -183,7 +183,7 @@ #define CIPHY_100STS_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_100STS_ESDERR 0x0100 /* premature end of stream error */ -/* 1000BT status extention register #2 */ +/* 1000BT status extension register #2 */ #define CIPHY_MII_1000STS2 0x11 #define CIPHY_1000STS2_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_1000STS2_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -193,7 +193,7 @@ #define CIPHY_1000STS2_TXERR 0x0400 /* transmit error detected */ #define CIPHY_1000STS2_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_1000STS2_ESDERR 0x0100 /* premature end of stream error */ -#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extention err detected */ +#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extension err detected */ #define CIPHY_1000STS2_BCM5400 0x0040 /* non-complient BCM5400 detected */ /* Bypass control register */ @@ -334,7 +334,7 @@ #define CIPHY_LED_LINKACTBLINK 0x0004 /* enable link/activity LED blink */ #define CIPHY_LED_BLINKRATE 0x0002 /* blink rate 0=10hz, 1=5hz */ -/* Auxilliary control and status register */ +/* Auxiliary control and status register */ #define CIPHY_MII_AUXCSR 0x1C #define CIPHY_AUXCSR_ANEGDONE 0x8000 /* Autoneg complete */ #define CIPHY_AUXCSR_ANEGOFF 0x4000 /* Autoneg disabled */ Index: src/sys/dev/mii/dmphy.c diff -u src/sys/dev/mii/dmphy.c:1.34 src/sys/dev/mii/dmphy.c:1.34.18.1 --- src/sys/dev/mii/dmphy.c:1.34 Mon Oct 19 18:41:13 2009 +++ src/sys/dev/mii/dmphy.c Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: dmphy.c,v 1.34 2009/10/19 18:41:13 bouyer Exp $ */ +/* $NetBSD: dmphy.c,v 1.34.18.1 2014/11/09 12:13:16 martin 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.34.18.1 2014/11/09 12:13:16 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -247,11 +247,11 @@ dmphy_status(struct mii_softc *sc) 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 Index: src/sys/dev/mii/gentbi.c diff -u src/sys/dev/mii/gentbi.c:1.24 src/sys/dev/mii/gentbi.c:1.24.18.1 --- src/sys/dev/mii/gentbi.c:1.24 Mon Oct 19 18:41:13 2009 +++ src/sys/dev/mii/gentbi.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: gentbi.c,v 1.24 2009/10/19 18:41:13 bouyer Exp $ */ +/* $NetBSD: gentbi.c,v 1.24.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -55,14 +55,14 @@ */ /* - * Driver for generic ten-bit (1000BASE-SX) interfaces, built in to + * Driver for generic ten-bit (1000BASE-SX) interfaces, built into * many Gigabit Ethernet chips. * * All we have to do here is correctly report speed and duplex. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gentbi.c,v 1.24 2009/10/19 18:41:13 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gentbi.c,v 1.24.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -249,7 +249,7 @@ gentbi_status(struct mii_softc *sc) if (bmcr & BMCR_AUTOEN) { /* - * The media status bits are only valid of autonegotiation + * The media status bits are only valid if autonegotiation * has completed (or it's disabled). */ if ((bmsr & BMSR_ACOMP) == 0) { @@ -269,6 +269,8 @@ gentbi_status(struct mii_softc *sc) (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; } Index: src/sys/dev/mii/glxtphy.c diff -u src/sys/dev/mii/glxtphy.c:1.23 src/sys/dev/mii/glxtphy.c:1.23.18.1 --- src/sys/dev/mii/glxtphy.c:1.23 Mon Oct 19 18:41:13 2009 +++ src/sys/dev/mii/glxtphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: glxtphy.c,v 1.23 2009/10/19 18:41:13 bouyer Exp $ */ +/* $NetBSD: glxtphy.c,v 1.23.18.1 2014/11/09 12:13:15 martin 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.23.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -265,6 +265,8 @@ glxtphy_status(struct mii_softc *sc) 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; } Index: src/sys/dev/mii/gphyter.c diff -u src/sys/dev/mii/gphyter.c:1.28 src/sys/dev/mii/gphyter.c:1.28.18.1 --- src/sys/dev/mii/gphyter.c:1.28 Thu Jan 7 09:30:28 2010 +++ src/sys/dev/mii/gphyter.c Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: gphyter.c,v 1.28 2010/01/07 09:30:28 jdc Exp $ */ +/* $NetBSD: gphyter.c,v 1.28.18.1 2014/11/09 12:13:16 martin 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.28.18.1 2014/11/09 12:13:16 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -300,6 +300,8 @@ gphyter_status(struct mii_softc *sc) 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; } Index: src/sys/dev/mii/icsphy.c diff -u src/sys/dev/mii/icsphy.c:1.48 src/sys/dev/mii/icsphy.c:1.48.18.1 --- src/sys/dev/mii/icsphy.c:1.48 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/icsphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: icsphy.c,v 1.48 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: icsphy.c,v 1.48.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: icsphy.c,v 1.48 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: icsphy.c,v 1.48.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -252,8 +252,11 @@ icsphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX; else mii->mii_media_active |= IFM_10_T; + if (qpr & QPR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Index: src/sys/dev/mii/lxtphy.c diff -u src/sys/dev/mii/lxtphy.c:1.48 src/sys/dev/mii/lxtphy.c:1.48.18.1 --- src/sys/dev/mii/lxtphy.c:1.48 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/lxtphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: lxtphy.c,v 1.48 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: lxtphy.c,v 1.48.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lxtphy.c,v 1.48 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lxtphy.c,v 1.48.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -272,8 +272,11 @@ lxtphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX; else mii->mii_media_active |= IFM_10_T; + if (csr & CSR_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Index: src/sys/dev/mii/igphy.c diff -u src/sys/dev/mii/igphy.c:1.21 src/sys/dev/mii/igphy.c:1.21.16.1 --- src/sys/dev/mii/igphy.c:1.21 Sun Mar 7 07:53:37 2010 +++ src/sys/dev/mii/igphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: igphy.c,v 1.21 2010/03/07 07:53:37 msaitoh Exp $ */ +/* $NetBSD: igphy.c,v 1.21.16.1 2014/11/09 12:13:15 martin Exp $ */ /* * The Intel copyright applies to the analog register setup, and the @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.21 2010/03/07 07:53:37 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.21.16.1 2014/11/09 12:13:15 martin Exp $"); #include "opt_mii.h" @@ -482,6 +482,8 @@ igphy_status(struct mii_softc *sc) if (pssr & PSSR_FULL_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; } Index: src/sys/dev/mii/ihphy.c diff -u src/sys/dev/mii/ihphy.c:1.2 src/sys/dev/mii/ihphy.c:1.2.10.1 --- src/sys/dev/mii/ihphy.c:1.2 Fri May 20 06:06:59 2011 +++ src/sys/dev/mii/ihphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ihphy.c,v 1.2 2011/05/20 06:06:59 msaitoh Exp $ */ +/* $NetBSD: ihphy.c,v 1.2.10.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.2 2011/05/20 06:06:59 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.2.10.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -294,8 +294,9 @@ ihphy_status(struct mii_softc *sc) } if (esr & IHPHY_ESR_DUPLEX) - mii->mii_media_active |= - IFM_FDX | mii_phy_flowstatus(sc); + mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc); + else + mii->mii_media_active |= IFM_HDX; } static void Index: src/sys/dev/mii/ikphy.c diff -u src/sys/dev/mii/ikphy.c:1.9 src/sys/dev/mii/ikphy.c:1.9.18.1 --- src/sys/dev/mii/ikphy.c:1.9 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/ikphy.c Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ikphy.c,v 1.9 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: ikphy.c,v 1.9.18.1 2014/11/09 12:13:16 martin Exp $ */ /******************************************************************************* Copyright (c) 2001-2005, Intel Corporation @@ -59,7 +59,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ikphy.c,v 1.9 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ikphy.c,v 1.9.18.1 2014/11/09 12:13:16 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -342,6 +342,8 @@ ikphy_status(struct mii_softc *sc) if (pssr & GG82563_PSSR_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; kmrn = PHY_READ(sc, GG82563_PHY_KMRN_MODE_CTRL); Index: src/sys/dev/mii/mvphy.c diff -u src/sys/dev/mii/mvphy.c:1.9 src/sys/dev/mii/mvphy.c:1.9.18.1 --- src/sys/dev/mii/mvphy.c:1.9 Thu Jun 18 08:40:26 2009 +++ src/sys/dev/mii/mvphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: mvphy.c,v 1.9 2009/06/18 08:40:26 rjs Exp $ */ +/* $NetBSD: mvphy.c,v 1.9.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 2006 Sam Leffler, Errno Consulting @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mvphy.c,v 1.9 2009/06/18 08:40:26 rjs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mvphy.c,v 1.9.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -290,6 +290,8 @@ mvphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (hwstatus & MV_STATUS_RESOLVED_DUPLEX_FULL) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else { mii->mii_media_active |= IFM_NONE; /* XXX flush ATU only on link down transition */ Index: src/sys/dev/mii/inphy.c diff -u src/sys/dev/mii/inphy.c:1.52 src/sys/dev/mii/inphy.c:1.52.18.1 --- src/sys/dev/mii/inphy.c:1.52 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/inphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: inphy.c,v 1.52 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: inphy.c,v 1.52.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: inphy.c,v 1.52 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: inphy.c,v 1.52.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -252,8 +252,11 @@ inphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_T4; else mii->mii_media_active |= IFM_10_T; + if (scr & SCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; if (mii->mii_media_active & IFM_FDX) mii->mii_media_active |= mii_phy_flowstatus(sc); Index: src/sys/dev/mii/iophy.c diff -u src/sys/dev/mii/iophy.c:1.36 src/sys/dev/mii/iophy.c:1.36.18.1 --- src/sys/dev/mii/iophy.c:1.36 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/iophy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: iophy.c,v 1.36 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: iophy.c,v 1.36.18.1 2014/11/09 12:13:15 martin Exp $ */ /* * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iophy.c,v 1.36 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iophy.c,v 1.36.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -246,6 +246,8 @@ iophy_status(struct mii_softc *sc) if (ext0 & EXT0_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Index: src/sys/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.37 src/sys/dev/mii/makphy.c:1.37.2.1 --- src/sys/dev/mii/makphy.c:1.37 Sat Jan 21 16:48:08 2012 +++ src/sys/dev/mii/makphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.37 2012/01/21 16:48:08 chs Exp $ */ +/* $NetBSD: makphy.c,v 1.37.2.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.37 2012/01/21 16:48:08 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.37.2.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -314,6 +314,8 @@ makphy_status(struct mii_softc *sc) if (pssr & PSSR_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; } Index: src/sys/dev/mii/mii.h diff -u src/sys/dev/mii/mii.h:1.14.18.1 src/sys/dev/mii/mii.h:1.14.18.2 --- src/sys/dev/mii/mii.h:1.14.18.1 Tue Nov 4 09:23:20 2014 +++ src/sys/dev/mii/mii.h Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: mii.h,v 1.14.18.1 2014/11/04 09:23:20 martin Exp $ */ +/* $NetBSD: mii.h,v 1.14.18.2 2014/11/09 12:13:16 martin Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. All rights reserved. @@ -45,7 +45,7 @@ #define MII_COMMAND_WRITE 0x01 #define MII_COMMAND_ACK 0x02 -#define MII_BMCR 0x00 /* Basic mode control register (rw) */ +#define MII_BMCR 0x00 /* Basic mode control register (rw) */ #define BMCR_RESET 0x8000 /* reset */ #define BMCR_LOOP 0x4000 /* loopback */ #define BMCR_SPEED0 0x2000 /* speed selection (LSB) */ @@ -83,7 +83,7 @@ /* * Note that the EXTSTAT bit indicates that there is extended status * info available in register 15, but 802.3 section 22.2.4.3 also - * states that that all 1000 Mb/s capable PHYs will set this bit to 1. + * states that all 1000 Mb/s capable PHYs will set this bit to 1. */ #define BMSR_MEDIAMASK (BMSR_100T4|BMSR_100TXFDX|BMSR_100TXHDX| \ Index: src/sys/dev/mii/nsphy.c diff -u src/sys/dev/mii/nsphy.c:1.57 src/sys/dev/mii/nsphy.c:1.57.18.1 --- src/sys/dev/mii/nsphy.c:1.57 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/nsphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: nsphy.c,v 1.57 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: nsphy.c,v 1.57.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nsphy.c,v 1.57 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nsphy.c,v 1.57.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -264,7 +264,7 @@ nsphy_status(struct mii_softc *sc) if (bmcr & BMCR_AUTOEN) { /* - * The PAR status bits are only valid of autonegotiation + * The PAR status bits are only valid if autonegotiation * has completed (or it's disabled). */ if ((bmsr & BMSR_ACOMP) == 0) { @@ -284,13 +284,13 @@ nsphy_status(struct mii_softc *sc) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -306,10 +306,7 @@ nsphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; -#if 0 - if (par & PAR_FDX) - mii->mii_media_active |= IFM_FDX; -#endif + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Index: src/sys/dev/mii/nsphyter.c diff -u src/sys/dev/mii/nsphyter.c:1.36 src/sys/dev/mii/nsphyter.c:1.36.4.1 --- src/sys/dev/mii/nsphyter.c:1.36 Fri Nov 25 23:31:53 2011 +++ src/sys/dev/mii/nsphyter.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: nsphyter.c,v 1.36 2011/11/25 23:31:53 jakllsch Exp $ */ +/* $NetBSD: nsphyter.c,v 1.36.4.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nsphyter.c,v 1.36 2011/11/25 23:31:53 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nsphyter.c,v 1.36.4.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -256,9 +256,12 @@ nsphyter_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; + if (physts & PHYSTS_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; } Index: src/sys/dev/mii/qsphy.c diff -u src/sys/dev/mii/qsphy.c:1.47 src/sys/dev/mii/qsphy.c:1.47.18.1 --- src/sys/dev/mii/qsphy.c:1.47 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/qsphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: qsphy.c,v 1.47 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: qsphy.c,v 1.47.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.47 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.47.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -236,19 +236,19 @@ qsphy_status(struct mii_softc *sc) PHY_READ(sc, MII_QSPHY_PCTL); switch (pctl & PCTL_OPMASK) { case PCTL_10_T: - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; break; case PCTL_10_T_FDX: mii->mii_media_active |= IFM_10_T|IFM_FDX; break; case PCTL_100_TX: - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; break; case PCTL_100_TX_FDX: mii->mii_media_active |= IFM_100_TX|IFM_FDX; break; case PCTL_100_T4: - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; break; default: /* Erg... this shouldn't happen. */ Index: src/sys/dev/mii/rlphy.c diff -u src/sys/dev/mii/rlphy.c:1.27 src/sys/dev/mii/rlphy.c:1.27.10.1 --- src/sys/dev/mii/rlphy.c:1.27 Thu Jan 20 14:26:11 2011 +++ src/sys/dev/mii/rlphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rlphy.c,v 1.27 2011/01/20 14:26:11 pooka Exp $ */ +/* $NetBSD: rlphy.c,v 1.27.10.1 2014/11/09 12:13:15 martin Exp $ */ /* $OpenBSD: rlphy.c,v 1.20 2005/07/31 05:27:30 pvalchev Exp $ */ /* @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.27 2011/01/20 14:26:11 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.27.10.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -246,13 +246,13 @@ rlphy_status(struct mii_softc *sc) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -261,7 +261,7 @@ rlphy_status(struct mii_softc *sc) /* * If the other side doesn't support NWAY, then the * best we can do is determine if we have a 10Mbps or - * 100Mbps link. There's no way to know if the link + * 100Mbps link. There's no way to know if the link * is full or half duplex, so we default to half duplex * and hope that the user is clever enough to manually * change the media settings if we're wrong. @@ -296,7 +296,7 @@ rlphy_status(struct mii_softc *sc) else mii->mii_media_active |= IFM_100_TX; } - + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Index: src/sys/dev/mii/sqphy.c diff -u src/sys/dev/mii/sqphy.c:1.49 src/sys/dev/mii/sqphy.c:1.49.18.1 --- src/sys/dev/mii/sqphy.c:1.49 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/sqphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sqphy.c,v 1.49 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: sqphy.c,v 1.49.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sqphy.c,v 1.49 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sqphy.c,v 1.49.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -264,6 +264,8 @@ sqphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (status & STATUS_DPLX_DET) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Index: src/sys/dev/mii/tlphy.c diff -u src/sys/dev/mii/tlphy.c:1.59 src/sys/dev/mii/tlphy.c:1.59.18.1 --- src/sys/dev/mii/tlphy.c:1.59 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/tlphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: tlphy.c,v 1.59 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: tlphy.c,v 1.59.18.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.59 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.59.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -339,6 +339,8 @@ tlphy_status(struct mii_softc *sc) */ if (bmcr & BMCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; mii->mii_media_active |= IFM_10_T; } Index: src/sys/dev/mii/tqphy.c diff -u src/sys/dev/mii/tqphy.c:1.38 src/sys/dev/mii/tqphy.c:1.38.18.1 --- src/sys/dev/mii/tqphy.c:1.38 Mon Oct 19 18:41:14 2009 +++ src/sys/dev/mii/tqphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: tqphy.c,v 1.38 2009/10/19 18:41:14 bouyer Exp $ */ +/* $NetBSD: tqphy.c,v 1.38.18.1 2014/11/09 12:13:15 martin Exp $ */ /* * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tqphy.c,v 1.38 2009/10/19 18:41:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tqphy.c,v 1.38.18.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -250,8 +250,11 @@ tqphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX; else mii->mii_media_active |= IFM_10_T; + if (diag & DIAG_DPLX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Index: src/sys/dev/mii/ukphy_subr.c diff -u src/sys/dev/mii/ukphy_subr.c:1.11 src/sys/dev/mii/ukphy_subr.c:1.11.18.1 --- src/sys/dev/mii/ukphy_subr.c:1.11 Mon Feb 16 08:00:42 2009 +++ src/sys/dev/mii/ukphy_subr.c Sun Nov 9 12:13:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ukphy_subr.c,v 1.11 2009/02/16 08:00:42 cegger Exp $ */ +/* $NetBSD: ukphy_subr.c,v 1.11.18.1 2014/11/09 12:13:16 martin Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ukphy_subr.c,v 1.11 2009/02/16 08:00:42 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ukphy_subr.c,v 1.11.18.1 2014/11/09 12:13:16 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,7 +92,7 @@ ukphy_status(struct mii_softc *phy) anlpar = PHY_READ(phy, MII_ANAR) & PHY_READ(phy, MII_ANLPAR); if ((phy->mii_flags & MIIF_HAVE_GTCR) != 0 && (phy->mii_extcapabilities & - (EXTSR_1000THDX|EXTSR_1000TFDX)) != 0) { + (EXTSR_1000THDX | EXTSR_1000TFDX)) != 0) { gtcr = PHY_READ(phy, MII_100T2CR); gtsr = PHY_READ(phy, MII_100T2SR); } else @@ -102,17 +102,17 @@ ukphy_status(struct mii_softc *phy) mii->mii_media_active |= IFM_1000_T|IFM_FDX; else if ((gtcr & GTCR_ADV_1000THDX) && (gtsr & GTSR_LP_1000THDX)) - mii->mii_media_active |= IFM_1000_T; + mii->mii_media_active |= IFM_1000_T|IFM_HDX; else if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; Index: src/sys/dev/mii/urlphy.c diff -u src/sys/dev/mii/urlphy.c:1.25 src/sys/dev/mii/urlphy.c:1.25.20.1 --- src/sys/dev/mii/urlphy.c:1.25 Sat Jan 31 05:44:05 2009 +++ src/sys/dev/mii/urlphy.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: urlphy.c,v 1.25 2009/01/31 05:44:05 hira Exp $ */ +/* $NetBSD: urlphy.c,v 1.25.20.1 2014/11/09 12:13:15 martin Exp $ */ /* * Copyright (c) 2001, 2002 * Shingo WATANABE <n...@nabechan.org>. All rights reserved. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.25 2009/01/31 05:44:05 hira Exp $"); +__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.25.20.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -254,8 +254,11 @@ urlphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX; else mii->mii_media_active |= IFM_10_T; + if (msr & URLPHY_MSR_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Index: src/sys/dev/pci/if_kse.c diff -u src/sys/dev/pci/if_kse.c:1.22 src/sys/dev/pci/if_kse.c:1.22.14.1 --- src/sys/dev/pci/if_kse.c:1.22 Mon Apr 5 07:20:26 2010 +++ src/sys/dev/pci/if_kse.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_kse.c,v 1.22 2010/04/05 07:20:26 joerg Exp $ */ +/* $NetBSD: if_kse.c,v 1.22.14.1 2014/11/09 12:13:15 martin Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.22 2010/04/05 07:20:26 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.22.14.1 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> @@ -1312,11 +1312,11 @@ ifmedia_sts(struct ifnet *ifp, struct if if (result & (1U << 3)) ifmr->ifm_active |= IFM_100_TX|IFM_FDX; else if (result & (1U << 2)) - ifmr->ifm_active |= IFM_100_TX; + ifmr->ifm_active |= IFM_100_TX|IFM_HDX; else if (result & (1U << 1)) ifmr->ifm_active |= IFM_10_T|IFM_FDX; else if (result & (1U << 0)) - ifmr->ifm_active |= IFM_10_T; + ifmr->ifm_active |= IFM_10_T|IFM_HDX; else ifmr->ifm_active |= IFM_NONE; if (ctl & (1U << 4)) Index: src/sys/dev/pci/if_txp.c diff -u src/sys/dev/pci/if_txp.c:1.38 src/sys/dev/pci/if_txp.c:1.38.14.1 --- src/sys/dev/pci/if_txp.c:1.38 Sat Nov 13 13:52:07 2010 +++ src/sys/dev/pci/if_txp.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_txp.c,v 1.38 2010/11/13 13:52:07 uebayasi Exp $ */ +/* $NetBSD: if_txp.c,v 1.38.14.1 2014/11/09 12:13:15 martin Exp $ */ /* * Copyright (c) 2001 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.38 2010/11/13 13:52:07 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.38.14.1 2014/11/09 12:13:15 martin Exp $"); #include "opt_inet.h" @@ -1836,13 +1836,13 @@ txp_ifmedia_sts(struct ifnet *ifp, struc if (anlpar & ANLPAR_TX_FD) ifmr->ifm_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - ifmr->ifm_active |= IFM_100_T4; + ifmr->ifm_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - ifmr->ifm_active |= IFM_100_TX; + ifmr->ifm_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) ifmr->ifm_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - ifmr->ifm_active |= IFM_10_T; + ifmr->ifm_active |= IFM_10_T|IFM_HDX; else ifmr->ifm_active |= IFM_NONE; } else Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.227.2.12 src/sys/dev/pci/if_wm.c:1.227.2.13 --- src/sys/dev/pci/if_wm.c:1.227.2.12 Sun Nov 9 12:03:18 2014 +++ src/sys/dev/pci/if_wm.c Sun Nov 9 12:13:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.227.2.12 2014/11/09 12:03:18 martin Exp $ */ +/* $NetBSD: if_wm.c,v 1.227.2.13 2014/11/09 12:13:15 martin Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -76,7 +76,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.227.2.12 2014/11/09 12:03:18 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.227.2.13 2014/11/09 12:13:15 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -5966,6 +5966,8 @@ wm_tbi_mediastatus(struct ifnet *ifp, st ifmr->ifm_active |= IFM_1000_SX; if (CSR_READ(sc, WMREG_STATUS) & STATUS_FD) ifmr->ifm_active |= IFM_FDX; + else + ifmr->ifm_active |= IFM_HDX; ctrl = CSR_READ(sc, WMREG_CTRL); if (ctrl & CTRL_RFCE) ifmr->ifm_active |= IFM_FLOW | IFM_ETH_RXPAUSE;