diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-02-03 05:59:19 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-02-03 05:59:19 +0000 |
commit | a62e8ce300736cbef187d86ed89cc6659a9d121d (patch) | |
tree | e4a63883ec8617a8df58e791319fbd99c7a1a7cd /sys/dev | |
parent | 4132770850f9eab855a9df6b8a87be9539f16d9b (diff) |
new timeouts
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_sf.c | 16 | ||||
-rw-r--r-- | sys/dev/pci/if_sfreg.h | 1 |
2 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/pci/if_sf.c b/sys/dev/pci/if_sf.c index 1350c99c65d..c3f7168e35b 100644 --- a/sys/dev/pci/if_sf.c +++ b/sys/dev/pci/if_sf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sf.c,v 1.8 2000/10/16 17:08:08 aaron Exp $ */ +/* $OpenBSD: if_sf.c,v 1.9 2001/02/03 05:59:17 mickey Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -91,6 +91,7 @@ #include <sys/errno.h> #include <sys/malloc.h> #include <sys/kernel.h> +#include <sys/timeout.h> #include <net/if.h> #include <net/if_dl.h> @@ -1026,7 +1027,7 @@ int sf_intr(arg) if (status & SF_ISR_ABNORMALINTR) { if (status & SF_ISR_STATSOFLOW) { - untimeout(sf_stats_update, sc); + timeout_del(&sc->sc_stats_tmo); sf_stats_update(sc); } else sf_init(sc); @@ -1147,10 +1148,11 @@ void sf_init(xsc) ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; - timeout(sf_stats_update, sc, hz); - splx(s); + timeout_set(&sc->sc_stats_tmo, sf_stats_update, sc); + timeout_add(&sc->sc_stats_tmo, hz); + return; } @@ -1283,7 +1285,7 @@ void sf_stop(sc) ifp = &sc->arpcom.ac_if; - untimeout(sf_stats_update, sc); + timeout_del(&sc->sc_stats_tmo); csr_write_4(sc, SF_GEN_ETH_CTL, 0); csr_write_4(sc, SF_CQ_CONSIDX, 0); @@ -1362,10 +1364,10 @@ void sf_stats_update(xsc) sf_start(ifp); } - timeout(sf_stats_update, sc, hz); - splx(s); + timeout_add(&sc->sc_stats_tmo, hz); + return; } diff --git a/sys/dev/pci/if_sfreg.h b/sys/dev/pci/if_sfreg.h index ca86644464a..26914397bb3 100644 --- a/sys/dev/pci/if_sfreg.h +++ b/sys/dev/pci/if_sfreg.h @@ -1031,6 +1031,7 @@ struct sf_softc { void *sc_ih; /* interrupt handler cookie */ struct arpcom arpcom; /* interface info */ struct ifmedia ifmedia; /* media info */ + struct timeout sc_stats_tmo; mii_data_t sc_mii; /* mii bus */ bus_space_handle_t sf_bhandle; /* bus space handle */ bus_space_tag_t sf_btag; /* bus space tag */ |