summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sis.c
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2003-07-22 01:35:09 +0000
committercognet <cognet@FreeBSD.org>2003-07-22 01:35:09 +0000
commit171794b4835a86a4c03f2f35618171c32e838fde (patch)
treee2e9516d29d28bf1d9b8158db40741ee02de5508 /sys/pci/if_sis.c
parentba36ddb07d75f5227ec82f0bdff03f40de79b482 (diff)
downloadFreeBSD-src-171794b4835a86a4c03f2f35618171c32e838fde.zip
FreeBSD-src-171794b4835a86a4c03f2f35618171c32e838fde.tar.gz
Erm, my previous commit was wrong and sis_tick() was only called each time
sis_ioctl() was called, so one had to use ifconfig each time the cable got plugged in to be able to use the connection. Do it a better way now, add a "in_tick" field in the softc structure, call timeout() in sis_tick() and don't call it in sis_init() if in_tick is non-zero. Reported by: Landmark Networks Pointy hat to: cognet
Diffstat (limited to 'sys/pci/if_sis.c')
-rw-r--r--sys/pci/if_sis.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index eb51295..69822de 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -1739,6 +1739,7 @@ sis_tick(xsc)
sc = xsc;
SIS_LOCK(sc);
+ sc->in_tick = 1;
ifp = &sc->arpcom.ac_if;
mii = device_get_softc(sc->sis_miibus);
@@ -1751,6 +1752,8 @@ sis_tick(xsc)
sis_start(ifp);
}
+ sc->sis_stat_ch = timeout(sis_tick, sc, hz);
+ sc->in_tick = 0;
SIS_UNLOCK(sc);
return;
@@ -2187,7 +2190,8 @@ sis_init(xsc)
ifp->if_flags |= IFF_RUNNING;
ifp->if_flags &= ~IFF_OACTIVE;
- sc->sis_stat_ch = timeout(sis_tick, sc, hz);
+ if (!sc->in_tick)
+ sc->sis_stat_ch = timeout(sis_tick, sc, hz);
SIS_UNLOCK(sc);
OpenPOWER on IntegriCloud