CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Sat Jan 29 16:59:32 UTC 2022 Modified Files: src/sys/dev/mii [netbsd-9]: makphy.c makphyvar.h Log Message: Pull up the following revisions (all via patch), requested by msaitoh in ticket #1410: sys/dev/mii/makphy.c1.67,1.69-1.72 sys/dev/mii/makphyvar.h 1.3-1.4 - Add I347-AT4 support. - Add three workarounds for QEMU e1000: - QEMU sets BMSR_EXTSTAT but the access to register 15 fails. Set EXTSR_1000TFDX and EXTSR_1000THDX if the access failed in the attach function. It's just a cosmetic change. - Marvell 88E1[01]11 have the Fiber/Copper auto selection feature, but QEMU doesn't implement it. If the register access failed, the media is regarded as copper only. It's just a cosmetic change. - QEMU provides the PHY specific status register at 0x11 but the link indication bit (PSSR_LINK) is always 1. It causes "virsh domif-setlink xxx yyy down" doesn't work. To avoid this problem, read the BMSR and check the BMSR_LINK bit. Add MAKPHY_QUIRK_PSSR_LINK bit for this quirk. Set it if MII_EXTSR doesn't exist because it's one of the case of QEMU. - Reduce the number of access to the ESSR register. One of the reason is that the register is not implemented on QEMU. Another reason is that it's not required to access the register if the device is in the copper only mode. To generate a diff of this commit: cvs rdiff -u -r1.60.2.3 -r1.60.2.4 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.2 -r1.2.6.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.60.2.3 src/sys/dev/mii/makphy.c:1.60.2.4 --- src/sys/dev/mii/makphy.c:1.60.2.3 Sat Jan 29 16:54:42 2022 +++ src/sys/dev/mii/makphy.c Sat Jan 29 16:59:31 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.60.2.3 2022/01/29 16:54:42 martin Exp $ */ +/* $NetBSD: makphy.c,v 1.60.2.4 2022/01/29 16:59:31 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.60.2.3 2022/01/29 16:54:42 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.60.2.4 2022/01/29 16:59:31 martin 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, }; @@ -159,6 +160,7 @@ makphyattach(device_t parent, device_t s struct makphy_softc *maksc = (struct makphy_softc *)sc; const char *name; uint16_t reg, model; + int rv; mpd = mii_phy_match(ma, makphys); aprint_naive(": Media interface\n"); @@ -205,8 +207,22 @@ page0: PHY_READ(sc, MII_BMSR, >mii_capabilities); sc->mii_capabilities &= ma->mii_capmask; - if (sc->mii_capabilities & BMSR_EXTSTAT) - PHY_READ(sc, MII_EXTSR, >mii_extcapabilities); + if (sc->mii_capabilities & BMSR_EXTSTAT) { + rv = PHY_READ(sc, MII_EXTSR, >mii_extcapabilities); + if (rv != 0) { + aprint_verbose_dev(self, "Failed to read EXTSR. " + "Are you an emulator?. " + "Regard as 1000BASE-T.\n"); + sc->mii_extcapabilities + |= EXTSR_1000TFDX | EXTSR_1000THDX; + + /* + * Also assume it doesn't support PSSR_LINK bit. + * It's for QEMU. + */ + maksc->sc_flags |= MAKPHY_QUIRK_PSSR_LINK; + } + } if (((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) @@ -219,8 +235,18 @@ page0: 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) { + rv = PHY_READ(sc, MAKPHY_ESSR, ); + if (rv != 0) { +/* + * XXX Emulator (e.g qemu) may not implement + * the ESSR register. If so, regard as copper + * media. + */ +copperonly = true; +aprint_verbose_dev(self, "Failed to access " +"ESSR. Are you an emulator? Regard as " +"copper only media.\n"); + } else if ((reg & ESSR_AUTOSEL_DISABLE) != 0) { switch (reg & ESSR_HWCFG_MODE) { case ESSR_RTBI_FIBER: case ESSR_RGMII_FIBER: @@ -238,7 +264,8 @@ page0: default: break; } - } + } else +maksc->sc_flags |= MAKPHY_F_FICO_AUTOSEL; break; default: break; @@ -418,6 +445,7 @@ makphy_service(struct mii_softc *sc, str static void makphy_status(struct mii_softc *sc) { + struct makphy_softc *maksc = (struct makphy_softc *)sc; struct mii_data *mii = sc->mii_pdata; uint16_t bmcr, gsr, pssr, essr; @@ -428,6 +456,23 @@ makphy_status(struct mii_softc *sc) /* XXX FIXME: Use different page for Fiber on newer chips */ PHY_READ(sc, MAKPHY_PSSR, ); + if ((maksc->sc_flags & MAKPHY_QUIRK_PSSR_LINK) != 0) { + uint16_t bmsr; +
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Sat Jan 29 16:59:32 UTC 2022 Modified Files: src/sys/dev/mii [netbsd-9]: makphy.c makphyvar.h Log Message: Pull up the following revisions (all via patch), requested by msaitoh in ticket #1410: sys/dev/mii/makphy.c1.67,1.69-1.72 sys/dev/mii/makphyvar.h 1.3-1.4 - Add I347-AT4 support. - Add three workarounds for QEMU e1000: - QEMU sets BMSR_EXTSTAT but the access to register 15 fails. Set EXTSR_1000TFDX and EXTSR_1000THDX if the access failed in the attach function. It's just a cosmetic change. - Marvell 88E1[01]11 have the Fiber/Copper auto selection feature, but QEMU doesn't implement it. If the register access failed, the media is regarded as copper only. It's just a cosmetic change. - QEMU provides the PHY specific status register at 0x11 but the link indication bit (PSSR_LINK) is always 1. It causes "virsh domif-setlink xxx yyy down" doesn't work. To avoid this problem, read the BMSR and check the BMSR_LINK bit. Add MAKPHY_QUIRK_PSSR_LINK bit for this quirk. Set it if MII_EXTSR doesn't exist because it's one of the case of QEMU. - Reduce the number of access to the ESSR register. One of the reason is that the register is not implemented on QEMU. Another reason is that it's not required to access the register if the device is in the copper only mode. To generate a diff of this commit: cvs rdiff -u -r1.60.2.3 -r1.60.2.4 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.2 -r1.2.6.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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Sat Jan 29 16:54:42 UTC 2022 Modified Files: src/sys/dev/mii [netbsd-9]: igphy.c ihphy.c makphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #1409): sys/dev/mii/igphy.c: revision 1.37 sys/dev/mii/ihphy.c: revision 1.19 sys/dev/mii/makphy.c: revision 1.68 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.31.4.1 -r1.31.4.2 src/sys/dev/mii/igphy.c cvs rdiff -u -r1.14.4.2 -r1.14.4.3 src/sys/dev/mii/ihphy.c cvs rdiff -u -r1.60.2.2 -r1.60.2.3 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.31.4.1 src/sys/dev/mii/igphy.c:1.31.4.2 --- src/sys/dev/mii/igphy.c:1.31.4.1 Wed Aug 5 15:14:18 2020 +++ src/sys/dev/mii/igphy.c Sat Jan 29 16:54:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: igphy.c,v 1.31.4.1 2020/08/05 15:14:18 martin Exp $ */ +/* $NetBSD: igphy.c,v 1.31.4.2 2022/01/29 16:54:42 martin 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.31.4.1 2020/08/05 15:14:18 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.31.4.2 2022/01/29 16:54:42 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_mii.h" @@ -433,7 +433,6 @@ igphy_status(struct mii_softc *sc) PHY_READ(sc, MII_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.14.4.2 src/sys/dev/mii/ihphy.c:1.14.4.3 --- src/sys/dev/mii/ihphy.c:1.14.4.2 Sat Nov 20 14:59:04 2021 +++ src/sys/dev/mii/ihphy.c Sat Jan 29 16:54:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: ihphy.c,v 1.14.4.2 2021/11/20 14:59:04 martin Exp $ */ +/* $NetBSD: ihphy.c,v 1.14.4.3 2022/01/29 16:54:42 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.14.4.2 2021/11/20 14:59:04 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.14.4.3 2022/01/29 16:54:42 martin Exp $"); #include #include @@ -238,7 +238,6 @@ ihphy_status(struct mii_softc *sc) PHY_READ(sc, MII_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.60.2.2 src/sys/dev/mii/makphy.c:1.60.2.3 --- src/sys/dev/mii/makphy.c:1.60.2.2 Wed Aug 5 15:14:18 2020 +++ src/sys/dev/mii/makphy.c Sat Jan 29 16:54:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.60.2.2 2020/08/05 15:14:18 martin Exp $ */ +/* $NetBSD: makphy.c,v 1.60.2.3 2022/01/29 16:54:42 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.60.2.2 2020/08/05 15:14:18 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.60.2.3 2022/01/29 16:54:42 martin Exp $"); #include #include @@ -434,9 +434,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: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Sat Jan 29 16:54:42 UTC 2022 Modified Files: src/sys/dev/mii [netbsd-9]: igphy.c ihphy.c makphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #1409): sys/dev/mii/igphy.c: revision 1.37 sys/dev/mii/ihphy.c: revision 1.19 sys/dev/mii/makphy.c: revision 1.68 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.31.4.1 -r1.31.4.2 src/sys/dev/mii/igphy.c cvs rdiff -u -r1.14.4.2 -r1.14.4.3 src/sys/dev/mii/ihphy.c cvs rdiff -u -r1.60.2.2 -r1.60.2.3 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Fri Jul 10 10:18:32 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket #990 To generate a diff of this commit: cvs rdiff -u -r1.151.2.7 -r1.151.2.8 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.7 -r1.139.2.8 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.151.2.7 src/sys/dev/mii/miidevs.h:1.151.2.8 --- src/sys/dev/mii/miidevs.h:1.151.2.7 Tue Apr 14 16:44:10 2020 +++ src/sys/dev/mii/miidevs.h Fri Jul 10 10:18:32 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.151.2.7 2020/04/14 16:44:10 martin Exp $ */ +/* $NetBSD: miidevs.h,v 1.151.2.8 2020/07/10 10:18:32 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.6 2020/04/14 16:43:12 martin Exp + * NetBSD: miidevs,v 1.153.2.7 2020/07/10 10:18:01 martin 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.139.2.7 src/sys/dev/mii/miidevs_data.h:1.139.2.8 --- src/sys/dev/mii/miidevs_data.h:1.139.2.7 Tue Apr 14 16:44:10 2020 +++ src/sys/dev/mii/miidevs_data.h Fri Jul 10 10:18:32 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.139.2.7 2020/04/14 16:44:10 martin Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.139.2.8 2020/07/10 10:18:32 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.6 2020/04/14 16:43:12 martin Exp + * NetBSD: miidevs,v 1.153.2.7 2020/07/10 10:18:01 martin 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: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Fri Jul 10 10:18:32 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket #990 To generate a diff of this commit: cvs rdiff -u -r1.151.2.7 -r1.151.2.8 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.7 -r1.139.2.8 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Fri Jul 10 10:18:01 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs Log Message: Pull up following revision(s) (requested by msaitoh in ticket #990): sys/dev/mii/miidevs: revision 1.168 Add some Microsemi (Vitesse) devices. To generate a diff of this commit: cvs rdiff -u -r1.153.2.6 -r1.153.2.7 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.153.2.6 src/sys/dev/mii/miidevs:1.153.2.7 --- src/sys/dev/mii/miidevs:1.153.2.6 Tue Apr 14 16:43:12 2020 +++ src/sys/dev/mii/miidevs Fri Jul 10 10:18:01 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.153.2.6 2020/04/14 16:43:12 martin Exp $ +$NetBSD: miidevs,v 1.153.2.7 2020/07/10 10:18:01 martin 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: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Fri Jul 10 10:18:01 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs Log Message: Pull up following revision(s) (requested by msaitoh in ticket #990): sys/dev/mii/miidevs: revision 1.168 Add some Microsemi (Vitesse) devices. To generate a diff of this commit: cvs rdiff -u -r1.153.2.6 -r1.153.2.7 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Tue Apr 14 16:44:10 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket #831 To generate a diff of this commit: cvs rdiff -u -r1.151.2.6 -r1.151.2.7 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.6 -r1.139.2.7 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.151.2.6 src/sys/dev/mii/miidevs.h:1.151.2.7 --- src/sys/dev/mii/miidevs.h:1.151.2.6 Thu Mar 19 19:23:14 2020 +++ src/sys/dev/mii/miidevs.h Tue Apr 14 16:44:10 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.151.2.6 2020/03/19 19:23:14 martin Exp $ */ +/* $NetBSD: miidevs.h,v 1.151.2.7 2020/04/14 16:44:10 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.5 2020/03/19 19:21:37 martin Exp + * NetBSD: miidevs,v 1.153.2.6 2020/04/14 16:43:12 martin 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 */ @@ -76,7 +78,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 */ @@ -88,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 */ @@ -103,6 +103,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 */ @@ -121,6 +122,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. */ @@ -295,6 +297,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 @@ -548,8 +552,12 @@ #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" +#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 @@ -593,6 +601,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" @@ -608,10 +620,10 @@ #define MII_STR_xxTSC_78Q2121 "78Q2121 100BASE-TX media interface" /* VIA
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Tue Apr 14 16:44:10 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket #831 To generate a diff of this commit: cvs rdiff -u -r1.151.2.6 -r1.151.2.7 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.6 -r1.139.2.7 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Tue Apr 14 16:43:12 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: brgphy.c miidevs rdcphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #831): sys/dev/mii/rdcphy.c: revision 1.6 sys/dev/mii/rdcphy.c: revision 1.8 sys/dev/mii/miidevs: revision 1.162 sys/dev/mii/miidevs: revision 1.163 sys/dev/mii/miidevs: revision 1.164 sys/dev/mii/miidevs: revision 1.165 sys/dev/mii/miidevs: revision 1.167 sys/dev/mii/brgphy.c: revision 1.87 Change the OUI macro name of RDC to xxRDC. 0x00d02d is non-bitreverse value of official 0x000bb4. From Andrius V. RDC -> xxRDC. No functional change. Add BCM54213PE Match BCM54213PE 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. - Add Quake Technologies and Aeluros' OUI - Add Teranetics TN1010 10GBase-T PHY Add two new RDC PHYs from Andrius V. Add two new RDC PHYs from Andrius V. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.84.4.1 src/sys/dev/mii/brgphy.c cvs rdiff -u -r1.153.2.5 -r1.153.2.6 src/sys/dev/mii/miidevs cvs rdiff -u -r1.4 -r1.4.4.1 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/brgphy.c diff -u src/sys/dev/mii/brgphy.c:1.84 src/sys/dev/mii/brgphy.c:1.84.4.1 --- src/sys/dev/mii/brgphy.c:1.84 Thu Apr 11 08:50:20 2019 +++ src/sys/dev/mii/brgphy.c Tue Apr 14 16:43:12 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $ */ +/* $NetBSD: brgphy.c,v 1.84.4.1 2020/04/14 16:43:12 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.84.4.1 2020/04/14 16:43:12 martin 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, Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.153.2.5 src/sys/dev/mii/miidevs:1.153.2.6 --- src/sys/dev/mii/miidevs:1.153.2.5 Thu Mar 19 19:21:37 2020 +++ src/sys/dev/mii/miidevs Tue Apr 14 16:43:12 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.153.2.5 2020/03/19 19:21:37 martin Exp $ +$NetBSD: miidevs,v 1.153.2.6 2020/04/14 16:43:12 martin 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 @@ -69,7 +71,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 @@ -81,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 @@ -96,6 +96,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 @@ -114,6 +115,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. @@ -214,6 +216,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
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Tue Apr 14 16:43:12 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: brgphy.c miidevs rdcphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #831): sys/dev/mii/rdcphy.c: revision 1.6 sys/dev/mii/rdcphy.c: revision 1.8 sys/dev/mii/miidevs: revision 1.162 sys/dev/mii/miidevs: revision 1.163 sys/dev/mii/miidevs: revision 1.164 sys/dev/mii/miidevs: revision 1.165 sys/dev/mii/miidevs: revision 1.167 sys/dev/mii/brgphy.c: revision 1.87 Change the OUI macro name of RDC to xxRDC. 0x00d02d is non-bitreverse value of official 0x000bb4. From Andrius V. RDC -> xxRDC. No functional change. Add BCM54213PE Match BCM54213PE 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. - Add Quake Technologies and Aeluros' OUI - Add Teranetics TN1010 10GBase-T PHY Add two new RDC PHYs from Andrius V. Add two new RDC PHYs from Andrius V. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.84.4.1 src/sys/dev/mii/brgphy.c cvs rdiff -u -r1.153.2.5 -r1.153.2.6 src/sys/dev/mii/miidevs cvs rdiff -u -r1.4 -r1.4.4.1 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Thu Mar 19 19:23:14 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen (for ticket #786) To generate a diff of this commit: cvs rdiff -u -r1.151.2.5 -r1.151.2.6 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.5 -r1.139.2.6 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.151.2.5 src/sys/dev/mii/miidevs.h:1.151.2.6 --- src/sys/dev/mii/miidevs.h:1.151.2.5 Mon Nov 25 16:55:09 2019 +++ src/sys/dev/mii/miidevs.h Thu Mar 19 19:23:14 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.151.2.5 2019/11/25 16:55:09 martin Exp $ */ +/* $NetBSD: miidevs.h,v 1.151.2.6 2020/03/19 19:23:14 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.4 2019/11/25 16:53:29 martin Exp + * NetBSD: miidevs,v 1.153.2.5 2020/03/19 19:21:37 martin Exp */ /*- @@ -71,7 +71,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 +167,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 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.139.2.5 src/sys/dev/mii/miidevs_data.h:1.139.2.6 --- src/sys/dev/mii/miidevs_data.h:1.139.2.5 Mon Nov 25 16:55:09 2019 +++ src/sys/dev/mii/miidevs_data.h Thu Mar 19 19:23:14 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.139.2.5 2019/11/25 16:55:09 martin Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.139.2.6 2020/03/19 19:23:14 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.4 2019/11/25 16:53:29 martin Exp + * NetBSD: miidevs,v 1.153.2.5 2020/03/19 19:21:37 martin 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 },
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Thu Mar 19 19:23:14 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen (for ticket #786) To generate a diff of this commit: cvs rdiff -u -r1.151.2.5 -r1.151.2.6 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.5 -r1.139.2.6 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Tue Jan 28 11:04:14 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: makphy.c makphyreg.h Log Message: Pull up the following, requested by msaitoh in ticket #663: sys/dev/mii/makphy.c1.61, 1.63-1.64 via patch sys/dev/mii/makphyreg.h 1.10 - 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. - Fix comment. KNF. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.60.2.1 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.9 -r1.9.6.1 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.60 src/sys/dev/mii/makphy.c:1.60.2.1 --- src/sys/dev/mii/makphy.c:1.60 Wed Jul 3 17:40:29 2019 +++ src/sys/dev/mii/makphy.c Tue Jan 28 11:04:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.60 2019/07/03 17:40:29 maxv Exp $ */ +/* $NetBSD: makphy.c,v 1.60.2.1 2020/01/28 11:04:14 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.60 2019/07/03 17:40:29 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.60.2.1 2020/01/28 11:04:14 martin Exp $"); #include #include @@ -201,21 +201,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, >mii_capabilities); @@ -223,6 +208,55 @@ page0: if (sc->mii_capabilities & BMSR_EXTSTAT) PHY_READ(sc, MII_EXTSR, >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 are 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; + } + } + aprint_normal_dev(self, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) @@ -240,9 +274,7 @@ makphy_reset(struct mii_softc *sc) mii_phy_reset(sc); - /* - * Initialize PHY Specific Control Register. - */ + /* Initialize PHY Specific Control Register. */ PHY_READ(sc, MAKPHY_PSCR, ); /* Assert CRS on transmit. */ @@ -387,7 +419,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; @@ -425,10 +457,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 */ + +
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Tue Jan 28 11:04:14 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: makphy.c makphyreg.h Log Message: Pull up the following, requested by msaitoh in ticket #663: sys/dev/mii/makphy.c1.61, 1.63-1.64 via patch sys/dev/mii/makphyreg.h 1.10 - 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. - Fix comment. KNF. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.60.2.1 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.9 -r1.9.6.1 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Sun Jan 26 11:11:13 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: ihphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #649): sys/dev/mii/ihphy.c: revision 1.15 Remove extra 10ms delay in ihphy_reset(). The delay are in if_wm.c side. It's required for hardware full reset and it't not requred on soft reset. When ihphy.c was added in 9 years ago, some workaround code were not in if_wm.c yet and the initialization code was not good. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.14.4.1 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.14 src/sys/dev/mii/ihphy.c:1.14.4.1 --- src/sys/dev/mii/ihphy.c:1.14 Mon Mar 25 07:34:13 2019 +++ src/sys/dev/mii/ihphy.c Sun Jan 26 11:11:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ihphy.c,v 1.14 2019/03/25 07:34:13 msaitoh Exp $ */ +/* $NetBSD: ihphy.c,v 1.14.4.1 2020/01/26 11:11:13 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.14 2019/03/25 07:34:13 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.14.4.1 2020/01/26 11:11:13 martin Exp $"); #include #include @@ -291,14 +291,6 @@ ihphy_reset(struct mii_softc *sc) PHY_WRITE(sc, MII_BMCR, BMCR_RESET | BMCR_ISO); - /* - * Regarding reset, the data sheet specifies (page 55): - * - * "After PHY reset, a delay of 10 ms is required before - * any register access using MDIO." - */ - delay(1); - /* Wait another 100ms for it to complete. */ for (i = 0; i < 100; i++) { PHY_READ(sc, MII_BMCR, );
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Sun Jan 26 11:11:13 UTC 2020 Modified Files: src/sys/dev/mii [netbsd-9]: ihphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #649): sys/dev/mii/ihphy.c: revision 1.15 Remove extra 10ms delay in ihphy_reset(). The delay are in if_wm.c side. It's required for hardware full reset and it't not requred on soft reset. When ihphy.c was added in 9 years ago, some workaround code were not in if_wm.c yet and the initialization code was not good. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.14.4.1 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Dec 11 14:54:47 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: files.mii Log Message: Pull up following revision(s) (requested by msaitoh in ticket #543): sys/dev/mii/files.mii: revision 1.54 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.50.26.2 -r1.50.26.3 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Dec 11 14:54:47 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: files.mii Log Message: Pull up following revision(s) (requested by msaitoh in ticket #543): sys/dev/mii/files.mii: revision 1.54 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.50.26.2 -r1.50.26.3 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.50.26.2 src/sys/dev/mii/files.mii:1.50.26.3 --- src/sys/dev/mii/files.mii:1.50.26.2 Mon Nov 25 16:53:55 2019 +++ src/sys/dev/mii/files.mii Wed Dec 11 14:54:47 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.mii,v 1.50.26.2 2019/11/25 16:53:55 martin Exp $ +# $NetBSD: files.mii,v 1.50.26.3 2019/12/11 14:54:47 martin 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: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Dec 9 12:49:39 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: devlist2h.awk Log Message: Pull up following revision(s) (requested by uwe in ticket #521): sys/dev/mii/devlist2h.awk: revision 1.10 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.9.4.1 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.9.4.1 --- src/sys/dev/mii/devlist2h.awk:1.9 Mon Mar 25 09:46:24 2019 +++ src/sys/dev/mii/devlist2h.awk Mon Dec 9 12:49:39 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.9.4.1 2019/12/09 12:49:39 martin 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: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Dec 9 12:49:39 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: devlist2h.awk Log Message: Pull up following revision(s) (requested by uwe in ticket #521): sys/dev/mii/devlist2h.awk: revision 1.10 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.9.4.1 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Nov 27 11:19:46 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ipgphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #490): sys/dev/mii/ipgphy.c: revision 1.7 Print dmesg correctly. To generate a diff of this commit: cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/sys/dev/mii/ipgphy.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Nov 27 11:19:46 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ipgphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #490): sys/dev/mii/ipgphy.c: revision 1.7 Print dmesg correctly. To generate a diff of this commit: cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/sys/dev/mii/ipgphy.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/ipgphy.c diff -u src/sys/dev/mii/ipgphy.c:1.6.2.2 src/sys/dev/mii/ipgphy.c:1.6.2.3 --- src/sys/dev/mii/ipgphy.c:1.6.2.2 Mon Nov 25 16:44:31 2019 +++ src/sys/dev/mii/ipgphy.c Wed Nov 27 11:19:46 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ipgphy.c,v 1.6.2.2 2019/11/25 16:44:31 martin Exp $ */ +/* $NetBSD: ipgphy.c,v 1.6.2.3 2019/11/27 11:19:46 martin Exp $ */ /* $OpenBSD: ipgphy.c,v 1.19 2015/07/19 06:28:12 yuo Exp $ */ /*- @@ -33,7 +33,7 @@ * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY. */ #include -__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.6.2.2 2019/11/25 16:44:31 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.6.2.3 2019/11/27 11:19:46 martin Exp $"); #include #include @@ -118,7 +118,8 @@ ipgphy_attach(device_t parent, device_t //sc->mii_capabilities &= ~BMSR_ANEG; if (sc->mii_capabilities & BMSR_EXTSTAT) PHY_READ(sc, MII_EXTSR, >mii_extcapabilities); - + + aprint_normal_dev(self, ""); mii_phy_add_media(sc); aprint_normal("\n"); }
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Nov 25 16:55:09 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket 479 To generate a diff of this commit: cvs rdiff -u -r1.151.2.4 -r1.151.2.5 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.4 -r1.139.2.5 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Nov 25 16:55:09 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket 479 To generate a diff of this commit: cvs rdiff -u -r1.151.2.4 -r1.151.2.5 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.4 -r1.139.2.5 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.151.2.4 src/sys/dev/mii/miidevs.h:1.151.2.5 --- src/sys/dev/mii/miidevs.h:1.151.2.4 Mon Nov 25 16:53:55 2019 +++ src/sys/dev/mii/miidevs.h Mon Nov 25 16:55:09 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: miidevs.h,v 1.151.2.4 2019/11/25 16:53:55 martin Exp $ */ +/* $NetBSD: miidevs.h,v 1.151.2.5 2019/11/25 16:55:09 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.139.2.4 src/sys/dev/mii/miidevs_data.h:1.139.2.5 --- src/sys/dev/mii/miidevs_data.h:1.139.2.4 Mon Nov 25 16:53:55 2019 +++ src/sys/dev/mii/miidevs_data.h Mon Nov 25 16:55:09 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: miidevs_data.h,v 1.139.2.4 2019/11/25 16:53:55 martin Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.139.2.5 2019/11/25 16:55:09 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Nov 25 16:53:55 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: files.mii miidevs.h miidevs_data.h Added Files: src/sys/dev/mii [netbsd-9]: jmphy.c jmphyreg.h smscphy.c Log Message: Regen for ticket 479 To generate a diff of this commit: cvs rdiff -u -r1.50.26.1 -r1.50.26.2 src/sys/dev/mii/files.mii cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/mii/jmphy.c src/sys/dev/mii/jmphyreg.h \ src/sys/dev/mii/smscphy.c cvs rdiff -u -r1.151.2.3 -r1.151.2.4 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.3 -r1.139.2.4 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/files.mii diff -u src/sys/dev/mii/files.mii:1.50.26.1 src/sys/dev/mii/files.mii:1.50.26.2 --- src/sys/dev/mii/files.mii:1.50.26.1 Mon Nov 25 16:44:31 2019 +++ src/sys/dev/mii/files.mii Mon Nov 25 16:53:55 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.mii,v 1.50.26.1 2019/11/25 16:44:31 martin Exp $ +# $NetBSD: files.mii,v 1.50.26.2 2019/11/25 16:53:55 martin Exp $ defflag opt_mii.h MIIVERBOSE @@ -103,6 +103,10 @@ device ipgphy: mii_phy attach ipgphy at mii file dev/mii/ipgphy.c ipgphy +device jmphy: mii_phy +attach jmphy at mii +file dev/mii/jmphy.cjmphy + device sqphy: mii_phy attach sqphy at mii file dev/mii/sqphy.csqphy @@ -162,3 +166,7 @@ file dev/mii/rdcphy.c rdcphy device micphy: mii_phy, ukphy_subr attach micphy at mii file dev/mii/micphy.c micphy + +device smscphy: mii_phy +attach smscphy at mii +file dev/mii/smscphy.c smscphy Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.151.2.3 src/sys/dev/mii/miidevs.h:1.151.2.4 --- src/sys/dev/mii/miidevs.h:1.151.2.3 Mon Nov 25 16:26:31 2019 +++ src/sys/dev/mii/miidevs.h Mon Nov 25 16:53:55 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.151.2.3 2019/11/25 16:26:31 martin Exp $ */ +/* $NetBSD: miidevs.h,v 1.151.2.4 2019/11/25 16:53:55 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.3 2019/11/25 16:26:00 martin Exp + * NetBSD: miidevs,v 1.153.2.4 2019/11/25 16:53:29 martin Exp */ /*- @@ -494,13 +494,27 @@ #define MII_MODEL_MARVELL_E 0x000c #define MII_STR_MARVELL_E "Marvell 88E Gigabit PHY" -/* Micrel PHYs */ +/* Micrel PHYs (Kendin and Microchip) */ +#define MII_MODEL_MICREL_KSZ8041 0x0011 +#define MII_STR_MICREL_KSZ8041 "Micrel KSZ8041TL/FTL/MLL 10/100 PHY" +#define MII_MODEL_MICREL_KSZ8041RNLI 0x0013 +#define MII_STR_MICREL_KSZ8041RNLI "Micrel KSZ8041RNLI 10/100 PHY" +#define MII_MODEL_MICREL_KSZ8051 0x0015 +#define MII_STR_MICREL_KSZ8051 "Micrel KSZ80[235]1 10/100 PHY" #define MII_MODEL_MICREL_KSZ8081 0x0016 -#define MII_STR_MICREL_KSZ8081 "Micrel KSZ8081 10/100 PHY" -#define MII_MODEL_MICREL_KSZ9021RNI 0x0021 -#define MII_STR_MICREL_KSZ9021RNI "Micrel KSZ9021RNI 10/100/1000 PHY" +#define MII_STR_MICREL_KSZ8081 "Micrel KSZ80[89]1 10/100 PHY" +#define MII_MODEL_MICREL_KSZ8061 0x0017 +#define MII_STR_MICREL_KSZ8061 "Micrel KSZ8061 10/100 PHY" +#define MII_MODEL_MICREL_KSZ9021_8001_8721 0x0021 +#define MII_STR_MICREL_KSZ9021_8001_8721 "Micrel KSZ9021 Gb & KSZ8001/8721 10/100 PHY" #define MII_MODEL_MICREL_KSZ9031 0x0022 #define MII_STR_MICREL_KSZ9031 "Micrel KSZ9031 10/100/1000 PHY" +#define MII_MODEL_MICREL_KSZ9477 0x0023 +#define MII_STR_MICREL_KSZ9477 "Micrel KSZ9477 10/100/1000 PHY" +#define MII_MODEL_MICREL_KSZ9131 0x0024 +#define MII_STR_MICREL_KSZ9131 "Micrel KSZ9131 10/100/1000 PHY" +#define MII_MODEL_MICREL_KS8737 0x0032 +#define MII_STR_MICREL_KS8737 "Micrel KS8737 10/100 PHY" /* Myson Technology PHYs */ #define MII_MODEL_xxMYSON_MTD972 0x Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.139.2.3 src/sys/dev/mii/miidevs_data.h:1.139.2.4 --- src/sys/dev/mii/miidevs_data.h:1.139.2.3 Mon Nov 25 16:26:31 2019 +++ src/sys/dev/mii/miidevs_data.h Mon Nov 25 16:53:55 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.139.2.3 2019/11/25 16:26:31 martin Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.139.2.4 2019/11/25 16:53:55 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.3 2019/11/25 16:26:00 martin Exp + * NetBSD: miidevs,v 1.153.2.4 2019/11/25 16:53:29 martin Exp */ /*- @@ -204,9 +204,16 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_5, MII_STR_MARVELL_E1000_5 }, { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_6, MII_STR_MARVELL_E1000_6 }, { MII_OUI_MARVELL, MII_MODEL_MARVELL_E, MII_STR_MARVELL_E }, + { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8041, MII_STR_MICREL_KSZ8041 }, + { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8041RNLI, MII_STR_MICREL_KSZ8041RNLI }, + { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8051, MII_STR_MICREL_KSZ8051 }, { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8081,
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Nov 25 16:53:55 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: files.mii miidevs.h miidevs_data.h Added Files: src/sys/dev/mii [netbsd-9]: jmphy.c jmphyreg.h smscphy.c Log Message: Regen for ticket 479 To generate a diff of this commit: cvs rdiff -u -r1.50.26.1 -r1.50.26.2 src/sys/dev/mii/files.mii cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/mii/jmphy.c src/sys/dev/mii/jmphyreg.h \ src/sys/dev/mii/smscphy.c cvs rdiff -u -r1.151.2.3 -r1.151.2.4 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.3 -r1.139.2.4 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Nov 25 16:26:31 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket #473 To generate a diff of this commit: cvs rdiff -u -r1.151.2.2 -r1.151.2.3 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.2 -r1.139.2.3 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.151.2.2 src/sys/dev/mii/miidevs.h:1.151.2.3 --- src/sys/dev/mii/miidevs.h:1.151.2.2 Wed Oct 23 19:46:53 2019 +++ src/sys/dev/mii/miidevs.h Mon Nov 25 16:26:31 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.151.2.2 2019/10/23 19:46:53 martin Exp $ */ +/* $NetBSD: miidevs.h,v 1.151.2.3 2019/11/25 16:26:31 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp + * NetBSD: miidevs,v 1.153.2.3 2019/11/25 16:26:00 martin Exp */ /*- @@ -72,7 +72,9 @@ #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 */ #define MII_OUI_BROADCOM3 0x001be9 /* Broadcom Corporation */ #define MII_OUI_LEVEL1 0x00207b /* Level 1 */ #define MII_OUI_VIA 0x004063 /* VIA Technologies */ @@ -81,7 +83,6 @@ #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. */ #define MII_OUI_SEEQ 0x00a07d /* Seeq */ #define MII_OUI_ICS 0x00a0be /* Integrated Circuit Systems */ #define MII_OUI_INTEL 0x00aa00 /* Intel */ @@ -98,8 +99,9 @@ #define MII_OUI_NATSEMI 0x080017 /* National Semiconductor */ #define MII_OUI_TI 0x080028 /* Texas Instruments */ #define MII_OUI_BROADCOM4 0x18c086 /* Broadcom Corporation */ +#define MII_OUI_RENESAS 0x749050 /* Renesas */ -/* Unregisterd or wrong OUI */ +/* Unregistered or wrong OUI */ #define MII_OUI_yyREALTEK 0x04 /* Realtek */ #define MII_OUI_yyAMD 0x58 /* Advanced Micro Devices */ #define MII_OUI_xxMYSON 0x00032d /* Myson Technology */ @@ -111,6 +113,7 @@ #define MII_OUI_xxREALTEK 0x000732 /* Realtek */ #define MII_OUI_xxBROADCOM 0x000818 /* Broadcom Corporation */ #define MII_OUI_xxPMCSIERRA 0x0009c0 /* PMC-Sierra */ +#define MII_OUI_xxICPLUS 0x0009c3 /* IC Plus Corp. */ #define MII_OUI_xxMARVELL 0x000ac2 /* Marvell Semiconductor */ #define MII_OUI_xxINTEL 0x001f00 /* Intel */ #define MII_OUI_xxBROADCOM_ALT1 0x0050ef /* Broadcom Corporation */ @@ -343,14 +346,14 @@ #define MII_STR_xxDAVICOM_DM9601 "DM9601 internal 10/100 media interface" /* IC Plus Corp. PHYs */ -#define MII_MODEL_ICPLUS_IP100 0x0004 -#define MII_STR_ICPLUS_IP100 "IP100 10/100 PHY" -#define MII_MODEL_ICPLUS_IP101 0x0005 -#define MII_STR_ICPLUS_IP101 "IP101 10/100 PHY" -#define MII_MODEL_ICPLUS_IP1000A 0x0008 -#define MII_STR_ICPLUS_IP1000A "IP1000A 10/100/1000 PHY" -#define MII_MODEL_ICPLUS_IP1001 0x0019 -#define MII_STR_ICPLUS_IP1001 "IP1001 10/100/1000 PHY" +#define MII_MODEL_xxICPLUS_IP100 0x0004 +#define MII_STR_xxICPLUS_IP100 "IP100 10/100 PHY" +#define MII_MODEL_xxICPLUS_IP101 0x0005 +#define MII_STR_xxICPLUS_IP101 "IP101 10/100 PHY" +#define MII_MODEL_xxICPLUS_IP1000A 0x0008 +#define MII_STR_xxICPLUS_IP1000A "IP1000A 10/100/1000 PHY" +#define MII_MODEL_xxICPLUS_IP1001 0x0019 +#define MII_STR_xxICPLUS_IP1001 "IP1001 10/100/1000 PHY" /* Integrated Circuit Systems PHYs */ #define MII_MODEL_ICS_1889 0x0001 @@ -408,10 +411,10 @@ /* JMicron PHYs */ -#define MII_MODEL_JMICRON_JMC250 0x0021 -#define MII_STR_JMICRON_JMC250 "JMC250 10/100/1000 media interface" -#define MII_MODEL_JMICRON_JMC260 0x0022 -#define MII_STR_JMICRON_JMC260 "JMC260 10/100 media interface" +#define MII_MODEL_JMICRON_JMP211 0x0021 +#define MII_STR_JMICRON_JMP211 "JMP211 10/100/1000 media interface" +#define MII_MODEL_JMICRON_JMP202 0x0022 +#define MII_STR_JMICRON_JMP202 "JMP202 10/100 media interface" /* Level 1 PHYs */ #define MII_MODEL_xxLEVEL1_LXT970 0x Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.139.2.2 src/sys/dev/mii/miidevs_data.h:1.139.2.3 --- src/sys/dev/mii/miidevs_data.h:1.139.2.2 Wed Oct 23 19:46:53 2019 +++ src/sys/dev/mii/miidevs_data.h Mon Nov 25 16:26:31 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.139.2.2 2019/10/23 19:46:53 martin Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.139.2.3 2019/11/25 16:26:31 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp + *
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Nov 25 16:26:31 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket #473 To generate a diff of this commit: cvs rdiff -u -r1.151.2.2 -r1.151.2.3 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.2 -r1.139.2.3 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Nov 25 16:26:01 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs rlphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #473): sys/dev/mii/rlphy.c: revision 1.37 sys/dev/mii/miidevs: revision 1.155 sys/dev/mii/miidevs: revision 1.156 sys/dev/mii/miidevs: revision 1.157 sys/dev/mii/miidevs: revision 1.159 sys/dev/mii/miidevs: revision 1.160 Add Teranetics, Aquantia and Renesas. Use uppercase for vendor name. Change ICPLUS(0x0090c3) to xxICPLUS(0x0009c3) - ICPLUS -> xxICPLUS - Print model name if it's ICPLUS IP101 to avoid "Realtek internal PHY". Fix typo. from vezhlys - Rename JMICRON 0x0021 from JMC250 to JMP211 - Rename JMICRON 0x0022 from JMC260 to JMP202 To generate a diff of this commit: cvs rdiff -u -r1.153.2.2 -r1.153.2.3 src/sys/dev/mii/miidevs cvs rdiff -u -r1.36 -r1.36.4.1 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Nov 25 16:26:01 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs rlphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #473): sys/dev/mii/rlphy.c: revision 1.37 sys/dev/mii/miidevs: revision 1.155 sys/dev/mii/miidevs: revision 1.156 sys/dev/mii/miidevs: revision 1.157 sys/dev/mii/miidevs: revision 1.159 sys/dev/mii/miidevs: revision 1.160 Add Teranetics, Aquantia and Renesas. Use uppercase for vendor name. Change ICPLUS(0x0090c3) to xxICPLUS(0x0009c3) - ICPLUS -> xxICPLUS - Print model name if it's ICPLUS IP101 to avoid "Realtek internal PHY". Fix typo. from vezhlys - Rename JMICRON 0x0021 from JMC250 to JMP211 - Rename JMICRON 0x0022 from JMC260 to JMP202 To generate a diff of this commit: cvs rdiff -u -r1.153.2.2 -r1.153.2.3 src/sys/dev/mii/miidevs cvs rdiff -u -r1.36 -r1.36.4.1 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/miidevs diff -u src/sys/dev/mii/miidevs:1.153.2.2 src/sys/dev/mii/miidevs:1.153.2.3 --- src/sys/dev/mii/miidevs:1.153.2.2 Wed Oct 23 19:45:56 2019 +++ src/sys/dev/mii/miidevs Mon Nov 25 16:26:00 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp $ +$NetBSD: miidevs,v 1.153.2.3 2019/11/25 16:26:00 martin Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -65,7 +65,9 @@ oui ALTIMA 0x0010a9 Altima Communicati 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 oui BROADCOM3 0x001be9 Broadcom Corporation oui LEVEL1 0x00207b Level 1 oui VIA0x004063 VIA Technologies @@ -74,7 +76,6 @@ oui QUALSEMI 0x006051 Quality Semicond oui AMLOGIC 0x006051 Amlogic oui DAVICOM 0x00606e Davicom Semiconductor oui SMSC 0x00800f SMSC -oui ICPLUS 0x0090c3 IC Plus Corp. oui SEEQ 0x00a07d Seeq oui ICS0x00a0be Integrated Circuit Systems oui INTEL 0x00aa00 Intel @@ -91,8 +92,9 @@ oui XAQTI 0x00e0ae XaQti Corp. oui NATSEMI 0x080017 National Semiconductor oui TI0x080028 Texas Instruments oui BROADCOM4 0x18c086 Broadcom Corporation +oui RENESAS 0x749050 Renesas -/* Unregisterd or wrong OUI */ +/* Unregistered or wrong OUI */ oui yyREALTEK 0x04 Realtek oui yyAMD 0x58 Advanced Micro Devices oui xxMYSON 0x00032d Myson Technology @@ -104,6 +106,7 @@ oui xxQUALSEMI 0x00068a Quality Semico oui xxREALTEK 0x000732 Realtek oui xxBROADCOM 0x000818 Broadcom Corporation oui xxPMCSIERRA 0x0009c0 PMC-Sierra +oui xxICPLUS 0x0009c3 IC Plus Corp. oui xxMARVELL 0x000ac2 Marvell Semiconductor oui xxINTEL 0x001f00 Intel oui xxBROADCOM_ALT1 0x0050ef Broadcom Corporation @@ -242,10 +245,10 @@ model xxDAVICOM DM9161B 0x000b DM9161[B model xxDAVICOM DM9601 0x000c DM9601 internal 10/100 media interface /* IC Plus Corp. PHYs */ -model ICPLUS IP100 0x0004 IP100 10/100 PHY -model ICPLUS IP101 0x0005 IP101 10/100 PHY -model ICPLUS IP1000A 0x0008 IP1000A 10/100/1000 PHY -model ICPLUS IP1001 0x0019 IP1001 10/100/1000 PHY +model xxICPLUS IP100 0x0004 IP100 10/100 PHY +model xxICPLUS IP101 0x0005 IP101 10/100 PHY +model xxICPLUS IP1000A 0x0008 IP1000A 10/100/1000 PHY +model xxICPLUS IP1001 0x0019 IP1001 10/100/1000 PHY /* Integrated Circuit Systems PHYs */ model ICS 1889 0x0001 ICS1889 10/100 media interface @@ -278,8 +281,8 @@ model ATTANSIC I82578 0x0004 Intel 8257 /* JMicron PHYs */ -model JMICRON JMC250 0x0021 JMC250 10/100/1000 media interface -model JMICRON JMC260 0x0022 JMC260 10/100 media interface +model JMICRON JMP211 0x0021 JMP211 10/100/1000 media interface +model JMICRON JMP202 0x0022 JMP202 10/100 media interface /* Level 1 PHYs */ model xxLEVEL1 LXT970 0x LXT970 10/100 media interface Index: src/sys/dev/mii/rlphy.c diff -u src/sys/dev/mii/rlphy.c:1.36 src/sys/dev/mii/rlphy.c:1.36.4.1 --- src/sys/dev/mii/rlphy.c:1.36 Mon Mar 25 09:20:46 2019 +++ src/sys/dev/mii/rlphy.c Mon Nov 25 16:26:00 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rlphy.c,v 1.36 2019/03/25 09:20:46 msaitoh Exp $ */ +/* $NetBSD: rlphy.c,v 1.36.4.1 2019/11/25 16:26:00 martin 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.36 2019/03/25 09:20:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.36.4.1 2019/11/25 16:26:00 martin Exp $"); #include #include @@ -78,7 +78,7 @@ const struct mii_phy_funcs rlphy_funcs = static const struct mii_phydesc rlphys[] = { MII_PHY_DESC(yyREALTEK, RTL8201L), MII_PHY_DESC(REALTEK, RTL8201E), - MII_PHY_DESC(ICPLUS, IP101), + MII_PHY_DESC(xxICPLUS,
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Thu Nov 21 14:00:49 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: atphy.c mii_physubr.c miivar.h Log Message: Pull up following revision(s) (requested by msaitoh in ticket #459): sys/dev/mii/atphy.c: revision 1.23 sys/dev/mii/atphy.c: revision 1.25 sys/dev/mii/miivar.h: revision 1.69 sys/dev/mii/mii_physubr.c: revision 1.88 s/etphy/atphy/. No functional change. Fix a bug that atphy(4) can't negotiate correctly when the media setting is neither auto nor 1000baseT. Use correct index for mii_media_table[]. History: mii_anar() is first added in OpenBSD and ported to NetBSD. On NetBSD, only atphy(4) use this function. mii_physubr.c rev. 1.75 changed mii_anar() for simplify. It changed the argument from the ifmedia word to ifm_data used in our MII API, but the caller have not been changed. And then, PR kern/50206 was reported and the caller was modified by me to prevent panic but it was not correct fix. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.22.4.1 src/sys/dev/mii/atphy.c cvs rdiff -u -r1.87 -r1.87.4.1 src/sys/dev/mii/mii_physubr.c cvs rdiff -u -r1.68 -r1.68.4.1 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/atphy.c diff -u src/sys/dev/mii/atphy.c:1.22 src/sys/dev/mii/atphy.c:1.22.4.1 --- src/sys/dev/mii/atphy.c:1.22 Thu Apr 11 09:00:34 2019 +++ src/sys/dev/mii/atphy.c Thu Nov 21 14:00:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: atphy.c,v 1.22 2019/04/11 09:00:34 msaitoh Exp $ */ +/* $NetBSD: atphy.c,v 1.22.4.1 2019/11/21 14:00:49 martin 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.22 2019/04/11 09:00:34 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.22.4.1 2019/11/21 14:00:49 martin Exp $"); #include #include @@ -90,7 +90,7 @@ const struct mii_phy_funcs atphy_funcs = atphy_service, atphy_status, atphy_reset, }; -static const struct mii_phydesc etphys[] = { +static const struct mii_phydesc atphys[] = { MII_PHY_DESC(ATHEROS, F1), MII_PHY_DESC(ATTANSIC, L1), MII_PHY_DESC(ATTANSIC, L2), @@ -118,7 +118,7 @@ atphy_match(device_t parent, cfdata_t ma { struct mii_attach_args *ma = aux; - if (mii_phy_match(ma, etphys) != NULL) + if (mii_phy_match(ma, atphys) != NULL) return 10; return 0; @@ -133,7 +133,7 @@ atphy_attach(device_t parent, device_t s const struct mii_phydesc *mpd; uint16_t bmsr; - mpd = mii_phy_match(ma, etphys); + mpd = mii_phy_match(ma, atphys); aprint_naive(": Media interface\n"); aprint_normal(": %s, rev. %d\n", mpd->mpd_name, MII_REV(ma->mii_id2)); @@ -222,7 +222,7 @@ atphy_service(struct mii_softc *sc, stru return EINVAL; } - anar = mii_anar(IFM_SUBTYPE(ife->ifm_media)); + anar = mii_anar(ife); if ((ife->ifm_media & IFM_FDX) != 0) { bmcr |= BMCR_FDX; /* Enable pause. */ Index: src/sys/dev/mii/mii_physubr.c diff -u src/sys/dev/mii/mii_physubr.c:1.87 src/sys/dev/mii/mii_physubr.c:1.87.4.1 --- src/sys/dev/mii/mii_physubr.c:1.87 Tue Apr 9 11:28:45 2019 +++ src/sys/dev/mii/mii_physubr.c Thu Nov 21 14:00:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mii_physubr.c,v 1.87 2019/04/09 11:28:45 msaitoh Exp $ */ +/* $NetBSD: mii_physubr.c,v 1.87.4.1 2019/11/21 14:00:49 martin 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.87 2019/04/09 11:28:45 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.87.4.1 2019/11/21 14:00:49 martin Exp $"); #include #include @@ -697,19 +697,16 @@ mii_phy_resume(device_t dv, const pmf_qu /* - * Given an ifmedia word, return the corresponding ANAR value. + * Given an ifmedia_entry, return the corresponding ANAR value. */ uint16_t -mii_anar(int media) +mii_anar(struct ifmedia_entry *ife) { - int rv; #ifdef DIAGNOSTIC - if (/* media < 0 || */ media >= MII_NMEDIA) + if (ife->ifm_data >= MII_NMEDIA) panic("mii_anar"); #endif - rv = mii_media_table[media].mm_anar; - - return rv; + return mii_media_table[ife->ifm_data].mm_anar; } Index: src/sys/dev/mii/miivar.h diff -u src/sys/dev/mii/miivar.h:1.68 src/sys/dev/mii/miivar.h:1.68.4.1 --- src/sys/dev/mii/miivar.h:1.68 Thu Apr 11 09:14:07 2019 +++ src/sys/dev/mii/miivar.h Thu Nov 21 14:00:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: miivar.h,v 1.68 2019/04/11 09:14:07 msaitoh Exp $ */ +/* $NetBSD: miivar.h,v 1.68.4.1 2019/11/21 14:00:49 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -287,7 +287,7 @@ int mii_mediachg(struct mii_data *); void mii_tick(struct mii_data *); void mii_pollstat(struct mii_data *); void mii_down(struct mii_data *); -uint16_t mii_anar(int); +uint16_t mii_anar(struct ifmedia_entry *);
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Thu Nov 21 14:00:49 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: atphy.c mii_physubr.c miivar.h Log Message: Pull up following revision(s) (requested by msaitoh in ticket #459): sys/dev/mii/atphy.c: revision 1.23 sys/dev/mii/atphy.c: revision 1.25 sys/dev/mii/miivar.h: revision 1.69 sys/dev/mii/mii_physubr.c: revision 1.88 s/etphy/atphy/. No functional change. Fix a bug that atphy(4) can't negotiate correctly when the media setting is neither auto nor 1000baseT. Use correct index for mii_media_table[]. History: mii_anar() is first added in OpenBSD and ported to NetBSD. On NetBSD, only atphy(4) use this function. mii_physubr.c rev. 1.75 changed mii_anar() for simplify. It changed the argument from the ifmedia word to ifm_data used in our MII API, but the caller have not been changed. And then, PR kern/50206 was reported and the caller was modified by me to prevent panic but it was not correct fix. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.22.4.1 src/sys/dev/mii/atphy.c cvs rdiff -u -r1.87 -r1.87.4.1 src/sys/dev/mii/mii_physubr.c cvs rdiff -u -r1.68 -r1.68.4.1 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Nov 6 09:53:59 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ukphy_subr.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #402): sys/dev/mii/ukphy_subr.c: revision 1.16 Fix a bug that ukphy_status() misunderstand master mode. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.15.4.1 src/sys/dev/mii/ukphy_subr.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/ukphy_subr.c diff -u src/sys/dev/mii/ukphy_subr.c:1.15 src/sys/dev/mii/ukphy_subr.c:1.15.4.1 --- src/sys/dev/mii/ukphy_subr.c:1.15 Mon Mar 25 09:20:46 2019 +++ src/sys/dev/mii/ukphy_subr.c Wed Nov 6 09:53:59 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ukphy_subr.c,v 1.15 2019/03/25 09:20:46 msaitoh Exp $ */ +/* $NetBSD: ukphy_subr.c,v 1.15.4.1 2019/11/06 09:53:59 martin Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ukphy_subr.c,v 1.15 2019/03/25 09:20:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ukphy_subr.c,v 1.15.4.1 2019/11/06 09:53:59 martin Exp $"); #include #include @@ -119,7 +119,7 @@ ukphy_status(struct mii_softc *phy) else mii->mii_media_active |= IFM_NONE; - if ((mii->mii_media_active & IFM_1000_T) && + if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) && (gtsr & GTSR_MS_RES)) mii->mii_media_active |= IFM_ETH_MASTER;
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Nov 6 09:53:59 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ukphy_subr.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #402): sys/dev/mii/ukphy_subr.c: revision 1.16 Fix a bug that ukphy_status() misunderstand master mode. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.15.4.1 src/sys/dev/mii/ukphy_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Thu Oct 24 16:29:13 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ciphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #378): sys/dev/mii/ciphy.c: revision 1.36 Call mii_phy_flowstatus() to show the flow setting. To generate a diff of this commit: cvs rdiff -u -r1.34.4.2 -r1.34.4.3 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Thu Oct 24 16:29:13 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ciphy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #378): sys/dev/mii/ciphy.c: revision 1.36 Call mii_phy_flowstatus() to show the flow setting. To generate a diff of this commit: cvs rdiff -u -r1.34.4.2 -r1.34.4.3 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.34.4.2 src/sys/dev/mii/ciphy.c:1.34.4.3 --- src/sys/dev/mii/ciphy.c:1.34.4.2 Wed Oct 23 19:45:56 2019 +++ src/sys/dev/mii/ciphy.c Thu Oct 24 16:29:13 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $ */ +/* $NetBSD: ciphy.c,v 1.34.4.3 2019/10/24 16:29:13 martin Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.3 2019/10/24 16:29:13 martin Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -339,7 +339,7 @@ ciphy_status(struct mii_softc *sc) } if (bmsr & CIPHY_AUXCSR_FDX) - mii->mii_media_active |= IFM_FDX; + mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc); else mii->mii_media_active |= IFM_HDX;
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Oct 23 19:46:53 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket #372 To generate a diff of this commit: cvs rdiff -u -r1.151.2.1 -r1.151.2.2 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.1 -r1.139.2.2 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Oct 23 19:46:53 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: Regen for ticket #372 To generate a diff of this commit: cvs rdiff -u -r1.151.2.1 -r1.151.2.2 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139.2.1 -r1.139.2.2 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.151.2.1 src/sys/dev/mii/miidevs.h:1.151.2.2 --- src/sys/dev/mii/miidevs.h:1.151.2.1 Mon Sep 2 07:06:11 2019 +++ src/sys/dev/mii/miidevs.h Wed Oct 23 19:46:53 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.151.2.1 2019/09/02 07:06:11 martin Exp $ */ +/* $NetBSD: miidevs.h,v 1.151.2.2 2019/10/23 19:46:53 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp + * NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp */ /*- @@ -57,10 +57,8 @@ */ #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_BANKSPEED 0x0006b8 /* Bankspeed Pty */ #define MII_OUI_NETEXCELL 0x0008bb /* NetExcell */ @@ -118,6 +116,7 @@ #define MII_OUI_xxBROADCOM_ALT1 0x0050ef /* Broadcom Corporation */ #define MII_OUI_yyINTEL 0x005500 /* Intel */ #define MII_OUI_yyASIX 0x007063 /* Asix Semiconductor */ +#define MII_OUI_xxVITESSE 0x008083 /* Vitesse Semiconductor */ #define MII_OUI_xxPMCSIERRA2 0x009057 /* PMC-Sierra */ #define MII_OUI_xxCICADA 0x00c08f /* Cicada Semiconductor */ #define MII_OUI_xxNATSEMI 0x1000e8 /* National Semiconductor */ @@ -305,23 +304,26 @@ #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" -#define MII_MODEL_CICADA_CS8204 0x0004 -#define MII_STR_CICADA_CS8204 "Cicada CS8204 10/100/1000TX PHY" -#define MII_MODEL_CICADA_VSC8211 0x000b -#define MII_STR_CICADA_VSC8211 "Cicada VSC8211 10/100/1000TX PHY" -#define MII_MODEL_CICADA_CS8201A 0x0020 -#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" +/* Cicada Semiconductor PHYs (-> Vitesse -> Microsemi) */ + +#define MII_MODEL_xxCICADA_CIS8201 0x0001 +#define MII_STR_xxCICADA_CIS8201 "Cicada CIS8201 10/100/1000TX PHY" +#define MII_MODEL_xxCICADA_CIS8204 0x0004 +#define MII_STR_xxCICADA_CIS8204 "Cicada CIS8204 10/100/1000TX PHY" +#define MII_MODEL_xxCICADA_VSC8211 0x000b +#define MII_STR_xxCICADA_VSC8211 "Cicada VSC8211 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_CS8201B 0x0021 -#define MII_STR_xxCICADA_CS8201B "Cicada CS8201 10/100/1000TX PHY" +#define MII_MODEL_xxCICADA_VSC8224 0x0018 +#define MII_STR_xxCICADA_VSC8224 "Vitesse VSC8224 10/100/1000BASE-T PHY" +#define MII_MODEL_xxCICADA_CIS8201A 0x0020 +#define MII_STR_xxCICADA_CIS8201A "Cicada CIS8201 10/100/1000TX PHY" +#define MII_MODEL_xxCICADA_CIS8201B 0x0021 +#define MII_STR_xxCICADA_CIS8201B "Cicada CIS8201 10/100/1000TX PHY" +#define MII_MODEL_xxCICADA_VSC8234 0x0022 +#define MII_STR_xxCICADA_VSC8234 "Vitesse VSC8234 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 */ @@ -601,9 +603,13 @@ #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" +/* Vitesse PHYs (Now Microsemi) */ +#define MII_MODEL_xxVITESSE_VSC8601 0x0002 +#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_VSC8501 0x0013 +#define MII_STR_xxVITESSE_VSC8501 "Vitesse VSC8501 10/100/1000TX 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.139.2.1 src/sys/dev/mii/miidevs_data.h:1.139.2.2 ---
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Oct 23 19:45:57 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ciphy.c miidevs Log Message: Pull up following revision(s) (requested by msaitoh in ticket #372): sys/dev/mii/miidevs: revision 1.158 sys/dev/mii/ciphy.c: revision 1.37 - All of Cicada and Vitesse devices' OUI are not bit-reversed, so use "xx". - Rename CS82xx -> CIS82xx - Add Vitesse VSC8224, VSC8234, VSC8641 and VSC8501. - Match a lot of Cicada and Vitesse devices correctly. This change also fixes a bug that ciphy_fixup() didn't work. - Match VSC8221, VSC8234 and VSC8641. To generate a diff of this commit: cvs rdiff -u -r1.34.4.1 -r1.34.4.2 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.153.2.1 -r1.153.2.2 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Wed Oct 23 19:45:57 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ciphy.c miidevs Log Message: Pull up following revision(s) (requested by msaitoh in ticket #372): sys/dev/mii/miidevs: revision 1.158 sys/dev/mii/ciphy.c: revision 1.37 - All of Cicada and Vitesse devices' OUI are not bit-reversed, so use "xx". - Rename CS82xx -> CIS82xx - Add Vitesse VSC8224, VSC8234, VSC8641 and VSC8501. - Match a lot of Cicada and Vitesse devices correctly. This change also fixes a bug that ciphy_fixup() didn't work. - Match VSC8221, VSC8234 and VSC8641. To generate a diff of this commit: cvs rdiff -u -r1.34.4.1 -r1.34.4.2 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.153.2.1 -r1.153.2.2 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/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.34.4.1 src/sys/dev/mii/ciphy.c:1.34.4.2 --- src/sys/dev/mii/ciphy.c:1.34.4.1 Thu Oct 17 19:06:58 2019 +++ src/sys/dev/mii/ciphy.c Wed Oct 23 19:45:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.34.4.1 2019/10/17 19:06:58 martin Exp $ */ +/* $NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.1 2019/10/17 19:06:58 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -74,16 +74,16 @@ static const struct mii_phy_funcs ciphy_ }; static const struct mii_phydesc ciphys[] = { - MII_PHY_DESC(CICADA, CS8201), - MII_PHY_DESC(CICADA, CS8201A), - MII_PHY_DESC(CICADA, CS8201B), - MII_PHY_DESC(CICADA, CS8204), - MII_PHY_DESC(CICADA, VSC8211), - MII_PHY_DESC(CICADA, CS8244), - MII_PHY_DESC(CICADA, CS8201), - MII_PHY_DESC(CICADA, CS8201A), - MII_PHY_DESC(xxCICADA, CS8201B), - MII_PHY_DESC(VITESSE, VSC8601), + MII_PHY_DESC(xxCICADA, CIS8201), + MII_PHY_DESC(xxCICADA, CIS8201A), + MII_PHY_DESC(xxCICADA, CIS8201B), + MII_PHY_DESC(xxCICADA, CIS8204), + MII_PHY_DESC(xxCICADA, VSC8211), + MII_PHY_DESC(xxCICADA, VSC8221), + MII_PHY_DESC(xxCICADA, VSC8234), + MII_PHY_DESC(xxCICADA, VSC8244), + MII_PHY_DESC(xxVITESSE, VSC8601), + MII_PHY_DESC(xxVITESSE, VSC8641), MII_PHY_END, }; @@ -398,8 +398,8 @@ ciphy_fixup(struct mii_softc *sc) } switch (model) { - case MII_MODEL_CICADA_CS8201: - case MII_MODEL_CICADA_CS8204: + case MII_MODEL_xxCICADA_CIS8201: + case MII_MODEL_xxCICADA_CIS8204: /* Turn off "aux mode" (whatever that means) */ PHY_SETBIT(sc, CIPHY_MII_AUXCSR, CIPHY_AUXCSR_MDPPS); @@ -418,8 +418,8 @@ ciphy_fixup(struct mii_softc *sc) break; - case MII_MODEL_CICADA_CS8201A: - case MII_MODEL_CICADA_CS8201B: + case MII_MODEL_xxCICADA_CIS8201A: + case MII_MODEL_xxCICADA_CIS8201B: /* * Work around speed polling bug in VT3119/VT3216 * when using MII in full duplex mode. @@ -431,9 +431,12 @@ ciphy_fixup(struct mii_softc *sc) PHY_CLRBIT(sc, CIPHY_MII_10BTCSR, CIPHY_10BTCSR_ECHO); break; - case MII_MODEL_CICADA_VSC8211: - case MII_MODEL_CICADA_CS8244: - case MII_MODEL_VITESSE_VSC8601: + case MII_MODEL_xxCICADA_VSC8211: + case MII_MODEL_xxCICADA_VSC8221: + case MII_MODEL_xxCICADA_VSC8234: + case MII_MODEL_xxCICADA_VSC8244: + case MII_MODEL_xxVITESSE_VSC8601: + case MII_MODEL_xxVITESSE_VSC8641: break; default: aprint_error_dev(sc->mii_dev, "unknown CICADA PHY model %x\n", Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.153.2.1 src/sys/dev/mii/miidevs:1.153.2.2 --- src/sys/dev/mii/miidevs:1.153.2.1 Sun Sep 1 13:56:01 2019 +++ src/sys/dev/mii/miidevs Wed Oct 23 19:45:56 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp $ +$NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -50,10 +50,8 @@ $NetBSD: miidevs,v 1.153.2.1 2019/09/01 */ 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 BANKSPEED 0x0006b8 Bankspeed Pty oui NETEXCELL 0x0008bb NetExcell @@ -111,6 +109,7 @@ oui xxINTEL 0x001f00 Intel oui xxBROADCOM_ALT1 0x0050ef Broadcom Corporation oui yyINTEL 0x005500 Intel oui yyASIX 0x007063 Asix Semiconductor +oui xxVITESSE 0x008083 Vitesse Semiconductor oui xxPMCSIERRA2 0x009057 PMC-Sierra oui xxCICADA 0x00c08f Cicada Semiconductor oui xxNATSEMI 0x1000e8 National Semiconductor @@ -220,15 +219,17 @@ model BROADCOM3 BCM5720C 0x0036 BCM5720C 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
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Thu Oct 17 19:06:58 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ciphy.c rgephy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #347): sys/dev/mii/ciphy.c: revision 1.35 sys/dev/mii/rgephy.c: revision 1.56 sys/dev/mii/rgephy.c: revision 1.57 Make new rgephy_linkup() function and share it like FreeBSD. No functional change intended. - Indicate master mode if the negotiated result say so. - KNF To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.55 -r1.55.2.1 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Thu Oct 17 19:06:58 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: ciphy.c rgephy.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #347): sys/dev/mii/ciphy.c: revision 1.35 sys/dev/mii/rgephy.c: revision 1.56 sys/dev/mii/rgephy.c: revision 1.57 Make new rgephy_linkup() function and share it like FreeBSD. No functional change intended. - Indicate master mode if the negotiated result say so. - KNF To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.55 -r1.55.2.1 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/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.34 src/sys/dev/mii/ciphy.c:1.34.4.1 --- src/sys/dev/mii/ciphy.c:1.34 Thu Apr 11 09:14:07 2019 +++ src/sys/dev/mii/ciphy.c Thu Oct 17 19:06:58 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.34 2019/04/11 09:14:07 msaitoh Exp $ */ +/* $NetBSD: ciphy.c,v 1.34.4.1 2019/10/17 19:06:58 martin Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34 2019/04/11 09:14:07 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.1 2019/10/17 19:06:58 martin Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -297,7 +297,7 @@ static void ciphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - uint16_t bmsr, bmcr; + uint16_t bmsr, bmcr, gtsr; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; @@ -343,16 +343,19 @@ ciphy_status(struct mii_softc *sc) else mii->mii_media_active |= IFM_HDX; - return; + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) { + PHY_READ(sc, MII_GTSR, ); + if ((gtsr & GTSR_MS_RES) != 0) + mii->mii_media_active |= IFM_ETH_MASTER; + } } static void ciphy_reset(struct mii_softc *sc) { + mii_phy_reset(sc); DELAY(1000); - - return; } static inline int @@ -437,6 +440,4 @@ ciphy_fixup(struct mii_softc *sc) model); break; } - - return; } Index: src/sys/dev/mii/rgephy.c diff -u src/sys/dev/mii/rgephy.c:1.55 src/sys/dev/mii/rgephy.c:1.55.2.1 --- src/sys/dev/mii/rgephy.c:1.55 Wed Jun 5 17:50:06 2019 +++ src/sys/dev/mii/rgephy.c Thu Oct 17 19:06:58 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rgephy.c,v 1.55 2019/06/05 17:50:06 triaxx Exp $ */ +/* $NetBSD: rgephy.c,v 1.55.2.1 2019/10/17 19:06:58 martin Exp $ */ /* * Copyright (c) 2003 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.55 2019/06/05 17:50:06 triaxx Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.55.2.1 2019/10/17 19:06:58 martin Exp $"); /* @@ -75,6 +75,7 @@ static int rgephy_service(struct mii_sof static void rgephy_status(struct mii_softc *); static int rgephy_mii_phy_auto(struct mii_softc *); static void rgephy_reset(struct mii_softc *); +static bool rgephy_linkup(struct mii_softc *); static void rgephy_loop(struct mii_softc *); static void rgephy_load_dspcode(struct mii_softc *); @@ -295,26 +296,9 @@ rgephy_service(struct mii_softc *sc, str * need to restart the autonegotiation process. Read * the BMSR twice in case it's latched. */ - if (sc->mii_mpd_rev >= RGEPHY_8211F) { - /* RTL8211F */ - PHY_READ(sc, RGEPHY_MII_PHYSR, ); - if (reg & RGEPHY_PHYSR_LINK) { -sc->mii_ticks = 0; -break; - } - } else if (sc->mii_mpd_rev >= RGEPHY_8211B) { - /* RTL8211B(L) */ - PHY_READ(sc, RGEPHY_MII_SSR, ); - if (reg & RGEPHY_SSR_LINK) { -sc->mii_ticks = 0; -break; - } - } else { - PHY_READ(sc, RTK_GMEDIASTAT, ); - if ((reg & RTK_GMEDIASTAT_LINK) != 0) { -sc->mii_ticks = 0; -break; - } + if (rgephy_linkup(sc)) { + sc->mii_ticks = 0; + break; } /* Announce link loss right after it happens. */ @@ -345,28 +329,40 @@ rgephy_service(struct mii_softc *sc, str return 0; } +static bool +rgephy_linkup(struct mii_softc *sc) +{ + bool linkup = false; + uint16_t reg; + + if (sc->mii_mpd_rev >= RGEPHY_8211F) { + PHY_READ(sc, RGEPHY_MII_PHYSR, ); + if (reg & RGEPHY_PHYSR_LINK) + linkup = true; + } else if (sc->mii_mpd_rev >= RGEPHY_8211B) { + PHY_READ(sc, RGEPHY_MII_SSR, ); + if (reg & RGEPHY_SSR_LINK) + linkup = true; + } else { + PHY_READ(sc, RTK_GMEDIASTAT, ); + if ((reg & RTK_GMEDIASTAT_LINK) != 0) + linkup = true; + } + + return linkup; +} + static void rgephy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - uint16_t gstat, bmsr, bmcr, physr, ssr; + uint16_t gstat, bmsr, bmcr, gtsr, physr, ssr; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; - if (sc->mii_mpd_rev >= RGEPHY_8211F) { - PHY_READ(sc, RGEPHY_MII_PHYSR, ); - if (physr & RGEPHY_PHYSR_LINK) - mii->mii_media_status |= IFM_ACTIVE; - } else if (sc->mii_mpd_rev >= RGEPHY_8211B) { -
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Sep 2 07:06:11 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: regen (for ticket #144, also requested in ticket #171) To generate a diff of this commit: cvs rdiff -u -r1.151 -r1.151.2.1 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139 -r1.139.2.1 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.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Mon Sep 2 07:06:11 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h Log Message: regen (for ticket #144, also requested in ticket #171) To generate a diff of this commit: cvs rdiff -u -r1.151 -r1.151.2.1 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.139 -r1.139.2.1 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.151 src/sys/dev/mii/miidevs.h:1.151.2.1 --- src/sys/dev/mii/miidevs.h:1.151 Thu Jun 6 16:05:45 2019 +++ src/sys/dev/mii/miidevs.h Mon Sep 2 07:06:11 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.151 2019/06/06 16:05:45 thorpej Exp $ */ +/* $NetBSD: miidevs.h,v 1.151.2.1 2019/09/02 07:06:11 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153 2019/06/06 16:04:13 thorpej Exp + * NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp */ /*- @@ -131,8 +131,10 @@ /* * Agere PHYs */ -#define MII_MODEL_AGERE_ET1011 0x0004 -#define MII_STR_AGERE_ET1011 "Agere ET1011 10/100/1000baseT PHY" +#define MII_MODEL_AGERE_ET1011 0x0001 +#define MII_STR_AGERE_ET1011 "ET1011 10/100/1000baseT PHY" +#define MII_MODEL_AGERE_ET1011C 0x0004 +#define MII_STR_AGERE_ET1011C "ET1011C 10/100/1000baseT PHY" /* Asix semiconductor PHYs */ #define MII_MODEL_xxASIX_AX88X9X 0x0031 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.139 src/sys/dev/mii/miidevs_data.h:1.139.2.1 --- src/sys/dev/mii/miidevs_data.h:1.139 Thu Jun 6 16:05:45 2019 +++ src/sys/dev/mii/miidevs_data.h Mon Sep 2 07:06:11 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.139 2019/06/06 16:05:45 thorpej Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.139.2.1 2019/09/02 07:06:11 martin Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.153 2019/06/06 16:04:13 thorpej Exp + * NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp */ /*- @@ -43,6 +43,7 @@ struct mii_knowndev { }; 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 }, { MII_OUI_yyASIX, MII_MODEL_yyASIX_AX88772, MII_STR_yyASIX_AX88772 }, { MII_OUI_yyASIX, MII_MODEL_yyASIX_AX88772A, MII_STR_yyASIX_AX88772A },
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Sun Sep 1 13:56:01 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: etphy.c miidevs Log Message: Pull up following revision(s) (requested by msaitoh in ticket #144): sys/dev/mii/miidevs: revision 1.154 sys/dev/mii/etphy.c: revision 1.5 sys/dev/mii/etphy.c: revision 1.6 No functional change: - Use static. - KNF. >From FreeBSD: - Rename ET1011 to ET1011C - Add ET1011 >From FreeBSD: - Support ET1011. - Use mii_phy_flowstatus() to reflect flow status from negotiated result. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/dev/mii/etphy.c cvs rdiff -u -r1.153 -r1.153.2.1 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-9] src/sys/dev/mii
Module Name:src Committed By: martin Date: Sun Sep 1 13:56:01 UTC 2019 Modified Files: src/sys/dev/mii [netbsd-9]: etphy.c miidevs Log Message: Pull up following revision(s) (requested by msaitoh in ticket #144): sys/dev/mii/miidevs: revision 1.154 sys/dev/mii/etphy.c: revision 1.5 sys/dev/mii/etphy.c: revision 1.6 No functional change: - Use static. - KNF. >From FreeBSD: - Rename ET1011 to ET1011C - Add ET1011 >From FreeBSD: - Support ET1011. - Use mii_phy_flowstatus() to reflect flow status from negotiated result. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/dev/mii/etphy.c cvs rdiff -u -r1.153 -r1.153.2.1 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/etphy.c diff -u src/sys/dev/mii/etphy.c:1.4 src/sys/dev/mii/etphy.c:1.4.4.1 --- src/sys/dev/mii/etphy.c:1.4 Mon Mar 25 09:29:08 2019 +++ src/sys/dev/mii/etphy.c Sun Sep 1 13:56:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: etphy.c,v 1.4 2019/03/25 09:29:08 msaitoh Exp $ */ +/* $NetBSD: etphy.c,v 1.4.4.1 2019/09/01 13:56:01 martin 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.4 2019/03/25 09:29:08 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.4.4.1 2019/09/01 13:56:01 martin Exp $"); #include #include @@ -77,18 +77,19 @@ __KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1. #define ETPHY_SR_FDX 0x0080 -int etphy_service(struct mii_softc *, struct mii_data *, int); -void etphy_attach(device_t, device_t, void *); -int etphy_match(device_t, cfdata_t, void *); -void etphy_reset(struct mii_softc *); -void etphy_status(struct mii_softc *); +static int etphy_service(struct mii_softc *, struct mii_data *, int); +static void etphy_attach(device_t, device_t, void *); +static int etphy_match(device_t, cfdata_t, void *); +static void etphy_reset(struct mii_softc *); +static void etphy_status(struct mii_softc *); -const struct mii_phy_funcs etphy_funcs = { +static const struct mii_phy_funcs etphy_funcs = { etphy_service, etphy_status, etphy_reset, }; static const struct mii_phydesc etphys[] = { MII_PHY_DESC(AGERE, ET1011), + MII_PHY_DESC(AGERE, ET1011C), MII_PHY_END, }; @@ -133,7 +134,7 @@ static const struct etphy_dsp { { 0x8010, 46 } /* IdlguardTime */ }; -int +static int etphy_match(device_t parent, cfdata_t match, void *aux) { struct mii_attach_args *ma = aux; @@ -144,7 +145,7 @@ etphy_match(device_t parent, cfdata_t ma return 0; } -void +static void etphy_attach(device_t parent, device_t self, void *aux) { struct mii_softc *sc = device_private(self); @@ -185,7 +186,7 @@ etphy_attach(device_t parent, device_t s aprint_error_dev(self, "couldn't establish power handler\n"); } -int +static int etphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -229,7 +230,7 @@ etphy_service(struct mii_softc *sc, stru if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { PHY_WRITE(sc, MII_BMCR, - bmcr | BMCR_AUTOEN | BMCR_STARTNEG); +bmcr | BMCR_AUTOEN | BMCR_STARTNEG); } } break; @@ -252,19 +253,23 @@ etphy_service(struct mii_softc *sc, stru return 0; } -void +static void etphy_reset(struct mii_softc *sc) { uint16_t reg; int i; + if (sc->mii_mpd_model == MII_MODEL_AGERE_ET1011) { + mii_phy_reset(sc); + return; + } + for (i = 0; i < 2; ++i) { PHY_READ(sc, MII_PHYIDR1, ); PHY_READ(sc, MII_PHYIDR2, ); PHY_READ(sc, ETPHY_CTRL, ); - PHY_WRITE(sc, ETPHY_CTRL, - ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1); + PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1); PHY_WRITE(sc, ETPHY_INDEX, ETPHY_INDEX_MAGIC); PHY_READ(sc, ETPHY_DATA, ); @@ -294,13 +299,13 @@ etphy_reset(struct mii_softc *sc) PHY_READ(sc, MII_BMCR, ); PHY_READ(sc, ETPHY_CTRL, ); - PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_S1000); + PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_S1000); PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_RSV1); mii_phy_reset(sc); } -void +static void etphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; @@ -340,7 +345,7 @@ etphy_status(struct mii_softc *sc) } if (sr & ETPHY_SR_FDX) - mii->mii_media_active |= IFM_FDX; + mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc); else mii->mii_media_active |= IFM_HDX; } Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.153 src/sys/dev/mii/miidevs:1.153.2.1 --- src/sys/dev/mii/miidevs:1.153 Thu Jun 6 16:04:13 2019 +++ src/sys/dev/mii/miidevs Sun Sep 1 13:56:01 2019 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.153 2019/06/06 16:04:13 thorpej Exp $ +$NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -124,7 +124,8 @@