From a62e8ce300736cbef187d86ed89cc6659a9d121d Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Sat, 3 Feb 2001 05:59:19 +0000 Subject: new timeouts --- sys/dev/pci/if_sf.c | 16 +++++++++------- sys/dev/pci/if_sfreg.h | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'sys/dev') 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 . All rights reserved. @@ -91,6 +91,7 @@ #include #include #include +#include #include #include @@ -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 */ -- cgit v1.2.3