CVS commit: src/sys/dev/mii
Module Name:src Committed By: pgoyette Date: Sat Jun 5 22:45:03 UTC 2021 Modified Files: src/sys/dev/mii: mii_verbose.c Log Message: Ooopppsss - typo! To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/mii/mii_verbose.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/dev/mii/mii_verbose.c diff -u src/sys/dev/mii/mii_verbose.c:1.7 src/sys/dev/mii/mii_verbose.c:1.8 --- src/sys/dev/mii/mii_verbose.c:1.7 Sat Jun 5 22:21:15 2021 +++ src/sys/dev/mii/mii_verbose.c Sat Jun 5 22:45:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mii_verbose.c,v 1.7 2021/06/05 22:21:15 pgoyette Exp $ */ +/* $NetBSD: mii_verbose.c,v 1.8 2021/06/05 22:45:03 pgoyette Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -55,7 +55,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_verbose.c,v 1.7 2021/06/05 22:21:15 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_verbose.c,v 1.8 2021/06/05 22:45:03 pgoyette Exp $"); #include #include @@ -81,7 +81,7 @@ miiverbose_modcmd(modcmd_t cmd, void *ar mii_get_descr = saved_mii_get_descr; mii_verbose_loaded = 0; return 0; - casce MODULE_CMD_AUTOUNLOAD: + case MODULE_CMD_AUTOUNLOAD: return EBUSY; default: return ENOTTY;
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Nov 4 09:15:10 UTC 2020 Modified Files: src/sys/dev/mii: igphy.c ihphy.c makphy.c Log Message: Fix a bug that "ifconfig xx0 media none" set LINK_STATE_UNKNOWN instead of LINK_STATE_DOWN. XXX We should check for other PHY drivers, too. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/dev/mii/igphy.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/mii/ihphy.c cvs rdiff -u -r1.67 -r1.68 src/sys/dev/mii/makphy.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/dev/mii/igphy.c diff -u src/sys/dev/mii/igphy.c:1.36 src/sys/dev/mii/igphy.c:1.37 --- src/sys/dev/mii/igphy.c:1.36 Mon Aug 3 07:25:59 2020 +++ src/sys/dev/mii/igphy.c Wed Nov 4 09:15:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: igphy.c,v 1.36 2020/08/03 07:25:59 msaitoh Exp $ */ +/* $NetBSD: igphy.c,v 1.37 2020/11/04 09:15:10 msaitoh Exp $ */ /* * The Intel copyright applies to the analog register setup, and the @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.36 2020/08/03 07:25:59 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.37 2020/11/04 09:15:10 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_mii.h" @@ -437,7 +437,6 @@ igphy_status(struct mii_softc *sc) PHY_READ(sc, MII_BMCR, &bmcr); if (bmcr & BMCR_ISO) { mii->mii_media_active |= IFM_NONE; - mii->mii_media_status = 0; return; } Index: src/sys/dev/mii/ihphy.c diff -u src/sys/dev/mii/ihphy.c:1.18 src/sys/dev/mii/ihphy.c:1.19 --- src/sys/dev/mii/ihphy.c:1.18 Sat Mar 28 18:37:18 2020 +++ src/sys/dev/mii/ihphy.c Wed Nov 4 09:15:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ihphy.c,v 1.18 2020/03/28 18:37:18 thorpej Exp $ */ +/* $NetBSD: ihphy.c,v 1.19 2020/11/04 09:15:10 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.18 2020/03/28 18:37:18 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.19 2020/11/04 09:15:10 msaitoh Exp $"); #include #include @@ -242,7 +242,6 @@ ihphy_status(struct mii_softc *sc) PHY_READ(sc, MII_BMCR, &bmcr); if (bmcr & (BMCR_ISO | BMCR_PDOWN)) { mii->mii_media_active |= IFM_NONE; - mii->mii_media_status = 0; return; } Index: src/sys/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.67 src/sys/dev/mii/makphy.c:1.68 --- src/sys/dev/mii/makphy.c:1.67 Tue Oct 20 08:53:34 2020 +++ src/sys/dev/mii/makphy.c Wed Nov 4 09:15:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.67 2020/10/20 08:53:34 msaitoh Exp $ */ +/* $NetBSD: makphy.c,v 1.68 2020/11/04 09:15:10 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.67 2020/10/20 08:53:34 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.68 2020/11/04 09:15:10 msaitoh Exp $"); #include #include @@ -436,9 +436,8 @@ makphy_status(struct mii_softc *sc) if (bmcr & BMCR_LOOP) mii->mii_media_active |= IFM_LOOP; - if (bmcr & BMCR_ISO) { + if (bmcr & (BMCR_ISO | BMCR_PDOWN)) { mii->mii_media_active |= IFM_NONE; - mii->mii_media_status = 0; return; }
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Oct 20 08:53:34 UTC 2020 Modified Files: src/sys/dev/mii: makphy.c Log Message: Add Intel I347-AT4. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/dev/mii/makphy.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/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.66 src/sys/dev/mii/makphy.c:1.67 --- src/sys/dev/mii/makphy.c:1.66 Mon Aug 3 07:25:59 2020 +++ src/sys/dev/mii/makphy.c Tue Oct 20 08:53:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.66 2020/08/03 07:25:59 msaitoh Exp $ */ +/* $NetBSD: makphy.c,v 1.67 2020/10/20 08:53:34 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.66 2020/08/03 07:25:59 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.67 2020/10/20 08:53:34 msaitoh Exp $"); #include #include @@ -117,6 +117,7 @@ static const struct mii_phydesc makphys[ MII_PHY_DESC(xxMARVELL, E3016), MII_PHY_DESC(xxMARVELL, E3082), MII_PHY_DESC(xxMARVELL, PHYG65G), + MII_PHY_DESC(xxMARVELL, I347), MII_PHY_END, };
CVS commit: src/sys/dev/mii
Module Name:src Committed By: kardel Date: Thu Aug 27 10:10:23 UTC 2020 Modified Files: src/sys/dev/mii: mii_physubr.c Log Message: Move mii_phy_statusmsg(sc) back to its original position. Fixes deafness bug on macppc reported and tested by martin@ Thanks ! To generate a diff of this commit: cvs rdiff -u -r1.93 -r1.94 src/sys/dev/mii/mii_physubr.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/dev/mii/mii_physubr.c diff -u src/sys/dev/mii/mii_physubr.c:1.93 src/sys/dev/mii/mii_physubr.c:1.94 --- src/sys/dev/mii/mii_physubr.c:1.93 Mon Aug 24 12:46:04 2020 +++ src/sys/dev/mii/mii_physubr.c Thu Aug 27 10:10:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mii_physubr.c,v 1.93 2020/08/24 12:46:04 kardel Exp $ */ +/* $NetBSD: mii_physubr.c,v 1.94 2020/08/27 10:10:23 kardel Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.93 2020/08/24 12:46:04 kardel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.94 2020/08/27 10:10:23 kardel Exp $"); #include #include @@ -451,10 +451,10 @@ mii_phy_update(struct mii_softc *sc, int if (sc->mii_media_active != mii_media_active || sc->mii_media_status != mii_media_status || cmd == MII_MEDIACHG) { + mii_phy_statusmsg(sc); (*mii->mii_statchg)(mii->mii_ifp); sc->mii_media_active = mii_media_active; sc->mii_media_status = mii_media_status; - mii_phy_statusmsg(sc); } }
CVS commit: src/sys/dev/mii
Module Name:src Committed By: kardel Date: Mon Aug 24 12:46:04 UTC 2020 Modified Files: src/sys/dev/mii: mii_physubr.c Log Message: Keep the change check invariant intact. The previous code could miss status updates by picking up a new status different from the tested status. This left addresses in the DETACHED state although the link status is already UP again. addresses PR/kern 55538 To generate a diff of this commit: cvs rdiff -u -r1.92 -r1.93 src/sys/dev/mii/mii_physubr.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/dev/mii/mii_physubr.c diff -u src/sys/dev/mii/mii_physubr.c:1.92 src/sys/dev/mii/mii_physubr.c:1.93 --- src/sys/dev/mii/mii_physubr.c:1.92 Mon Aug 24 04:23:41 2020 +++ src/sys/dev/mii/mii_physubr.c Mon Aug 24 12:46:04 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mii_physubr.c,v 1.92 2020/08/24 04:23:41 msaitoh Exp $ */ +/* $NetBSD: mii_physubr.c,v 1.93 2020/08/24 12:46:04 kardel Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.92 2020/08/24 04:23:41 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.93 2020/08/24 12:46:04 kardel Exp $"); #include #include @@ -440,16 +440,21 @@ void mii_phy_update(struct mii_softc *sc, int cmd) { struct mii_data *mii = sc->mii_pdata; + u_int mii_media_active; + int mii_media_status; KASSERT(mii_locked(mii)); - if (sc->mii_media_active != mii->mii_media_active || - sc->mii_media_status != mii->mii_media_status || + mii_media_active = mii->mii_media_active; + mii_media_status = mii->mii_media_status; + + if (sc->mii_media_active != mii_media_active || + sc->mii_media_status != mii_media_status || cmd == MII_MEDIACHG) { - mii_phy_statusmsg(sc); (*mii->mii_statchg)(mii->mii_ifp); - sc->mii_media_active = mii->mii_media_active; - sc->mii_media_status = mii->mii_media_status; + sc->mii_media_active = mii_media_active; + sc->mii_media_status = mii_media_status; + mii_phy_statusmsg(sc); } }
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Aug 24 04:49:05 UTC 2020 Modified Files: src/sys/dev/mii: urlphy.c Log Message: Remove extra PHY_RESET(sc) in the MII_TICK path because it's not requierd to just restart autonego. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/dev/mii/urlphy.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/dev/mii/urlphy.c diff -u src/sys/dev/mii/urlphy.c:1.37 src/sys/dev/mii/urlphy.c:1.38 --- src/sys/dev/mii/urlphy.c:1.37 Mon Aug 24 04:23:41 2020 +++ src/sys/dev/mii/urlphy.c Mon Aug 24 04:49:05 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: urlphy.c,v 1.37 2020/08/24 04:23:41 msaitoh Exp $ */ +/* $NetBSD: urlphy.c,v 1.38 2020/08/24 04:49:05 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002 * Shingo WATANABE . All rights reserved. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.37 2020/08/24 04:23:41 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.38 2020/08/24 04:49:05 msaitoh Exp $"); #include #include @@ -197,8 +197,6 @@ urlphy_service(struct mii_softc *sc, str if (sc->mii_ticks <= sc->mii_anegticks) return 0; - PHY_RESET(sc); - if (mii_phy_auto_restart(sc) == EJUSTRETURN) return 0;
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Aug 24 04:23:41 UTC 2020 Modified Files: src/sys/dev/mii: ciphy.c mii_physubr.c miivar.h urlphy.c Log Message: Don't do full initialization for autonego when just restarting autonego because it's not required. This change reduce extra initialization which include PHY_RESET() which caused long delay(max 500ms). To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.91 -r1.92 src/sys/dev/mii/mii_physubr.c cvs rdiff -u -r1.72 -r1.73 src/sys/dev/mii/miivar.h cvs rdiff -u -r1.36 -r1.37 src/sys/dev/mii/urlphy.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/dev/mii/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.40 src/sys/dev/mii/ciphy.c:1.41 --- src/sys/dev/mii/ciphy.c:1.40 Tue Jul 7 08:44:12 2020 +++ src/sys/dev/mii/ciphy.c Mon Aug 24 04:23:41 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.40 2020/07/07 08:44:12 msaitoh Exp $ */ +/* $NetBSD: ciphy.c,v 1.41 2020/08/24 04:23:41 msaitoh Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.40 2020/07/07 08:44:12 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.41 2020/08/24 04:23:41 msaitoh Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -273,7 +273,7 @@ setit: if (sc->mii_ticks <= sc->mii_anegticks) break; - mii_phy_auto(sc); + mii_phy_auto_restart(sc); return 0; } Index: src/sys/dev/mii/mii_physubr.c diff -u src/sys/dev/mii/mii_physubr.c:1.91 src/sys/dev/mii/mii_physubr.c:1.92 --- src/sys/dev/mii/mii_physubr.c:1.91 Tue Jul 7 08:44:12 2020 +++ src/sys/dev/mii/mii_physubr.c Mon Aug 24 04:23:41 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mii_physubr.c,v 1.91 2020/07/07 08:44:12 msaitoh Exp $ */ +/* $NetBSD: mii_physubr.c,v 1.92 2020/08/24 04:23:41 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.91 2020/07/07 08:44:12 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.92 2020/08/24 04:23:41 msaitoh Exp $"); #include #include @@ -198,6 +198,7 @@ mii_phy_setmedia(struct mii_softc *sc) PHY_WRITE(sc, MII_BMCR, bmcr); } +/* Setup autonegotiation and start it. */ int mii_phy_auto(struct mii_softc *sc) { @@ -283,6 +284,20 @@ mii_phy_auto(struct mii_softc *sc) return EJUSTRETURN; } +/* Just restart autonegotiation without changing any setting */ +int +mii_phy_auto_restart(struct mii_softc *sc) +{ + uint16_t reg; + + PHY_READ(sc, MII_BMCR, ®); + reg |= BMCR_STARTNEG; + PHY_WRITE(sc, MII_BMCR, reg); + sc->mii_ticks = 0; + + return EJUSTRETURN; +} + static void mii_phy_auto_timeout_locked(struct mii_softc *sc) { @@ -365,9 +380,7 @@ mii_phy_tick(struct mii_softc *sc) if (sc->mii_ticks <= sc->mii_anegticks) return EJUSTRETURN; - PHY_RESET(sc); - - if (mii_phy_auto(sc) == EJUSTRETURN) + if (mii_phy_auto_restart(sc) == EJUSTRETURN) return EJUSTRETURN; /* Index: src/sys/dev/mii/miivar.h diff -u src/sys/dev/mii/miivar.h:1.72 src/sys/dev/mii/miivar.h:1.73 --- src/sys/dev/mii/miivar.h:1.72 Tue Jul 7 08:44:12 2020 +++ src/sys/dev/mii/miivar.h Mon Aug 24 04:23:41 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: miivar.h,v 1.72 2020/07/07 08:44:12 msaitoh Exp $ */ +/* $NetBSD: miivar.h,v 1.73 2020/08/24 04:23:41 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001, 2020 The NetBSD Foundation, Inc. @@ -332,6 +332,7 @@ void mii_phy_delete_media(struct mii_sof /* MII must be LOCKED */ void mii_phy_setmedia(struct mii_softc *); int mii_phy_auto(struct mii_softc *); +int mii_phy_auto_restart(struct mii_softc *); void mii_phy_reset(struct mii_softc *); void mii_phy_down(struct mii_softc *); int mii_phy_tick(struct mii_softc *); Index: src/sys/dev/mii/urlphy.c diff -u src/sys/dev/mii/urlphy.c:1.36 src/sys/dev/mii/urlphy.c:1.37 --- src/sys/dev/mii/urlphy.c:1.36 Tue Jul 7 08:44:12 2020 +++ src/sys/dev/mii/urlphy.c Mon Aug 24 04:23:41 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: urlphy.c,v 1.36 2020/07/07 08:44:12 msaitoh Exp $ */ +/* $NetBSD: urlphy.c,v 1.37 2020/08/24 04:23:41 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002 * Shingo WATANABE . All rights reserved. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.36 2020/07/07 08:44:12 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.37 2020/08/24 04:23:41 msaitoh Exp $"); #include #include @@ -199,7 +199,7 @@ urlphy_service(struct mii_softc *sc, str PHY_RESET(sc); - if (mii_phy_auto(sc) == EJUSTRETURN) + if (mii_phy_auto_restart(sc) == EJUSTRETURN) return 0; break;
CVS commit: src/sys/dev/mii
Module Name:src Committed By: uwe Date: Tue Aug 4 04:22:03 UTC 2020 Modified Files: src/sys/dev/mii: devlist2h.awk Log Message: mii_knowndevs[] is de facto const, define it as such. This time for real. On my first try I did it in the generated miidevs_data.h file. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/dev/mii/devlist2h.awk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/devlist2h.awk diff -u src/sys/dev/mii/devlist2h.awk:1.10 src/sys/dev/mii/devlist2h.awk:1.11 --- src/sys/dev/mii/devlist2h.awk:1.10 Mon Dec 2 21:24:50 2019 +++ src/sys/dev/mii/devlist2h.awk Tue Aug 4 04:22:02 2020 @@ -1,5 +1,5 @@ #! /usr/bin/awk -f -# $NetBSD: devlist2h.awk,v 1.10 2019/12/02 21:24:50 uwe Exp $ +# $NetBSD: devlist2h.awk,v 1.11 2020/08/04 04:22:02 uwe Exp $ # # Copyright (c) 1998 The NetBSD Foundation, Inc. # All rights reserved. @@ -147,7 +147,7 @@ NF > 0 && $1 == "model" { printf(" int model;\n") > dfile printf(" const char *descr;\n") > dfile printf("};\n") > dfile - printf("struct mii_knowndev mii_knowndevs[] = {\n") > dfile + printf("const struct mii_knowndev mii_knowndevs[] = {\n") > dfile firstdone = 1 }
CVS commit: src/sys/dev/mii
Module Name:src Committed By: uwe Date: Mon Aug 3 14:00:41 UTC 2020 Modified Files: src/sys/dev/mii: miidevs_data.h Log Message: mii_knowndevs[] is de facto const, define it as such. To generate a diff of this commit: cvs rdiff -u -r1.153 -r1.154 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.153 src/sys/dev/mii/miidevs_data.h:1.154 --- src/sys/dev/mii/miidevs_data.h:1.153 Tue Jun 23 14:35:59 2020 +++ src/sys/dev/mii/miidevs_data.h Mon Aug 3 14:00:41 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: miidevs_data.h,v 1.153 2020/06/23 14:35:59 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.154 2020/08/03 14:00:41 uwe Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. @@ -41,7 +41,7 @@ struct mii_knowndev { int model; const char *descr; }; -struct mii_knowndev mii_knowndevs[] = { +const struct mii_knowndev mii_knowndevs[] = { { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011, MII_STR_AGERE_ET1011 }, { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011C, MII_STR_AGERE_ET1011C }, { MII_OUI_xxASIX, MII_MODEL_xxASIX_AX88X9X, MII_STR_xxASIX_AX88X9X },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Aug 3 07:25:59 UTC 2020 Modified Files: src/sys/dev/mii: igphy.c igphyreg.h makphy.c makphyreg.h Log Message: Rename PSSR_* to MAKPHY_PSSR_* and IGPHY_PSSR_* to avoid conflict. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/dev/mii/igphy.c cvs rdiff -u -r1.12 -r1.13 src/sys/dev/mii/igphyreg.h cvs rdiff -u -r1.65 -r1.66 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/mii/makphyreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/igphy.c diff -u src/sys/dev/mii/igphy.c:1.35 src/sys/dev/mii/igphy.c:1.36 --- src/sys/dev/mii/igphy.c:1.35 Mon Aug 3 07:16:51 2020 +++ src/sys/dev/mii/igphy.c Mon Aug 3 07:25:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: igphy.c,v 1.35 2020/08/03 07:16:51 msaitoh Exp $ */ +/* $NetBSD: igphy.c,v 1.36 2020/08/03 07:25:59 msaitoh Exp $ */ /* * The Intel copyright applies to the analog register setup, and the @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.35 2020/08/03 07:16:51 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.36 2020/08/03 07:25:59 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_mii.h" @@ -431,7 +431,7 @@ igphy_status(struct mii_softc *sc) PHY_READ(sc, IGPHY_PORT_STATUS, &pssr); - if (pssr & PSSR_LINK_UP) + if (pssr & IGPHY_PSSR_LINK_UP) mii->mii_media_status |= IFM_ACTIVE; PHY_READ(sc, MII_BMCR, &bmcr); @@ -453,19 +453,19 @@ igphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_NONE; return; } - switch (pssr & PSSR_SPEED_MASK) { - case PSSR_SPEED_1000MBPS: + switch (pssr & IGPHY_PSSR_SPEED_MASK) { + case IGPHY_PSSR_SPEED_1000MBPS: mii->mii_media_active |= IFM_1000_T; PHY_READ(sc, MII_100T2SR, >sr); if (gtsr & GTSR_MS_RES) mii->mii_media_active |= IFM_ETH_MASTER; break; - case PSSR_SPEED_100MBPS: + case IGPHY_PSSR_SPEED_100MBPS: mii->mii_media_active |= IFM_100_TX; break; - case PSSR_SPEED_10MBPS: + case IGPHY_PSSR_SPEED_10MBPS: mii->mii_media_active |= IFM_10_T; break; @@ -475,7 +475,7 @@ igphy_status(struct mii_softc *sc) return; } - if (pssr & PSSR_FULL_DUPLEX) + if (pssr & IGPHY_PSSR_FULL_DUPLEX) mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc); else Index: src/sys/dev/mii/igphyreg.h diff -u src/sys/dev/mii/igphyreg.h:1.12 src/sys/dev/mii/igphyreg.h:1.13 --- src/sys/dev/mii/igphyreg.h:1.12 Mon Aug 3 07:16:51 2020 +++ src/sys/dev/mii/igphyreg.h Mon Aug 3 07:25:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: igphyreg.h,v 1.12 2020/08/03 07:16:51 msaitoh Exp $ */ +/* $NetBSD: igphyreg.h,v 1.13 2020/08/03 07:25:59 msaitoh Exp $ */ /*** @@ -53,18 +53,18 @@ /* IGP01E1000 Specific Port Status Register - R/O */ #define IGPHY_PORT_STATUS 0x11 -#define PSSR_AUTONEG_FAILED 0x0001 /* RO LH SC */ -#define PSSR_POLARITY_REVERSED 0x0002 -#define PSSR_CABLE_LENGTH 0x007C -#define PSSR_FULL_DUPLEX 0x0200 -#define PSSR_LINK_UP 0x0400 -#define PSSR_MDIX 0x0800 -#define PSSR_SPEED_MASK 0xC000 /* speed bits mask */ -#define PSSR_SPEED_10MBPS 0x4000 -#define PSSR_SPEED_100MBPS 0x8000 -#define PSSR_SPEED_1000MBPS 0xC000 -#define PSSR_CABLE_LENGTH_SHIFT 0x0002 /* shift right 2 */ -#define PSSR_MDIX_SHIFT 0x000B /* shift right 11 */ +#define IGPHY_PSSR_AUTONEG_FAILED 0x0001 /* RO LH SC */ +#define IGPHY_PSSR_POLARITY_REVERSED 0x0002 +#define IGPHY_PSSR_CABLE_LENGTH 0x007C +#define IGPHY_PSSR_FULL_DUPLEX 0x0200 +#define IGPHY_PSSR_LINK_UP 0x0400 +#define IGPHY_PSSR_MDIX 0x0800 +#define IGPHY_PSSR_SPEED_MASK 0xC000 /* speed bits mask */ +#define IGPHY_PSSR_SPEED_10MBPS 0x4000 +#define IGPHY_PSSR_SPEED_100MBPS 0x8000 +#define IGPHY_PSSR_SPEED_1000MBPS 0xC000 +#define IGPHY_PSSR_CABLE_LENGTH_SHIFT 0x0002 /* shift right 2 */ +#define IGPHY_PSSR_MDIX_SHIFT 0x000B /* shift right 11 */ /* IGP01E1000 Specific Port Control Register - R/W */ #define IGPHY_PORT_CTRL 0x12 Index: src/sys/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.65 src/sys/dev/mii/makphy.c:1.66 --- src/sys/dev/mii/makphy.c:1.65 Sun Mar 15 23:04:50 2020 +++ src/sys/dev/mii/makphy.c Mon Aug 3 07:25:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.65 2020/03/15 23:04:50 thorpej Exp $ */ +/* $NetBSD: makphy.c,v 1.66 2020/08/03 07:25:59 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.65 2020/03/15 23:04:50 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.66 2020/08/03 07:25:59 msaitoh Exp $"); #include #include @@ -429,7 +429,7 @@ makphy_status(struct mii_softc *sc) /* XXX FIXME: Use different page for Fiber on newer chips */ PHY_READ(sc, MAKPHY_PSSR, &pssr); - if (pssr & PSSR_LINK
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Jul 7 08:44:12 UTC 2020 Modified Files: src/sys/dev/mii: ciphy.c igphy.c mii_physubr.c miivar.h tlphy.c urlphy.c Log Message: - Remove the waitfor argument from mii_phy_auto(). - Whitespace fix. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.33 -r1.34 src/sys/dev/mii/igphy.c cvs rdiff -u -r1.90 -r1.91 src/sys/dev/mii/mii_physubr.c cvs rdiff -u -r1.71 -r1.72 src/sys/dev/mii/miivar.h cvs rdiff -u -r1.70 -r1.71 src/sys/dev/mii/tlphy.c cvs rdiff -u -r1.35 -r1.36 src/sys/dev/mii/urlphy.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/dev/mii/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.39 src/sys/dev/mii/ciphy.c:1.40 --- src/sys/dev/mii/ciphy.c:1.39 Sun Mar 15 23:04:50 2020 +++ src/sys/dev/mii/ciphy.c Tue Jul 7 08:44:12 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.39 2020/03/15 23:04:50 thorpej Exp $ */ +/* $NetBSD: ciphy.c,v 1.40 2020/07/07 08:44:12 msaitoh Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.39 2020/03/15 23:04:50 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.40 2020/07/07 08:44:12 msaitoh Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -173,7 +173,7 @@ ciphy_service(struct mii_softc *sc, stru if (reg & BMCR_AUTOEN) return 0; #endif - (void) mii_phy_auto(sc, 0); + (void) mii_phy_auto(sc); break; case IFM_1000_T: speed = BMCR_S1000; @@ -273,7 +273,7 @@ setit: if (sc->mii_ticks <= sc->mii_anegticks) break; - mii_phy_auto(sc, 0); + mii_phy_auto(sc); return 0; } Index: src/sys/dev/mii/igphy.c diff -u src/sys/dev/mii/igphy.c:1.33 src/sys/dev/mii/igphy.c:1.34 --- src/sys/dev/mii/igphy.c:1.33 Sun Mar 15 23:04:50 2020 +++ src/sys/dev/mii/igphy.c Tue Jul 7 08:44:12 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: igphy.c,v 1.33 2020/03/15 23:04:50 thorpej Exp $ */ +/* $NetBSD: igphy.c,v 1.34 2020/07/07 08:44:12 msaitoh Exp $ */ /* * The Intel copyright applies to the analog register setup, and the @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.33 2020/03/15 23:04:50 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.34 2020/07/07 08:44:12 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_mii.h" @@ -523,14 +523,14 @@ igphy_smartspeed_workaround(struct mii_s gtcr &= ~GTCR_MAN_MS; PHY_WRITE(sc, MII_100T2CR, gtcr); } -mii_phy_auto(sc, 0); +mii_phy_auto(sc); } break; case IGPHY_TICK_DOWNSHIFT: PHY_READ(sc, MII_100T2CR, >cr); gtcr |= GTCR_MAN_MS; PHY_WRITE(sc, MII_100T2CR, gtcr); - mii_phy_auto(sc, 0); + mii_phy_auto(sc); break; default: break; Index: src/sys/dev/mii/mii_physubr.c diff -u src/sys/dev/mii/mii_physubr.c:1.90 src/sys/dev/mii/mii_physubr.c:1.91 --- src/sys/dev/mii/mii_physubr.c:1.90 Sun Mar 15 23:04:50 2020 +++ src/sys/dev/mii/mii_physubr.c Tue Jul 7 08:44:12 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mii_physubr.c,v 1.90 2020/03/15 23:04:50 thorpej Exp $ */ +/* $NetBSD: mii_physubr.c,v 1.91 2020/07/07 08:44:12 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.90 2020/03/15 23:04:50 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.91 2020/07/07 08:44:12 msaitoh Exp $"); #include #include @@ -147,7 +147,7 @@ mii_phy_setmedia(struct mii_softc *sc) PHY_READ(sc, MII_BMCR, &bmcr); if ((bmcr & BMCR_AUTOEN) == 0 || (sc->mii_flags & (MIIF_FORCEANEG | MIIF_DOPAUSE))) - (void) mii_phy_auto(sc, 1); + (void) mii_phy_auto(sc); return; } @@ -193,15 +193,14 @@ mii_phy_setmedia(struct mii_softc *sc) if (sc->mii_flags & MIIF_HAVE_GTCR) PHY_WRITE(sc, MII_100T2CR, gtcr); if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) - mii_phy_auto(sc, 0); + mii_phy_auto(sc); else PHY_WRITE(sc, MII_BMCR, bmcr); } int -mii_phy_auto(struct mii_softc *sc, int waitfor) +mii_phy_auto(struct mii_softc *sc) { - int i; struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -266,24 +265,6 @@ mii_phy_auto(struct mii_softc *sc, int w PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG); } - if (waitfor) { - /* Wait 500ms for it to complete. */ - for (i = 0; i < 500; i++) { - uint16_t bmsr; - - PHY_READ(sc, MII_BMSR, &bmsr); - if (bmsr & BMSR_ACOMP) -return 0; - delay(1000); - } - - /* - * Don't need to worry about clearing MIIF_DOINGAUTO. If that's - * set, a timeout is pending, and it will clear the flag. - */ - return EIO; - } - /* * Just let it finish asynchronously. This is for the benefit of * the tick handler driving autonegotiation. Don't want 500ms @@ -308,7 +289,7 @@ mii_phy_auto_timeout_locked(s
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Jul 7 08:35:16 UTC 2020 Modified Files: src/sys/dev/mii: tlphy.c Log Message: - Call tlphy_auto correctly. - It's not required to do busy-wait by mii_phy_auto(sc, 1). Now there is no any PHY driver which calls mii_phy_auto(sc, 1). To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sys/dev/mii/tlphy.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/dev/mii/tlphy.c diff -u src/sys/dev/mii/tlphy.c:1.69 src/sys/dev/mii/tlphy.c:1.70 --- src/sys/dev/mii/tlphy.c:1.69 Tue Jul 7 06:59:22 2020 +++ src/sys/dev/mii/tlphy.c Tue Jul 7 08:35:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: tlphy.c,v 1.69 2020/07/07 06:59:22 msaitoh Exp $ */ +/* $NetBSD: tlphy.c,v 1.70 2020/07/07 08:35:16 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.69 2020/07/07 06:59:22 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.70 2020/07/07 08:35:16 msaitoh Exp $"); #include #include @@ -98,7 +98,7 @@ CFATTACH_DECL_NEW(tlphy, sizeof(struct t tlphymatch, tlphyattach, mii_phy_detach, mii_phy_activate); static int tlphy_service(struct mii_softc *, struct mii_data *, int); -static int tlphy_auto(struct tlphy_softc *, int); +static int tlphy_auto(struct tlphy_softc *); static void tlphy_acomp(struct tlphy_softc *); static void tlphy_status(struct mii_softc *); @@ -239,12 +239,7 @@ tlphy_service(struct mii_softc *sc, stru switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: - /* - * The ThunderLAN PHY doesn't self-configure after - * an autonegotiation cycle, so there's no such - * thing as "already in auto mode". - */ - (void) tlphy_auto(tsc, 1); + (void) tlphy_auto(tsc); break; case IFM_10_2: case IFM_10_5: @@ -268,8 +263,37 @@ tlphy_service(struct mii_softc *sc, stru * XXX WHAT ABOUT CHECKING LINK ON THE BNC/AUI?! */ - if (mii_phy_tick(sc) == EJUSTRETURN) - return 0; + /* Only used for autonegotiation. */ + if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { + sc->mii_ticks = 0; + break; + } + + /* + * Check for link. + * Read the status register twice; BMSR_LINK is latch-low. + */ + PHY_READ(sc, MII_BMSR, ®); + PHY_READ(sc, MII_BMSR, ®); + if (reg & BMSR_LINK) { + sc->mii_ticks = 0; + break; + } + + /* + * mii_ticks == 0 means it's the first tick after changing the + * media or the link became down since the last tick + * (see above), so break to update the status. + */ + if (sc->mii_ticks++ == 0) + break; + + /* Only retry autonegotiation every mii_anegticks seconds. */ + KASSERT(sc->mii_anegticks != 0); + if (sc->mii_ticks <= sc->mii_anegticks) + break; + + tlphy_auto(tsc); break; case MII_DOWN: @@ -338,12 +362,12 @@ tlphy_status(struct mii_softc *sc) } static int -tlphy_auto(struct tlphy_softc *tsc, int waitfor) +tlphy_auto(struct tlphy_softc *tsc) { struct mii_softc *sc = &tsc->sc_mii; int error; - switch ((error = mii_phy_auto(sc, waitfor))) { + switch ((error = mii_phy_auto(sc, 0))) { case EIO: /* * Just assume we're not in full-duplex mode.
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Jul 7 06:59:22 UTC 2020 Modified Files: src/sys/dev/mii: tlphy.c Log Message: "no media present" is intended case on tlphy(4), so don't use aprint_error_dev(). To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/dev/mii/tlphy.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/dev/mii/tlphy.c diff -u src/sys/dev/mii/tlphy.c:1.68 src/sys/dev/mii/tlphy.c:1.69 --- src/sys/dev/mii/tlphy.c:1.68 Sun Mar 15 23:04:50 2020 +++ src/sys/dev/mii/tlphy.c Tue Jul 7 06:59:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: tlphy.c,v 1.68 2020/03/15 23:04:50 thorpej Exp $ */ +/* $NetBSD: tlphy.c,v 1.69 2020/07/07 06:59:22 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.68 2020/03/15 23:04:50 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.69 2020/07/07 06:59:22 msaitoh Exp $"); #include #include @@ -164,7 +164,11 @@ tlphyattach(device_t parent, device_t se mii_unlock(mii); #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) -#define PRINT(str) aprint_normal("%s%s", sep, str); sep = ", " +#define PRINT(str) \ + do { \ + aprint_normal("%s%s", sep, str); \ + sep = ", "; \ + } while (/* CONSTCOND */0) if (tsc->sc_tlphycap) { mii_lock(mii); @@ -179,15 +183,13 @@ tlphyattach(device_t parent, device_t se ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, sc->mii_inst), 0); PRINT("10base5"); - } + } else + PRINT("no media present"); aprint_normal("\n"); } if (sc->mii_capabilities & BMSR_MEDIAMASK) mii_phy_add_media(sc); else { - if ((tsc->sc_tlphycap & - (TLPHY_MEDIA_10_2 | TLPHY_MEDIA_10_5)) == 0) - aprint_error_dev(self, "no media present\n"); /* * mii_phy_add_media() automatically install power handler, * but if_media_add() doesn't. Do it now.
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Jun 23 14:36:00 UTC 2020 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.164 -r1.165 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.152 -r1.153 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.164 src/sys/dev/mii/miidevs.h:1.165 --- src/sys/dev/mii/miidevs.h:1.164 Wed Apr 8 03:01:28 2020 +++ src/sys/dev/mii/miidevs.h Tue Jun 23 14:35:59 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.164 2020/04/08 03:01:28 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.165 2020/06/23 14:35:59 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.167 2020/04/08 03:01:05 msaitoh Exp + * NetBSD: miidevs,v 1.168 2020/06/23 14:35:36 msaitoh Exp */ /*- @@ -630,8 +630,28 @@ #define MII_STR_xxVITESSE_VSC8601 "VSC8601 10/100/1000 PHY" #define MII_MODEL_xxVITESSE_VSC8641 0x0003 #define MII_STR_xxVITESSE_VSC8641 "Vitesse VSC8641 10/100/1000TX PHY" +#define MII_MODEL_xxVITESSE_VSC8504 0x000c +#define MII_STR_xxVITESSE_VSC8504 "Vitesse VSC8504 quad 10/100/1000TX PHY" +#define MII_MODEL_xxVITESSE_VSC8552 0x000e +#define MII_STR_xxVITESSE_VSC8552 "Vitesse VSC8552 dual 10/100/1000TX PHY" +#define MII_MODEL_xxVITESSE_VSC8502 0x0012 +#define MII_STR_xxVITESSE_VSC8502 "Vitesse VSC8502 dual 10/100/1000TX PHY" #define MII_MODEL_xxVITESSE_VSC8501 0x0013 #define MII_STR_xxVITESSE_VSC8501 "Vitesse VSC8501 10/100/1000TX PHY" +#define MII_MODEL_xxVITESSE_VSC8531 0x0017 +#define MII_STR_xxVITESSE_VSC8531 "Vitesse VSC8531 10/100/1000TX PHY" +#define MII_MODEL_xxVITESSE_VSC8662 0x0026 +#define MII_STR_xxVITESSE_VSC8662 "Vitesse VSC866[24] dual/quad 1000T 100FX 1000X PHY" +#define MII_MODEL_xxVITESSE_VSC8514 0x0027 +#define MII_STR_xxVITESSE_VSC8514 "Vitesse VSC8514 quad 1000T PHY" +#define MII_MODEL_xxVITESSE_VSC8512 0x002e +#define MII_STR_xxVITESSE_VSC8512 "Vitesse VSC8512 12port 1000T PHY" +#define MII_MODEL_xxVITESSE_VSC8522 0x002f +#define MII_STR_xxVITESSE_VSC8522 "Vitesse VSC8522 12port 1000T PHY" +#define MII_MODEL_xxVITESSE_VSC8658 0x0035 +#define MII_STR_xxVITESSE_VSC8658 "Vitesse VSC8658 octal 1000T 100FX 1000X PHY" +#define MII_MODEL_xxVITESSE_VSC8541 0x0037 +#define MII_STR_xxVITESSE_VSC8541 "Vitesse VSC8541 1000T PHY" /* XaQti Corp. PHYs */ #define MII_MODEL_xxXAQTI_XMACII 0x Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.152 src/sys/dev/mii/miidevs_data.h:1.153 --- src/sys/dev/mii/miidevs_data.h:1.152 Wed Apr 8 03:01:28 2020 +++ src/sys/dev/mii/miidevs_data.h Tue Jun 23 14:35:59 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.152 2020/04/08 03:01:28 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.153 2020/06/23 14:35:59 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.167 2020/04/08 03:01:05 msaitoh Exp + * NetBSD: miidevs,v 1.168 2020/06/23 14:35:36 msaitoh Exp */ /*- @@ -258,7 +258,17 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_xxVIA, MII_MODEL_xxVIA_VT6103_2, MII_STR_xxVIA_VT6103_2 }, { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8601, MII_STR_xxVITESSE_VSC8601 }, { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8641, MII_STR_xxVITESSE_VSC8641 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8504, MII_STR_xxVITESSE_VSC8504 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8552, MII_STR_xxVITESSE_VSC8552 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8502, MII_STR_xxVITESSE_VSC8502 }, { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8501, MII_STR_xxVITESSE_VSC8501 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8531, MII_STR_xxVITESSE_VSC8531 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8662, MII_STR_xxVITESSE_VSC8662 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8514, MII_STR_xxVITESSE_VSC8514 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8512, MII_STR_xxVITESSE_VSC8512 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8522, MII_STR_xxVITESSE_VSC8522 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8658, MII_STR_xxVITESSE_VSC8658 }, + { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8541, MII_STR_xxVITESSE_VSC8541 }, { MII_OUI_xxXAQTI, MII_MODEL_xxXAQTI_XMACII, MII_STR_xxXAQTI_XMACII }, { 0, 0, NULL } };
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Jun 23 14:35:37 UTC 2020 Modified Files: src/sys/dev/mii: miidevs Log Message: Add some Microsemi (Vitesse) devices. To generate a diff of this commit: cvs rdiff -u -r1.167 -r1.168 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.167 src/sys/dev/mii/miidevs:1.168 --- src/sys/dev/mii/miidevs:1.167 Wed Apr 8 03:01:05 2020 +++ src/sys/dev/mii/miidevs Tue Jun 23 14:35:36 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.167 2020/04/08 03:01:05 msaitoh Exp $ +$NetBSD: miidevs,v 1.168 2020/06/23 14:35:36 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -407,7 +407,17 @@ model xxVIA VT6103_2 0x0034 VT6103 10/1 /* Vitesse PHYs (Now Microsemi) */ model xxVITESSE VSC8601 0x0002 VSC8601 10/100/1000 PHY model xxVITESSE VSC8641 0x0003 Vitesse VSC8641 10/100/1000TX PHY +model xxVITESSE VSC8504 0x000c Vitesse VSC8504 quad 10/100/1000TX PHY +model xxVITESSE VSC8552 0x000e Vitesse VSC8552 dual 10/100/1000TX PHY +model xxVITESSE VSC8502 0x0012 Vitesse VSC8502 dual 10/100/1000TX PHY model xxVITESSE VSC8501 0x0013 Vitesse VSC8501 10/100/1000TX PHY +model xxVITESSE VSC8531 0x0017 Vitesse VSC8531 10/100/1000TX PHY +model xxVITESSE VSC8662 0x0026 Vitesse VSC866[24] dual/quad 1000T 100FX 1000X PHY +model xxVITESSE VSC8514 0x0027 Vitesse VSC8514 quad 1000T PHY +model xxVITESSE VSC8512 0x002e Vitesse VSC8512 12port 1000T PHY +model xxVITESSE VSC8522 0x002f Vitesse VSC8522 12port 1000T PHY +model xxVITESSE VSC8658 0x0035 Vitesse VSC8658 octal 1000T 100FX 1000X PHY +model xxVITESSE VSC8541 0x0037 Vitesse VSC8541 1000T PHY /* XaQti Corp. PHYs */ model xxXAQTI XMACII 0x XaQti Corp. XMAC II gigabit interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Mon May 25 19:48:38 UTC 2020 Modified Files: src/sys/dev/mii: brgphy.c brgphyreg.h Log Message: Add support for BCM54213PE RGMII clock delays, from OpenBSD To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/dev/mii/brgphy.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/mii/brgphyreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/brgphy.c diff -u src/sys/dev/mii/brgphy.c:1.89 src/sys/dev/mii/brgphy.c:1.90 --- src/sys/dev/mii/brgphy.c:1.89 Sat Mar 28 18:37:18 2020 +++ src/sys/dev/mii/brgphy.c Mon May 25 19:48:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphy.c,v 1.89 2020/03/28 18:37:18 thorpej Exp $ */ +/* $NetBSD: brgphy.c,v 1.90 2020/05/25 19:48:38 jmcneill Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.89 2020/03/28 18:37:18 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.90 2020/05/25 19:48:38 jmcneill Exp $"); #include #include @@ -118,7 +118,7 @@ static void brgphy_crc_bug(struct mii_so static void brgphy_disable_early_dac(struct mii_softc *); static void brgphy_jumbo_settings(struct mii_softc *); static void brgphy_eth_wirespeed(struct mii_softc *); - +static void brgphy_bcm54xx_clock_delay(struct mii_softc *); static const struct mii_phy_funcs brgphy_copper_funcs = { brgphy_service, brgphy_copper_status, brgphy_reset, @@ -460,6 +460,12 @@ setit: break; } break; + case MII_OUI_BROADCOM4: + switch (sc->mii_mpd_model) { + case MII_MODEL_BROADCOM4_BCM54213PE: +brgphy_bcm54xx_clock_delay(sc); +break; + } } } @@ -1242,3 +1248,30 @@ brgphy_eth_wirespeed(struct mii_softc *s PHY_READ(sc, BRGPHY_MII_AUXCTL, &val); PHY_WRITE(sc, BRGPHY_MII_AUXCTL, val | (1 << 15) | (1 << 4)); } + +static void +brgphy_bcm54xx_clock_delay(struct mii_softc *sc) +{ + uint16_t val; + + PHY_WRITE(sc, BRGPHY_MII_AUXCTL, BRGPHY_AUXCTL_SHADOW_MISC | + BRGPHY_AUXCTL_SHADOW_MISC << BRGPHY_AUXCTL_MISC_READ_SHIFT); + PHY_READ(sc, BRGPHY_MII_AUXCTL, &val); + val &= BRGPHY_AUXCTL_MISC_DATA_MASK; + if (sc->mii_flags & MIIF_RXID) + val |= BRGPHY_AUXCTL_MISC_RGMII_SKEW_EN; + else + val &= ~BRGPHY_AUXCTL_MISC_RGMII_SKEW_EN; + PHY_WRITE(sc, BRGPHY_MII_AUXCTL, BRGPHY_AUXCTL_MISC_WRITE_EN | + BRGPHY_AUXCTL_SHADOW_MISC | val); + + PHY_WRITE(sc, BRGPHY_MII_SHADOW_1C, BRGPHY_SHADOW_1C_CLK_CTRL); + PHY_READ(sc, BRGPHY_MII_SHADOW_1C, &val); + val &= BRGPHY_SHADOW_1C_DATA_MASK; + if (sc->mii_flags & MIIF_TXID) + val |= BRGPHY_SHADOW_1C_GTXCLK_EN; + else + val &= ~BRGPHY_SHADOW_1C_GTXCLK_EN; + PHY_WRITE(sc, BRGPHY_MII_SHADOW_1C, BRGPHY_SHADOW_1C_WRITE_EN | + BRGPHY_SHADOW_1C_CLK_CTRL | val); +} Index: src/sys/dev/mii/brgphyreg.h diff -u src/sys/dev/mii/brgphyreg.h:1.11 src/sys/dev/mii/brgphyreg.h:1.12 --- src/sys/dev/mii/brgphyreg.h:1.11 Thu Apr 11 09:14:07 2019 +++ src/sys/dev/mii/brgphyreg.h Mon May 25 19:48:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphyreg.h,v 1.11 2019/04/11 09:14:07 msaitoh Exp $ */ +/* $NetBSD: brgphyreg.h,v 1.12 2020/05/25 19:48:38 jmcneill Exp $ */ /* * Copyright (c) 2000 @@ -192,6 +192,17 @@ /* Begin: PHY register values for the 5706 PHY */ /***/ +/* + * Aux control shadow register, bits 0-2 select function (0x00 to + * 0x07). + */ +#define BRGPHY_AUXCTL_SHADOW_MISC 0x07 +#define BRGPHY_AUXCTL_MISC_DATA_MASK 0x7ff8 +#define BRGPHY_AUXCTL_MISC_READ_SHIFT 12 +#define BRGPHY_AUXCTL_MISC_WRITE_EN 0x8000 +#define BRGPHY_AUXCTL_MISC_RGMII_SKEW_EN 0x0200 +#define BRGPHY_AUXCTL_MISC_WIRESPEED_EN 0x0010 + /* * Shadow register 0x1C, bit 15 is write enable, * bits 14-10 select function (0x00 to 0x1F). @@ -199,6 +210,11 @@ #define BRGPHY_MII_SHADOW_1C 0x1C #define BRGPHY_SHADOW_1C_WRITE_EN 0x8000 #define BRGPHY_SHADOW_1C_SELECT_MASK 0x7C00 +#define BRGPHY_SHADOW_1C_DATA_MASK 0x03FF + +/* Shadow 0x1C Clock Alignment Control Register (select value 0x03) */ +#define BRGPHY_SHADOW_1C_CLK_CTRL (0x03 << 10) +#define BRGPHY_SHADOW_1C_GTXCLK_EN 0x0200 /* Shadow 0x1C Mode Control Register (select value 0x1F) */ #define BRGPHY_SHADOW_1C_MODE_CTRL (0x1F << 10)
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Mon May 25 19:47:59 UTC 2020 Modified Files: src/sys/dev/mii: miivar.h Log Message: Add MIIF_RXID and MIIF_TXID flags to signal that RX or TX delays are required, from OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/dev/mii/miivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miivar.h diff -u src/sys/dev/mii/miivar.h:1.70 src/sys/dev/mii/miivar.h:1.71 --- src/sys/dev/mii/miivar.h:1.70 Sun Mar 15 23:04:50 2020 +++ src/sys/dev/mii/miivar.h Mon May 25 19:47:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: miivar.h,v 1.70 2020/03/15 23:04:50 thorpej Exp $ */ +/* $NetBSD: miivar.h,v 1.71 2020/05/25 19:47:58 jmcneill Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001, 2020 The NetBSD Foundation, Inc. @@ -175,6 +175,8 @@ typedef struct mii_softc mii_softc_t; #define MIIF_FORCEANEG 0x0400 /* force auto-negotiation */ #define MIIF_PROBING 0x0800 /* PHY probe in-progress */ #define MIIF_EXITING 0x1000 /* MII is exiting */ +#define MIIF_RXID 0x2000 /* add RX delay */ +#define MIIF_TXID 0x4000 /* add TX delay */ #define MIIF_INHERIT_MASK (MIIF_NOISOLATE | MIIF_NOLOOP | MIIF_AUTOTSLEEP)
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Apr 8 03:01:28 UTC 2020 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.163 -r1.164 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.151 -r1.152 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.163 src/sys/dev/mii/miidevs.h:1.164 --- src/sys/dev/mii/miidevs.h:1.163 Fri Mar 13 04:44:58 2020 +++ src/sys/dev/mii/miidevs.h Wed Apr 8 03:01:28 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.163 2020/03/13 04:44:58 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.164 2020/04/08 03:01:28 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.166 2020/03/13 04:44:34 msaitoh Exp + * NetBSD: miidevs,v 1.167 2020/04/08 03:01:05 msaitoh Exp */ /*- @@ -554,6 +554,10 @@ /* RDC Semiconductor PHYs */ #define MII_MODEL_xxRDC_R6040 0x0003 #define MII_STR_xxRDC_R6040 "R6040 10/100 media interface" +#define MII_MODEL_xxRDC_R6040_2 0x0005 +#define MII_STR_xxRDC_R6040_2 "R6040 10/100 media interface" +#define MII_MODEL_xxRDC_R6040_3 0x0006 +#define MII_STR_xxRDC_R6040_3 "R6040 10/100 media interface" /* RealTek PHYs */ #define MII_MODEL_xxREALTEK_RTL8169S 0x0011 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.151 src/sys/dev/mii/miidevs_data.h:1.152 --- src/sys/dev/mii/miidevs_data.h:1.151 Fri Mar 13 04:44:58 2020 +++ src/sys/dev/mii/miidevs_data.h Wed Apr 8 03:01:28 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.151 2020/03/13 04:44:58 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.152 2020/04/08 03:01:28 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.166 2020/03/13 04:44:34 msaitoh Exp + * NetBSD: miidevs,v 1.167 2020/04/08 03:01:05 msaitoh Exp */ /*- @@ -229,6 +229,8 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_PMCSIERRA, MII_MODEL_PMCSIERRA_PM8354, MII_STR_PMCSIERRA_PM8354 }, { MII_OUI_xxQUALSEMI, MII_MODEL_xxQUALSEMI_QS6612, MII_STR_xxQUALSEMI_QS6612 }, { MII_OUI_xxRDC, MII_MODEL_xxRDC_R6040, MII_STR_xxRDC_R6040 }, + { MII_OUI_xxRDC, MII_MODEL_xxRDC_R6040_2, MII_STR_xxRDC_R6040_2 }, + { MII_OUI_xxRDC, MII_MODEL_xxRDC_R6040_3, MII_STR_xxRDC_R6040_3 }, { MII_OUI_xxREALTEK, MII_MODEL_xxREALTEK_RTL8169S, MII_STR_xxREALTEK_RTL8169S }, { MII_OUI_yyREALTEK, MII_MODEL_yyREALTEK_RTL8201L, MII_STR_yyREALTEK_RTL8201L }, { MII_OUI_REALTEK, MII_MODEL_REALTEK_RTL8251, MII_STR_REALTEK_RTL8251 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Apr 8 03:01:58 UTC 2020 Modified Files: src/sys/dev/mii: rdcphy.c Log Message: Add two new RDC PHYs from Andrius V. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/mii/rdcphy.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/dev/mii/rdcphy.c diff -u src/sys/dev/mii/rdcphy.c:1.7 src/sys/dev/mii/rdcphy.c:1.8 --- src/sys/dev/mii/rdcphy.c:1.7 Sun Mar 15 23:04:50 2020 +++ src/sys/dev/mii/rdcphy.c Wed Apr 8 03:01:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rdcphy.c,v 1.7 2020/03/15 23:04:50 thorpej Exp $*/ +/* $NetBSD: rdcphy.c,v 1.8 2020/04/08 03:01:58 msaitoh Exp $*/ /*- * Copyright (c) 2010, Pyun YongHyeon @@ -33,7 +33,7 @@ * Driver for the RDC Semiconductor R6040 10/100 PHY. */ #include -__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.7 2020/03/15 23:04:50 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.8 2020/04/08 03:01:58 msaitoh Exp $"); #include #include @@ -75,6 +75,8 @@ static const struct mii_phy_funcs rdcphy static const struct mii_phydesc rdcphys[] = { MII_PHY_DESC(xxRDC, R6040), + MII_PHY_DESC(xxRDC, R6040_2), + MII_PHY_DESC(xxRDC, R6040_3), MII_PHY_END, };
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Apr 8 03:01:05 UTC 2020 Modified Files: src/sys/dev/mii: miidevs Log Message: Add two new RDC PHYs from Andrius V. To generate a diff of this commit: cvs rdiff -u -r1.166 -r1.167 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.166 src/sys/dev/mii/miidevs:1.167 --- src/sys/dev/mii/miidevs:1.166 Fri Mar 13 04:44:34 2020 +++ src/sys/dev/mii/miidevs Wed Apr 8 03:01:05 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.166 2020/03/13 04:44:34 msaitoh Exp $ +$NetBSD: miidevs,v 1.167 2020/04/08 03:01:05 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -360,6 +360,8 @@ model xxQUALSEMI QS6612 0x QS6612 1 /* RDC Semiconductor PHYs */ model xxRDC R6040 0x0003 R6040 10/100 media interface +model xxRDC R6040_2 0x0005 R6040 10/100 media interface +model xxRDC R6040_3 0x0006 R6040 10/100 media interface /* RealTek PHYs */ model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 13 18:57:49 UTC 2020 Modified Files: src/sys/dev/mii: atphy.c Log Message: Fix a bug that atphy(4) doesn't work with Attansic L2 rev. 1. Reported by Rocky Hotas. - On ASUS M2N-MX SE Plus (NVIDIA MCP61 with Attansic L2 rev. 1), changing debug port 0x29's value makes the next PHY read fail with error. Read any register to ignore this problem if the PHY is Attansic L2 revision 1. I don't know if this problem is from L2 rev. 1 itself or from the combination because I have only one machine which has L2 rev. "1". At least, ASUS eee pc 900 (Attansic L2 rev. "2") has no this problem. - Add comment. AR8021 document has no description about the power saving control register(debug port 0x29). - Add comment. AR8031 document says the lower 14 bits are reserved and the default value is 0x36d0. Shouldn't we clear those bits? - I have no document neither L1(F1) nor L2(F2), so I don't know whether the debug port access is correct or not. Tested with the following machines: - ASUS P5B SE, L1 rev. 5,age(4) - ASUS K50IJ, L1 rev. 9,ale(4) - ASUS eee pc 900, L2 rev. 2,lii(4) - ASUS M2N-MX SE Plus, L2 rev. 1,nfe(4) - Intel DP55WB,82578(AR8021 rev. 2), wm(4) - Dell inspiron 14z, AR0835 rev. 9,alc(4) To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/mii/atphy.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/dev/mii/atphy.c diff -u src/sys/dev/mii/atphy.c:1.28 src/sys/dev/mii/atphy.c:1.29 --- src/sys/dev/mii/atphy.c:1.28 Fri Mar 13 04:44:34 2020 +++ src/sys/dev/mii/atphy.c Fri Mar 13 18:57:49 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: atphy.c,v 1.28 2020/03/13 04:44:34 msaitoh Exp $ */ +/* $NetBSD: atphy.c,v 1.29 2020/03/13 18:57:49 msaitoh Exp $ */ /* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */ /*- @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.28 2020/03/13 04:44:34 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.29 2020/03/13 18:57:49 msaitoh Exp $"); #include #include @@ -404,10 +404,30 @@ atphy_reset(struct mii_softc *sc) uint16_t reg; int i; - /* Take PHY out of power down mode. */ + /* + * Take PHY out of power down mode. + * + * XXX AR8021 document has no description about the power saving + * control register. Shouldn't we write it? + */ PHY_WRITE(sc, 29, 0x29); + /* + * XXX AR8031 document says the lower 14 bits are reserved and the + * default value is 0x36d0. Shouldn't we clear those bits? + * I have no document neither L1(F1) nor L2(F2). + */ PHY_WRITE(sc, 30, 0); + if ((sc->mii_mpd_model == MII_MODEL_ATTANSIC_L2) + && (sc->mii_mpd_rev == 1)) { + /* + * On NVIDIA MCP61 with Attansic L2 rev. 1, changing debug + * port 0x29's value makes the next PHY read fail with error. + * This is observed on ASUS M2N-MX SE Plus. Read any register + * to ignore this problem. + */ + (void)PHY_READ(sc, ATPHY_SCR, ®); + } PHY_READ(sc, ATPHY_SCR, ®); /* Enable automatic crossover. */ reg |= ATPHY_SCR_AUTO_X_MODE;
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 13 04:44:58 UTC 2020 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.150 -r1.151 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.162 src/sys/dev/mii/miidevs.h:1.163 --- src/sys/dev/mii/miidevs.h:1.162 Thu Feb 27 06:17:50 2020 +++ src/sys/dev/mii/miidevs.h Fri Mar 13 04:44:58 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.162 2020/02/27 06:17:50 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.163 2020/03/13 04:44:58 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.164 2020/02/27 06:17:28 msaitoh Exp + * NetBSD: miidevs,v 1.166 2020/03/13 04:44:34 msaitoh Exp */ /*- @@ -60,10 +60,12 @@ #define MII_OUI_TRIDIUM 0x0001f0 /* Tridium */ #define MII_OUI_DATATRACK 0x0002c6 /* Data Track Technology */ #define MII_OUI_AGERE 0x00053d /* Agere */ +#define MII_OUI_QUAKE 0x000897 /* Quake Technologies */ #define MII_OUI_BANKSPEED 0x0006b8 /* Bankspeed Pty */ #define MII_OUI_NETEXCELL 0x0008bb /* NetExcell */ #define MII_OUI_NETAS 0x0009c3 /* Netas */ #define MII_OUI_BROADCOM2 0x000af7 /* Broadcom Corporation */ +#define MII_OUI_AELUROS 0x000b25 /* Aeluros */ #define MII_OUI_RALINK 0x000c43 /* Ralink Technology */ #define MII_OUI_ASIX 0x000ec6 /* ASIX */ #define MII_OUI_BROADCOM 0x001018 /* Broadcom Corporation */ @@ -71,7 +73,6 @@ #define MII_OUI_ALTIMA 0x0010a9 /* Altima Communications */ #define MII_OUI_ENABLESEMI 0x0010dd /* Enable Semiconductor */ #define MII_OUI_SUNPLUS 0x001105 /* Sunplus Technology */ -#define MII_OUI_ATHEROS 0x001374 /* Atheros */ #define MII_OUI_TERANETICS 0x0014a6 /* Teranetics */ #define MII_OUI_RALINK2 0x0017a5 /* Ralink Technology */ #define MII_OUI_AQUANTIA 0x0017b6 /* Aquantia Corporation */ @@ -168,13 +169,7 @@ #define MII_MODEL_xxAMLOGIC_GXL 0x #define MII_STR_xxAMLOGIC_GXL "Meson GXL internal PHY" -/* Atheros PHYs */ -#define MII_MODEL_ATHEROS_F1 0x0001 -#define MII_STR_ATHEROS_F1 "F1 10/100/1000 PHY" -#define MII_MODEL_ATHEROS_F2 0x0002 -#define MII_STR_ATHEROS_F2 "F2 10/100 PHY" - -/* Attansic PHYs */ +/* Attansic/Atheros PHYs */ #define MII_MODEL_ATTANSIC_L1 0x0001 #define MII_STR_ATTANSIC_L1 "L1 10/100/1000 PHY" #define MII_MODEL_ATTANSIC_L2 0x0002 @@ -602,6 +597,10 @@ #define MII_MODEL_SMSC_LAN8742 0x0013 #define MII_STR_SMSC_LAN8742 "SMSC LAN8742 10/100 media interface" +/* Teranetics PHY */ +#define MII_MODEL_TERANETICS_TN1010 0x0001 +#define MII_STR_TERANETICS_TN1010 "Teranetics TN1010 10GBase-T PHY" + /* Texas Instruments PHYs */ #define MII_MODEL_TI_TLAN10T 0x0001 #define MII_STR_TI_TLAN10T "ThunderLAN 10BASE-T media interface" Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.150 src/sys/dev/mii/miidevs_data.h:1.151 --- src/sys/dev/mii/miidevs_data.h:1.150 Thu Feb 27 06:17:50 2020 +++ src/sys/dev/mii/miidevs_data.h Fri Mar 13 04:44:58 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.150 2020/02/27 06:17:50 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.151 2020/03/13 04:44:58 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.164 2020/02/27 06:17:28 msaitoh Exp + * NetBSD: miidevs,v 1.166 2020/03/13 04:44:34 msaitoh Exp */ /*- @@ -55,8 +55,6 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C874, MII_STR_ALTIMA_Am79C874 }, { MII_OUI_AMLOGIC, MII_MODEL_AMLOGIC_GXL, MII_STR_AMLOGIC_GXL }, { MII_OUI_xxAMLOGIC, MII_MODEL_xxAMLOGIC_GXL, MII_STR_xxAMLOGIC_GXL }, - { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F1, MII_STR_ATHEROS_F1 }, - { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F2, MII_STR_ATHEROS_F2 }, { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L1, MII_STR_ATTANSIC_L1 }, { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L2, MII_STR_ATTANSIC_L2 }, { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8021, MII_STR_ATTANSIC_AR8021 }, @@ -248,6 +246,7 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8740, MII_STR_SMSC_LAN8740 }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8741A, MII_STR_SMSC_LAN8741A }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8742, MII_STR_SMSC_LAN8742 }, + { MII_OUI_TERANETICS, MII_MODEL_TERANETICS_TN1010, MII_STR_TERANETICS_TN1010 }, { MII_OUI_TI, MII_MODEL_TI_TLAN10T, MII_STR_TI_TLAN10T }, { MII_OUI_TI, MII_MODEL_TI_100VGPMI, MII_STR_TI_100VGPMI }, { MII_OUI_TI, MII_MODEL_TI_TNETE2101, MII_STR_TI_TNETE2101 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 13 04:44:34 UTC 2020 Modified Files: src/sys/dev/mii: atphy.c miidevs Log Message: 0x001374 is non-bitreversed value of Attansic OUI(0x00c82e). Attansic/Atheros correctly uses ID1 and ID2 register, so delete all 0x001374 related entries. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/mii/atphy.c cvs rdiff -u -r1.165 -r1.166 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/atphy.c diff -u src/sys/dev/mii/atphy.c:1.27 src/sys/dev/mii/atphy.c:1.28 --- src/sys/dev/mii/atphy.c:1.27 Fri Dec 13 08:30:26 2019 +++ src/sys/dev/mii/atphy.c Fri Mar 13 04:44:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: atphy.c,v 1.27 2019/12/13 08:30:26 msaitoh Exp $ */ +/* $NetBSD: atphy.c,v 1.28 2020/03/13 04:44:34 msaitoh Exp $ */ /* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */ /*- @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.27 2019/12/13 08:30:26 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.28 2020/03/13 04:44:34 msaitoh Exp $"); #include #include @@ -103,7 +103,6 @@ const struct mii_phy_funcs atphy_funcs = }; static const struct mii_phydesc atphys[] = { - MII_PHY_DESC(ATHEROS, F1), MII_PHY_DESC(ATTANSIC, L1), MII_PHY_DESC(ATTANSIC, L2), MII_PHY_DESC(ATTANSIC, AR8021), Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.165 src/sys/dev/mii/miidevs:1.166 --- src/sys/dev/mii/miidevs:1.165 Fri Mar 13 04:43:03 2020 +++ src/sys/dev/mii/miidevs Fri Mar 13 04:44:34 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.165 2020/03/13 04:43:03 msaitoh Exp $ +$NetBSD: miidevs,v 1.166 2020/03/13 04:44:34 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -66,7 +66,6 @@ oui MICREL 0x0010a1 Micrel oui ALTIMA 0x0010a9 Altima Communications oui ENABLESEMI 0x0010dd Enable Semiconductor oui SUNPLUS 0x001105 Sunplus Technology -oui ATHEROS 0x001374 Atheros oui TERANETICS 0x0014a6 Teranetics oui RALINK2 0x0017a5 Ralink Technology oui AQUANTIA 0x0017b6 Aquantia Corporation @@ -150,11 +149,7 @@ model ALTIMA Am79C874 0x0021 Am79C874 1 model AMLOGIC GXL 0x Meson GXL internal PHY model xxAMLOGIC GXL 0x Meson GXL internal PHY -/* Atheros PHYs */ -model ATHEROS F1 0x0001 F1 10/100/1000 PHY -model ATHEROS F2 0x0002 F2 10/100 PHY - -/* Attansic PHYs */ +/* Attansic/Atheros PHYs */ model ATTANSIC L1 0x0001 L1 10/100/1000 PHY model ATTANSIC L2 0x0002 L2 10/100 PHY model ATTANSIC AR8021 0x0004 Atheros AR8021 10/100/1000 PHY
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 13 04:43:04 UTC 2020 Modified Files: src/sys/dev/mii: miidevs Log Message: - Add Quake Technologies and Aeluros' OUI - Add Teranetics TN1010 10GBase-T PHY To generate a diff of this commit: cvs rdiff -u -r1.164 -r1.165 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.164 src/sys/dev/mii/miidevs:1.165 --- src/sys/dev/mii/miidevs:1.164 Thu Feb 27 06:17:28 2020 +++ src/sys/dev/mii/miidevs Fri Mar 13 04:43:03 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.164 2020/02/27 06:17:28 msaitoh Exp $ +$NetBSD: miidevs,v 1.165 2020/03/13 04:43:03 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -53,10 +53,12 @@ oui AMD0x1a Advanced Micro Devic oui TRIDIUM 0x0001f0 Tridium oui DATATRACK 0x0002c6 Data Track Technology oui AGERE 0x00053d Agere +oui QUAKE 0x000897 Quake Technologies oui BANKSPEED 0x0006b8 Bankspeed Pty oui NETEXCELL 0x0008bb NetExcell oui NETAS 0x0009c3 Netas oui BROADCOM2 0x000af7 Broadcom Corporation +oui AELUROS 0x000b25 Aeluros oui RALINK 0x000c43 Ralink Technology oui ASIX 0x000ec6 ASIX oui BROADCOM 0x001018 Broadcom Corporation @@ -389,6 +391,9 @@ model SMSC LAN8740 0x0011 SMSC LAN8740 model SMSC LAN8741A 0x0012 SMSC LAN8741A 10/100 media interface model SMSC LAN8742 0x0013 SMSC LAN8742 10/100 media interface +/* Teranetics PHY */ +model TERANETICS TN1010 0x0001 Teranetics TN1010 10GBase-T PHY + /* Texas Instruments PHYs */ model TI TLAN10T 0x0001 ThunderLAN 10BASE-T media interface model TI 100VGPMI 0x0002 ThunderLAN 100VG-AnyLan media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Feb 27 06:17:50 UTC 2020 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.149 -r1.150 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.161 src/sys/dev/mii/miidevs.h:1.162 --- src/sys/dev/mii/miidevs.h:1.161 Sat Feb 22 18:57:09 2020 +++ src/sys/dev/mii/miidevs.h Thu Feb 27 06:17:50 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.161 2020/02/22 18:57:09 jmcneill Exp $ */ +/* $NetBSD: miidevs.h,v 1.162 2020/02/27 06:17:50 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp + * NetBSD: miidevs,v 1.164 2020/02/27 06:17:28 msaitoh Exp */ /*- @@ -77,7 +77,6 @@ #define MII_OUI_AQUANTIA 0x0017b6 /* Aquantia Corporation */ #define MII_OUI_BROADCOM3 0x001be9 /* Broadcom Corporation */ #define MII_OUI_LEVEL1 0x00207b /* Level 1 */ -#define MII_OUI_VIA 0x004063 /* VIA Technologies */ #define MII_OUI_MARVELL 0x005043 /* Marvell Semiconductor */ #define MII_OUI_QUALSEMI 0x006051 /* Quality Semiconductor */ #define MII_OUI_AMLOGIC 0x006051 /* Amlogic */ @@ -103,6 +102,7 @@ /* Unregistered or wrong OUI */ #define MII_OUI_yyREALTEK 0x04 /* Realtek */ #define MII_OUI_yyAMD 0x58 /* Advanced Micro Devices */ +#define MII_OUI_xxVIA 0x0002c6 /* VIA Technologies */ #define MII_OUI_xxMYSON 0x00032d /* Myson Technology */ #define MII_OUI_xxTSC 0x00039c /* TDK Semiconductor */ #define MII_OUI_xxASIX 0x000674 /* Asix Semiconductor */ @@ -617,10 +617,10 @@ #define MII_STR_xxTSC_78Q2121 "78Q2121 100BASE-TX media interface" /* VIA Technologies PHYs */ -#define MII_MODEL_VIA_VT6103 0x0032 -#define MII_STR_VIA_VT6103 "VT6103 10/100 PHY" -#define MII_MODEL_VIA_VT6103_2 0x0034 -#define MII_STR_VIA_VT6103_2 "VT6103 10/100 PHY" +#define MII_MODEL_xxVIA_VT6103 0x0032 +#define MII_STR_xxVIA_VT6103 "VT6103 10/100 PHY" +#define MII_MODEL_xxVIA_VT6103_2 0x0034 +#define MII_STR_xxVIA_VT6103_2 "VT6103 10/100 PHY" /* Vitesse PHYs (Now Microsemi) */ #define MII_MODEL_xxVITESSE_VSC8601 0x0002 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.149 src/sys/dev/mii/miidevs_data.h:1.150 --- src/sys/dev/mii/miidevs_data.h:1.149 Sat Feb 22 18:57:09 2020 +++ src/sys/dev/mii/miidevs_data.h Thu Feb 27 06:17:50 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.149 2020/02/22 18:57:09 jmcneill Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.150 2020/02/27 06:17:50 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp + * NetBSD: miidevs,v 1.164 2020/02/27 06:17:28 msaitoh Exp */ /*- @@ -253,8 +253,8 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_TI, MII_MODEL_TI_TNETE2101, MII_STR_TI_TNETE2101 }, { MII_OUI_xxTSC, MII_MODEL_xxTSC_78Q2120, MII_STR_xxTSC_78Q2120 }, { MII_OUI_xxTSC, MII_MODEL_xxTSC_78Q2121, MII_STR_xxTSC_78Q2121 }, - { MII_OUI_VIA, MII_MODEL_VIA_VT6103, MII_STR_VIA_VT6103 }, - { MII_OUI_VIA, MII_MODEL_VIA_VT6103_2, MII_STR_VIA_VT6103_2 }, + { MII_OUI_xxVIA, MII_MODEL_xxVIA_VT6103, MII_STR_xxVIA_VT6103 }, + { MII_OUI_xxVIA, MII_MODEL_xxVIA_VT6103_2, MII_STR_xxVIA_VT6103_2 }, { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8601, MII_STR_xxVITESSE_VSC8601 }, { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8641, MII_STR_xxVITESSE_VSC8641 }, { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8501, MII_STR_xxVITESSE_VSC8501 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Feb 27 06:17:28 UTC 2020 Modified Files: src/sys/dev/mii: miidevs Log Message: Use xxVIA instead of VIA. 0x004063 is VIA's official OUI but VT6103 use 0x0002c6. 0x0002c6 is non-bitreversed value of 0x004063. Reported by Andrius V. To generate a diff of this commit: cvs rdiff -u -r1.163 -r1.164 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.163 src/sys/dev/mii/miidevs:1.164 --- src/sys/dev/mii/miidevs:1.163 Sat Feb 22 18:56:57 2020 +++ src/sys/dev/mii/miidevs Thu Feb 27 06:17:28 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp $ +$NetBSD: miidevs,v 1.164 2020/02/27 06:17:28 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -70,7 +70,6 @@ oui RALINK2 0x0017a5 Ralink Technology oui AQUANTIA 0x0017b6 Aquantia Corporation oui BROADCOM3 0x001be9 Broadcom Corporation oui LEVEL1 0x00207b Level 1 -oui VIA0x004063 VIA Technologies oui MARVELL 0x005043 Marvell Semiconductor oui QUALSEMI 0x006051 Quality Semiconductor oui AMLOGIC 0x006051 Amlogic @@ -96,6 +95,7 @@ oui RENESAS 0x749050 Renesas /* Unregistered or wrong OUI */ oui yyREALTEK 0x04 Realtek oui yyAMD 0x58 Advanced Micro Devices +oui xxVIA 0x0002c6 VIA Technologies oui xxMYSON 0x00032d Myson Technology oui xxTSC 0x00039c TDK Semiconductor oui xxASIX 0x000674 Asix Semiconductor @@ -399,8 +399,8 @@ model xxTSC 78Q2120 0x0014 78Q2120 10/1 model xxTSC 78Q2121 0x0015 78Q2121 100BASE-TX media interface /* VIA Technologies PHYs */ -model VIA VT6103 0x0032 VT6103 10/100 PHY -model VIA VT6103_2 0x0034 VT6103 10/100 PHY +model xxVIA VT6103 0x0032 VT6103 10/100 PHY +model xxVIA VT6103_2 0x0034 VT6103 10/100 PHY /* Vitesse PHYs (Now Microsemi) */ model xxVITESSE VSC8601 0x0002 VSC8601 10/100/1000 PHY
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:57:31 UTC 2020 Modified Files: src/sys/dev/mii: brgphy.c Log Message: Match BCM54213PE To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/dev/mii/brgphy.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/dev/mii/brgphy.c diff -u src/sys/dev/mii/brgphy.c:1.86 src/sys/dev/mii/brgphy.c:1.87 --- src/sys/dev/mii/brgphy.c:1.86 Wed Nov 27 10:19:20 2019 +++ src/sys/dev/mii/brgphy.c Sat Feb 22 18:57:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphy.c,v 1.86 2019/11/27 10:19:20 msaitoh Exp $ */ +/* $NetBSD: brgphy.c,v 1.87 2020/02/22 18:57:31 jmcneill Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.86 2019/11/27 10:19:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.87 2020/02/22 18:57:31 jmcneill Exp $"); #include #include @@ -178,6 +178,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(BROADCOM3, BCM5720C), MII_PHY_DESC(BROADCOM3, BCM57765), MII_PHY_DESC(BROADCOM3, BCM57780), + MII_PHY_DESC(BROADCOM4, BCM54213PE), MII_PHY_DESC(BROADCOM4, BCM5725C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906), MII_PHY_END,
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:57:09 UTC 2020 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.160 -r1.161 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.148 -r1.149 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.160 src/sys/dev/mii/miidevs.h:1.161 --- src/sys/dev/mii/miidevs.h:1.160 Wed Feb 5 06:38:36 2020 +++ src/sys/dev/mii/miidevs.h Sat Feb 22 18:57:09 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.160 2020/02/05 06:38:36 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.161 2020/02/22 18:57:09 jmcneill Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp + * NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp */ /*- @@ -302,6 +302,8 @@ #define MII_STR_BROADCOM3_BCM53125 "BCM53125 1000BASE-T switch" #define MII_MODEL_BROADCOM3_BCM5720C 0x0036 #define MII_STR_BROADCOM3_BCM5720C "BCM5720C 1000BASE-T media interface" +#define MII_MODEL_BROADCOM4_BCM54213PE 0x000a +#define MII_STR_BROADCOM4_BCM54213PE "BCM54213PE 1000BASE-T media interface" #define MII_MODEL_BROADCOM4_BCM5725C 0x0038 #define MII_STR_BROADCOM4_BCM5725C "BCM5725C 1000BASE-T media interface" #define MII_MODEL_xxBROADCOM_ALT1_BCM5906 0x0004 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.148 src/sys/dev/mii/miidevs_data.h:1.149 --- src/sys/dev/mii/miidevs_data.h:1.148 Wed Feb 5 06:38:36 2020 +++ src/sys/dev/mii/miidevs_data.h Sat Feb 22 18:57:09 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.148 2020/02/05 06:38:36 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.149 2020/02/22 18:57:09 jmcneill Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp + * NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp */ /*- @@ -118,6 +118,7 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57765, MII_STR_BROADCOM3_BCM57765 }, { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM53125, MII_STR_BROADCOM3_BCM53125 }, { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5720C, MII_STR_BROADCOM3_BCM5720C }, + { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM54213PE, MII_STR_BROADCOM4_BCM54213PE }, { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM5725C, MII_STR_BROADCOM4_BCM5725C }, { MII_OUI_xxBROADCOM_ALT1, MII_MODEL_xxBROADCOM_ALT1_BCM5906, MII_STR_xxBROADCOM_ALT1_BCM5906 }, { MII_OUI_xxCICADA, MII_MODEL_xxCICADA_CIS8201, MII_STR_xxCICADA_CIS8201 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:56:57 UTC 2020 Modified Files: src/sys/dev/mii: miidevs Log Message: Add BCM54213PE To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.162 src/sys/dev/mii/miidevs:1.163 --- src/sys/dev/mii/miidevs:1.162 Wed Feb 5 06:38:20 2020 +++ src/sys/dev/mii/miidevs Sat Feb 22 18:56:57 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp $ +$NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -219,6 +219,7 @@ model BROADCOM3 BCM5719C 0x0022 BCM5719C model BROADCOM3 BCM57765 0x0024 BCM57765 1000BASE-T media interface model BROADCOM3 BCM53125 0x0032 BCM53125 1000BASE-T switch model BROADCOM3 BCM5720C 0x0036 BCM5720C 1000BASE-T media interface +model BROADCOM4 BCM54213PE 0x000a BCM54213PE 1000BASE-T media interface model BROADCOM4 BCM5725C 0x0038 BCM5725C 1000BASE-T media interface model xxBROADCOM_ALT1 BCM5906 0x0004 BCM5906 10/100baseTX media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: nisimura Date: Fri Feb 14 14:17:42 UTC 2020 Modified Files: src/sys/dev/mii: dmphy.c Log Message: unbreak the previous commit error To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/dev/mii/dmphy.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/dev/mii/dmphy.c diff -u src/sys/dev/mii/dmphy.c:1.45 src/sys/dev/mii/dmphy.c:1.46 --- src/sys/dev/mii/dmphy.c:1.45 Fri Feb 14 14:14:45 2020 +++ src/sys/dev/mii/dmphy.c Fri Feb 14 14:17:42 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dmphy.c,v 1.45 2020/02/14 14:14:45 nisimura Exp $ */ +/* $NetBSD: dmphy.c,v 1.46 2020/02/14 14:17:42 nisimura Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.45 2020/02/14 14:14:45 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.46 2020/02/14 14:17:42 nisimura Exp $"); #include #include @@ -241,7 +241,7 @@ dmphy_status(struct mii_softc *sc) else mii->mii_media_active |= IFM_NONE; if (mii->mii_media_active & IFM_FDX) - mii->mii_media_active |= mii_phy_flowstatus(phy); + mii->mii_media_active |= mii_phy_flowstatus(sc); } else mii->mii_media_active = ife->ifm_media; }
CVS commit: src/sys/dev/mii
Module Name:src Committed By: nisimura Date: Fri Feb 14 14:14:45 UTC 2020 Modified Files: src/sys/dev/mii: dmphy.c Log Message: determine FDX flow control abilities To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/dev/mii/dmphy.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/dev/mii/dmphy.c diff -u src/sys/dev/mii/dmphy.c:1.44 src/sys/dev/mii/dmphy.c:1.45 --- src/sys/dev/mii/dmphy.c:1.44 Wed Nov 27 10:19:20 2019 +++ src/sys/dev/mii/dmphy.c Fri Feb 14 14:14:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dmphy.c,v 1.44 2019/11/27 10:19:20 msaitoh Exp $ */ +/* $NetBSD: dmphy.c,v 1.45 2020/02/14 14:14:45 nisimura Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.44 2019/11/27 10:19:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.45 2020/02/14 14:14:45 nisimura Exp $"); #include #include @@ -240,6 +240,8 @@ dmphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; + if (mii->mii_media_active & IFM_FDX) + mii->mii_media_active |= mii_phy_flowstatus(phy); } else mii->mii_media_active = ife->ifm_media; }
CVS commit: src/sys/dev/mii
Module Name:src Committed By: nisimura Date: Fri Feb 14 12:14:34 UTC 2020 Modified Files: src/sys/dev/mii: micphy.c Log Message: add missing two aprint_normal* lines To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/mii/micphy.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/dev/mii/micphy.c diff -u src/sys/dev/mii/micphy.c:1.11 src/sys/dev/mii/micphy.c:1.12 --- src/sys/dev/mii/micphy.c:1.11 Fri Dec 13 08:30:26 2019 +++ src/sys/dev/mii/micphy.c Fri Feb 14 12:14:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: micphy.c,v 1.11 2019/12/13 08:30:26 msaitoh Exp $ */ +/* $NetBSD: micphy.c,v 1.12 2020/02/14 12:14:33 nisimura Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.11 2019/12/13 08:30:26 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.12 2020/02/14 12:14:33 nisimura Exp $"); #include "opt_mii.h" @@ -241,7 +241,9 @@ micphyattach(device_t parent, device_t s if (sc->mii_capabilities & BMSR_EXTSTAT) PHY_READ(sc, MII_EXTSR, &sc->mii_extcapabilities); + aprint_normal_dev(self, ""); mii_phy_add_media(sc); + aprint_normal("\n"); } static void
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 5 06:39:13 UTC 2020 Modified Files: src/sys/dev/mii: rdcphy.c Log Message: RDC -> xxRDC. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/rdcphy.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/dev/mii/rdcphy.c diff -u src/sys/dev/mii/rdcphy.c:1.5 src/sys/dev/mii/rdcphy.c:1.6 --- src/sys/dev/mii/rdcphy.c:1.5 Wed Nov 27 10:19:21 2019 +++ src/sys/dev/mii/rdcphy.c Wed Feb 5 06:39:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rdcphy.c,v 1.5 2019/11/27 10:19:21 msaitoh Exp $*/ +/* $NetBSD: rdcphy.c,v 1.6 2020/02/05 06:39:13 msaitoh Exp $*/ /*- * Copyright (c) 2010, Pyun YongHyeon @@ -33,7 +33,7 @@ * Driver for the RDC Semiconductor R6040 10/100 PHY. */ #include -__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.5 2019/11/27 10:19:21 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.6 2020/02/05 06:39:13 msaitoh Exp $"); #include #include @@ -74,7 +74,7 @@ static const struct mii_phy_funcs rdcphy }; static const struct mii_phydesc rdcphys[] = { - MII_PHY_DESC(RDC, R6040), + MII_PHY_DESC(xxRDC, R6040), MII_PHY_END, };
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 5 06:38:36 UTC 2020 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.147 -r1.148 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.159 src/sys/dev/mii/miidevs.h:1.160 --- src/sys/dev/mii/miidevs.h:1.159 Wed Nov 6 16:00:33 2019 +++ src/sys/dev/mii/miidevs.h Wed Feb 5 06:38:36 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.159 2019/11/06 16:00:33 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.160 2020/02/05 06:38:36 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.161 2019/11/06 16:00:02 msaitoh Exp + * NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp */ /*- @@ -89,7 +89,6 @@ #define MII_OUI_TSC 0x00c039 /* TDK Semiconductor */ #define MII_OUI_MYSON 0x00c0b4 /* Myson Technology */ #define MII_OUI_ATTANSIC 0x00c82e /* Attansic Technology */ -#define MII_OUI_RDC 0x00d02d /* RDC Semiconductor */ #define MII_OUI_JMICRON 0x00d831 /* JMicron */ #define MII_OUI_PMCSIERRA 0x00e004 /* PMC-Sierra */ #define MII_OUI_SIS 0x00e006 /* Silicon Integrated Systems */ @@ -122,6 +121,7 @@ #define MII_OUI_xxVITESSE 0x008083 /* Vitesse Semiconductor */ #define MII_OUI_xxPMCSIERRA2 0x009057 /* PMC-Sierra */ #define MII_OUI_xxCICADA 0x00c08f /* Cicada Semiconductor */ +#define MII_OUI_xxRDC 0x00d02d /* RDC Semiconductor */ #define MII_OUI_xxNATSEMI 0x1000e8 /* National Semiconductor */ #define MII_OUI_xxLEVEL1 0x782000 /* Level 1 */ #define MII_OUI_xxXAQTI 0xace000 /* XaQti Corp. */ @@ -555,8 +555,8 @@ #define MII_STR_xxQUALSEMI_QS6612 "QS6612 10/100 media interface" /* RDC Semiconductor PHYs */ -#define MII_MODEL_RDC_R6040 0x0003 -#define MII_STR_RDC_R6040 "R6040 10/100 media interface" +#define MII_MODEL_xxRDC_R6040 0x0003 +#define MII_STR_xxRDC_R6040 "R6040 10/100 media interface" /* RealTek PHYs */ #define MII_MODEL_xxREALTEK_RTL8169S 0x0011 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.147 src/sys/dev/mii/miidevs_data.h:1.148 --- src/sys/dev/mii/miidevs_data.h:1.147 Wed Nov 6 16:00:33 2019 +++ src/sys/dev/mii/miidevs_data.h Wed Feb 5 06:38:36 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.147 2019/11/06 16:00:33 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.148 2020/02/05 06:38:36 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.161 2019/11/06 16:00:02 msaitoh Exp + * NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp */ /*- @@ -229,7 +229,7 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_xxPMCSIERRA2, MII_MODEL_xxPMCSIERRA2_PM8353, MII_STR_xxPMCSIERRA2_PM8353 }, { MII_OUI_PMCSIERRA, MII_MODEL_PMCSIERRA_PM8354, MII_STR_PMCSIERRA_PM8354 }, { MII_OUI_xxQUALSEMI, MII_MODEL_xxQUALSEMI_QS6612, MII_STR_xxQUALSEMI_QS6612 }, - { MII_OUI_RDC, MII_MODEL_RDC_R6040, MII_STR_RDC_R6040 }, + { MII_OUI_xxRDC, MII_MODEL_xxRDC_R6040, MII_STR_xxRDC_R6040 }, { MII_OUI_xxREALTEK, MII_MODEL_xxREALTEK_RTL8169S, MII_STR_xxREALTEK_RTL8169S }, { MII_OUI_yyREALTEK, MII_MODEL_yyREALTEK_RTL8201L, MII_STR_yyREALTEK_RTL8201L }, { MII_OUI_REALTEK, MII_MODEL_REALTEK_RTL8251, MII_STR_REALTEK_RTL8251 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 5 06:38:20 UTC 2020 Modified Files: src/sys/dev/mii: miidevs Log Message: Change the OUI macro name of RDC to xxRDC. 0x00d02d is non-bitreverse value of official 0x000bb4. From Andrius V. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.161 src/sys/dev/mii/miidevs:1.162 --- src/sys/dev/mii/miidevs:1.161 Wed Nov 6 16:00:02 2019 +++ src/sys/dev/mii/miidevs Wed Feb 5 06:38:20 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.161 2019/11/06 16:00:02 msaitoh Exp $ +$NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -82,7 +82,6 @@ oui INTEL 0x00aa00 Intel oui TSC0x00c039 TDK Semiconductor oui MYSON 0x00c0b4 Myson Technology oui ATTANSIC 0x00c82e Attansic Technology -oui RDC0x00d02d RDC Semiconductor oui JMICRON 0x00d831 JMicron oui PMCSIERRA 0x00e004 PMC-Sierra oui SIS0x00e006 Silicon Integrated Systems @@ -115,6 +114,7 @@ oui yyASIX 0x007063 Asix Semiconductor oui xxVITESSE 0x008083 Vitesse Semiconductor oui xxPMCSIERRA2 0x009057 PMC-Sierra oui xxCICADA 0x00c08f Cicada Semiconductor +oui xxRDC 0x00d02d RDC Semiconductor oui xxNATSEMI 0x1000e8 National Semiconductor oui xxLEVEL1 0x782000 Level 1 oui xxXAQTI 0xace000 XaQti Corp. @@ -361,7 +361,7 @@ model PMCSIERRA PM8354 0x0004 PM8354 Qu model xxQUALSEMI QS6612 0x QS6612 10/100 media interface /* RDC Semiconductor PHYs */ -model RDC R6040 0x0003 R6040 10/100 media interface +model xxRDC R6040 0x0003 R6040 10/100 media interface /* RealTek PHYs */ model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Jan 28 05:08:02 UTC 2020 Modified Files: src/sys/dev/mii: makphy.c Log Message: Fix comment. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/dev/mii/makphy.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/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.63 src/sys/dev/mii/makphy.c:1.64 --- src/sys/dev/mii/makphy.c:1.63 Thu Dec 12 09:25:37 2019 +++ src/sys/dev/mii/makphy.c Tue Jan 28 05:08:02 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.63 2019/12/12 09:25:37 msaitoh Exp $ */ +/* $NetBSD: makphy.c,v 1.64 2020/01/28 05:08:02 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.63 2019/12/12 09:25:37 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.64 2020/01/28 05:08:02 msaitoh Exp $"); #include #include @@ -213,7 +213,7 @@ page0: != 0)) { bool fiberonly = false, copperonly = false; - /* Both copper and fiber is set. check MODE[] */ + /* Both copper and fiber are set. check MODE[] */ switch (sc->mii_mpd_model) { case MII_MODEL_xxMARVELL_E1011: case MII_MODEL_xxMARVELL_E:
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Dec 13 08:30:26 UTC 2019 Modified Files: src/sys/dev/mii: atphy.c micphy.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/atphy.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/mii/micphy.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/dev/mii/atphy.c diff -u src/sys/dev/mii/atphy.c:1.26 src/sys/dev/mii/atphy.c:1.27 --- src/sys/dev/mii/atphy.c:1.26 Wed Nov 27 10:19:20 2019 +++ src/sys/dev/mii/atphy.c Fri Dec 13 08:30:26 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: atphy.c,v 1.26 2019/11/27 10:19:20 msaitoh Exp $ */ +/* $NetBSD: atphy.c,v 1.27 2019/12/13 08:30:26 msaitoh Exp $ */ /* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */ /*- @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.26 2019/11/27 10:19:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.27 2019/12/13 08:30:26 msaitoh Exp $"); #include #include @@ -99,7 +99,7 @@ CFATTACH_DECL_NEW(atphy, sizeof(struct a atphy_match, atphy_attach, mii_phy_detach, mii_phy_activate); const struct mii_phy_funcs atphy_funcs = { -atphy_service, atphy_status, atphy_reset, + atphy_service, atphy_status, atphy_reset, }; static const struct mii_phydesc atphys[] = { @@ -192,8 +192,10 @@ atphy_attach(device_t parent, device_t s sc->mii_flags = ma->mii_flags; sc->mii_flags |= MIIF_NOLOOP; - prop_dictionary_get_bool(parent_prop, "tx_internal_delay", &asc->rgmii_tx_internal_delay); - prop_dictionary_get_bool(parent_prop, "rx_internal_delay", &asc->rgmii_rx_internal_delay); + prop_dictionary_get_bool(parent_prop, "tx_internal_delay", + &asc->rgmii_tx_internal_delay); + prop_dictionary_get_bool(parent_prop, "rx_internal_delay", + &asc->rgmii_rx_internal_delay); prop_dictionary_get_uint32(prop, "clk_25m", &asc->mii_clk_25m); if (asc->mii_clk_25m != 0) Index: src/sys/dev/mii/micphy.c diff -u src/sys/dev/mii/micphy.c:1.10 src/sys/dev/mii/micphy.c:1.11 --- src/sys/dev/mii/micphy.c:1.10 Wed Nov 27 10:19:20 2019 +++ src/sys/dev/mii/micphy.c Fri Dec 13 08:30:26 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: micphy.c,v 1.10 2019/11/27 10:19:20 msaitoh Exp $ */ +/* $NetBSD: micphy.c,v 1.11 2019/12/13 08:30:26 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.10 2019/11/27 10:19:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.11 2019/12/13 08:30:26 msaitoh Exp $"); #include "opt_mii.h" @@ -113,7 +113,7 @@ static const struct mii_phydesc micphys[ }; /* - * Model Rev. Media LSTYPE Devices + * Model Rev. Media LSTYPE Devices * * 0x11 1001F_42 KSZ8041 * 0x13 1001F_42? KSZ8041RNLI @@ -129,10 +129,10 @@ static const struct mii_phydesc micphys[ * 0x9 100none? KSZ8721CL * 0xa 1001F_42 KSZ8001 * 0x22 giga GIGA KSZ9031 - * 0x23 1? gigasw GIGA KSZ9477 (No master/slave bit) + * 0x23 1? gigasw GIGA KSZ9477 (No master/slave bit) * 5? giga GIGA LAN7430internal - * 0x24 giga GIGA KSZ9131 - * 0x32 1001F_42 KS8737 + * 0x24 giga GIGA KSZ9131 + * 0x32 1001F_42 KS8737 */ /* Type of link status register */
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Dec 12 09:25:37 UTC 2019 Modified Files: src/sys/dev/mii: makphy.c makphyreg.h Log Message: - Remove ESSR_FIBER_LINK bit check in makphyattach(). This bit is valid only when the link is up, so it's not good to check in the attach function. - There is an environment that both copper and fiber bits are set in EXTSR but it support copper only. To resolve this problem, check the ESSR register's HWCFG_MODE bit and drop unsupported bits. - If the chip is in Fiber/Copper auto select mode, check which media is selected. Currently, the code supports 88E1011, 88E and 88E1112 only. To support other chips documents are required. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/mii/makphyreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.62 src/sys/dev/mii/makphy.c:1.63 --- src/sys/dev/mii/makphy.c:1.62 Wed Nov 27 10:19:20 2019 +++ src/sys/dev/mii/makphy.c Thu Dec 12 09:25:37 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.62 2019/11/27 10:19:20 msaitoh Exp $ */ +/* $NetBSD: makphy.c,v 1.63 2019/12/12 09:25:37 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.62 2019/11/27 10:19:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.63 2019/12/12 09:25:37 msaitoh Exp $"); #include #include @@ -200,21 +200,6 @@ page0: break; } - switch (model) { - case MII_MODEL_xxMARVELL_E1011: - case MII_MODEL_xxMARVELL_E1112: - if (PHY_READ(sc, MAKPHY_ESSR, ®) != 0) { - aprint_verbose_dev(self, - "Failed to read MAKPHY_ESSR\n"); - break; - } - if (reg & ESSR_FIBER_LINK) - sc->mii_flags |= MIIF_HAVEFIBER; - break; - default: - break; - } - PHY_RESET(sc); PHY_READ(sc, MII_BMSR, &sc->mii_capabilities); @@ -222,6 +207,54 @@ page0: if (sc->mii_capabilities & BMSR_EXTSTAT) PHY_READ(sc, MII_EXTSR, &sc->mii_extcapabilities); + if (((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) + != 0) + && ((sc->mii_extcapabilities & (EXTSR_1000XFDX | EXTSR_1000XHDX)) + != 0)) { + bool fiberonly = false, copperonly = false; + + /* Both copper and fiber is set. check MODE[] */ + switch (sc->mii_mpd_model) { + case MII_MODEL_xxMARVELL_E1011: + case MII_MODEL_xxMARVELL_E: + /* These devices have ESSR register */ + PHY_READ(sc, MAKPHY_ESSR, ®); + if ((reg & ESSR_AUTOSEL_DISABLE) != 0) { +switch (reg & ESSR_HWCFG_MODE) { +case ESSR_RTBI_FIBER: +case ESSR_RGMII_FIBER: +case ESSR_RGMII_SGMII: /* right? */ +case ESSR_TBI_FIBER: +case ESSR_GMII_FIBER: + fiberonly = true; + break; +case ESSR_SGMII_WC_COPPER: +case ESSR_SGMII_WOC_COPPER: +case ESSR_RTBI_COPPER: +case ESSR_RGMII_COPPER: +case ESSR_GMII_COPPER: + copperonly = true; +default: + break; +} + } + break; + default: + break; + } + if (fiberonly || copperonly) + aprint_debug_dev(self, "both copper and fiber are set " + "but MODE[] is %s only.\n", + fiberonly ? "fiber" : "copper"); + if (fiberonly) + sc->mii_extcapabilities + &= ~(EXTSR_1000TFDX | EXTSR_1000THDX); + else if (copperonly) { + sc->mii_extcapabilities + &= ~(EXTSR_1000XFDX | EXTSR_1000XHDX); + sc->mii_flags &= ~MIIF_IS_1000X; + } + } mii_phy_add_media(sc); } @@ -378,7 +411,7 @@ static void makphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - uint16_t bmcr, gsr, pssr; + uint16_t bmcr, gsr, pssr, essr; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; @@ -416,10 +449,45 @@ makphy_status(struct mii_softc *sc) } } - /* XXX FIXME: Use different page for Fiber on newer chips */ + /* + * XXX The following code support Fiber/Copper auto select mode + * only for 88E1011, 88E and 88E1112. For other chips, the document + * is required. + */ if (sc->mii_flags & MIIF_IS_1000X) { + /* Not in Fiber/Copper auto select mode */ + mii->mii_media_active |= IFM_1000_SX; + } else if ((sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1011) || + (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E)) { + /* Fiber/Copper auto select mode */ + + PHY_READ(sc, MAKPHY_ESSR, &essr); + if ((essr & ESSR_FIBER_LINK) == 0) + goto copper; + + /* XXX Assume 1000BASE-SX only */ mii->mii_media_active |= IFM_1000_SX; + } else if (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1112) { + /* Fiber/Copper auto select mode */ + + PHY_READ(sc, MAKPHY_PSSR, &pssr); + if ((pssr & PSSR_RESOLUTION_FIBER) == 0) + goto copper; + + switch (PSSR_SPEED_get(pssr)) { + case SPEED_1000: + mii->mii_media_active |= IFM_1000_SX; + break; + case SPEED_100: + mii->mii_media_active |= IFM_100_FX; +
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Dec 11 02:22:39 UTC 2019 Modified Files: src/sys/dev/mii: files.mii Log Message: Add ukphy_subr flag to ipgphy to make kernel compilable with ipgphy and without ukphy. Pointed out by Hauke. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/files.mii Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/files.mii diff -u src/sys/dev/mii/files.mii:1.53 src/sys/dev/mii/files.mii:1.54 --- src/sys/dev/mii/files.mii:1.53 Fri Nov 1 02:53:22 2019 +++ src/sys/dev/mii/files.mii Wed Dec 11 02:22:38 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.mii,v 1.53 2019/11/01 02:53:22 msaitoh Exp $ +# $NetBSD: files.mii,v 1.54 2019/12/11 02:22:38 msaitoh Exp $ defflag opt_mii.h MIIVERBOSE @@ -99,7 +99,7 @@ device ikphy: mii_phy attach ikphy at mii file dev/mii/ikphy.cikphy -device ipgphy: mii_phy +device ipgphy: mii_phy, ukphy_subr attach ipgphy at mii file dev/mii/ipgphy.c ipgphy
CVS commit: src/sys/dev/mii
Module Name:src Committed By: uwe Date: Mon Dec 2 21:24:50 UTC 2019 Modified Files: src/sys/dev/mii: devlist2h.awk Log Message: Fix s/product/model/ search-and-destroy accident that affected license. Back in 1998 thorpej@ adapted this from one of the several versions we have in the tree but needed s/product/model/ in the text of the script. Unfortunately that also affected the license text: "This model includes software..." and "...or promote models". To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/dev/mii/devlist2h.awk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/devlist2h.awk diff -u src/sys/dev/mii/devlist2h.awk:1.9 src/sys/dev/mii/devlist2h.awk:1.10 --- src/sys/dev/mii/devlist2h.awk:1.9 Mon Mar 25 09:46:24 2019 +++ src/sys/dev/mii/devlist2h.awk Mon Dec 2 21:24:50 2019 @@ -1,5 +1,5 @@ #! /usr/bin/awk -f -# $NetBSD: devlist2h.awk,v 1.9 2019/03/25 09:46:24 msaitoh Exp $ +# $NetBSD: devlist2h.awk,v 1.10 2019/12/02 21:24:50 uwe Exp $ # # Copyright (c) 1998 The NetBSD Foundation, Inc. # All rights reserved. @@ -41,8 +41,8 @@ #documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software #must display the following acknowledgement: -# This model includes software developed by Christopher G. Demetriou. -# 4. The name of the author(s) may not be used to endorse or promote models +# This product includes software developed by Christopher G. Demetriou. +# 4. The name of the author(s) may not be used to endorse or promote products #derived from this software without specific prior written permission # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Mon Apr 22 09:30:09 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.149 -r1.150 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.137 -r1.138 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.149 src/sys/dev/mii/miidevs.h:1.150 --- src/sys/dev/mii/miidevs.h:1.149 Mon Mar 25 11:44:10 2019 +++ src/sys/dev/mii/miidevs.h Mon Apr 22 09:30:09 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.149 2019/03/25 11:44:10 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.150 2019/04/22 09:30:09 jmcneill Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.151 2019/03/25 11:43:50 msaitoh Exp + * NetBSD: miidevs,v 1.152 2019/04/22 09:29:55 jmcneill Exp */ /*- @@ -80,6 +80,7 @@ #define MII_OUI_VIA 0x004063 /* VIA Technologies */ #define MII_OUI_MARVELL 0x005043 /* Marvell Semiconductor */ #define MII_OUI_QUALSEMI 0x006051 /* Quality Semiconductor */ +#define MII_OUI_AMLOGIC 0x006051 /* Amlogic */ #define MII_OUI_DAVICOM 0x00606e /* Davicom Semiconductor */ #define MII_OUI_SMSC 0x00800f /* SMSC */ #define MII_OUI_ICPLUS 0x0090c3 /* IC Plus Corp. */ @@ -107,6 +108,7 @@ #define MII_OUI_xxTSC 0x00039c /* TDK Semiconductor */ #define MII_OUI_xxASIX 0x000674 /* Asix Semiconductor */ #define MII_OUI_xxDAVICOM 0x000676 /* Davicom Semiconductor */ +#define MII_OUI_xxAMLOGIC 0x00068a /* Amlogic */ #define MII_OUI_xxQUALSEMI 0x00068a /* Quality Semiconductor */ #define MII_OUI_xxREALTEK 0x000732 /* Realtek */ #define MII_OUI_xxBROADCOM 0x000818 /* Broadcom Corporation */ @@ -156,6 +158,12 @@ #define MII_MODEL_ALTIMA_Am79C874 0x0021 #define MII_STR_ALTIMA_Am79C874 "Am79C874 10/100 media interface" +/* Amlogic PHYs */ +#define MII_MODEL_AMLOGIC_GXL 0x +#define MII_STR_AMLOGIC_GXL "Meson GXL internal PHY" +#define MII_MODEL_xxAMLOGIC_GXL 0x +#define MII_STR_xxAMLOGIC_GXL "Meson GXL internal PHY" + /* Atheros PHYs */ #define MII_MODEL_ATHEROS_F1 0x0001 #define MII_STR_ATHEROS_F1 "F1 10/100/1000 PHY" Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.137 src/sys/dev/mii/miidevs_data.h:1.138 --- src/sys/dev/mii/miidevs_data.h:1.137 Mon Mar 25 11:44:10 2019 +++ src/sys/dev/mii/miidevs_data.h Mon Apr 22 09:30:09 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.137 2019/03/25 11:44:10 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.138 2019/04/22 09:30:09 jmcneill Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.151 2019/03/25 11:43:50 msaitoh Exp + * NetBSD: miidevs,v 1.152 2019/04/22 09:29:55 jmcneill Exp */ /*- @@ -52,6 +52,8 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_AC101, MII_STR_ALTIMA_AC101 }, { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C875, MII_STR_ALTIMA_Am79C875 }, { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C874, MII_STR_ALTIMA_Am79C874 }, + { MII_OUI_AMLOGIC, MII_MODEL_AMLOGIC_GXL, MII_STR_AMLOGIC_GXL }, + { MII_OUI_xxAMLOGIC, MII_MODEL_xxAMLOGIC_GXL, MII_STR_xxAMLOGIC_GXL }, { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F1, MII_STR_ATHEROS_F1 }, { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F2, MII_STR_ATHEROS_F2 }, { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L1, MII_STR_ATTANSIC_L1 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Mon Apr 22 09:29:55 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Add Amlogix GXL internal PHY To generate a diff of this commit: cvs rdiff -u -r1.151 -r1.152 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.151 src/sys/dev/mii/miidevs:1.152 --- src/sys/dev/mii/miidevs:1.151 Mon Mar 25 11:43:50 2019 +++ src/sys/dev/mii/miidevs Mon Apr 22 09:29:55 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.151 2019/03/25 11:43:50 msaitoh Exp $ +$NetBSD: miidevs,v 1.152 2019/04/22 09:29:55 jmcneill Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -73,6 +73,7 @@ oui LEVEL1 0x00207b Level 1 oui VIA0x004063 VIA Technologies oui MARVELL 0x005043 Marvell Semiconductor oui QUALSEMI 0x006051 Quality Semiconductor +oui AMLOGIC 0x006051 Amlogic oui DAVICOM 0x00606e Davicom Semiconductor oui SMSC 0x00800f SMSC oui ICPLUS 0x0090c3 IC Plus Corp. @@ -100,6 +101,7 @@ oui xxMYSON 0x00032d Myson Technology oui xxTSC 0x00039c TDK Semiconductor oui xxASIX 0x000674 Asix Semiconductor oui xxDAVICOM 0x000676 Davicom Semiconductor +oui xxAMLOGIC 0x00068a Amlogic oui xxQUALSEMI 0x00068a Quality Semiconductor oui xxREALTEK 0x000732 Realtek oui xxBROADCOM 0x000818 Broadcom Corporation @@ -139,6 +141,10 @@ model ALTIMA AC101 0x0021 AC101 10/100 model ALTIMA Am79C875 0x0014 Am79C875 10/100 media interface model ALTIMA Am79C874 0x0021 Am79C874 10/100 media interface +/* Amlogic PHYs */ +model AMLOGIC GXL 0x Meson GXL internal PHY +model xxAMLOGIC GXL 0x Meson GXL internal PHY + /* Atheros PHYs */ model ATHEROS F1 0x0001 F1 10/100/1000 PHY model ATHEROS F2 0x0002 F2 10/100 PHY
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Apr 11 09:14:07 UTC 2019 Modified Files: src/sys/dev/mii: brgphyreg.h ciphy.c mii.h miivar.h rgephy.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/dev/mii/brgphyreg.h cvs rdiff -u -r1.33 -r1.34 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/mii.h cvs rdiff -u -r1.67 -r1.68 src/sys/dev/mii/miivar.h cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/rgephy.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/dev/mii/brgphyreg.h diff -u src/sys/dev/mii/brgphyreg.h:1.10 src/sys/dev/mii/brgphyreg.h:1.11 --- src/sys/dev/mii/brgphyreg.h:1.10 Wed Jan 16 07:32:13 2019 +++ src/sys/dev/mii/brgphyreg.h Thu Apr 11 09:14:07 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphyreg.h,v 1.10 2019/01/16 07:32:13 msaitoh Exp $ */ +/* $NetBSD: brgphyreg.h,v 1.11 2019/04/11 09:14:07 msaitoh Exp $ */ /* * Copyright (c) 2000 @@ -323,6 +323,6 @@ /***/ #define BRGPHY_INTRS \ - ~(BRGPHY_IMR_LNK_CHG|BRGPHY_IMR_LSP_CHG|BRGPHY_IMR_DUP_CHG) + ~(BRGPHY_IMR_LNK_CHG | BRGPHY_IMR_LSP_CHG | BRGPHY_IMR_DUP_CHG) #endif /* _DEV_BRGPHY_MIIREG_H_ */ Index: src/sys/dev/mii/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.33 src/sys/dev/mii/ciphy.c:1.34 --- src/sys/dev/mii/ciphy.c:1.33 Thu Apr 11 08:50:20 2019 +++ src/sys/dev/mii/ciphy.c Thu Apr 11 09:14:07 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.33 2019/04/11 08:50:20 msaitoh Exp $ */ +/* $NetBSD: ciphy.c,v 1.34 2019/04/11 09:14:07 msaitoh Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.33 2019/04/11 08:50:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34 2019/04/11 09:14:07 msaitoh Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -212,9 +212,8 @@ setit: if ((mii->mii_ifp->if_flags & IFF_LINK0)) { PHY_WRITE(sc, MII_GTCR, gig | GTCR_MAN_MS | GTCR_ADV_MS); - } else { + } else PHY_WRITE(sc, MII_GTCR, gig | GTCR_MAN_MS); - } break; case IFM_NONE: PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); @@ -398,7 +397,6 @@ ciphy_fixup(struct mii_softc *sc) switch (model) { case MII_MODEL_CICADA_CS8201: case MII_MODEL_CICADA_CS8204: - /* Turn off "aux mode" (whatever that means) */ PHY_SETBIT(sc, CIPHY_MII_AUXCSR, CIPHY_AUXCSR_MDPPS); @@ -407,11 +405,10 @@ ciphy_fixup(struct mii_softc *sc) * when using MII in full duplex mode. */ if ((speed == CIPHY_SPEED10 || speed == CIPHY_SPEED100) && - (status & CIPHY_AUXCSR_FDX)) { + (status & CIPHY_AUXCSR_FDX)) PHY_SETBIT(sc, CIPHY_MII_10BTCSR, CIPHY_10BTCSR_ECHO); - } else { + else PHY_CLRBIT(sc, CIPHY_MII_10BTCSR, CIPHY_10BTCSR_ECHO); - } /* Enable link/activity LED blink. */ PHY_SETBIT(sc, CIPHY_MII_LED, CIPHY_LED_LINKACTBLINK); @@ -420,15 +417,14 @@ ciphy_fixup(struct mii_softc *sc) case MII_MODEL_CICADA_CS8201A: case MII_MODEL_CICADA_CS8201B: - /* * Work around speed polling bug in VT3119/VT3216 * when using MII in full duplex mode. */ if ((speed == CIPHY_SPEED10 || speed == CIPHY_SPEED100) && - (status & CIPHY_AUXCSR_FDX)) { + (status & CIPHY_AUXCSR_FDX)) PHY_SETBIT(sc, CIPHY_MII_10BTCSR, CIPHY_10BTCSR_ECHO); - } else + else PHY_CLRBIT(sc, CIPHY_MII_10BTCSR, CIPHY_10BTCSR_ECHO); break; Index: src/sys/dev/mii/mii.h diff -u src/sys/dev/mii/mii.h:1.26 src/sys/dev/mii/mii.h:1.27 --- src/sys/dev/mii/mii.h:1.26 Mon Feb 25 07:36:16 2019 +++ src/sys/dev/mii/mii.h Thu Apr 11 09:14:07 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mii.h,v 1.26 2019/02/25 07:36:16 msaitoh Exp $ */ +/* $NetBSD: mii.h,v 1.27 2019/04/11 09:14:07 msaitoh Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. All rights reserved. @@ -64,7 +64,7 @@ #define BMCR_S100 BMCR_SPEED0 /* 100 Mb/s */ #define BMCR_S1000 BMCR_SPEED1 /* 1000 Mb/s */ -#define BMCR_SPEED(x) ((x) & (BMCR_SPEED0|BMCR_SPEED1)) +#define BMCR_SPEED(x) ((x) & (BMCR_SPEED0 | BMCR_SPEED1)) #define MII_BMSR 0x01 /* Basic mode status register (ro) */ #define BMSR_100T4 0x8000 /* 100 base T4 capable */ @@ -90,8 +90,8 @@ * states that all 1000 Mb/s capable PHYs will set this bit to 1. */ -#define BMSR_MEDIAMASK (BMSR_100T4|BMSR_100TXFDX|BMSR_100TXHDX| \ - BMSR_10TFDX|BMSR_10THDX|BMSR_100T2FDX|BMSR_100T2HDX) +#define BMSR_MEDIAMASK (BMSR_100T4 | BMSR_100TXFDX | BMSR_100TXHDX | \ + BMSR_10TFDX | BMSR_10THDX | BMSR_100T2FDX | BMSR_100T2HDX) /* * Convert BMSR media capabilities to ANAR bits for autonegotiation. @@ -304,7 +304,7 @@ #define EXTSR_1000TFDX 0x2000 /* 1000T full-duplex capable */ #define EXTSR_1000THDX 0x1000 /* 1000T half-duplex capable */ -#define EXTSR_MEDIAMASK (EXTSR_1000XFDX|EXTSR_1000XHDX| \ - EXTSR_1000TFDX|EXTSR_1000THDX) +#define EXTSR_MEDIAMASK (EXTSR_1000XFDX |
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Apr 11 09:00:34 UTC 2019 Modified Files: src/sys/dev/mii: atphy.c Log Message: Simplify. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/dev/mii/atphy.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/dev/mii/atphy.c diff -u src/sys/dev/mii/atphy.c:1.21 src/sys/dev/mii/atphy.c:1.22 --- src/sys/dev/mii/atphy.c:1.21 Mon Mar 25 09:20:46 2019 +++ src/sys/dev/mii/atphy.c Thu Apr 11 09:00:34 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: atphy.c,v 1.21 2019/03/25 09:20:46 msaitoh Exp $ */ +/* $NetBSD: atphy.c,v 1.22 2019/04/11 09:00:34 msaitoh Exp $ */ /* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */ /*- @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.21 2019/03/25 09:20:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.22 2019/04/11 09:00:34 msaitoh Exp $"); #include #include @@ -223,7 +223,7 @@ atphy_service(struct mii_softc *sc, stru } anar = mii_anar(IFM_SUBTYPE(ife->ifm_media)); - if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { + if ((ife->ifm_media & IFM_FDX) != 0) { bmcr |= BMCR_FDX; /* Enable pause. */ if (sc->mii_flags & MIIF_DOPAUSE)
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Apr 11 08:50:20 UTC 2019 Modified Files: src/sys/dev/mii: brgphy.c ciphy.c rgephy.c Log Message: 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. Same as a part of FreeBSD r217413. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/dev/mii/brgphy.c cvs rdiff -u -r1.32 -r1.33 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/rgephy.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/dev/mii/brgphy.c diff -u src/sys/dev/mii/brgphy.c:1.83 src/sys/dev/mii/brgphy.c:1.84 --- src/sys/dev/mii/brgphy.c:1.83 Mon Mar 25 09:20:46 2019 +++ src/sys/dev/mii/brgphy.c Thu Apr 11 08:50:20 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphy.c,v 1.83 2019/03/25 09:20:46 msaitoh Exp $ */ +/* $NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.83 2019/03/25 09:20:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $"); #include #include @@ -351,7 +351,7 @@ brgphy_service(struct mii_softc *sc, str speed = BMCR_S10; setit: brgphy_loop(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= BMCR_FDX; gig = GTCR_ADV_1000TFDX; } else Index: src/sys/dev/mii/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.32 src/sys/dev/mii/ciphy.c:1.33 --- src/sys/dev/mii/ciphy.c:1.32 Mon Mar 25 09:20:46 2019 +++ src/sys/dev/mii/ciphy.c Thu Apr 11 08:50:20 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.32 2019/03/25 09:20:46 msaitoh Exp $ */ +/* $NetBSD: ciphy.c,v 1.33 2019/04/11 08:50:20 msaitoh Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.32 2019/03/25 09:20:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.33 2019/04/11 08:50:20 msaitoh Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -184,7 +184,7 @@ ciphy_service(struct mii_softc *sc, stru case IFM_10_T: speed = BMCR_S10; setit: - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= BMCR_FDX; gig = GTCR_ADV_1000TFDX; } else Index: src/sys/dev/mii/rgephy.c diff -u src/sys/dev/mii/rgephy.c:1.52 src/sys/dev/mii/rgephy.c:1.53 --- src/sys/dev/mii/rgephy.c:1.52 Mon Mar 25 09:20:46 2019 +++ src/sys/dev/mii/rgephy.c Thu Apr 11 08:50:20 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rgephy.c,v 1.52 2019/03/25 09:20:46 msaitoh Exp $ */ +/* $NetBSD: rgephy.c,v 1.53 2019/04/11 08:50:20 msaitoh Exp $ */ /* * Copyright (c) 2003 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.52 2019/03/25 09:20:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.53 2019/04/11 08:50:20 msaitoh Exp $"); /* @@ -231,7 +231,7 @@ rgephy_service(struct mii_softc *sc, str anar |= ANAR_10_FD | ANAR_10; setit: rgephy_loop(sc); - if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) { + if ((ife->ifm_media & IFM_FDX) != 0) { speed |= BMCR_FDX; gig = GTCR_ADV_1000TFDX; anar &= ~(ANAR_TX | ANAR_10);
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Apr 9 11:28:45 UTC 2019 Modified Files: src/sys/dev/mii: mii.c mii_physubr.c miivar.h Log Message: - Use uint16_t more for MII registers. - Whitespace. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/mii.c cvs rdiff -u -r1.86 -r1.87 src/sys/dev/mii/mii_physubr.c cvs rdiff -u -r1.66 -r1.67 src/sys/dev/mii/miivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/mii.c diff -u src/sys/dev/mii/mii.c:1.53 src/sys/dev/mii/mii.c:1.54 --- src/sys/dev/mii/mii.c:1.53 Mon Mar 25 09:20:46 2019 +++ src/sys/dev/mii/mii.c Tue Apr 9 11:28:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mii.c,v 1.53 2019/03/25 09:20:46 msaitoh Exp $ */ +/* $NetBSD: mii.c,v 1.54 2019/04/09 11:28:45 msaitoh Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.53 2019/03/25 09:20:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.54 2019/04/09 11:28:45 msaitoh Exp $"); #include #include @@ -280,7 +280,7 @@ bitreverse(unsigned char x) } u_int -mii_oui(u_int id1, u_int id2) +mii_oui(uint16_t id1, uint16_t id2) { u_int h; Index: src/sys/dev/mii/mii_physubr.c diff -u src/sys/dev/mii/mii_physubr.c:1.86 src/sys/dev/mii/mii_physubr.c:1.87 --- src/sys/dev/mii/mii_physubr.c:1.86 Mon Mar 25 09:20:46 2019 +++ src/sys/dev/mii/mii_physubr.c Tue Apr 9 11:28:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mii_physubr.c,v 1.86 2019/03/25 09:20:46 msaitoh Exp $ */ +/* $NetBSD: mii_physubr.c,v 1.87 2019/04/09 11:28:45 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.86 2019/03/25 09:20:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.87 2019/04/09 11:28:45 msaitoh Exp $"); #include #include @@ -699,7 +699,7 @@ mii_phy_resume(device_t dv, const pmf_qu /* * Given an ifmedia word, return the corresponding ANAR value. */ -int +uint16_t mii_anar(int media) { int rv; Index: src/sys/dev/mii/miivar.h diff -u src/sys/dev/mii/miivar.h:1.66 src/sys/dev/mii/miivar.h:1.67 --- src/sys/dev/mii/miivar.h:1.66 Tue Feb 26 05:26:10 2019 +++ src/sys/dev/mii/miivar.h Tue Apr 9 11:28:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: miivar.h,v 1.66 2019/02/26 05:26:10 msaitoh Exp $ */ +/* $NetBSD: miivar.h,v 1.67 2019/04/09 11:28:45 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -196,9 +196,9 @@ struct mii_phydesc { * An array of these structures map MII media types to BMCR/ANAR settings. */ struct mii_media { - int mm_bmcr; /* BMCR settings for this media */ - int mm_anar; /* ANAR settings for this media */ - int mm_gtcr; /* 100base-T2 or 1000base-T CR */ + uint16_t mm_bmcr; /* BMCR settings for this media */ + uint16_t mm_anar; /* ANAR settings for this media */ + uint16_t mm_gtcr; /* 100base-T2 or 1000base-T CR */ }; #define MII_MEDIA_NONE 0 @@ -291,9 +291,9 @@ int mii_mediachg(struct mii_data *); void mii_tick(struct mii_data *); void mii_pollstat(struct mii_data *); void mii_down(struct mii_data *); -int mii_anar(int); +uint16_t mii_anar(int); -int mii_ifmedia_change(struct mii_data *); +int mii_ifmedia_change(struct mii_data *); int mii_phy_activate(device_t, enum devact); int mii_phy_detach(device_t, int); @@ -317,7 +317,7 @@ u_int mii_phy_flowstatus(struct mii_soft void ukphy_status(struct mii_softc *); -u_int mii_oui(u_int, u_int); +u_int mii_oui(uint16_t, uint16_t); #define MII_OUI(id1, id2) mii_oui(id1, id2) #define MII_MODEL(id2) (((id2) & IDR2_MODEL) >> 4) #define MII_REV(id2) ((id2) & IDR2_REV)
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 11:43:50 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Add Bankspeed Pty and NetExcell. To generate a diff of this commit: cvs rdiff -u -r1.150 -r1.151 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.150 src/sys/dev/mii/miidevs:1.151 --- src/sys/dev/mii/miidevs:1.150 Mon Mar 25 09:46:50 2019 +++ src/sys/dev/mii/miidevs Mon Mar 25 11:43:50 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.150 2019/03/25 09:46:50 msaitoh Exp $ +$NetBSD: miidevs,v 1.151 2019/03/25 11:43:50 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -55,6 +55,8 @@ oui TRIDIUM 0x0001f0 Tridium oui DATATRACK 0x0002c6 Data Track Technology oui CICADA 0x0003f1 Cicada Semiconductor oui AGERE 0x00053d Agere +oui BANKSPEED 0x0006b8 Bankspeed Pty +oui NETEXCELL 0x0008bb NetExcell oui NETAS 0x0009c3 Netas oui BROADCOM2 0x000af7 Broadcom Corporation oui RALINK 0x000c43 Ralink Technology
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 11:44:10 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.148 -r1.149 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.136 -r1.137 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.148 src/sys/dev/mii/miidevs.h:1.149 --- src/sys/dev/mii/miidevs.h:1.148 Mon Mar 25 09:47:17 2019 +++ src/sys/dev/mii/miidevs.h Mon Mar 25 11:44:10 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.148 2019/03/25 09:47:17 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.149 2019/03/25 11:44:10 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.150 2019/03/25 09:46:50 msaitoh Exp + * NetBSD: miidevs,v 1.151 2019/03/25 11:43:50 msaitoh Exp */ /*- @@ -62,6 +62,8 @@ #define MII_OUI_DATATRACK 0x0002c6 /* Data Track Technology */ #define MII_OUI_CICADA 0x0003f1 /* Cicada Semiconductor */ #define MII_OUI_AGERE 0x00053d /* Agere */ +#define MII_OUI_BANKSPEED 0x0006b8 /* Bankspeed Pty */ +#define MII_OUI_NETEXCELL 0x0008bb /* NetExcell */ #define MII_OUI_NETAS 0x0009c3 /* Netas */ #define MII_OUI_BROADCOM2 0x000af7 /* Broadcom Corporation */ #define MII_OUI_RALINK 0x000c43 /* Ralink Technology */ Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.136 src/sys/dev/mii/miidevs_data.h:1.137 --- src/sys/dev/mii/miidevs_data.h:1.136 Mon Mar 25 09:47:17 2019 +++ src/sys/dev/mii/miidevs_data.h Mon Mar 25 11:44:10 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.136 2019/03/25 09:47:17 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.137 2019/03/25 11:44:10 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.150 2019/03/25 09:46:50 msaitoh Exp + * NetBSD: miidevs,v 1.151 2019/03/25 11:43:50 msaitoh Exp */ /*-
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 09:47:18 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.135 -r1.136 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.147 src/sys/dev/mii/miidevs.h:1.148 --- src/sys/dev/mii/miidevs.h:1.147 Fri Mar 15 04:00:29 2019 +++ src/sys/dev/mii/miidevs.h Mon Mar 25 09:47:17 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.147 2019/03/15 04:00:29 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.148 2019/03/25 09:47:17 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.149 2019/03/15 04:00:06 msaitoh Exp + * NetBSD: miidevs,v 1.150 2019/03/25 09:46:50 msaitoh Exp */ /*- @@ -290,7 +290,7 @@ #define MII_STR_BROADCOM4_BCM5725C "BCM5725C 1000BASE-T media interface" #define MII_MODEL_xxBROADCOM_ALT1_BCM5906 0x0004 #define MII_STR_xxBROADCOM_ALT1_BCM5906 "BCM5906 10/100baseTX media interface" - + /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ #define MII_MODEL_CICADA_CS8201 0x0001 #define MII_STR_CICADA_CS8201 "Cicada CS8201 10/100/1000TX PHY" Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.135 src/sys/dev/mii/miidevs_data.h:1.136 --- src/sys/dev/mii/miidevs_data.h:1.135 Fri Mar 15 04:00:29 2019 +++ src/sys/dev/mii/miidevs_data.h Mon Mar 25 09:47:17 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.135 2019/03/15 04:00:29 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.136 2019/03/25 09:47:17 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.149 2019/03/15 04:00:06 msaitoh Exp + * NetBSD: miidevs,v 1.150 2019/03/25 09:46:50 msaitoh Exp */ /*- @@ -36,6 +36,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +struct mii_knowndev { + int oui; + int model; + const char *descr; +}; struct mii_knowndev mii_knowndevs[] = { { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011, MII_STR_AGERE_ET1011 }, { MII_OUI_xxASIX, MII_MODEL_xxASIX_AX88X9X, MII_STR_xxASIX_AX88X9X },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 09:46:50 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Remove extra space. To generate a diff of this commit: cvs rdiff -u -r1.149 -r1.150 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.149 src/sys/dev/mii/miidevs:1.150 --- src/sys/dev/mii/miidevs:1.149 Fri Mar 15 04:00:06 2019 +++ src/sys/dev/mii/miidevs Mon Mar 25 09:46:50 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.149 2019/03/15 04:00:06 msaitoh Exp $ +$NetBSD: miidevs,v 1.150 2019/03/25 09:46:50 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -209,7 +209,7 @@ model BROADCOM3 BCM57765 0x0024 BCM57765 model BROADCOM3 BCM5720C 0x0036 BCM5720C 1000BASE-T media interface model BROADCOM4 BCM5725C 0x0038 BCM5725C 1000BASE-T media interface model xxBROADCOM_ALT1 BCM5906 0x0004 BCM5906 10/100baseTX media interface - + /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ model CICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY model CICADA CS8204 0x0004 Cicada CS8204 10/100/1000TX PHY
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 09:46:24 UTC 2019 Modified Files: src/sys/dev/mii: devlist2h.awk mii_verbose.c Log Message: Fix compile error when MIIVERBOSE is set. Reported by Kurt Schreiner. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/dev/mii/devlist2h.awk cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/mii_verbose.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/dev/mii/devlist2h.awk diff -u src/sys/dev/mii/devlist2h.awk:1.8 src/sys/dev/mii/devlist2h.awk:1.9 --- src/sys/dev/mii/devlist2h.awk:1.8 Sat Jun 3 14:46:29 2017 +++ src/sys/dev/mii/devlist2h.awk Mon Mar 25 09:46:24 2019 @@ -1,5 +1,5 @@ #! /usr/bin/awk -f -# $NetBSD: devlist2h.awk,v 1.8 2017/06/03 14:46:29 christos Exp $ +# $NetBSD: devlist2h.awk,v 1.9 2019/03/25 09:46:24 msaitoh Exp $ # # Copyright (c) 1998 The NetBSD Foundation, Inc. # All rights reserved. @@ -142,6 +142,11 @@ NF > 0 && $1 == "model" { models[nmodels, 4]) > hfile if (!firstdone) { + printf("struct mii_knowndev {\n") > dfile + printf(" int oui;\n") > dfile + printf(" int model;\n") > dfile + printf(" const char *descr;\n") > dfile + printf("};\n") > dfile printf("struct mii_knowndev mii_knowndevs[] = {\n") > dfile firstdone = 1 } Index: src/sys/dev/mii/mii_verbose.c diff -u src/sys/dev/mii/mii_verbose.c:1.5 src/sys/dev/mii/mii_verbose.c:1.6 --- src/sys/dev/mii/mii_verbose.c:1.5 Mon Mar 25 07:34:13 2019 +++ src/sys/dev/mii/mii_verbose.c Mon Mar 25 09:46:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mii_verbose.c,v 1.5 2019/03/25 07:34:13 msaitoh Exp $ */ +/* $NetBSD: mii_verbose.c,v 1.6 2019/03/25 09:46:24 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -55,19 +55,13 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_verbose.c,v 1.5 2019/03/25 07:34:13 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_verbose.c,v 1.6 2019/03/25 09:46:24 msaitoh Exp $"); #include #include #include #include -struct mii_knowndev { - int oui; - int model; - const char *descr; -}; - const char * mii_get_descr_real(int, int); MODULE(MODULE_CLASS_MISC, miiverbose, NULL);
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 09:29:09 UTC 2019 Modified Files: src/sys/dev/mii: etphy.c inphy.c lxtphy.c nsphyter.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/etphy.c cvs rdiff -u -r1.57 -r1.58 src/sys/dev/mii/inphy.c cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/lxtphy.c cvs rdiff -u -r1.42 -r1.43 src/sys/dev/mii/nsphyter.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/dev/mii/etphy.c diff -u src/sys/dev/mii/etphy.c:1.3 src/sys/dev/mii/etphy.c:1.4 --- src/sys/dev/mii/etphy.c:1.3 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/etphy.c Mon Mar 25 09:29:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: etphy.c,v 1.3 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: etphy.c,v 1.4 2019/03/25 09:29:08 msaitoh Exp $ */ /* $OpenBSD: etphy.c,v 1.4 2008/04/02 20:12:58 brad Exp $ */ /* @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.3 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.4 2019/03/25 09:29:08 msaitoh Exp $"); #include #include @@ -193,9 +193,7 @@ etphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ + /* If we're not polling our PHY instance, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) return 0; break; @@ -211,9 +209,7 @@ etphy_service(struct mii_softc *sc, stru return 0; } - /* - * If the interface is not up, don't do anything. - */ + /* If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; @@ -239,9 +235,7 @@ etphy_service(struct mii_softc *sc, stru break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ + /* If we're not currently selected, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) return 0; Index: src/sys/dev/mii/inphy.c diff -u src/sys/dev/mii/inphy.c:1.57 src/sys/dev/mii/inphy.c:1.58 --- src/sys/dev/mii/inphy.c:1.57 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/inphy.c Mon Mar 25 09:29:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: inphy.c,v 1.57 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: inphy.c,v 1.58 2019/03/25 09:29:08 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: inphy.c,v 1.57 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: inphy.c,v 1.58 2019/03/25 09:29:08 msaitoh Exp $"); #include #include @@ -106,9 +106,9 @@ inphymatch(device_t parent, cfdata_t mat struct mii_attach_args *ma = aux; if (mii_phy_match(ma, inphys) != NULL) - return (10); + return 10; - return (0); + return 0; } static void @@ -154,11 +154,9 @@ inphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ + /* If we're not polling our PHY instance, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); + return 0; break; case MII_MEDIACHG: @@ -169,12 +167,10 @@ inphy_service(struct mii_softc *sc, stru if (IFM_INST(ife->ifm_media) != sc->mii_inst) { PHY_READ(sc, MII_BMCR, ®); PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); + return 0; } - /* - * If the interface is not up, don't do anything. - */ + /* If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; @@ -182,19 +178,17 @@ inphy_service(struct mii_softc *sc, stru break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ + /* If we're not currently selected, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); + return 0; if (mii_phy_tick(sc) == EJUSTRETURN) - return (0); + return 0; break; case MII_DOWN: mii_phy_down(sc); - return (0); + return 0; } /* Update the media status. */ @@ -202,7 +196,7 @@ inphy_service(struct mii_softc *sc, stru /* Callback if something changed. */ mii_phy_update(sc, cmd); - return (0); + return 0; } static void Index: src/sys/dev/mii/lxtphy.c diff -u src/sys/dev/mii/lxtphy.c:1.52 src/sys/dev/mii/lxtphy.c:1.53 --- src/sys/dev/mii/lxtphy.c:1.52 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/lxtphy.c Mon Mar 25 09:29:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: lxtphy.c,v 1.52 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: lxtphy.c,v 1.53 2019/03/25 09:29:08 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lxtphy.c,v 1.52 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lxtphy.c,v 1.53 2019/03/25 09:29:08 msaitoh Exp $"); #include #include @@
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 09:20:46 UTC 2019 Modified Files: src/sys/dev/mii: acphy.c atphy.c bmtphy.c brgphy.c ciphy.c dmphy.c gentbi.c icsphy.c iophy.c mii.c mii_physubr.c nsphy.c pnaphy.c qsphy.c rdcphy.c rgephy.c rlphy.c sqphy.c tlphy.c tqphy.c ukphy.c ukphy_subr.c urlphy.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/mii/acphy.c cvs rdiff -u -r1.20 -r1.21 src/sys/dev/mii/atphy.c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/bmtphy.c cvs rdiff -u -r1.82 -r1.83 src/sys/dev/mii/brgphy.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.42 -r1.43 src/sys/dev/mii/dmphy.c src/sys/dev/mii/tqphy.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/mii/gentbi.c cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/icsphy.c src/sys/dev/mii/sqphy.c cvs rdiff -u -r1.40 -r1.41 src/sys/dev/mii/iophy.c cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/mii.c cvs rdiff -u -r1.85 -r1.86 src/sys/dev/mii/mii_physubr.c cvs rdiff -u -r1.63 -r1.64 src/sys/dev/mii/nsphy.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/pnaphy.c cvs rdiff -u -r1.51 -r1.52 src/sys/dev/mii/qsphy.c src/sys/dev/mii/rgephy.c cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/rdcphy.c cvs rdiff -u -r1.35 -r1.36 src/sys/dev/mii/rlphy.c cvs rdiff -u -r1.65 -r1.66 src/sys/dev/mii/tlphy.c cvs rdiff -u -r1.50 -r1.51 src/sys/dev/mii/ukphy.c cvs rdiff -u -r1.14 -r1.15 src/sys/dev/mii/ukphy_subr.c cvs rdiff -u -r1.33 -r1.34 src/sys/dev/mii/urlphy.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/dev/mii/acphy.c diff -u src/sys/dev/mii/acphy.c:1.27 src/sys/dev/mii/acphy.c:1.28 --- src/sys/dev/mii/acphy.c:1.27 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/acphy.c Mon Mar 25 09:20:46 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: acphy.c,v 1.27 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: acphy.c,v 1.28 2019/03/25 09:20:46 msaitoh Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.27 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.28 2019/03/25 09:20:46 msaitoh Exp $"); #include #include @@ -87,9 +87,9 @@ acphymatch(device_t parent, cfdata_t mat struct mii_attach_args *ma = aux; if (mii_phy_match(ma, acphys) != NULL) - return (10); + return 10; - return (0); + return 0; } static void @@ -114,9 +114,7 @@ acphyattach(device_t parent, device_t se PHY_RESET(sc); - /* - * XXX Check MCR_FX_SEL to set MIIF_HAVE_FIBER? - */ + /* XXX Check MCR_FX_SEL to set MIIF_HAVE_FIBER? */ PHY_READ(sc, MII_BMSR, &sc->mii_capabilities); sc->mii_capabilities &= ma->mii_capmask; @@ -148,11 +146,9 @@ acphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ + /* If we're not polling our PHY instance, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); + return 0; break; case MII_MEDIACHG: @@ -163,12 +159,10 @@ acphy_service(struct mii_softc *sc, stru if (IFM_INST(ife->ifm_media) != sc->mii_inst) { PHY_READ(sc, MII_BMCR, ®); PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); + return 0; } - /* - * If the interface is not up, don't do anything. - */ + /* If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; @@ -176,19 +170,17 @@ acphy_service(struct mii_softc *sc, stru break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ + /* If we're not currently selected, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); + return 0; if (mii_phy_tick(sc) == EJUSTRETURN) - return (0); + return 0; break; case MII_DOWN: mii_phy_down(sc); - return (0); + return 0; } /* Update the media status. */ @@ -196,7 +188,7 @@ acphy_service(struct mii_softc *sc, stru /* Callback if something changed. */ mii_phy_update(sc, cmd); - return (0); + return 0; } static void Index: src/sys/dev/mii/atphy.c diff -u src/sys/dev/mii/atphy.c:1.20 src/sys/dev/mii/atphy.c:1.21 --- src/sys/dev/mii/atphy.c:1.20 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/atphy.c Mon Mar 25 09:20:46 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: atphy.c,v 1.20 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: atphy.c,v 1.21 2019/03/25 09:20:46 msaitoh Exp $ */ /* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */ /*- @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.20 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.21 2019/03/25 09:20:46 msaitoh Exp $"); #include #include @@ -174,9 +174,7 @@ atphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polli
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 07:34:13 UTC 2019 Modified Files: src/sys/dev/mii: amhphy.c dmphy.c exphy.c glxtphy.c gphyter.c igphy.c ihphy.c ikphy.c makphy.c micphy.c mii_physubr.c mii_verbose.c mvphy.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/dev/mii/amhphy.c cvs rdiff -u -r1.41 -r1.42 src/sys/dev/mii/dmphy.c cvs rdiff -u -r1.55 -r1.56 src/sys/dev/mii/exphy.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/mii/glxtphy.c cvs rdiff -u -r1.32 -r1.33 src/sys/dev/mii/gphyter.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/mii/igphy.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/mii/ihphy.c cvs rdiff -u -r1.14 -r1.15 src/sys/dev/mii/ikphy.c cvs rdiff -u -r1.58 -r1.59 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/mii/micphy.c cvs rdiff -u -r1.84 -r1.85 src/sys/dev/mii/mii_physubr.c cvs rdiff -u -r1.4 -r1.5 src/sys/dev/mii/mii_verbose.c cvs rdiff -u -r1.12 -r1.13 src/sys/dev/mii/mvphy.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/dev/mii/amhphy.c diff -u src/sys/dev/mii/amhphy.c:1.22 src/sys/dev/mii/amhphy.c:1.23 --- src/sys/dev/mii/amhphy.c:1.22 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/amhphy.c Mon Mar 25 07:34:13 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: amhphy.c,v 1.22 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: amhphy.c,v 1.23 2019/03/25 07:34:13 msaitoh Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.22 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.23 2019/03/25 07:34:13 msaitoh Exp $"); #include #include @@ -82,9 +82,9 @@ amhphymatch(device_t parent, cfdata_t ma struct mii_attach_args *ma = aux; if (mii_phy_match(ma, amhphys) != NULL) - return (10); + return 10; - return (0); + return 0; } static void @@ -127,11 +127,9 @@ amhphy_service(struct mii_softc *sc, str switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ + /* If we're not polling our PHY instance, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); + return 0; break; case MII_MEDIACHG: @@ -142,12 +140,10 @@ amhphy_service(struct mii_softc *sc, str if (IFM_INST(ife->ifm_media) != sc->mii_inst) { PHY_READ(sc, MII_BMCR, ®); PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - return (0); + return 0; } - /* - * If the interface is not up, don't do anything. - */ + /* If the interface is not up, don't do anything. */ if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; @@ -155,19 +151,17 @@ amhphy_service(struct mii_softc *sc, str break; case MII_TICK: - /* - * If we're not currently selected, just return. - */ + /* If we're not currently selected, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); + return 0; if (mii_phy_tick(sc) == EJUSTRETURN) - return (0); + return 0; break; case MII_DOWN: mii_phy_down(sc); - return (0); + return 0; } /* Update the media status. */ @@ -175,7 +169,7 @@ amhphy_service(struct mii_softc *sc, str /* Callback if something changed. */ mii_phy_update(sc, cmd); - return (0); + return 0; } static void @@ -218,9 +212,8 @@ amhphy_status(struct mii_softc *sc) if (ssr & SSR_S) { /* * This should't really ever happen, since it's - * a 10BASE-T only PHY. But the bit exists, - * according to the documentation, so we pay - * attention to it. + * a 10BASE-T only PHY. But the bit exists, according + * to the documentation, so we pay attention to it. */ mii->mii_media_active |= IFM_100_TX; } else Index: src/sys/dev/mii/dmphy.c diff -u src/sys/dev/mii/dmphy.c:1.41 src/sys/dev/mii/dmphy.c:1.42 --- src/sys/dev/mii/dmphy.c:1.41 Mon Mar 18 02:52:23 2019 +++ src/sys/dev/mii/dmphy.c Mon Mar 25 07:34:13 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dmphy.c,v 1.41 2019/03/18 02:52:23 msaitoh Exp $ */ +/* $NetBSD: dmphy.c,v 1.42 2019/03/25 07:34:13 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.41 2019/03/18 02:52:23 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.42 2019/03/25 07:34:13 msaitoh Exp $"); #include #include @@ -108,9 +108,9 @@ dmphymatch(device_t parent, cfdata_t mat struct mii_attach_args *ma = aux; if (mii_phy_match(ma, dmphys) != NULL) - return (10); + return 10; - return (0); + return 0; } static void @@ -153,11 +153,9 @@ dmphy_service(struct mii_softc *sc, stru switch (cmd) { case MII_POLLSTAT: - /* - * If we're not polling our PHY instance, just return. - */ + /* If we're not polling our PHY instance, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst)
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 07:09:54 UTC 2019 Modified Files: src/sys/dev/mii: mii_ethersubr.c Log Message: - Copy copyright messages from if_ethersubr.c rev. 1.157. - Add missing RCS ID. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/mii_ethersubr.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/dev/mii/mii_ethersubr.c diff -u src/sys/dev/mii/mii_ethersubr.c:1.1 src/sys/dev/mii/mii_ethersubr.c:1.2 --- src/sys/dev/mii/mii_ethersubr.c:1.1 Wed Jan 2 00:41:07 2008 +++ src/sys/dev/mii/mii_ethersubr.c Mon Mar 25 07:09:54 2019 @@ -1,3 +1,68 @@ +/* $NetBSD: mii_ethersubr.c,v 1.2 2019/03/25 07:09:54 msaitoh Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + *may be used to endorse or promote products derived from this software + *without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1982, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + *may be used to endorse or promote products derived from this software + *without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)if_ethersubr.c 8.2 (Berkeley) 4/4/96 + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: mii_ethersubr.c,v 1.2 2019/03/25 07:09:54 msaitoh Exp $"); + #include #include #include
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 06:17:56 UTC 2019 Modified Files: src/sys/dev/mii: makphyvar.h Log Message: Add my name. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/makphyvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/makphyvar.h diff -u src/sys/dev/mii/makphyvar.h:1.1 src/sys/dev/mii/makphyvar.h:1.2 --- src/sys/dev/mii/makphyvar.h:1.1 Mon Mar 25 05:39:51 2019 +++ src/sys/dev/mii/makphyvar.h Mon Mar 25 06:17:56 2019 @@ -1,11 +1,11 @@ -/* $NetBSD: makphyvar.h,v 1.1 2019/03/25 05:39:51 msaitoh Exp $ */ +/* $NetBSD: makphyvar.h,v 1.2 2019/03/25 06:17:56 msaitoh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation - * by + * by Masanobu SAITOH. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 25 05:39:51 UTC 2019 Modified Files: src/sys/dev/mii: makphy.c Added Files: src/sys/dev/mii: makphyvar.h Log Message: - 88E1000(S) has no page select register, so don't access it. Note that qemu doesn't implement the register and the access fails. For I210, we can use the register. - Don't set PSCR_CRS_ON_TX bit on I210. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/dev/mii/makphy.c cvs rdiff -u -r0 -r1.1 src/sys/dev/mii/makphyvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.57 src/sys/dev/mii/makphy.c:1.58 --- src/sys/dev/mii/makphy.c:1.57 Wed Feb 27 18:21:04 2019 +++ src/sys/dev/mii/makphy.c Mon Mar 25 05:39:51 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.57 2019/02/27 18:21:04 jakllsch Exp $ */ +/* $NetBSD: makphy.c,v 1.58 2019/03/25 05:39:51 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.57 2019/02/27 18:21:04 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.58 2019/03/25 05:39:51 msaitoh Exp $"); #include #include @@ -76,11 +76,12 @@ __KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1 #include #include +#include static int makphymatch(device_t, cfdata_t, void *); static void makphyattach(device_t, device_t, void *); -CFATTACH_DECL_NEW(makphy, sizeof(struct mii_softc), +CFATTACH_DECL_NEW(makphy, sizeof(struct makphy_softc), makphymatch, makphyattach, mii_phy_detach, mii_phy_activate); static int makphy_service(struct mii_softc *, struct mii_data *, int); @@ -155,22 +156,24 @@ makphyattach(device_t parent, device_t s struct mii_attach_args *ma = aux; struct mii_data *mii = ma->mii_data; const struct mii_phydesc *mpd; + struct makphy_softc *maksc = (struct makphy_softc *)sc; const char *name; - uint16_t reg; + uint16_t reg, model; mpd = mii_phy_match(ma, makphys); aprint_naive(": Media interface\n"); if (mpd) name = mpd->mpd_name; - else if (makphy_isi210(parent, ma)) + else if (makphy_isi210(parent, ma)) { name = MII_STR_xxMARVELL_I210; - else + maksc->sc_flags |= MAKPHY_F_I210; + } else panic("Unknown PHY"); aprint_normal(": %s, rev. %d\n", name, MII_REV(ma->mii_id2)); sc->mii_dev = self; sc->mii_mpd_oui = MII_OUI(ma->mii_id1, ma->mii_id2); - sc->mii_mpd_model = MII_MODEL(ma->mii_id2); + sc->mii_mpd_model = model = MII_MODEL(ma->mii_id2); sc->mii_mpd_rev = MII_REV(ma->mii_id2); sc->mii_inst = mii->mii_instance; sc->mii_phy = ma->mii_phyno; @@ -179,10 +182,26 @@ makphyattach(device_t parent, device_t s sc->mii_flags = ma->mii_flags; sc->mii_anegticks = MII_ANEGTICKS; - /* Make sure page 0 is selected. */ - PHY_WRITE(sc, MAKPHY_EADR, 0); + switch (model) { + case MII_MODEL_xxMARVELL_E1000: + if ((maksc->sc_flags & MAKPHY_F_I210) != 0) + goto page0; + /* FALLTHROUGH */ + case MII_MODEL_xxMARVELL_E1000_3: + case MII_MODEL_xxMARVELL_E1000S: + case MII_MODEL_xxMARVELL_E1000_5: + /* 88E1000 series has no EADR */ + break; + default: +page0: + /* Make sure page 0 is selected. */ + if (PHY_WRITE(sc, MAKPHY_EADR, 0) != 0) + aprint_verbose_dev(self, + "Failed to access EADR. Are you an emulator?\n"); + break; + } - switch (sc->mii_mpd_model) { + switch (model) { case MII_MODEL_xxMARVELL_E1011: case MII_MODEL_xxMARVELL_E1112: PHY_READ(sc, MAKPHY_ESSR, ®); @@ -212,6 +231,7 @@ makphyattach(device_t parent, device_t s static void makphy_reset(struct mii_softc *sc) { + struct makphy_softc *maksc = (struct makphy_softc *)sc; uint16_t reg; mii_phy_reset(sc); @@ -224,6 +244,9 @@ makphy_reset(struct mii_softc *sc) /* Assert CRS on transmit. */ switch (sc->mii_mpd_model) { case MII_MODEL_MARVELL_E1000_0: + if ((maksc->sc_flags & MAKPHY_F_I210) != 0) + break; + /* FALLTHROUGH */ case MII_MODEL_MARVELL_E1000_3: case MII_MODEL_MARVELL_E1000_5: case MII_MODEL_MARVELL_E1000_6: Added files: Index: src/sys/dev/mii/makphyvar.h diff -u /dev/null src/sys/dev/mii/makphyvar.h:1.1 --- /dev/null Mon Mar 25 05:39:51 2019 +++ src/sys/dev/mii/makphyvar.h Mon Mar 25 05:39:51 2019 @@ -0,0 +1,42 @@ +/* $NetBSD: makphyvar.h,v 1.1 2019/03/25 05:39:51 msaitoh Exp $ */ + +/*- + * Copyright (c) 2018 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditi
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Mar 18 02:52:24 UTC 2019 Modified Files: src/sys/dev/mii: dmphy.c Log Message: Add Davicom DM9161,DM9161A,DM9161B and DM9601 support. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/dev/mii/dmphy.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/dev/mii/dmphy.c diff -u src/sys/dev/mii/dmphy.c:1.40 src/sys/dev/mii/dmphy.c:1.41 --- src/sys/dev/mii/dmphy.c:1.40 Mon Feb 25 04:24:22 2019 +++ src/sys/dev/mii/dmphy.c Mon Mar 18 02:52:23 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dmphy.c,v 1.40 2019/02/25 04:24:22 msaitoh Exp $ */ +/* $NetBSD: dmphy.c,v 1.41 2019/03/18 02:52:23 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.40 2019/02/25 04:24:22 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.41 2019/03/18 02:52:23 msaitoh Exp $"); #include #include @@ -94,6 +94,10 @@ static const struct mii_phy_funcs dmphy_ static const struct mii_phydesc dmphys[] = { MII_PHY_DESC(xxDAVICOM, DM9101), MII_PHY_DESC(xxDAVICOM, DM9102), + MII_PHY_DESC(xxDAVICOM, DM9161), + MII_PHY_DESC(xxDAVICOM, DM9161A), + MII_PHY_DESC(xxDAVICOM, DM9161B), + MII_PHY_DESC(xxDAVICOM, DM9601), MII_PHY_DESC(DAVICOM, DM9101), MII_PHY_END, };
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 15 04:00:29 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.134 -r1.135 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.146 src/sys/dev/mii/miidevs.h:1.147 --- src/sys/dev/mii/miidevs.h:1.146 Fri Mar 8 07:10:54 2019 +++ src/sys/dev/mii/miidevs.h Fri Mar 15 04:00:29 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.146 2019/03/08 07:10:54 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.147 2019/03/15 04:00:29 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.148 2019/03/08 07:10:26 msaitoh Exp + * NetBSD: miidevs,v 1.149 2019/03/15 04:00:06 msaitoh Exp */ /*- @@ -317,6 +317,14 @@ #define MII_STR_xxDAVICOM_DM9101 "DM9101 (AMD Am79C873) 10/100 media interface" #define MII_MODEL_xxDAVICOM_DM9102 0x0004 #define MII_STR_xxDAVICOM_DM9102 "DM9102 10/100 media interface" +#define MII_MODEL_xxDAVICOM_DM9161 0x0008 +#define MII_STR_xxDAVICOM_DM9161 "DM9161 10/100 media interface" +#define MII_MODEL_xxDAVICOM_DM9161A 0x000a +#define MII_STR_xxDAVICOM_DM9161A "DM9161A 10/100 media interface" +#define MII_MODEL_xxDAVICOM_DM9161B 0x000b +#define MII_STR_xxDAVICOM_DM9161B "DM9161[BC] 10/100 media interface" +#define MII_MODEL_xxDAVICOM_DM9601 0x000c +#define MII_STR_xxDAVICOM_DM9601 "DM9601 internal 10/100 media interface" /* IC Plus Corp. PHYs */ #define MII_MODEL_ICPLUS_IP100 0x0004 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.134 src/sys/dev/mii/miidevs_data.h:1.135 --- src/sys/dev/mii/miidevs_data.h:1.134 Fri Mar 8 07:10:54 2019 +++ src/sys/dev/mii/miidevs_data.h Fri Mar 15 04:00:29 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.134 2019/03/08 07:10:54 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.135 2019/03/15 04:00:29 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.148 2019/03/08 07:10:26 msaitoh Exp + * NetBSD: miidevs,v 1.149 2019/03/15 04:00:06 msaitoh Exp */ /*- @@ -122,6 +122,10 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_DAVICOM, MII_MODEL_DAVICOM_DM9101, MII_STR_DAVICOM_DM9101 }, { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9101, MII_STR_xxDAVICOM_DM9101 }, { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9102, MII_STR_xxDAVICOM_DM9102 }, + { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9161, MII_STR_xxDAVICOM_DM9161 }, + { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9161A, MII_STR_xxDAVICOM_DM9161A }, + { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9161B, MII_STR_xxDAVICOM_DM9161B }, + { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9601, MII_STR_xxDAVICOM_DM9601 }, { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP100, MII_STR_ICPLUS_IP100 }, { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP101, MII_STR_ICPLUS_IP101 }, { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP1000A, MII_STR_ICPLUS_IP1000A },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 15 04:00:06 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Add Davicom DM9161, DM9161[ABC] and DM9601. To generate a diff of this commit: cvs rdiff -u -r1.148 -r1.149 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.148 src/sys/dev/mii/miidevs:1.149 --- src/sys/dev/mii/miidevs:1.148 Fri Mar 8 07:10:26 2019 +++ src/sys/dev/mii/miidevs Fri Mar 15 04:00:06 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.148 2019/03/08 07:10:26 msaitoh Exp $ +$NetBSD: miidevs,v 1.149 2019/03/15 04:00:06 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -225,6 +225,10 @@ model xxCICADA CS8201B 0x0021 Cicada CS model DAVICOM DM9101 0x DM9101 (AMD Am79C873) 10/100 media interface model xxDAVICOM DM9101 0x DM9101 (AMD Am79C873) 10/100 media interface model xxDAVICOM DM9102 0x0004 DM9102 10/100 media interface +model xxDAVICOM DM9161 0x0008 DM9161 10/100 media interface +model xxDAVICOM DM9161A 0x000a DM9161A 10/100 media interface +model xxDAVICOM DM9161B 0x000b DM9161[BC] 10/100 media interface +model xxDAVICOM DM9601 0x000c DM9601 internal 10/100 media interface /* IC Plus Corp. PHYs */ model ICPLUS IP100 0x0004 IP100 10/100 PHY
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 8 09:59:15 UTC 2019 Modified Files: src/sys/dev/mii: nsphyter.c rlphy.c Log Message: Use static. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/dev/mii/nsphyter.c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/rlphy.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/dev/mii/nsphyter.c diff -u src/sys/dev/mii/nsphyter.c:1.41 src/sys/dev/mii/nsphyter.c:1.42 --- src/sys/dev/mii/nsphyter.c:1.41 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/nsphyter.c Fri Mar 8 09:59:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nsphyter.c,v 1.41 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: nsphyter.c,v 1.42 2019/03/08 09:59:15 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nsphyter.c,v 1.41 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nsphyter.c,v 1.42 2019/03/08 09:59:15 msaitoh Exp $"); #include #include @@ -258,7 +258,7 @@ nsphyter_status(struct mii_softc *sc) mii->mii_media_active = ife->ifm_media; } -void +static void nsphyter_reset(struct mii_softc *sc) { int i; Index: src/sys/dev/mii/rlphy.c diff -u src/sys/dev/mii/rlphy.c:1.34 src/sys/dev/mii/rlphy.c:1.35 --- src/sys/dev/mii/rlphy.c:1.34 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/rlphy.c Fri Mar 8 09:59:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rlphy.c,v 1.34 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: rlphy.c,v 1.35 2019/03/08 09:59:15 msaitoh Exp $ */ /* $OpenBSD: rlphy.c,v 1.20 2005/07/31 05:27:30 pvalchev Exp $ */ /* @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.34 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.35 2019/03/08 09:59:15 msaitoh Exp $"); #include #include @@ -61,16 +61,15 @@ struct rlphy_softc { int sc_rtl8201; }; -int rlphymatch(device_t, cfdata_t, void *); -void rlphyattach(device_t, device_t, void *); +static int rlphymatch(device_t, cfdata_t, void *); +static void rlphyattach(device_t, device_t, void *); CFATTACH_DECL_NEW(rlphy, sizeof(struct rlphy_softc), rlphymatch, rlphyattach, mii_phy_detach, mii_phy_activate); -int rlphy_service(struct mii_softc *, struct mii_data *, int); -void rlphy_status(struct mii_softc *); - -static void rlphy_reset(struct mii_softc *); +static int rlphy_service(struct mii_softc *, struct mii_data *, int); +static void rlphy_status(struct mii_softc *); +static void rlphy_reset(struct mii_softc *); const struct mii_phy_funcs rlphy_funcs = { rlphy_service, rlphy_status, rlphy_reset, @@ -83,7 +82,7 @@ static const struct mii_phydesc rlphys[] MII_PHY_END, }; -int +static int rlphymatch(device_t parent, cfdata_t match, void *aux) { struct mii_attach_args *ma = aux; @@ -109,7 +108,7 @@ rlphymatch(device_t parent, cfdata_t mat return 5; } -void +static void rlphyattach(device_t parent, device_t self, void *aux) { struct rlphy_softc *rsc = device_private(self); @@ -148,7 +147,7 @@ rlphyattach(device_t parent, device_t se aprint_normal("\n"); } -int +static int rlphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -205,7 +204,7 @@ rlphy_service(struct mii_softc *sc, stru return (0); } -void +static void rlphy_status(struct mii_softc *sc) { struct rlphy_softc *rsc = (void *)sc;
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 8 07:10:27 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Add yyASIX and AX88772* devices. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.147 src/sys/dev/mii/miidevs:1.148 --- src/sys/dev/mii/miidevs:1.147 Fri Mar 8 07:08:49 2019 +++ src/sys/dev/mii/miidevs Fri Mar 8 07:10:26 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.147 2019/03/08 07:08:49 msaitoh Exp $ +$NetBSD: miidevs,v 1.148 2019/03/08 07:10:26 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -106,6 +106,7 @@ oui xxMARVELL 0x000ac2 Marvell Semicon oui xxINTEL 0x001f00 Intel oui xxBROADCOM_ALT1 0x0050ef Broadcom Corporation oui yyINTEL 0x005500 Intel +oui yyASIX 0x007063 Asix Semiconductor oui xxPMCSIERRA2 0x009057 PMC-Sierra oui xxCICADA 0x00c08f Cicada Semiconductor oui xxNATSEMI 0x1000e8 National Semiconductor @@ -123,6 +124,9 @@ model AGERE ET1011 0x0004 Agere ET1011 /* Asix semiconductor PHYs */ model xxASIX AX88X9X 0x0031 Ax88x9x internal PHY +model yyASIX AX88772 0x0001 AX88772 internal PHY +model yyASIX AX88772A 0x0006 AX88772A internal PHY +model yyASIX AX88772B 0x0008 AX88772B internal PHY /* Altima Communications PHYs */ /* Don't know the model for ACXXX */
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 8 07:10:55 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.133 -r1.134 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.145 src/sys/dev/mii/miidevs.h:1.146 --- src/sys/dev/mii/miidevs.h:1.145 Fri Mar 8 05:26:21 2019 +++ src/sys/dev/mii/miidevs.h Fri Mar 8 07:10:54 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.145 2019/03/08 05:26:21 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.146 2019/03/08 07:10:54 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.146 2019/03/08 05:26:04 msaitoh Exp + * NetBSD: miidevs,v 1.148 2019/03/08 07:10:26 msaitoh Exp */ /*- @@ -98,35 +98,28 @@ #define MII_OUI_TI 0x080028 /* Texas Instruments */ #define MII_OUI_BROADCOM4 0x18c086 /* Broadcom Corporation */ -/* Some Intel 82553's use an alternative OUI. */ -#define MII_OUI_xxINTEL 0x001f00 /* Intel */ - -/* Some VIA 6122's use an alternative OUI. */ -#define MII_OUI_xxCICADA 0x00c08f /* Cicada Semiconductor */ - -/* bad bitorder (bits "g" and "h" (= MSBs byte 1) lost) */ +/* Unregisterd or wrong OUI */ +#define MII_OUI_yyREALTEK 0x04 /* Realtek */ #define MII_OUI_yyAMD 0x58 /* Advanced Micro Devices */ +#define MII_OUI_xxMYSON 0x00032d /* Myson Technology */ +#define MII_OUI_xxTSC 0x00039c /* TDK Semiconductor */ +#define MII_OUI_xxASIX 0x000674 /* Asix Semiconductor */ +#define MII_OUI_xxDAVICOM 0x000676 /* Davicom Semiconductor */ +#define MII_OUI_xxQUALSEMI 0x00068a /* Quality Semiconductor */ +#define MII_OUI_xxREALTEK 0x000732 /* Realtek */ #define MII_OUI_xxBROADCOM 0x000818 /* Broadcom Corporation */ +#define MII_OUI_xxPMCSIERRA 0x0009c0 /* PMC-Sierra */ +#define MII_OUI_xxMARVELL 0x000ac2 /* Marvell Semiconductor */ +#define MII_OUI_xxINTEL 0x001f00 /* Intel */ #define MII_OUI_xxBROADCOM_ALT1 0x0050ef /* Broadcom Corporation */ -#define MII_OUI_xxDAVICOM 0x000676 /* Davicom Semiconductor */ #define MII_OUI_yyINTEL 0x005500 /* Intel */ -#define MII_OUI_xxMARVELL 0x000ac2 /* Marvell Semiconductor */ -#define MII_OUI_xxMYSON 0x00032d /* Myson Technology */ +#define MII_OUI_yyASIX 0x007063 /* Asix Semiconductor */ +#define MII_OUI_xxPMCSIERRA2 0x009057 /* PMC-Sierra */ +#define MII_OUI_xxCICADA 0x00c08f /* Cicada Semiconductor */ #define MII_OUI_xxNATSEMI 0x1000e8 /* National Semiconductor */ -#define MII_OUI_xxQUALSEMI 0x00068a /* Quality Semiconductor */ -#define MII_OUI_xxTSC 0x00039c /* TDK Semiconductor */ - -/* bad byteorder (bits "q" and "r" (= LSBs byte 3) lost) */ #define MII_OUI_xxLEVEL1 0x782000 /* Level 1 */ #define MII_OUI_xxXAQTI 0xace000 /* XaQti Corp. */ -/* Don't know what's going on here. */ -#define MII_OUI_xxASIX 0x000674 /* Asix Semiconductor */ -#define MII_OUI_xxPMCSIERRA 0x0009c0 /* PMC-Sierra */ -#define MII_OUI_xxPMCSIERRA2 0x009057 /* PMC-Sierra */ - -#define MII_OUI_xxREALTEK 0x000732 /* Realtek */ -#define MII_OUI_yyREALTEK 0x04 /* Realtek */ /* * List of known models. Grouped by oui. */ @@ -140,6 +133,12 @@ /* Asix semiconductor PHYs */ #define MII_MODEL_xxASIX_AX88X9X 0x0031 #define MII_STR_xxASIX_AX88X9X "Ax88x9x internal PHY" +#define MII_MODEL_yyASIX_AX88772 0x0001 +#define MII_STR_yyASIX_AX88772 "AX88772 internal PHY" +#define MII_MODEL_yyASIX_AX88772A 0x0006 +#define MII_STR_yyASIX_AX88772A "AX88772A internal PHY" +#define MII_MODEL_yyASIX_AX88772B 0x0008 +#define MII_STR_yyASIX_AX88772B "AX88772B internal PHY" /* Altima Communications PHYs */ /* Don't know the model for ACXXX */ Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.133 src/sys/dev/mii/miidevs_data.h:1.134 --- src/sys/dev/mii/miidevs_data.h:1.133 Fri Mar 8 05:26:21 2019 +++ src/sys/dev/mii/miidevs_data.h Fri Mar 8 07:10:54 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.133 2019/03/08 05:26:21 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.134 2019/03/08 07:10:54 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.146 2019/03/08 05:26:04 msaitoh Exp + * NetBSD: miidevs,v 1.148 2019/03/08 07:10:26 msaitoh Exp */ /*- @@ -39,6 +39,9 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011, MII_STR_AGERE_ET1011 }, { MII_OUI_xxASIX, MII_MODEL_xxASIX_AX88X9X, MII_STR_xxASIX_AX88X9X }, + { MII_OUI_yyASIX, MII_MODEL_yyASIX_AX88772, MII_STR_yyASIX_AX88772 }, + { MII_OUI_yyASIX, MII_MODEL_yyASIX_AX88772A, MII_STR_yyASIX_AX88772A }, + { MII_OUI_yyASIX, MII_MODEL_yyASIX_AX88772B, MII_STR_yyASIX_AX88772B }, { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_ACXXX, MII_STR_ALTIMA_ACXXX },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 8 07:08:49 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Cleanup xx or yy OUIs. Sort by number. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.146 src/sys/dev/mii/miidevs:1.147 --- src/sys/dev/mii/miidevs:1.146 Fri Mar 8 05:26:04 2019 +++ src/sys/dev/mii/miidevs Fri Mar 8 07:08:49 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.146 2019/03/08 05:26:04 msaitoh Exp $ +$NetBSD: miidevs,v 1.147 2019/03/08 07:08:49 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -91,35 +91,27 @@ oui NATSEMI 0x080017 National Semicond oui TI0x080028 Texas Instruments oui BROADCOM4 0x18c086 Broadcom Corporation -/* Some Intel 82553's use an alternative OUI. */ -oui xxINTEL 0x001f00 Intel - -/* Some VIA 6122's use an alternative OUI. */ -oui xxCICADA 0x00c08f Cicada Semiconductor - -/* bad bitorder (bits "g" and "h" (= MSBs byte 1) lost) */ +/* Unregisterd or wrong OUI */ +oui yyREALTEK 0x04 Realtek oui yyAMD 0x58 Advanced Micro Devices +oui xxMYSON 0x00032d Myson Technology +oui xxTSC 0x00039c TDK Semiconductor +oui xxASIX 0x000674 Asix Semiconductor +oui xxDAVICOM 0x000676 Davicom Semiconductor +oui xxQUALSEMI 0x00068a Quality Semiconductor +oui xxREALTEK 0x000732 Realtek oui xxBROADCOM 0x000818 Broadcom Corporation +oui xxPMCSIERRA 0x0009c0 PMC-Sierra +oui xxMARVELL 0x000ac2 Marvell Semiconductor +oui xxINTEL 0x001f00 Intel oui xxBROADCOM_ALT1 0x0050ef Broadcom Corporation -oui xxDAVICOM 0x000676 Davicom Semiconductor oui yyINTEL 0x005500 Intel -oui xxMARVELL 0x000ac2 Marvell Semiconductor -oui xxMYSON 0x00032d Myson Technology +oui xxPMCSIERRA2 0x009057 PMC-Sierra +oui xxCICADA 0x00c08f Cicada Semiconductor oui xxNATSEMI 0x1000e8 National Semiconductor -oui xxQUALSEMI 0x00068a Quality Semiconductor -oui xxTSC 0x00039c TDK Semiconductor - -/* bad byteorder (bits "q" and "r" (= LSBs byte 3) lost) */ oui xxLEVEL1 0x782000 Level 1 oui xxXAQTI 0xace000 XaQti Corp. -/* Don't know what's going on here. */ -oui xxASIX 0x000674 Asix Semiconductor -oui xxPMCSIERRA 0x0009c0 PMC-Sierra -oui xxPMCSIERRA2 0x009057 PMC-Sierra - -oui xxREALTEK 0x000732 Realtek -oui yyREALTEK 0x04 Realtek /* * List of known models. Grouped by oui. */
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 8 05:26:21 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.144 -r1.145 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.132 -r1.133 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.144 src/sys/dev/mii/miidevs.h:1.145 --- src/sys/dev/mii/miidevs.h:1.144 Thu Mar 7 03:27:14 2019 +++ src/sys/dev/mii/miidevs.h Fri Mar 8 05:26:21 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.144 2019/03/07 03:27:14 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.145 2019/03/08 05:26:21 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.145 2019/03/07 03:26:53 msaitoh Exp + * NetBSD: miidevs,v 1.146 2019/03/08 05:26:04 msaitoh Exp */ /*- @@ -380,8 +380,8 @@ #define MII_STR_xxMARVELL_I210 "I210 10/100/1000 media interface" #define MII_MODEL_xxMARVELL_I82563 0x000a #define MII_STR_xxMARVELL_I82563 "i82563 10/100/1000 media interface" -#define MII_MODEL_ATHEROS_I82578 0x0004 -#define MII_STR_ATHEROS_I82578 "Intel 82578 10/100/1000 media interface" +#define MII_MODEL_ATTANSIC_I82578 0x0004 +#define MII_STR_ATTANSIC_I82578 "Intel 82578 10/100/1000 media interface" /* JMicron PHYs */ Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.132 src/sys/dev/mii/miidevs_data.h:1.133 --- src/sys/dev/mii/miidevs_data.h:1.132 Thu Mar 7 03:27:14 2019 +++ src/sys/dev/mii/miidevs_data.h Fri Mar 8 05:26:21 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.132 2019/03/07 03:27:14 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.133 2019/03/08 05:26:21 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.145 2019/03/07 03:26:53 msaitoh Exp + * NetBSD: miidevs,v 1.146 2019/03/08 05:26:04 msaitoh Exp */ /*- @@ -147,7 +147,7 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_INTEL, MII_MODEL_INTEL_I350, MII_STR_INTEL_I350 }, { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_I210, MII_STR_xxMARVELL_I210 }, { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_I82563, MII_STR_xxMARVELL_I82563 }, - { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_I82578, MII_STR_ATHEROS_I82578 }, + { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_I82578, MII_STR_ATTANSIC_I82578 }, { MII_OUI_JMICRON, MII_MODEL_JMICRON_JMC250, MII_STR_JMICRON_JMC250 }, { MII_OUI_JMICRON, MII_MODEL_JMICRON_JMC260, MII_STR_JMICRON_JMC260 }, { MII_OUI_xxLEVEL1, MII_MODEL_xxLEVEL1_LXT970, MII_STR_xxLEVEL1_LXT970 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Fri Mar 8 05:26:04 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Fix I82578 OUI. This change only affects to MIIVERBOSE. See also if_wm.c rev. 1.599. To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.145 src/sys/dev/mii/miidevs:1.146 --- src/sys/dev/mii/miidevs:1.145 Thu Mar 7 03:26:53 2019 +++ src/sys/dev/mii/miidevs Fri Mar 8 05:26:04 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.145 2019/03/07 03:26:53 msaitoh Exp $ +$NetBSD: miidevs,v 1.146 2019/03/08 05:26:04 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -263,7 +263,7 @@ model INTEL I82580 0x003a 82580 10/100/ model INTEL I350 0x003b I350 10/100/1000 media interface model xxMARVELL I210 0x I210 10/100/1000 media interface model xxMARVELL I82563 0x000a i82563 10/100/1000 media interface -model ATHEROS I82578 0x0004 Intel 82578 10/100/1000 media interface +model ATTANSIC I82578 0x0004 Intel 82578 10/100/1000 media interface /* JMicron PHYs */
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Mar 7 03:27:14 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.143 -r1.144 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.131 -r1.132 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.143 src/sys/dev/mii/miidevs.h:1.144 --- src/sys/dev/mii/miidevs.h:1.143 Wed Mar 6 04:46:41 2019 +++ src/sys/dev/mii/miidevs.h Thu Mar 7 03:27:14 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.143 2019/03/06 04:46:41 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.144 2019/03/07 03:27:14 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.144 2019/03/06 04:46:17 msaitoh Exp + * NetBSD: miidevs,v 1.145 2019/03/07 03:26:53 msaitoh Exp */ /*- @@ -547,6 +547,10 @@ #define MII_STR_SMSC_LAN83C185 "SMSC LAN83C185 10/100 PHY" #define MII_MODEL_SMSC_LAN8700 0x000c #define MII_STR_SMSC_LAN8700 "SMSC LAN8700 10/100 Ethernet Transceiver" +#define MII_MODEL_SMSC_LAN911X 0x000d +#define MII_STR_SMSC_LAN911X "SMSC LAN911X internal 10/100 PHY" +#define MII_MODEL_SMSC_LAN75XX 0x000e +#define MII_STR_SMSC_LAN75XX "SMSC LAN75XX internal 10/100 PHY" #define MII_MODEL_SMSC_LAN8710_LAN8720 0x000f #define MII_STR_SMSC_LAN8710_LAN8720 "SMSC LAN8710/LAN8720 10/100 Ethernet Transceiver" #define MII_MODEL_SMSC_LAN8740 0x0011 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.131 src/sys/dev/mii/miidevs_data.h:1.132 --- src/sys/dev/mii/miidevs_data.h:1.131 Wed Mar 6 04:46:41 2019 +++ src/sys/dev/mii/miidevs_data.h Thu Mar 7 03:27:14 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.131 2019/03/06 04:46:41 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.132 2019/03/07 03:27:14 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.144 2019/03/06 04:46:17 msaitoh Exp + * NetBSD: miidevs,v 1.145 2019/03/07 03:26:53 msaitoh Exp */ /*- @@ -217,6 +217,8 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_SIS, MII_MODEL_SIS_900, MII_STR_SIS_900 }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN83C185, MII_STR_SMSC_LAN83C185 }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8700, MII_STR_SMSC_LAN8700 }, + { MII_OUI_SMSC, MII_MODEL_SMSC_LAN911X, MII_STR_SMSC_LAN911X }, + { MII_OUI_SMSC, MII_MODEL_SMSC_LAN75XX, MII_STR_SMSC_LAN75XX }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8710_LAN8720, MII_STR_SMSC_LAN8710_LAN8720 }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8740, MII_STR_SMSC_LAN8740 }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8741A, MII_STR_SMSC_LAN8741A },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Mar 7 03:26:54 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Add SMSC(Microchip) LAN911X and LAN75XX. To generate a diff of this commit: cvs rdiff -u -r1.144 -r1.145 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.144 src/sys/dev/mii/miidevs:1.145 --- src/sys/dev/mii/miidevs:1.144 Wed Mar 6 04:46:17 2019 +++ src/sys/dev/mii/miidevs Thu Mar 7 03:26:53 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.144 2019/03/06 04:46:17 msaitoh Exp $ +$NetBSD: miidevs,v 1.145 2019/03/07 03:26:53 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -360,6 +360,8 @@ model SIS 900 0x SiS 900 10/100 me /* SMSC PHYs */ model SMSC LAN83C185 0x000a SMSC LAN83C185 10/100 PHY model SMSC LAN8700 0x000c SMSC LAN8700 10/100 Ethernet Transceiver +model SMSC LAN911X 0x000d SMSC LAN911X internal 10/100 PHY +model SMSC LAN75XX 0x000e SMSC LAN75XX internal 10/100 PHY model SMSC LAN8710_LAN8720 0x000f SMSC LAN8710/LAN8720 10/100 Ethernet Transceiver model SMSC LAN8740 0x0011 SMSC LAN8740 10/100 media interface model SMSC LAN8741A 0x0012 SMSC LAN8741A 10/100 media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Mar 6 04:46:41 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.142 -r1.143 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.130 -r1.131 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.142 src/sys/dev/mii/miidevs.h:1.143 --- src/sys/dev/mii/miidevs.h:1.142 Wed Feb 27 03:05:39 2019 +++ src/sys/dev/mii/miidevs.h Wed Mar 6 04:46:41 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.142 2019/02/27 03:05:39 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.143 2019/03/06 04:46:41 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.143 2019/02/27 03:05:18 msaitoh Exp + * NetBSD: miidevs,v 1.144 2019/03/06 04:46:17 msaitoh Exp */ /*- @@ -551,6 +551,10 @@ #define MII_STR_SMSC_LAN8710_LAN8720 "SMSC LAN8710/LAN8720 10/100 Ethernet Transceiver" #define MII_MODEL_SMSC_LAN8740 0x0011 #define MII_STR_SMSC_LAN8740 "SMSC LAN8740 10/100 media interface" +#define MII_MODEL_SMSC_LAN8741A 0x0012 +#define MII_STR_SMSC_LAN8741A "SMSC LAN8741A 10/100 media interface" +#define MII_MODEL_SMSC_LAN8742 0x0013 +#define MII_STR_SMSC_LAN8742 "SMSC LAN8742 10/100 media interface" /* Texas Instruments PHYs */ #define MII_MODEL_TI_TLAN10T 0x0001 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.130 src/sys/dev/mii/miidevs_data.h:1.131 --- src/sys/dev/mii/miidevs_data.h:1.130 Wed Feb 27 03:05:39 2019 +++ src/sys/dev/mii/miidevs_data.h Wed Mar 6 04:46:41 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.130 2019/02/27 03:05:39 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.131 2019/03/06 04:46:41 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.143 2019/02/27 03:05:18 msaitoh Exp + * NetBSD: miidevs,v 1.144 2019/03/06 04:46:17 msaitoh Exp */ /*- @@ -219,6 +219,8 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8700, MII_STR_SMSC_LAN8700 }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8710_LAN8720, MII_STR_SMSC_LAN8710_LAN8720 }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8740, MII_STR_SMSC_LAN8740 }, + { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8741A, MII_STR_SMSC_LAN8741A }, + { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8742, MII_STR_SMSC_LAN8742 }, { MII_OUI_TI, MII_MODEL_TI_TLAN10T, MII_STR_TI_TLAN10T }, { MII_OUI_TI, MII_MODEL_TI_100VGPMI, MII_STR_TI_100VGPMI }, { MII_OUI_TI, MII_MODEL_TI_TNETE2101, MII_STR_TI_TNETE2101 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Mar 6 04:46:17 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Add SMSC(now Microchip) LAN8741A and LAN8742 To generate a diff of this commit: cvs rdiff -u -r1.143 -r1.144 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.143 src/sys/dev/mii/miidevs:1.144 --- src/sys/dev/mii/miidevs:1.143 Wed Feb 27 03:05:18 2019 +++ src/sys/dev/mii/miidevs Wed Mar 6 04:46:17 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.143 2019/02/27 03:05:18 msaitoh Exp $ +$NetBSD: miidevs,v 1.144 2019/03/06 04:46:17 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -362,6 +362,8 @@ model SMSC LAN83C185 0x000a SMSC LAN83C model SMSC LAN8700 0x000c SMSC LAN8700 10/100 Ethernet Transceiver model SMSC LAN8710_LAN8720 0x000f SMSC LAN8710/LAN8720 10/100 Ethernet Transceiver model SMSC LAN8740 0x0011 SMSC LAN8740 10/100 media interface +model SMSC LAN8741A 0x0012 SMSC LAN8741A 10/100 media interface +model SMSC LAN8742 0x0013 SMSC LAN8742 10/100 media interface /* Texas Instruments PHYs */ model TI TLAN10T 0x0001 ThunderLAN 10BASE-T media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Mar 5 02:13:15 UTC 2019 Modified Files: src/sys/dev/mii: tlphy.c Log Message: mii_phy_add_media() automatically install power handler, but if_media_add() doesn't. When mii_phy_add_media() isn't used, call pmf_device_register(). To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/dev/mii/tlphy.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/dev/mii/tlphy.c diff -u src/sys/dev/mii/tlphy.c:1.64 src/sys/dev/mii/tlphy.c:1.65 --- src/sys/dev/mii/tlphy.c:1.64 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/tlphy.c Tue Mar 5 02:13:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: tlphy.c,v 1.64 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: tlphy.c,v 1.65 2019/03/05 02:13:15 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.64 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.65 2019/03/05 02:13:15 msaitoh Exp $"); #include #include @@ -180,12 +180,19 @@ tlphyattach(device_t parent, device_t se if (sc->mii_capabilities & BMSR_MEDIAMASK) { aprint_normal("%s", sep); mii_phy_add_media(sc); - } else if ((tsc->sc_tlphycap & + } else { + if ((tsc->sc_tlphycap & (TLPHY_MEDIA_10_2 | TLPHY_MEDIA_10_5)) == 0) - aprint_error("no media present"); - else if (!pmf_device_register(self, NULL, mii_phy_resume)) { - aprint_normal("\n"); - aprint_error_dev(self, "couldn't establish power handler"); + aprint_error("no media present"); + /* + * mii_phy_add_media() automatically install power handler, + * but if_media_add() doesn't. Do it now. + */ + if (!pmf_device_register(self, NULL, mii_phy_resume)) { + aprint_normal("\n"); + aprint_error_dev(self, + "couldn't establish power handler"); + } } aprint_normal("\n"); #undef ADD
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jakllsch Date: Wed Feb 27 18:21:04 UTC 2019 Modified Files: src/sys/dev/mii: makphy.c Log Message: Use symbolic MII_MODEL_xxMARVELL_I210 instead of a literal 0 in makphy_isi210(). To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/dev/mii/makphy.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/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.56 src/sys/dev/mii/makphy.c:1.57 --- src/sys/dev/mii/makphy.c:1.56 Mon Feb 25 04:26:22 2019 +++ src/sys/dev/mii/makphy.c Wed Feb 27 18:21:04 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.56 2019/02/25 04:26:22 msaitoh Exp $ */ +/* $NetBSD: makphy.c,v 1.57 2019/02/27 18:21:04 jakllsch Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.56 2019/02/25 04:26:22 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.57 2019/02/27 18:21:04 jakllsch Exp $"); #include #include @@ -128,7 +128,7 @@ makphy_isi210(device_t parent, struct mi /* I21[01]'s model number is 0 */ if ((MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxMARVELL) - && (MII_MODEL(ma->mii_id2) == 0) + && (MII_MODEL(ma->mii_id2) == MII_MODEL_xxMARVELL_I210) && (device_is_a(parent, "wm"))) return true; return false;
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 27 03:05:18 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: - Add SMSC LAN83C185 10/100 PHY from OpenBSD - Add SMSC LAN8740 10/100 media interface To generate a diff of this commit: cvs rdiff -u -r1.142 -r1.143 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.142 src/sys/dev/mii/miidevs:1.143 --- src/sys/dev/mii/miidevs:1.142 Mon Feb 25 06:23:33 2019 +++ src/sys/dev/mii/miidevs Wed Feb 27 03:05:18 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.142 2019/02/25 06:23:33 msaitoh Exp $ +$NetBSD: miidevs,v 1.143 2019/02/27 03:05:18 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -358,8 +358,10 @@ model SEEQ 80225 0x0008 Seeq 80225 10/1 model SIS 900 0x SiS 900 10/100 media interface /* SMSC PHYs */ +model SMSC LAN83C185 0x000a SMSC LAN83C185 10/100 PHY model SMSC LAN8700 0x000c SMSC LAN8700 10/100 Ethernet Transceiver model SMSC LAN8710_LAN8720 0x000f SMSC LAN8710/LAN8720 10/100 Ethernet Transceiver +model SMSC LAN8740 0x0011 SMSC LAN8740 10/100 media interface /* Texas Instruments PHYs */ model TI TLAN10T 0x0001 ThunderLAN 10BASE-T media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 27 03:05:39 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.141 -r1.142 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.129 -r1.130 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.141 src/sys/dev/mii/miidevs.h:1.142 --- src/sys/dev/mii/miidevs.h:1.141 Mon Feb 25 06:23:53 2019 +++ src/sys/dev/mii/miidevs.h Wed Feb 27 03:05:39 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.141 2019/02/25 06:23:53 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.142 2019/02/27 03:05:39 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.142 2019/02/25 06:23:33 msaitoh Exp + * NetBSD: miidevs,v 1.143 2019/02/27 03:05:18 msaitoh Exp */ /*- @@ -543,10 +543,14 @@ #define MII_STR_SIS_900 "SiS 900 10/100 media interface" /* SMSC PHYs */ +#define MII_MODEL_SMSC_LAN83C185 0x000a +#define MII_STR_SMSC_LAN83C185 "SMSC LAN83C185 10/100 PHY" #define MII_MODEL_SMSC_LAN8700 0x000c #define MII_STR_SMSC_LAN8700 "SMSC LAN8700 10/100 Ethernet Transceiver" #define MII_MODEL_SMSC_LAN8710_LAN8720 0x000f #define MII_STR_SMSC_LAN8710_LAN8720 "SMSC LAN8710/LAN8720 10/100 Ethernet Transceiver" +#define MII_MODEL_SMSC_LAN8740 0x0011 +#define MII_STR_SMSC_LAN8740 "SMSC LAN8740 10/100 media interface" /* Texas Instruments PHYs */ #define MII_MODEL_TI_TLAN10T 0x0001 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.129 src/sys/dev/mii/miidevs_data.h:1.130 --- src/sys/dev/mii/miidevs_data.h:1.129 Mon Feb 25 06:23:53 2019 +++ src/sys/dev/mii/miidevs_data.h Wed Feb 27 03:05:39 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.129 2019/02/25 06:23:53 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.130 2019/02/27 03:05:39 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.142 2019/02/25 06:23:33 msaitoh Exp + * NetBSD: miidevs,v 1.143 2019/02/27 03:05:18 msaitoh Exp */ /*- @@ -215,8 +215,10 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_SEEQ, MII_MODEL_SEEQ_84220, MII_STR_SEEQ_84220 }, { MII_OUI_SEEQ, MII_MODEL_SEEQ_80225, MII_STR_SEEQ_80225 }, { MII_OUI_SIS, MII_MODEL_SIS_900, MII_STR_SIS_900 }, + { MII_OUI_SMSC, MII_MODEL_SMSC_LAN83C185, MII_STR_SMSC_LAN83C185 }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8700, MII_STR_SMSC_LAN8700 }, { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8710_LAN8720, MII_STR_SMSC_LAN8710_LAN8720 }, + { MII_OUI_SMSC, MII_MODEL_SMSC_LAN8740, MII_STR_SMSC_LAN8740 }, { MII_OUI_TI, MII_MODEL_TI_TLAN10T, MII_STR_TI_TLAN10T }, { MII_OUI_TI, MII_MODEL_TI_100VGPMI, MII_STR_TI_100VGPMI }, { MII_OUI_TI, MII_MODEL_TI_TNETE2101, MII_STR_TI_TNETE2101 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Feb 26 05:26:10 UTC 2019 Modified Files: src/sys/dev/mii: miivar.h rgephy.c Log Message: Add MI MII clause 45 MMD MDIO access macros via clause 22 indirect registers: DESCRIPTION static inline int MMD_INDIRECT(struct mii_softc *sc, uint16_t daddr, uint16_t regnum): Setup MMD device address and register number. It also setup address incrementation function. static inline int MMD_INDIRECT_READ(struct mii_softc *sc, uint16_t daddr, uint16_t regnum, uint16_t *valp)): Do MMD_INDIRECT() and then read the register. static inline int MMD_INDIRECT_WRITE(struct mii_softc *sc, uint16_t daddr, uint16_t regnum, uint16_t val): Do MMD_INDIRECT() and then write the register. RETURN VALUE Retruns 0 on success. Non-zero vaule on failure. Note that old PHYs have no indirect access registers. Accessing such devices with these functions cause timeout and return non-zero value (e.g. ETIMEDOUT). EXAMPLE Read MMD Auto negotiation device's EEE advertisement register, drop 100BASE-TX support and write it. uint16_t eeadvert; /* Post increment is not required */ MMD_INDIRECT_READ(sc, MDIO_MMD_AN | MMDACR_FN_DATA, MDIO_AN_EEEADVERT, &eeadvert); eeadvert &= ~AN_EEEADVERT_100_TX; /* * MMD device address and the register number are already set, so it's * enough to read MII_MMDACR. */ PHY_WRITE(sc. MII_MMDACR, eeadvert); To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/dev/mii/miivar.h cvs rdiff -u -r1.50 -r1.51 src/sys/dev/mii/rgephy.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/dev/mii/miivar.h diff -u src/sys/dev/mii/miivar.h:1.65 src/sys/dev/mii/miivar.h:1.66 --- src/sys/dev/mii/miivar.h:1.65 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/miivar.h Tue Feb 26 05:26:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: miivar.h,v 1.65 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: miivar.h,v 1.66 2019/02/26 05:26:10 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ #include #include +#include #include /* @@ -222,6 +223,57 @@ struct mii_media { (*(p)->mii_pdata->mii_writereg)(device_parent((p)->mii_dev), \ (p)->mii_phy, (r), (v)) +/* + * Setup MDD indirect access. Set device address and register number. + * "addr" variable takes an address ORed with the function (MMDACR_FN_*). + * + */ +static inline int +MMD_INDIRECT(struct mii_softc *sc, uint16_t daddr, uint16_t regnum) +{ + int rv; + + /* + * Set the MMD device address and set the access mode (function) + * to address. + */ + if ((rv = PHY_WRITE(sc, MII_MMDACR, (daddr & ~MMDACR_FUNCMASK))) != 0) + return rv; + + /* Set the register number */ + if ((rv = PHY_WRITE(sc, MII_MMDAADR, regnum)) != 0) + return rv; + + /* Set the access mode (function) */ + rv = PHY_WRITE(sc, MII_MMDACR, daddr); + + return rv; +} + +static inline int +MMD_INDIRECT_READ(struct mii_softc *sc, uint16_t daddr, uint16_t regnum, +uint16_t *valp) +{ + int rv; + + if ((rv = MMD_INDIRECT(sc, daddr, regnum)) != 0) + return rv; + + return PHY_READ(sc, MII_MMDAADR, valp); +} + +static inline int +MMD_INDIRECT_WRITE(struct mii_softc *sc, uint16_t daddr, uint16_t regnum, +uint16_t val) +{ + int rv; + + if ((rv = MMD_INDIRECT(sc, daddr, regnum)) != 0) + return rv; + + return PHY_WRITE(sc, MII_MMDAADR, val); +} + #define PHY_SERVICE(p, d, o) \ (*(p)->mii_funcs->pf_service)((p), (d), (o)) Index: src/sys/dev/mii/rgephy.c diff -u src/sys/dev/mii/rgephy.c:1.50 src/sys/dev/mii/rgephy.c:1.51 --- src/sys/dev/mii/rgephy.c:1.50 Mon Feb 25 07:36:16 2019 +++ src/sys/dev/mii/rgephy.c Tue Feb 26 05:26:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rgephy.c,v 1.50 2019/02/25 07:36:16 msaitoh Exp $ */ +/* $NetBSD: rgephy.c,v 1.51 2019/02/26 05:26:10 msaitoh Exp $ */ /* * Copyright (c) 2003 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.50 2019/02/25 07:36:16 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.51 2019/02/26 05:26:10 msaitoh Exp $"); /* @@ -700,9 +700,7 @@ rgephy_reset(struct mii_softc *sc) /* RTL8211F */ delay(1); /* disable EEE */ - PHY_WRITE(sc, MII_MMDACR, MMDACR_FN_ADDRESS | MDIO_MMD_AN); - PHY_WRITE(sc, MII_MMDAADR, MDIO_AN_EEEADVERT); - PHY_WRITE(sc, MII_MMDACR, MMDACR_FN_DATA | MDIO_MMD_AN); - PHY_WRITE(sc, MII_MMDAADR, 0x); + MMD_INDIRECT_WRITE(sc, MDIO_MMD_AN | MMDACR_FN_DATA, + MDIO_AN_EEEADVERT, 0x); } }
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Feb 25 07:36:16 UTC 2019 Modified Files: src/sys/dev/mii: mii.h rgephy.c Log Message: MMDACR_FN_{DATANPI,DATAPIRW,DATAPIW} are little hard to identify and might be misread, so rename them to MMDACR_FN_{DATA,DATA_INC_RW,DATA_INC_W}. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/mii/mii.h cvs rdiff -u -r1.49 -r1.50 src/sys/dev/mii/rgephy.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/dev/mii/mii.h diff -u src/sys/dev/mii/mii.h:1.25 src/sys/dev/mii/mii.h:1.26 --- src/sys/dev/mii/mii.h:1.25 Wed Jan 16 08:32:24 2019 +++ src/sys/dev/mii/mii.h Mon Feb 25 07:36:16 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mii.h,v 1.25 2019/01/16 08:32:24 msaitoh Exp $ */ +/* $NetBSD: mii.h,v 1.26 2019/02/25 07:36:16 msaitoh Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. All rights reserved. @@ -292,9 +292,9 @@ #define MMDACR_FUNCMASK 0xc000 /* function */ #define MMDACR_DADDRMASK 0x001f /* device address */ #define MMDACR_FN_ADDRESS (0 << 14) /* address */ -#define MMDACR_FN_DATANPI (1 << 14) /* data, no post increment */ -#define MMDACR_FN_DATAPIRW (2 << 14) /* data, post increment on r/w */ -#define MMDACR_FN_DATAPIW (3 << 14) /* data, post increment on wr only */ +#define MMDACR_FN_DATA (1 << 14) /* data, no post increment */ +#define MMDACR_FN_DATA_INC_RW (2 << 14) /* data, post increment on r/w */ +#define MMDACR_FN_DATA_INC_W (3 << 14) /* data, post increment on wr only */ #define MII_MMDAADR 0x0e /* MMD access address data register */ Index: src/sys/dev/mii/rgephy.c diff -u src/sys/dev/mii/rgephy.c:1.49 src/sys/dev/mii/rgephy.c:1.50 --- src/sys/dev/mii/rgephy.c:1.49 Mon Feb 25 06:59:37 2019 +++ src/sys/dev/mii/rgephy.c Mon Feb 25 07:36:16 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rgephy.c,v 1.49 2019/02/25 06:59:37 msaitoh Exp $ */ +/* $NetBSD: rgephy.c,v 1.50 2019/02/25 07:36:16 msaitoh Exp $ */ /* * Copyright (c) 2003 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.49 2019/02/25 06:59:37 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.50 2019/02/25 07:36:16 msaitoh Exp $"); /* @@ -702,7 +702,7 @@ rgephy_reset(struct mii_softc *sc) /* disable EEE */ PHY_WRITE(sc, MII_MMDACR, MMDACR_FN_ADDRESS | MDIO_MMD_AN); PHY_WRITE(sc, MII_MMDAADR, MDIO_AN_EEEADVERT); - PHY_WRITE(sc, MII_MMDACR, MMDACR_FN_DATANPI | MDIO_MMD_AN); + PHY_WRITE(sc, MII_MMDACR, MMDACR_FN_DATA | MDIO_MMD_AN); PHY_WRITE(sc, MII_MMDAADR, 0x); } }
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Feb 25 06:59:37 UTC 2019 Modified Files: src/sys/dev/mii: rgephy.c rgephyreg.h Log Message: It seems EEE support is not only on 8211F but on 8211D and newer. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/dev/mii/rgephy.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/mii/rgephyreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/rgephy.c diff -u src/sys/dev/mii/rgephy.c:1.48 src/sys/dev/mii/rgephy.c:1.49 --- src/sys/dev/mii/rgephy.c:1.48 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/rgephy.c Mon Feb 25 06:59:37 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rgephy.c,v 1.48 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: rgephy.c,v 1.49 2019/02/25 06:59:37 msaitoh Exp $ */ /* * Copyright (c) 2003 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.48 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.49 2019/02/25 06:59:37 msaitoh Exp $"); /* @@ -696,7 +696,7 @@ rgephy_reset(struct mii_softc *sc) /* NWay enable and Restart NWay */ PHY_WRITE(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); - if (sc->mii_mpd_rev == RGEPHY_8211F) { + if (sc->mii_mpd_rev >= RGEPHY_8211D) { /* RTL8211F */ delay(1); /* disable EEE */ Index: src/sys/dev/mii/rgephyreg.h diff -u src/sys/dev/mii/rgephyreg.h:1.11 src/sys/dev/mii/rgephyreg.h:1.12 --- src/sys/dev/mii/rgephyreg.h:1.11 Wed Jun 27 07:51:36 2018 +++ src/sys/dev/mii/rgephyreg.h Mon Feb 25 06:59:37 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rgephyreg.h,v 1.11 2018/06/27 07:51:36 msaitoh Exp $ */ +/* $NetBSD: rgephyreg.h,v 1.12 2019/02/25 06:59:37 msaitoh Exp $ */ /* * Copyright (c) 2003 @@ -39,6 +39,7 @@ #define RGEPHY_8211B 2 #define RGEPHY_8211C 3 +#define RGEPHY_8211D 4 #define RGEPHY_8211E 5 #define RGEPHY_8211F 6
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Feb 25 06:23:53 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.140 -r1.141 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.128 -r1.129 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.140 src/sys/dev/mii/miidevs.h:1.141 --- src/sys/dev/mii/miidevs.h:1.140 Wed Feb 13 08:40:14 2019 +++ src/sys/dev/mii/miidevs.h Mon Feb 25 06:23:53 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.140 2019/02/13 08:40:14 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.141 2019/02/25 06:23:53 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.140 2019/02/13 08:39:55 msaitoh Exp + * NetBSD: miidevs,v 1.142 2019/02/25 06:23:33 msaitoh Exp */ /*- @@ -141,6 +141,20 @@ #define MII_MODEL_xxASIX_AX88X9X 0x0031 #define MII_STR_xxASIX_AX88X9X "Ax88x9x internal PHY" +/* Altima Communications PHYs */ +/* Don't know the model for ACXXX */ +#define MII_MODEL_ALTIMA_ACXXX 0x0001 +#define MII_STR_ALTIMA_ACXXX "ACXXX 10/100 media interface" +#define MII_MODEL_ALTIMA_AC101L 0x0012 +#define MII_STR_ALTIMA_AC101L "AC101L 10/100 media interface" +#define MII_MODEL_ALTIMA_AC101 0x0021 +#define MII_STR_ALTIMA_AC101 "AC101 10/100 media interface" +/* AMD Am79C87[45] have ALTIMA OUI */ +#define MII_MODEL_ALTIMA_Am79C875 0x0014 +#define MII_STR_ALTIMA_Am79C875 "Am79C875 10/100 media interface" +#define MII_MODEL_ALTIMA_Am79C874 0x0021 +#define MII_STR_ALTIMA_Am79C874 "Am79C874 10/100 media interface" + /* Atheros PHYs */ #define MII_MODEL_ATHEROS_F1 0x0001 #define MII_STR_ATHEROS_F1 "F1 10/100/1000 PHY" @@ -157,20 +171,6 @@ #define MII_MODEL_ATTANSIC_AR8035 0x0007 #define MII_STR_ATTANSIC_AR8035 "Atheros AR8035 10/100/1000 PHY" -/* Altima Communications PHYs */ -/* Don't know the model for ACXXX */ -#define MII_MODEL_ALTIMA_ACXXX 0x0001 -#define MII_STR_ALTIMA_ACXXX "ACXXX 10/100 media interface" -#define MII_MODEL_ALTIMA_AC101L 0x0012 -#define MII_STR_ALTIMA_AC101L "AC101L 10/100 media interface" -#define MII_MODEL_ALTIMA_AC101 0x0021 -#define MII_STR_ALTIMA_AC101 "AC101 10/100 media interface" -/* AMD Am79C87[45] have ALTIMA OUI */ -#define MII_MODEL_ALTIMA_Am79C875 0x0014 -#define MII_STR_ALTIMA_Am79C875 "Am79C875 10/100 media interface" -#define MII_MODEL_ALTIMA_Am79C874 0x0021 -#define MII_STR_ALTIMA_Am79C874 "Am79C874 10/100 media interface" - /* Advanced Micro Devices PHYs */ /* see Davicom DM9101 for Am79C873 */ #define MII_MODEL_yyAMD_79C972_10T 0x0001 @@ -312,6 +312,8 @@ /* Davicom Semiconductor PHYs */ /* AMD Am79C873 seems to be a relabeled DM9101 */ +#define MII_MODEL_DAVICOM_DM9101 0x +#define MII_STR_DAVICOM_DM9101 "DM9101 (AMD Am79C873) 10/100 media interface" #define MII_MODEL_xxDAVICOM_DM9101 0x #define MII_STR_xxDAVICOM_DM9101 "DM9101 (AMD Am79C873) 10/100 media interface" #define MII_MODEL_xxDAVICOM_DM9102 0x0004 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.128 src/sys/dev/mii/miidevs_data.h:1.129 --- src/sys/dev/mii/miidevs_data.h:1.128 Wed Feb 13 08:40:14 2019 +++ src/sys/dev/mii/miidevs_data.h Mon Feb 25 06:23:53 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.128 2019/02/13 08:40:14 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.129 2019/02/25 06:23:53 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.140 2019/02/13 08:39:55 msaitoh Exp + * NetBSD: miidevs,v 1.142 2019/02/25 06:23:33 msaitoh Exp */ /*- @@ -39,17 +39,17 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011, MII_STR_AGERE_ET1011 }, { MII_OUI_xxASIX, MII_MODEL_xxASIX_AX88X9X, MII_STR_xxASIX_AX88X9X }, + { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_ACXXX, MII_STR_ALTIMA_ACXXX }, + { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_AC101L, MII_STR_ALTIMA_AC101L }, + { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_AC101, MII_STR_ALTIMA_AC101 }, + { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C875, MII_STR_ALTIMA_Am79C875 }, + { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C874, MII_STR_ALTIMA_Am79C874 }, { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F1, MII_STR_ATHEROS_F1 }, { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F2, MII_STR_ATHEROS_F2 }, { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L1, MII_STR_ATTANSIC_L1 }, { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L2, MII_STR_ATTANSIC_L2 }, { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8021, MII_STR_ATTANSIC_AR8021 }, { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8035, MII_STR_ATTANSIC_AR8035 }, - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_ACXXX, MII_STR_ALTIMA_ACXXX }, - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_AC101L, MII_STR_ALTIMA_AC101L }, - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_AC101, MII_STR_ALTIMA_AC101 }, - { MII_OU
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Feb 25 06:23:33 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Add non-xx'ed DAVICOM DM9101. To generate a diff of this commit: cvs rdiff -u -r1.141 -r1.142 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.141 src/sys/dev/mii/miidevs:1.142 --- src/sys/dev/mii/miidevs:1.141 Thu Feb 14 04:34:37 2019 +++ src/sys/dev/mii/miidevs Mon Feb 25 06:23:33 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.141 2019/02/14 04:34:37 msaitoh Exp $ +$NetBSD: miidevs,v 1.142 2019/02/25 06:23:33 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -226,6 +226,7 @@ model xxCICADA CS8201B 0x0021 Cicada CS /* Davicom Semiconductor PHYs */ /* AMD Am79C873 seems to be a relabeled DM9101 */ +model DAVICOM DM9101 0x DM9101 (AMD Am79C873) 10/100 media interface model xxDAVICOM DM9101 0x DM9101 (AMD Am79C873) 10/100 media interface model xxDAVICOM DM9102 0x0004 DM9102 10/100 media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Feb 25 04:26:22 UTC 2019 Modified Files: src/sys/dev/mii: makphy.c Log Message: Remove xxMARVELL E1000 and duplicated xxMARVELL E1000S to make functionality the same as rev. 1.54. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/dev/mii/makphy.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/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.55 src/sys/dev/mii/makphy.c:1.56 --- src/sys/dev/mii/makphy.c:1.55 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/makphy.c Mon Feb 25 04:26:22 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.55 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: makphy.c,v 1.56 2019/02/25 04:26:22 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.55 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.56 2019/02/25 04:26:22 msaitoh Exp $"); #include #include @@ -96,8 +96,6 @@ static const struct mii_phydesc makphys[ MII_PHY_DESC(MARVELL, E1000_3), MII_PHY_DESC(MARVELL, E1000_5), MII_PHY_DESC(MARVELL, E1000_6), - MII_PHY_DESC(xxMARVELL, E1000), - MII_PHY_DESC(xxMARVELL, E1000S), MII_PHY_DESC(xxMARVELL, E1000_3), MII_PHY_DESC(xxMARVELL, E1000_5), MII_PHY_DESC(xxMARVELL, E1000S),
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Feb 25 04:24:22 UTC 2019 Modified Files: src/sys/dev/mii: dmphy.c Log Message: Fix previos to not to duplicate DM9101 entry. One is DAVICOM and another is xxDAVICOM. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/mii/dmphy.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/dev/mii/dmphy.c diff -u src/sys/dev/mii/dmphy.c:1.39 src/sys/dev/mii/dmphy.c:1.40 --- src/sys/dev/mii/dmphy.c:1.39 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/dmphy.c Mon Feb 25 04:24:22 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dmphy.c,v 1.39 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: dmphy.c,v 1.40 2019/02/25 04:24:22 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.39 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.40 2019/02/25 04:24:22 msaitoh Exp $"); #include #include @@ -94,7 +94,7 @@ static const struct mii_phy_funcs dmphy_ static const struct mii_phydesc dmphys[] = { MII_PHY_DESC(xxDAVICOM, DM9101), MII_PHY_DESC(xxDAVICOM, DM9102), - MII_PHY_DESC(xxDAVICOM, DM9101), + MII_PHY_DESC(DAVICOM, DM9101), MII_PHY_END, };
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Feb 25 04:56:30 UTC 2019 Modified Files: src/sys/dev/mii: brgphy.c Log Message: - Add Broadcom BCM540[24], BCM5424 and BCM5466. - Sort lines. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/dev/mii/brgphy.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/dev/mii/brgphy.c diff -u src/sys/dev/mii/brgphy.c:1.81 src/sys/dev/mii/brgphy.c:1.82 --- src/sys/dev/mii/brgphy.c:1.81 Sun Feb 24 17:22:21 2019 +++ src/sys/dev/mii/brgphy.c Mon Feb 25 04:56:30 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphy.c,v 1.81 2019/02/24 17:22:21 christos Exp $ */ +/* $NetBSD: brgphy.c,v 1.82 2019/02/25 04:56:30 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.81 2019/02/24 17:22:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.82 2019/02/25 04:56:30 msaitoh Exp $"); #include #include @@ -140,12 +140,16 @@ static const struct mii_phy_funcs brgphy static const struct mii_phydesc brgphys[] = { MII_PHY_DESC(BROADCOM, BCM5400), MII_PHY_DESC(BROADCOM, BCM5401), + MII_PHY_DESC(BROADCOM, BCM5402), + MII_PHY_DESC(BROADCOM, BCM5404), MII_PHY_DESC(BROADCOM, BCM5411), MII_PHY_DESC(BROADCOM, BCM5421), - MII_PHY_DESC(BROADCOM, BCM5462), + MII_PHY_DESC(BROADCOM, BCM5424), MII_PHY_DESC(BROADCOM, BCM5461), - MII_PHY_DESC(BROADCOM, BCM54K2), + MII_PHY_DESC(BROADCOM, BCM5462), MII_PHY_DESC(BROADCOM, BCM5464), + MII_PHY_DESC(BROADCOM, BCM5466), + MII_PHY_DESC(BROADCOM, BCM54K2), MII_PHY_DESC(BROADCOM, BCM5701), MII_PHY_DESC(BROADCOM, BCM5703), MII_PHY_DESC(BROADCOM, BCM5704),
CVS commit: src/sys/dev/mii
Module Name:src Committed By: christos Date: Sun Feb 24 17:22:21 UTC 2019 Modified Files: src/sys/dev/mii: acphy.c amhphy.c atphy.c bmtphy.c brgphy.c ciphy.c dmphy.c etphy.c glxtphy.c gphyter.c icsphy.c igphy.c ihphy.c ikphy.c inphy.c iophy.c lxtphy.c makphy.c micphy.c miivar.h mvphy.c nsphy.c nsphyter.c pnaphy.c qsphy.c rdcphy.c rgephy.c rlphy.c sqphy.c tlphy.c tqphy.c Log Message: use a macro to tidy up the phydesc array initialization, from FreeBSD To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/acphy.c cvs rdiff -u -r1.21 -r1.22 src/sys/dev/mii/amhphy.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/mii/atphy.c cvs rdiff -u -r1.33 -r1.34 src/sys/dev/mii/bmtphy.c src/sys/dev/mii/rlphy.c cvs rdiff -u -r1.80 -r1.81 src/sys/dev/mii/brgphy.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.38 -r1.39 src/sys/dev/mii/dmphy.c cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/etphy.c src/sys/dev/mii/rdcphy.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/mii/glxtphy.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/mii/gphyter.c cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/icsphy.c src/sys/dev/mii/sqphy.c cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/igphy.c cvs rdiff -u -r1.12 -r1.13 src/sys/dev/mii/ihphy.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/mii/ikphy.c cvs rdiff -u -r1.56 -r1.57 src/sys/dev/mii/inphy.c cvs rdiff -u -r1.39 -r1.40 src/sys/dev/mii/iophy.c cvs rdiff -u -r1.51 -r1.52 src/sys/dev/mii/lxtphy.c cvs rdiff -u -r1.54 -r1.55 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/micphy.c cvs rdiff -u -r1.64 -r1.65 src/sys/dev/mii/miivar.h cvs rdiff -u -r1.11 -r1.12 src/sys/dev/mii/mvphy.c cvs rdiff -u -r1.62 -r1.63 src/sys/dev/mii/nsphy.c cvs rdiff -u -r1.40 -r1.41 src/sys/dev/mii/nsphyter.c cvs rdiff -u -r1.22 -r1.23 src/sys/dev/mii/pnaphy.c cvs rdiff -u -r1.50 -r1.51 src/sys/dev/mii/qsphy.c cvs rdiff -u -r1.47 -r1.48 src/sys/dev/mii/rgephy.c cvs rdiff -u -r1.63 -r1.64 src/sys/dev/mii/tlphy.c cvs rdiff -u -r1.41 -r1.42 src/sys/dev/mii/tqphy.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/dev/mii/acphy.c diff -u src/sys/dev/mii/acphy.c:1.26 src/sys/dev/mii/acphy.c:1.27 --- src/sys/dev/mii/acphy.c:1.26 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/acphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: acphy.c,v 1.26 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: acphy.c,v 1.27 2019/02/24 17:22:21 christos Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.26 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.27 2019/02/24 17:22:21 christos Exp $"); #include #include @@ -72,21 +72,13 @@ static const struct mii_phy_funcs acphy_ }; static const struct mii_phydesc acphys[] = { - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_AC101, - MII_STR_ALTIMA_AC101 }, - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_AC101L, - MII_STR_ALTIMA_AC101L }, - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C874, - MII_STR_ALTIMA_Am79C874 }, - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C875, - MII_STR_ALTIMA_Am79C875 }, - + MII_PHY_DESC(ALTIMA, AC101), + MII_PHY_DESC(ALTIMA, AC101L), + MII_PHY_DESC(ALTIMA, Am79C874), + MII_PHY_DESC(ALTIMA, Am79C875), /* XXX This is reported to work, but it's not from any data sheet. */ - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_ACXXX, - MII_STR_ALTIMA_ACXXX }, - - { 0,0, - NULL }, + MII_PHY_DESC(ALTIMA, ACXXX), + MII_PHY_END, }; static int Index: src/sys/dev/mii/amhphy.c diff -u src/sys/dev/mii/amhphy.c:1.21 src/sys/dev/mii/amhphy.c:1.22 --- src/sys/dev/mii/amhphy.c:1.21 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/amhphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: amhphy.c,v 1.21 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: amhphy.c,v 1.22 2019/02/24 17:22:21 christos Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.21 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.22 2019/02/24 17:22:21 christos Exp $"); #include #include @@ -72,11 +72,8 @@ static const struct mii_phy_funcs amhphy }; static const struct mii_phydesc amhphys[] = { - { MII_OUI_yyAMD, MII_MODEL_yyAMD_79c901, - MII_STR_yyAMD_79c901 }, - - { 0,0, - NULL }, + MII_PHY_DESC(yyAMD, 79c901), + MII_PHY_END, }; static int Index: src/sys/dev/mii/atphy.c diff -u src/sys/dev/mii/atphy.c:1.19 src/sys/dev/mii/atphy.c:1.20 --- src/sys/dev/mii/atphy.c:1.19 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/atphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: atphy.c,v 1.19 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: atphy.c,v 1.20 2019/02/24 17:22:21 christos Exp $ */ /* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */ /*- @@ -33,7 +33,7 @@ */ #include -__KE
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Feb 21 15:41:56 UTC 2019 Modified Files: src/sys/dev/mii: rgephy.c Log Message: Revision 2..5 == RTL8211B...F To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/dev/mii/rgephy.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/dev/mii/rgephy.c diff -u src/sys/dev/mii/rgephy.c:1.46 src/sys/dev/mii/rgephy.c:1.47 --- src/sys/dev/mii/rgephy.c:1.46 Tue Jan 22 03:42:27 2019 +++ src/sys/dev/mii/rgephy.c Thu Feb 21 15:41:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rgephy.c,v 1.46 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: rgephy.c,v 1.47 2019/02/21 15:41:56 msaitoh Exp $ */ /* * Copyright (c) 2003 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.46 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.47 2019/02/21 15:41:56 msaitoh Exp $"); /* @@ -125,7 +125,6 @@ rgephy_attach(device_t parent, device_t rev = MII_REV(ma->mii_id2); mpd = mii_phy_match(ma, rgephys); aprint_naive(": Media interface\n"); - aprint_normal(": %s, rev. %d\n", mpd->mpd_name, rev); sc->mii_dev = self; sc->mii_inst = mii->mii_instance; @@ -133,6 +132,15 @@ rgephy_attach(device_t parent, device_t sc->mii_mpd_oui = MII_OUI(ma->mii_id1, ma->mii_id2); sc->mii_mpd_model = MII_MODEL(ma->mii_id2); sc->mii_mpd_rev = MII_REV(ma->mii_id2); + + if (sc->mii_mpd_model == MII_MODEL_REALTEK_RTL8169S) { + aprint_normal(": RTL8211"); + if (sc->mii_mpd_rev != 0) + aprint_normal("%c",'@' + sc->mii_mpd_rev); + aprint_normal(" 1000BASE-T media interface\n"); + } else + aprint_normal(": %s, rev. %d\n", mpd->mpd_name, rev); + sc->mii_pdata = mii; sc->mii_flags = ma->mii_flags; sc->mii_anegticks = MII_ANEGTICKS_GIGE;
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Feb 19 07:49:58 UTC 2019 Modified Files: src/sys/dev/mii: ihphy.c Log Message: Match 82580(I340) and I350. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/mii/ihphy.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/dev/mii/ihphy.c diff -u src/sys/dev/mii/ihphy.c:1.11 src/sys/dev/mii/ihphy.c:1.12 --- src/sys/dev/mii/ihphy.c:1.11 Tue Jan 22 03:42:27 2019 +++ src/sys/dev/mii/ihphy.c Tue Feb 19 07:49:58 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ihphy.c,v 1.11 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: ihphy.c,v 1.12 2019/02/19 07:49:58 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.11 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.12 2019/02/19 07:49:58 msaitoh Exp $"); #include #include @@ -100,6 +100,10 @@ static const struct mii_phydesc ihphys[] MII_STR_INTEL_I82579 }, { MII_OUI_INTEL, MII_MODEL_INTEL_I217, MII_STR_INTEL_I217 }, + { MII_OUI_INTEL, MII_MODEL_INTEL_I82580, + MII_STR_INTEL_I82580}, + { MII_OUI_INTEL, MII_MODEL_INTEL_I350, + MII_STR_INTEL_I350}, { 0,0, NULL },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Feb 19 05:47:08 UTC 2019 Modified Files: src/sys/dev/mii: makphy.c Log Message: - Match Intel I21[01]. These chips' model number is wrongly set to 0 (== 88E1000 with model number 0). It seems the PHY function is almost the same as 88E1512. When we add 88E1512 related change to makphy.c, I21[01] should be take into account. - KNF. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/makphy.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/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.53 src/sys/dev/mii/makphy.c:1.54 --- src/sys/dev/mii/makphy.c:1.53 Fri Feb 8 09:17:12 2019 +++ src/sys/dev/mii/makphy.c Tue Feb 19 05:47:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.53 2019/02/08 09:17:12 msaitoh Exp $ */ +/* $NetBSD: makphy.c,v 1.54 2019/02/19 05:47:08 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.53 2019/02/08 09:17:12 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.54 2019/02/19 05:47:08 msaitoh Exp $"); #include #include @@ -168,15 +168,30 @@ static const struct mii_phydesc makphys[ #define MAKARG_PDOWN true /* Power DOWN */ #define MAKARG_PUP false /* Power UP */ +static bool +makphy_isi210(device_t parent, struct mii_attach_args *ma) +{ + + /* I21[01]'s model number is 0 */ + if ((MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxMARVELL) + && (MII_MODEL(ma->mii_id2) == 0) + && (device_is_a(parent, "wm"))) + return true; + return false; +} + static int makphymatch(device_t parent, cfdata_t match, void *aux) { struct mii_attach_args *ma = aux; if (mii_phy_match(ma, makphys) != NULL) - return (10); + return 10; - return (0); + if (makphy_isi210(parent, ma)) + return 10; + + return 0; } static void @@ -186,11 +201,18 @@ makphyattach(device_t parent, device_t s struct mii_attach_args *ma = aux; struct mii_data *mii = ma->mii_data; const struct mii_phydesc *mpd; + const char *name; uint16_t reg; mpd = mii_phy_match(ma, makphys); aprint_naive(": Media interface\n"); - aprint_normal(": %s, rev. %d\n", mpd->mpd_name, MII_REV(ma->mii_id2)); + if (mpd) + name = mpd->mpd_name; + else if (makphy_isi210(parent, ma)) + name = MII_STR_xxMARVELL_I210; + else + panic("Unknown PHY"); + aprint_normal(": %s, rev. %d\n", name, MII_REV(ma->mii_id2)); sc->mii_dev = self; sc->mii_mpd_oui = MII_OUI(ma->mii_id1, ma->mii_id2); @@ -316,7 +338,7 @@ makphy_service(struct mii_softc *sc, str uint16_t bmcr; if (!device_is_active(sc->mii_dev)) - return (ENXIO); + return ENXIO; switch (cmd) { case MII_POLLSTAT: @@ -324,7 +346,7 @@ makphy_service(struct mii_softc *sc, str * If we're not polling our PHY instance, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); + return 0; break; case MII_MEDIACHG: @@ -335,7 +357,7 @@ makphy_service(struct mii_softc *sc, str if (IFM_INST(ife->ifm_media) != sc->mii_inst) { PHY_READ(sc, MII_BMCR, &bmcr); PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_ISO); - return (0); + return 0; } /* @@ -367,15 +389,15 @@ makphy_service(struct mii_softc *sc, str * If we're not currently selected, just return. */ if (IFM_INST(ife->ifm_media) != sc->mii_inst) - return (0); + return 0; if (mii_phy_tick(sc) == EJUSTRETURN) - return (0); + return 0; break; case MII_DOWN: mii_phy_down(sc); - return (0); + return 0; } /* Update the media status. */ @@ -383,7 +405,7 @@ makphy_service(struct mii_softc *sc, str /* Callback if something changed. */ mii_phy_update(sc, cmd); - return (0); + return 0; } static void
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Feb 19 02:51:02 UTC 2019 Modified Files: src/sys/dev/mii: glxtphy.c Log Message: Fix duplicated LEVEL1_LXT1000_OLD entry. I suspect one of them is LEVEL1_LXT1000. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/glxtphy.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/dev/mii/glxtphy.c diff -u src/sys/dev/mii/glxtphy.c:1.26 src/sys/dev/mii/glxtphy.c:1.27 --- src/sys/dev/mii/glxtphy.c:1.26 Tue Jan 22 03:42:27 2019 +++ src/sys/dev/mii/glxtphy.c Tue Feb 19 02:51:02 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: glxtphy.c,v 1.26 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: glxtphy.c,v 1.27 2019/02/19 02:51:02 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.26 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.27 2019/02/19 02:51:02 msaitoh Exp $"); #include #include @@ -94,8 +94,8 @@ static const struct mii_phydesc glxtphys { MII_OUI_LEVEL1, MII_MODEL_LEVEL1_LXT1000_OLD, MII_STR_LEVEL1_LXT1000_OLD }, - { MII_OUI_LEVEL1, MII_MODEL_LEVEL1_LXT1000_OLD, - MII_STR_LEVEL1_LXT1000_OLD }, + { MII_OUI_LEVEL1, MII_MODEL_LEVEL1_LXT1000, + MII_STR_LEVEL1_LXT1000 }, { 0,0, NULL },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Mon Feb 18 07:27:15 UTC 2019 Modified Files: src/sys/dev/mii: dmphy.c Log Message: Fix typo in comment. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/dev/mii/dmphy.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/dev/mii/dmphy.c diff -u src/sys/dev/mii/dmphy.c:1.37 src/sys/dev/mii/dmphy.c:1.38 --- src/sys/dev/mii/dmphy.c:1.37 Tue Jan 22 03:42:27 2019 +++ src/sys/dev/mii/dmphy.c Mon Feb 18 07:27:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dmphy.c,v 1.37 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: dmphy.c,v 1.38 2019/02/18 07:27:15 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.37 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.38 2019/02/18 07:27:15 msaitoh Exp $"); #include #include @@ -234,7 +234,7 @@ dmphy_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) {
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Feb 14 04:34:37 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Sort in alphebetical order a bit. To generate a diff of this commit: cvs rdiff -u -r1.140 -r1.141 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.140 src/sys/dev/mii/miidevs:1.141 --- src/sys/dev/mii/miidevs:1.140 Wed Feb 13 08:39:55 2019 +++ src/sys/dev/mii/miidevs Thu Feb 14 04:34:37 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.140 2019/02/13 08:39:55 msaitoh Exp $ +$NetBSD: miidevs,v 1.141 2019/02/14 04:34:37 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -132,6 +132,15 @@ model AGERE ET1011 0x0004 Agere ET1011 /* Asix semiconductor PHYs */ model xxASIX AX88X9X 0x0031 Ax88x9x internal PHY +/* Altima Communications PHYs */ +/* Don't know the model for ACXXX */ +model ALTIMA ACXXX 0x0001 ACXXX 10/100 media interface +model ALTIMA AC101L 0x0012 AC101L 10/100 media interface +model ALTIMA AC101 0x0021 AC101 10/100 media interface +/* AMD Am79C87[45] have ALTIMA OUI */ +model ALTIMA Am79C875 0x0014 Am79C875 10/100 media interface +model ALTIMA Am79C874 0x0021 Am79C874 10/100 media interface + /* Atheros PHYs */ model ATHEROS F1 0x0001 F1 10/100/1000 PHY model ATHEROS F2 0x0002 F2 10/100 PHY @@ -142,15 +151,6 @@ model ATTANSIC L2 0x0002 L2 10/100 PHY model ATTANSIC AR8021 0x0004 Atheros AR8021 10/100/1000 PHY model ATTANSIC AR8035 0x0007 Atheros AR8035 10/100/1000 PHY -/* Altima Communications PHYs */ -/* Don't know the model for ACXXX */ -model ALTIMA ACXXX 0x0001 ACXXX 10/100 media interface -model ALTIMA AC101L 0x0012 AC101L 10/100 media interface -model ALTIMA AC101 0x0021 AC101 10/100 media interface -/* AMD Am79C87[45] have ALTIMA OUI */ -model ALTIMA Am79C875 0x0014 Am79C875 10/100 media interface -model ALTIMA Am79C874 0x0021 Am79C874 10/100 media interface - /* Advanced Micro Devices PHYs */ /* see Davicom DM9101 for Am79C873 */ model yyAMD 79C972_10T 0x0001 Am79C972 internal 10BASE-T interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Thu Feb 14 04:13:40 UTC 2019 Modified Files: src/sys/dev/mii: micphy.c Log Message: Add KSZ8081 support from FreeBSD. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/micphy.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/dev/mii/micphy.c diff -u src/sys/dev/mii/micphy.c:1.5 src/sys/dev/mii/micphy.c:1.6 --- src/sys/dev/mii/micphy.c:1.5 Tue Jan 22 17:41:06 2019 +++ src/sys/dev/mii/micphy.c Thu Feb 14 04:13:40 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: micphy.c,v 1.5 2019/01/22 17:41:06 skrll Exp $ */ +/* $NetBSD: micphy.c,v 1.6 2019/02/14 04:13:40 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.5 2019/01/22 17:41:06 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.6 2019/02/14 04:13:40 msaitoh Exp $"); #include "opt_mii.h" @@ -79,6 +79,8 @@ __KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1 static int micphymatch(device_t, cfdata_t, void *); static void micphyattach(device_t, device_t, void *); +static void micphy_reset(struct mii_softc *); +static int micphy_service(struct mii_softc *, struct mii_data *, int); CFATTACH_DECL3_NEW(micphy, sizeof(struct mii_softc), micphymatch, micphyattach, mii_phy_detach, mii_phy_activate, NULL, NULL, @@ -88,10 +90,13 @@ static int micphy_service(struct mii_sof static void micphy_fixup(struct mii_softc *, int, int, device_t); static const struct mii_phy_funcs micphy_funcs = { - micphy_service, ukphy_status, mii_phy_reset, + micphy_service, ukphy_status, micphy_reset, }; static const struct mii_phydesc micphys[] = { + { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8081, + MII_STR_MICREL_KSZ8081 }, + { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ9021RNI, MII_STR_MICREL_KSZ9021RNI }, @@ -99,6 +104,8 @@ static const struct mii_phydesc micphys[ NULL }, }; +#define MII_KSZ8081_PHYCTL2 0x1f + static int micphymatch(device_t parent, cfdata_t match, void *aux) { @@ -149,6 +156,24 @@ micphyattach(device_t parent, device_t s aprint_normal("\n"); } +static void +micphy_reset(struct mii_softc *sc) +{ + uint16_t reg; + + /* + * The 8081 has no "sticky bits" that survive a soft reset; several bits + * in the Phy Control Register 2 must be preserved across the reset. + * These bits are set up by the bootloader; they control how the phy + * interfaces to the board (such as clock frequency and LED behavior). + */ + if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ8081) + PHY_READ(sc, MII_KSZ8081_PHYCTL2, ®); + mii_phy_reset(sc); + if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ8081) + PHY_WRITE(sc, MII_KSZ8081_PHYCTL2, reg); +} + static int micphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) {
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 08:42:26 UTC 2019 Modified Files: src/sys/dev/mii: icsphy.c Log Message: Add ICS1893C support from FreeBSD. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/mii/icsphy.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/dev/mii/icsphy.c diff -u src/sys/dev/mii/icsphy.c:1.51 src/sys/dev/mii/icsphy.c:1.52 --- src/sys/dev/mii/icsphy.c:1.51 Tue Jan 22 03:42:27 2019 +++ src/sys/dev/mii/icsphy.c Wed Feb 13 08:42:26 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: icsphy.c,v 1.51 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: icsphy.c,v 1.52 2019/02/13 08:42:26 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: icsphy.c,v 1.51 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: icsphy.c,v 1.52 2019/02/13 08:42:26 msaitoh Exp $"); #include #include @@ -104,6 +104,9 @@ static const struct mii_phydesc icsphys[ { MII_OUI_ICS, MII_MODEL_ICS_1893, MII_STR_ICS_1893 }, + { MII_OUI_ICS, MII_MODEL_ICS_1893C, + MII_STR_ICS_1893C }, + { 0, 0, NULL }, };
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 08:41:43 UTC 2019 Modified Files: src/sys/dev/mii: ciphy.c Log Message: Add CS8204, CS8244 VSC8211 and VSC8601 support from {Free,Open}BSD. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/ciphy.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/dev/mii/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.29 src/sys/dev/mii/ciphy.c:1.30 --- src/sys/dev/mii/ciphy.c:1.29 Tue Jan 22 03:42:27 2019 +++ src/sys/dev/mii/ciphy.c Wed Feb 13 08:41:43 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.29 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: ciphy.c,v 1.30 2019/02/13 08:41:43 msaitoh Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.29 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.30 2019/02/13 08:41:43 msaitoh Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -83,6 +83,15 @@ static const struct mii_phydesc ciphys[] { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201B, MII_STR_CICADA_CS8201B }, + { MII_OUI_CICADA, MII_MODEL_CICADA_CS8204, + MII_STR_CICADA_CS8204 }, + + { MII_OUI_CICADA, MII_MODEL_CICADA_VSC8211, + MII_STR_CICADA_VSC8211 }, + + { MII_OUI_CICADA, MII_MODEL_CICADA_CS8244, + MII_STR_CICADA_CS8244 }, + { MII_OUI_xxCICADA, MII_MODEL_CICADA_CS8201, MII_STR_CICADA_CS8201 }, @@ -92,6 +101,9 @@ static const struct mii_phydesc ciphys[] { MII_OUI_xxCICADA, MII_MODEL_xxCICADA_CS8201B, MII_STR_xxCICADA_CS8201B }, + { MII_OUI_VITESSE, MII_MODEL_VITESSE_VSC8601, + MII_STR_VITESSE_VSC8601 }, + { 0,0, NULL }, }; @@ -422,6 +434,7 @@ ciphy_fixup(struct mii_softc *sc) switch (model) { case MII_MODEL_CICADA_CS8201: + case MII_MODEL_CICADA_CS8204: /* Turn off "aux mode" (whatever that means) */ PHY_SETBIT(sc, CIPHY_MII_AUXCSR, CIPHY_AUXCSR_MDPPS); @@ -457,6 +470,10 @@ ciphy_fixup(struct mii_softc *sc) } break; + case MII_MODEL_CICADA_VSC8211: + case MII_MODEL_CICADA_CS8244: + case MII_MODEL_VITESSE_VSC8601: + break; default: aprint_error_dev(sc->mii_dev, "unknown CICADA PHY model %x\n", model);
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 08:40:14 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: regen. To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.127 -r1.128 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.139 src/sys/dev/mii/miidevs.h:1.140 --- src/sys/dev/mii/miidevs.h:1.139 Wed Feb 13 04:35:58 2019 +++ src/sys/dev/mii/miidevs.h Wed Feb 13 08:40:14 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.139 2019/02/13 04:35:58 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.140 2019/02/13 08:40:14 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.139 2019/02/13 04:35:28 msaitoh Exp + * NetBSD: miidevs,v 1.140 2019/02/13 08:39:55 msaitoh Exp */ /*- @@ -303,12 +303,12 @@ #define MII_STR_CICADA_CS8201A "Cicada CS8201 10/100/1000TX PHY" #define MII_MODEL_CICADA_CS8201B 0x0021 #define MII_STR_CICADA_CS8201B "Cicada CS8201 10/100/1000TX PHY" +#define MII_MODEL_CICADA_CS8244 0x002c +#define MII_STR_CICADA_CS8244 "Vitesse VSC8244 Quad 10/100/1000BASE-T PHY" #define MII_MODEL_xxCICADA_VSC8221 0x0015 #define MII_STR_xxCICADA_VSC8221 "Vitesse VSC8221 10/100/1000BASE-T PHY" #define MII_MODEL_xxCICADA_CS8201B 0x0021 #define MII_STR_xxCICADA_CS8201B "Cicada CS8201 10/100/1000TX PHY" -#define MII_MODEL_xxCICADA_VSC8244 0x002c -#define MII_STR_xxCICADA_VSC8244 "Vitesse VSC8244 Quad 10/100/1000BASE-T PHY" /* Davicom Semiconductor PHYs */ /* AMD Am79C873 seems to be a relabeled DM9101 */ Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.127 src/sys/dev/mii/miidevs_data.h:1.128 --- src/sys/dev/mii/miidevs_data.h:1.127 Wed Feb 13 04:35:58 2019 +++ src/sys/dev/mii/miidevs_data.h Wed Feb 13 08:40:14 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.127 2019/02/13 04:35:58 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.128 2019/02/13 08:40:14 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.139 2019/02/13 04:35:28 msaitoh Exp + * NetBSD: miidevs,v 1.140 2019/02/13 08:39:55 msaitoh Exp */ /*- @@ -113,9 +113,9 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_CICADA, MII_MODEL_CICADA_VSC8211, MII_STR_CICADA_VSC8211 }, { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201A, MII_STR_CICADA_CS8201A }, { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201B, MII_STR_CICADA_CS8201B }, + { MII_OUI_CICADA, MII_MODEL_CICADA_CS8244, MII_STR_CICADA_CS8244 }, { MII_OUI_xxCICADA, MII_MODEL_xxCICADA_VSC8221, MII_STR_xxCICADA_VSC8221 }, { MII_OUI_xxCICADA, MII_MODEL_xxCICADA_CS8201B, MII_STR_xxCICADA_CS8201B }, - { MII_OUI_xxCICADA, MII_MODEL_xxCICADA_VSC8244, MII_STR_xxCICADA_VSC8244 }, { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9101, MII_STR_xxDAVICOM_DM9101 }, { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9102, MII_STR_xxDAVICOM_DM9102 }, { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP100, MII_STR_ICPLUS_IP100 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 08:39:55 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Change CS8244's OUI from xxCICADA to CICADA. I don't know whether this change is correct or not... To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.139 src/sys/dev/mii/miidevs:1.140 --- src/sys/dev/mii/miidevs:1.139 Wed Feb 13 04:35:28 2019 +++ src/sys/dev/mii/miidevs Wed Feb 13 08:39:55 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.139 2019/02/13 04:35:28 msaitoh Exp $ +$NetBSD: miidevs,v 1.140 2019/02/13 08:39:55 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -220,9 +220,9 @@ model CICADA CS8204 0x0004 Cicada CS820 model CICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY model CICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY +model CICADA CS8244 0x002c Vitesse VSC8244 Quad 10/100/1000BASE-T PHY model xxCICADA VSC8221 0x0015 Vitesse VSC8221 10/100/1000BASE-T PHY model xxCICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY -model xxCICADA VSC8244 0x002c Vitesse VSC8244 Quad 10/100/1000BASE-T PHY /* Davicom Semiconductor PHYs */ /* AMD Am79C873 seems to be a relabeled DM9101 */
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 04:35:58 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.126 -r1.127 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.138 src/sys/dev/mii/miidevs.h:1.139 --- src/sys/dev/mii/miidevs.h:1.138 Wed Feb 13 03:54:53 2019 +++ src/sys/dev/mii/miidevs.h Wed Feb 13 04:35:58 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.138 2019/02/13 03:54:53 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.139 2019/02/13 04:35:58 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.136 2019/02/13 03:54:16 msaitoh Exp + * NetBSD: miidevs,v 1.139 2019/02/13 04:35:28 msaitoh Exp */ /*- @@ -161,10 +161,10 @@ /* Don't know the model for ACXXX */ #define MII_MODEL_ALTIMA_ACXXX 0x0001 #define MII_STR_ALTIMA_ACXXX "ACXXX 10/100 media interface" -#define MII_MODEL_ALTIMA_AC101 0x0021 -#define MII_STR_ALTIMA_AC101 "AC101 10/100 media interface" #define MII_MODEL_ALTIMA_AC101L 0x0012 #define MII_STR_ALTIMA_AC101L "AC101L 10/100 media interface" +#define MII_MODEL_ALTIMA_AC101 0x0021 +#define MII_STR_ALTIMA_AC101 "AC101 10/100 media interface" /* AMD Am79C87[45] have ALTIMA OUI */ #define MII_MODEL_ALTIMA_Am79C875 0x0014 #define MII_STR_ALTIMA_Am79C875 "Am79C875 10/100 media interface" @@ -187,12 +187,12 @@ #define MII_STR_xxBROADCOM_3C905B "Broadcom 3c905B internal PHY" #define MII_MODEL_xxBROADCOM_3C905C 0x0017 #define MII_STR_xxBROADCOM_3C905C "Broadcom 3c905C internal PHY" +#define MII_MODEL_xxBROADCOM_BCM5221 0x001e +#define MII_STR_xxBROADCOM_BCM5221 "BCM5221 10/100 media interface" #define MII_MODEL_xxBROADCOM_BCM5201 0x0021 #define MII_STR_xxBROADCOM_BCM5201 "BCM5201 10/100 media interface" #define MII_MODEL_xxBROADCOM_BCM5214 0x0028 #define MII_STR_xxBROADCOM_BCM5214 "BCM5214 Quad 10/100 media interface" -#define MII_MODEL_xxBROADCOM_BCM5221 0x001e -#define MII_STR_xxBROADCOM_BCM5221 "BCM5221 10/100 media interface" #define MII_MODEL_xxBROADCOM_BCM5222 0x0032 #define MII_STR_xxBROADCOM_BCM5222 "BCM5222 Dual 10/100 media interface" #define MII_MODEL_xxBROADCOM_BCM4401 0x0036 @@ -203,8 +203,14 @@ #define MII_STR_BROADCOM_BCM5400 "BCM5400 1000BASE-T media interface" #define MII_MODEL_BROADCOM_BCM5401 0x0005 #define MII_STR_BROADCOM_BCM5401 "BCM5401 1000BASE-T media interface" +#define MII_MODEL_BROADCOM_BCM5402 0x0006 +#define MII_STR_BROADCOM_BCM5402 "BCM5402 1000BASE-T media interface" #define MII_MODEL_BROADCOM_BCM5411 0x0007 #define MII_STR_BROADCOM_BCM5411 "BCM5411 1000BASE-T media interface" +#define MII_MODEL_BROADCOM_BCM5404 0x0008 +#define MII_STR_BROADCOM_BCM5404 "BCM5404 1000BASE-T media interface" +#define MII_MODEL_BROADCOM_BCM5424 0x000a +#define MII_STR_BROADCOM_BCM5424 "BCM5424/BCM5234 1000BASE-T media interface" #define MII_MODEL_BROADCOM_BCM5464 0x000b #define MII_STR_BROADCOM_BCM5464 "BCM5464 1000BASE-T media interface" #define MII_MODEL_BROADCOM_BCM5461 0x000c @@ -235,10 +241,16 @@ #define MII_STR_BROADCOM_BCM5780 "BCM5780 1000BASE-T/X media interface" #define MII_MODEL_BROADCOM_BCM5708C 0x0036 #define MII_STR_BROADCOM_BCM5708C "BCM5708C 1000BASE-T media interface" +#define MII_MODEL_BROADCOM_BCM5466 0x003b +#define MII_STR_BROADCOM_BCM5466 "BCM5466 1000BASE-T media interface" #define MII_MODEL_BROADCOM2_BCM5325 0x0003 #define MII_STR_BROADCOM2_BCM5325 "BCM5325 10/100 5-port PHY switch" #define MII_MODEL_BROADCOM2_BCM5906 0x0004 #define MII_STR_BROADCOM2_BCM5906 "BCM5906 10/100baseTX media interface" +#define MII_MODEL_BROADCOM2_BCM5478 0x0008 +#define MII_STR_BROADCOM2_BCM5478 "BCM5478 1000BASE-T media interface" +#define MII_MODEL_BROADCOM2_BCM5488 0x0009 +#define MII_STR_BROADCOM2_BCM5488 "BCM5488 1000BASE-T media interface" #define MII_MODEL_BROADCOM2_BCM5481 0x000a #define MII_STR_BROADCOM2_BCM5481 "BCM5481 1000BASE-T media interface" #define MII_MODEL_BROADCOM2_BCM5482 0x000b @@ -293,10 +305,10 @@ #define MII_STR_CICADA_CS8201B "Cicada CS8201 10/100/1000TX PHY" #define MII_MODEL_xxCICADA_VSC8221 0x0015 #define MII_STR_xxCICADA_VSC8221 "Vitesse VSC8221 10/100/1000BASE-T PHY" -#define MII_MODEL_xxCICADA_VSC8244 0x002c -#define MII_STR_xxCICADA_VSC8244 "Vitesse VSC8244 Quad 10/100/1000BASE-T PHY" #define MII_MODEL_xxCICADA_CS8201B 0x0021 #define MII_STR_xxCICADA_CS8201B "Cicada CS8201 10/100/1000TX PHY" +#define MII_MODEL_xxCICADA_VSC8244 0x002c +#define MII_STR_xxCICADA_VSC8244 "Vitesse VSC8244 Quad 10/100/1000BASE-T PHY" /* Davicom Semiconductor PHYs */ /* AMD Am79C873 seems to be a relabeled DM9101 */ @@ -324,6 +336,8 @@ #define MII_STR_ICS_1892 "ICS1892 10/100 media interface" #define MII
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 04:35:28 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: - Sort by model number. - Add missing white space. To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.138 src/sys/dev/mii/miidevs:1.139 --- src/sys/dev/mii/miidevs:1.138 Wed Feb 13 04:15:01 2019 +++ src/sys/dev/mii/miidevs Wed Feb 13 04:35:28 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.138 2019/02/13 04:15:01 msaitoh Exp $ +$NetBSD: miidevs,v 1.139 2019/02/13 04:35:28 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -221,8 +221,8 @@ model CICADA VSC8211 0x000b Cicada VSC8 model CICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY model xxCICADA VSC8221 0x0015 Vitesse VSC8221 10/100/1000BASE-T PHY -model xxCICADA VSC8244 0x002c Vitesse VSC8244 Quad 10/100/1000BASE-T PHY model xxCICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY +model xxCICADA VSC8244 0x002c Vitesse VSC8244 Quad 10/100/1000BASE-T PHY /* Davicom Semiconductor PHYs */ /* AMD Am79C873 seems to be a relabeled DM9101 */ @@ -340,6 +340,7 @@ model xxQUALSEMI QS6612 0x QS6612 1 /* RDC Semiconductor PHYs */ model RDC R6040 0x0003 R6040 10/100 media interface + /* RealTek PHYs */ model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface model yyREALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 04:15:01 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: >From FreeBSD: - Add Broadcom BCM540[24], BCM5424, BCM5466 and BCM54[78]8. - Add ICS1893C. - Add Micrel KSZ8081 and KSZ9031. To generate a diff of this commit: cvs rdiff -u -r1.137 -r1.138 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.137 src/sys/dev/mii/miidevs:1.138 --- src/sys/dev/mii/miidevs:1.137 Wed Feb 13 04:02:11 2019 +++ src/sys/dev/mii/miidevs Wed Feb 13 04:15:01 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.137 2019/02/13 04:02:11 msaitoh Exp $ +$NetBSD: miidevs,v 1.138 2019/02/13 04:15:01 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -169,7 +169,10 @@ model xxBROADCOM BCM4401 0x0036 BCM4401 model xxBROADCOM BCM5365 0x0037 BCM5365 10/100 5-port PHY switch model BROADCOM BCM5400 0x0004 BCM5400 1000BASE-T media interface model BROADCOM BCM5401 0x0005 BCM5401 1000BASE-T media interface +model BROADCOM BCM5402 0x0006 BCM5402 1000BASE-T media interface model BROADCOM BCM5411 0x0007 BCM5411 1000BASE-T media interface +model BROADCOM BCM5404 0x0008 BCM5404 1000BASE-T media interface +model BROADCOM BCM5424 0x000a BCM5424/BCM5234 1000BASE-T media interface model BROADCOM BCM5464 0x000b BCM5464 1000BASE-T media interface model BROADCOM BCM5461 0x000c BCM5461 1000BASE-T media interface model BROADCOM BCM5462 0x000d BCM5462 1000BASE-T media interface @@ -185,8 +188,11 @@ model BROADCOM BCM54K2 0x002e BCM54K2 1 model BROADCOM BCM5714 0x0034 BCM5714 1000BASE-T/X media interface model BROADCOM BCM5780 0x0035 BCM5780 1000BASE-T/X media interface model BROADCOM BCM5708C 0x0036 BCM5708C 1000BASE-T media interface +model BROADCOM BCM5466 0x003b BCM5466 1000BASE-T media interface model BROADCOM2 BCM5325 0x0003 BCM5325 10/100 5-port PHY switch model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX media interface +model BROADCOM2 BCM5478 0x0008 BCM5478 1000BASE-T media interface +model BROADCOM2 BCM5488 0x0009 BCM5488 1000BASE-T media interface model BROADCOM2 BCM5481 0x000a BCM5481 1000BASE-T media interface model BROADCOM2 BCM5482 0x000b BCM5482 1000BASE-T media interface model BROADCOM2 BCM5755 0x000c BCM5755 1000BASE-T media interface @@ -234,6 +240,7 @@ model ICS 1889 0x0001 ICS1889 10/100 m model ICS 1890 0x0002 ICS1890 10/100 media interface model ICS 1892 0x0003 ICS1892 10/100 media interface model ICS 1893 0x0004 ICS1893 10/100 media interface +model ICS 1893C 0x0005 ICS1893C 10/100 media interface /* Intel PHYs */ model xxINTEL I82553 0x i82553 10/100 media interface @@ -304,7 +311,9 @@ model MARVELL E1000_6 0x0006 Marvell 88 model MARVELL E 0x000c Marvell 88E Gigabit PHY /* Micrel PHYs */ +model MICREL KSZ8081 0x0016 Micrel KSZ8081 10/100 PHY model MICREL KSZ9021RNI 0x0021 Micrel KSZ9021RNI 10/100/1000 PHY +model MICREL KSZ9031 0x0022 Micrel KSZ9031 10/100/1000 PHY /* Myson Technology PHYs */ model xxMYSON MTD972 0x MTD972 10/100 media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 04:02:11 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: Sort by model number. To generate a diff of this commit: cvs rdiff -u -r1.136 -r1.137 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.136 src/sys/dev/mii/miidevs:1.137 --- src/sys/dev/mii/miidevs:1.136 Wed Feb 13 03:54:16 2019 +++ src/sys/dev/mii/miidevs Wed Feb 13 04:02:11 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.136 2019/02/13 03:54:16 msaitoh Exp $ +$NetBSD: miidevs,v 1.137 2019/02/13 04:02:11 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -145,8 +145,8 @@ model ATTANSIC AR8035 0x0007 Atheros AR /* Altima Communications PHYs */ /* Don't know the model for ACXXX */ model ALTIMA ACXXX 0x0001 ACXXX 10/100 media interface -model ALTIMA AC101 0x0021 AC101 10/100 media interface model ALTIMA AC101L 0x0012 AC101L 10/100 media interface +model ALTIMA AC101 0x0021 AC101 10/100 media interface /* AMD Am79C87[45] have ALTIMA OUI */ model ALTIMA Am79C875 0x0014 Am79C875 10/100 media interface model ALTIMA Am79C874 0x0021 Am79C874 10/100 media interface @@ -161,9 +161,9 @@ model yyAMD 79c901home 0x0039 Am79C901 /* Broadcom Corp. PHYs */ model xxBROADCOM 3C905B 0x0012 Broadcom 3c905B internal PHY model xxBROADCOM 3C905C 0x0017 Broadcom 3c905C internal PHY +model xxBROADCOM BCM5221 0x001e BCM5221 10/100 media interface model xxBROADCOM BCM5201 0x0021 BCM5201 10/100 media interface model xxBROADCOM BCM5214 0x0028 BCM5214 Quad 10/100 media interface -model xxBROADCOM BCM5221 0x001e BCM5221 10/100 media interface model xxBROADCOM BCM5222 0x0032 BCM5222 Dual 10/100 media interface model xxBROADCOM BCM4401 0x0036 BCM4401 10/100 media interface model xxBROADCOM BCM5365 0x0037 BCM5365 10/100 5-port PHY switch @@ -264,12 +264,12 @@ model JMICRON JMC260 0x0022 JMC260 10/1 /* Level 1 PHYs */ model xxLEVEL1 LXT970 0x LXT970 10/100 media interface -model LEVEL1 LXT971 0x000e LXT971/2 10/100 media interface -model LEVEL1 LXT973 0x0021 LXT973 10/100 Dual PHY +model LEVEL1 LXT1000_OLD 0x0003 LXT1000 1000BASE-T media interface model LEVEL1 LXT974 0x0004 LXT974 10/100 Quad PHY model LEVEL1 LXT975 0x0005 LXT975 10/100 Quad PHY -model LEVEL1 LXT1000_OLD 0x0003 LXT1000 1000BASE-T media interface model LEVEL1 LXT1000 0x000c LXT1000 1000BASE-T media interface +model LEVEL1 LXT971 0x000e LXT971/2 10/100 media interface +model LEVEL1 LXT973 0x0021 LXT973 10/100 Dual PHY /* Marvell Semiconductor PHYs */ model xxMARVELL E1000 0x Marvell 88E1000 Gigabit PHY @@ -332,8 +332,8 @@ model xxQUALSEMI QS6612 0x QS6612 1 /* RDC Semiconductor PHYs */ model RDC R6040 0x0003 R6040 10/100 media interface /* RealTek PHYs */ -model yyREALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface +model yyREALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface model REALTEK RTL8251 0x RTL8251 1000BASE-T media interface model REALTEK RTL8201E 0x0008 RTL8201E 10/100 media interface model REALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 03:54:16 UTC 2019 Modified Files: src/sys/dev/mii: miidevs Log Message: - Add Tridium, Data Track Technology, Netas, Ralink Technology, Sunplus Technology and ADMtek's OUI. - Sort by OUI. To generate a diff of this commit: cvs rdiff -u -r1.135 -r1.136 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.135 src/sys/dev/mii/miidevs:1.136 --- src/sys/dev/mii/miidevs:1.135 Wed Feb 13 03:44:55 2019 +++ src/sys/dev/mii/miidevs Wed Feb 13 03:54:16 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.135 2019/02/13 03:44:55 msaitoh Exp $ +$NetBSD: miidevs,v 1.136 2019/02/13 03:54:16 msaitoh Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -51,14 +51,21 @@ $NetBSD: miidevs,v 1.135 2019/02/13 03:4 oui AMD0x1a Advanced Micro Devices oui VITESSE 0x0001c1 Vitesse +oui TRIDIUM 0x0001f0 Tridium +oui DATATRACK 0x0002c6 Data Track Technology oui CICADA 0x0003f1 Cicada Semiconductor oui AGERE 0x00053d Agere +oui NETAS 0x0009c3 Netas oui BROADCOM2 0x000af7 Broadcom Corporation +oui RALINK 0x000c43 Ralink Technology +oui ASIX 0x000ec6 ASIX oui BROADCOM 0x001018 Broadcom Corporation oui MICREL 0x0010a1 Micrel oui ALTIMA 0x0010a9 Altima Communications oui ENABLESEMI 0x0010dd Enable Semiconductor +oui SUNPLUS 0x001105 Sunplus Technology oui ATHEROS 0x001374 Atheros +oui RALINK2 0x0017a5 Ralink Technology oui BROADCOM3 0x001be9 Broadcom Corporation oui LEVEL1 0x00207b Level 1 oui VIA0x004063 VIA Technologies @@ -78,8 +85,8 @@ oui JMICRON 0x00d831 JMicron oui PMCSIERRA 0x00e004 PMC-Sierra oui SIS0x00e006 Silicon Integrated Systems oui REALTEK 0x00e04c RealTek +oui ADMTEK 0x00e092 ADMtek oui XAQTI 0x00e0ae XaQti Corp. -oui ASIX 0x000ec6 ASIX oui NATSEMI 0x080017 National Semiconductor oui TI0x080028 Texas Instruments oui BROADCOM4 0x18c086 Broadcom Corporation
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Wed Feb 13 03:54:53 UTC 2019 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.137 -r1.138 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.125 -r1.126 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.137 src/sys/dev/mii/miidevs.h:1.138 --- src/sys/dev/mii/miidevs.h:1.137 Sat Feb 9 07:46:07 2019 +++ src/sys/dev/mii/miidevs.h Wed Feb 13 03:54:53 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.137 2019/02/09 07:46:07 rin Exp $ */ +/* $NetBSD: miidevs.h,v 1.138 2019/02/13 03:54:53 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.133 2019/02/08 09:16:11 msaitoh Exp + * NetBSD: miidevs,v 1.136 2019/02/13 03:54:16 msaitoh Exp */ /*- @@ -57,16 +57,25 @@ */ #define MII_OUI_AMD 0x1a /* Advanced Micro Devices */ +#define MII_OUI_VITESSE 0x0001c1 /* Vitesse */ +#define MII_OUI_TRIDIUM 0x0001f0 /* Tridium */ +#define MII_OUI_DATATRACK 0x0002c6 /* Data Track Technology */ #define MII_OUI_CICADA 0x0003f1 /* Cicada Semiconductor */ #define MII_OUI_AGERE 0x00053d /* Agere */ +#define MII_OUI_NETAS 0x0009c3 /* Netas */ #define MII_OUI_BROADCOM2 0x000af7 /* Broadcom Corporation */ +#define MII_OUI_RALINK 0x000c43 /* Ralink Technology */ +#define MII_OUI_ASIX 0x000ec6 /* ASIX */ #define MII_OUI_BROADCOM 0x001018 /* Broadcom Corporation */ #define MII_OUI_MICREL 0x0010a1 /* Micrel */ #define MII_OUI_ALTIMA 0x0010a9 /* Altima Communications */ #define MII_OUI_ENABLESEMI 0x0010dd /* Enable Semiconductor */ +#define MII_OUI_SUNPLUS 0x001105 /* Sunplus Technology */ #define MII_OUI_ATHEROS 0x001374 /* Atheros */ +#define MII_OUI_RALINK2 0x0017a5 /* Ralink Technology */ #define MII_OUI_BROADCOM3 0x001be9 /* Broadcom Corporation */ #define MII_OUI_LEVEL1 0x00207b /* Level 1 */ +#define MII_OUI_VIA 0x004063 /* VIA Technologies */ #define MII_OUI_MARVELL 0x005043 /* Marvell Semiconductor */ #define MII_OUI_QUALSEMI 0x006051 /* Quality Semiconductor */ #define MII_OUI_DAVICOM 0x00606e /* Davicom Semiconductor */ @@ -83,9 +92,11 @@ #define MII_OUI_PMCSIERRA 0x00e004 /* PMC-Sierra */ #define MII_OUI_SIS 0x00e006 /* Silicon Integrated Systems */ #define MII_OUI_REALTEK 0x00e04c /* RealTek */ +#define MII_OUI_ADMTEK 0x00e092 /* ADMtek */ #define MII_OUI_XAQTI 0x00e0ae /* XaQti Corp. */ #define MII_OUI_NATSEMI 0x080017 /* National Semiconductor */ #define MII_OUI_TI 0x080028 /* Texas Instruments */ +#define MII_OUI_BROADCOM4 0x18c086 /* Broadcom Corporation */ /* Some Intel 82553's use an alternative OUI. */ #define MII_OUI_xxINTEL 0x001f00 /* Intel */ @@ -264,6 +275,8 @@ #define MII_STR_BROADCOM3_BCM57765 "BCM57765 1000BASE-T media interface" #define MII_MODEL_BROADCOM3_BCM5720C 0x0036 #define MII_STR_BROADCOM3_BCM5720C "BCM5720C 1000BASE-T media interface" +#define MII_MODEL_BROADCOM4_BCM5725C 0x0038 +#define MII_STR_BROADCOM4_BCM5725C "BCM5725C 1000BASE-T media interface" #define MII_MODEL_xxBROADCOM_ALT1_BCM5906 0x0004 #define MII_STR_xxBROADCOM_ALT1_BCM5906 "BCM5906 10/100baseTX media interface" @@ -528,6 +541,16 @@ #define MII_MODEL_xxTSC_78Q2121 0x0015 #define MII_STR_xxTSC_78Q2121 "78Q2121 100BASE-TX media interface" +/* VIA Technologies PHYs */ +#define MII_MODEL_VIA_VT6103 0x0032 +#define MII_STR_VIA_VT6103 "VT6103 10/100 PHY" +#define MII_MODEL_VIA_VT6103_2 0x0034 +#define MII_STR_VIA_VT6103_2 "VT6103 10/100 PHY" + +/* Vitesse PHYs */ +#define MII_MODEL_VITESSE_VSC8601 0x0002 +#define MII_STR_VITESSE_VSC8601 "VSC8601 10/100/1000 PHY" + /* XaQti Corp. PHYs */ #define MII_MODEL_xxXAQTI_XMACII 0x #define MII_STR_xxXAQTI_XMACII "XaQti Corp. XMAC II gigabit interface" Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.125 src/sys/dev/mii/miidevs_data.h:1.126 --- src/sys/dev/mii/miidevs_data.h:1.125 Sat Feb 9 07:46:07 2019 +++ src/sys/dev/mii/miidevs_data.h Wed Feb 13 03:54:53 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.125 2019/02/09 07:46:07 rin Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.126 2019/02/13 03:54:53 msaitoh Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.133 2019/02/08 09:16:11 msaitoh Exp + * NetBSD: miidevs,v 1.136 2019/02/13 03:54:16 msaitoh Exp */ /*- @@ -100,6 +100,7 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5719C, MII_STR_BROADCOM3_BCM5719C }, { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57765, MII_STR_BROADCOM3_BCM57765 }, { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5720C, MII_STR_BROADCOM3_BCM5720C }, + { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM5725C, MII_STR_BROADCOM4_BCM5725C }, { MII_OUI_xxBROAD