summaryrefslogtreecommitdiff
path: root/sys/arch/socppc/dev
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-04-08 10:49:26 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-04-08 10:49:26 +0000
commitf948b97a7c9e14e9354485155f7aebac5b939da1 (patch)
tree58bb38e39bf027e756c37b71dd54e7359d393675 /sys/arch/socppc/dev
parent8039d47b3db01a6f217429b0b9712a98dc51ce9a (diff)
Check for link status in tsec_start(). Prevent the watchdog from fireing
when no cable is plugged in but the interface is brough up. inputs and ok kettenis@
Diffstat (limited to 'sys/arch/socppc/dev')
-rw-r--r--sys/arch/socppc/dev/if_tsec.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/socppc/dev/if_tsec.c b/sys/arch/socppc/dev/if_tsec.c
index 3fd045bb686..95f91e3628c 100644
--- a/sys/arch/socppc/dev/if_tsec.c
+++ b/sys/arch/socppc/dev/if_tsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tsec.c,v 1.35 2015/03/10 11:17:55 mpi Exp $ */
+/* $OpenBSD: if_tsec.c,v 1.36 2015/04/08 10:49:25 mpi Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -253,6 +253,7 @@ struct tsec_softc {
#define sc_lladdr sc_ac.ac_enaddr
struct mii_data sc_mii;
#define sc_media sc_mii.mii_media
+ int sc_link;
struct tsec_dmamem *sc_txring;
struct tsec_buf *sc_txbuf;
@@ -521,6 +522,8 @@ tsec_start(struct ifnet *ifp)
return;
if (IFQ_IS_EMPTY(&ifp->if_snd))
return;
+ if (!sc->sc_link)
+ return;
idx = sc->sc_tx_prod;
while ((sc->sc_txdesc[idx].td_status & TSEC_TX_TO1) == 0) {
@@ -688,15 +691,21 @@ tsec_mii_statchg(struct device *self)
case IFM_1000_CX:
case IFM_1000_T:
maccfg2 |= TSEC_MACCFG2_IF_GMII;
+ sc->sc_link = 1;
break;
case IFM_100_TX:
ecntrl |= TSEC_ECNTRL_R100M;
maccfg2 |= TSEC_MACCFG2_IF_MII;
+ sc->sc_link = 1;
break;
case IFM_10_T:
ecntrl &= ~TSEC_ECNTRL_R100M;
maccfg2 |= TSEC_MACCFG2_IF_MII;
+ sc->sc_link = 1;
break;
+ default:
+ sc->sc_link = 0;
+ return;
}
if ((sc->sc_mii.mii_media_active & IFM_GMASK) == IFM_FDX)