summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2003-05-14 23:35:30 +0000
committermiod <miod@openbsd.org>2003-05-14 23:35:30 +0000
commitacc4e89ef4ee99100b1ab86ed635b15bc2af6593 (patch)
tree50b1fe0a28352131a66303844124dff96cf88749
parentMake the "slot" and "offset" locators for sbus drivers optional in (diff)
downloadwireguard-openbsd-acc4e89ef4ee99100b1ab86ed635b15bc2af6593.tar.xz
wireguard-openbsd-acc4e89ef4ee99100b1ab86ed635b15bc2af6593.zip
Silence the "lost carrier on FOO port" messages when the port has been set
in stone with "ifconfig le0 media foo". Inspired by previous am7990.c change. ok todd@ jason@
-rw-r--r--sys/arch/sparc/dev/if_le.c28
-rw-r--r--sys/dev/sbus/if_le_ledma.c12
2 files changed, 20 insertions, 20 deletions
diff --git a/sys/arch/sparc/dev/if_le.c b/sys/arch/sparc/dev/if_le.c
index 0ac2c8e093c..418d160d1f3 100644
--- a/sys/arch/sparc/dev/if_le.c
+++ b/sys/arch/sparc/dev/if_le.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le.c,v 1.20 2002/04/30 01:12:29 art Exp $ */
+/* $OpenBSD: if_le.c,v 1.21 2003/05/14 23:35:30 miod Exp $ */
/* $NetBSD: if_le.c,v 1.50 1997/09/09 20:54:48 pk Exp $ */
/*-
@@ -347,41 +347,40 @@ lehwinit(sc)
#endif
}
+#if defined(SUN4M)
hide void
lenocarrier(sc)
struct am7990_softc *sc;
{
-#if defined(SUN4M)
struct le_softc *lesc = (struct le_softc *)sc;
- if (CPU_ISSUN4M && lesc->sc_dma) {
+ if (lesc->sc_dma) {
/*
* Check if the user has requested a certain cable type, and
* if so, honor that request.
*/
- printf("%s: lost carrier on ", sc->sc_dev.dv_xname);
if (lesc->sc_dma->sc_regs->csr & DE_AUI_TP) {
- printf("UTP port");
switch (IFM_SUBTYPE(sc->sc_ifmedia.ifm_media)) {
case IFM_10_5:
case IFM_AUTO:
- printf(", switching to AUI port");
+ printf("%s: lost carrier on UTP port"
+ ", switching to AUI port\n",
+ sc->sc_dev.dv_xname);
lesetaui(sc);
}
} else {
- printf("AUI port");
switch (IFM_SUBTYPE(sc->sc_ifmedia.ifm_media)) {
case IFM_10_T:
case IFM_AUTO:
- printf(", switching to UTP port");
+ printf("%s: lost carrier on AUI port"
+ ", switching to UTP port\n",
+ sc->sc_dev.dv_xname);
lesetutp(sc);
}
}
- printf("\n");
- } else
-#endif
- printf("%s: lost carrier\n", sc->sc_dev.dv_xname);
+ }
}
+#endif
int
lematch(parent, vcf, aux)
@@ -542,7 +541,10 @@ leattach(parent, self, aux)
sc->sc_rdcsr = lerdcsr;
sc->sc_wrcsr = lewrcsr;
sc->sc_hwinit = lehwinit;
- sc->sc_nocarrier = lenocarrier;
+#if defined(SUN4M)
+ if (CPU_ISSUN4M)
+ sc->sc_nocarrier = lenocarrier;
+#endif
sc->sc_hwreset = lehwreset;
ifmedia_init(&sc->sc_ifmedia, 0, lemediachange, lemediastatus);
diff --git a/sys/dev/sbus/if_le_ledma.c b/sys/dev/sbus/if_le_ledma.c
index 598bf78490a..b0168411f2d 100644
--- a/sys/dev/sbus/if_le_ledma.c
+++ b/sys/dev/sbus/if_le_ledma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le_ledma.c,v 1.7 2003/02/17 01:29:21 henric Exp $ */
+/* $OpenBSD: if_le_ledma.c,v 1.8 2003/05/14 23:35:31 miod Exp $ */
/* $NetBSD: if_le_ledma.c,v 1.14 2001/05/30 11:46:35 mrg Exp $ */
/*-
@@ -297,26 +297,24 @@ lenocarrier(sc)
* Check if the user has requested a certain cable type, and
* if so, honor that request.
*/
- printf("%s: lost carrier on ", sc->sc_dev.dv_xname);
if (L64854_GCSR(lesc->sc_dma) & E_TP_AUI) {
- printf("UTP port");
switch (IFM_SUBTYPE(sc->sc_ifmedia.ifm_media)) {
case IFM_10_5:
case IFM_AUTO:
- printf(", switching to AUI port");
+ printf("%s: lost carrier on UTP port"
+ ", switching to AUI port\n", sc->sc_dev.dv_xname);
lesetaui(sc);
}
} else {
- printf("AUI port");
switch (IFM_SUBTYPE(sc->sc_ifmedia.ifm_media)) {
case IFM_10_T:
case IFM_AUTO:
- printf(", switching to UTP port");
+ printf("%s: lost carrier on AUI port"
+ ", switching to UTP port\n", sc->sc_dev.dv_xname);
lesetutp(sc);
}
}
- printf("\n");
}
int