summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/tropic.c38
-rw-r--r--sys/dev/ic/tropicvar.h5
-rw-r--r--sys/dev/mii/brgphy.c5
-rw-r--r--sys/dev/mii/miivar.h6
-rw-r--r--sys/dev/mii/nsgphy.c5
-rw-r--r--sys/dev/mii/xmphy.c5
-rw-r--r--sys/dev/pci/ncr.c13
-rw-r--r--sys/dev/rcons/rcons.h5
-rw-r--r--sys/dev/rcons/rcons_kern.c10
-rw-r--r--sys/netatalk/aarp.c18
-rw-r--r--sys/netatalk/at_control.c8
-rw-r--r--sys/netinet/ip_mroute.c19
-rw-r--r--sys/netiso/esis.c16
-rw-r--r--sys/netiso/iso_snpac.c9
-rw-r--r--sys/netiso/tuba_table.c9
-rw-r--r--sys/scsi/scsi_base.c6
-rw-r--r--sys/ufs/lfs/lfs_bio.c14
17 files changed, 114 insertions, 77 deletions
diff --git a/sys/dev/ic/tropic.c b/sys/dev/ic/tropic.c
index ad643a229c4..a73ef15a060 100644
--- a/sys/dev/ic/tropic.c
+++ b/sys/dev/ic/tropic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tropic.c,v 1.3 2001/08/12 12:03:03 heko Exp $ */
+/* $OpenBSD: tropic.c,v 1.4 2001/08/19 15:07:30 miod Exp $ */
/* $NetBSD: tropic.c,v 1.6 1999/12/17 08:26:31 fvdl Exp $ */
/*
@@ -47,6 +47,7 @@
#include <sys/ioctl.h>
#include <sys/errno.h>
#include <sys/device.h>
+#include <sys/timeout.h>
#include <net/if.h>
#include <net/if_llc.h>
@@ -90,7 +91,6 @@ void tr_xint __P((struct tr_softc *));
void tr_oldxint __P((struct tr_softc *));
struct mbuf *tr_get __P((struct tr_softc *, int, struct ifnet *));
void tr_opensap __P((struct tr_softc *, u_char));
-void tr_timeout __P((void *));
int tr_mbcopy __P((struct tr_softc *, bus_size_t, struct mbuf *));
void tr_bcopy __P((struct tr_softc *, u_char *, int));
void tr_start __P((struct ifnet *));
@@ -897,7 +897,6 @@ tr_intr(arg)
sc->sc_xmit_buffers);
#endif
sc->sc_xmit_correlator = 0;
- untimeout(tr_timeout, sc);
wakeup(&sc->tr_sleepevent);
}
else
@@ -913,7 +912,10 @@ tr_intr(arg)
* XXX untimeout depending on the error, timeout in other cases
* XXX error 0x24 && autospeed mode: open again !!!!
*/
- timeout(tr_init, sc, hz*30);
+ if (!timeout_initialized(&sc->init_timeout))
+ timeout_set(&sc->init_timeout,
+ tr_init, sc);
+ timeout_add(&sc->init_timeout, hz * 30);
}
break;
@@ -926,12 +928,10 @@ tr_intr(arg)
ifp->if_flags &= ~IFF_RUNNING;
ifp->if_flags &= ~IFF_UP;
ifp->if_flags &= ~IFF_OACTIVE;
- untimeout(tr_timeout, sc);
wakeup(&sc->tr_sleepevent);
}
break;
case DIR_SET_DEFAULT_RING_SPEED:
- untimeout(tr_timeout, sc);
wakeup(&sc->tr_sleepevent);
break;
@@ -944,7 +944,6 @@ tr_intr(arg)
SRB_OPNSAP_STATIONID);
printf("%s: Token Ring opened\n",
sc->sc_dev.dv_xname);
- untimeout(tr_timeout, sc);
wakeup(&sc->tr_sleepevent);
break;
/* XXX DLC_CLOSE_SAP not needed ? */
@@ -1044,7 +1043,10 @@ tr_intr(arg)
ifp->if_flags &= ~IFF_RUNNING;
ifp->if_flags &= ~IFF_UP;
IFQ_PURGE(&ifp->if_snd);
- timeout(tr_reinit, sc ,hz*30);
+ if (!timeout_initialized(&sc->reinit_timeout))
+ timeout_set(&sc->reinit_timeout,
+ tr_reinit, sc);
+ timeout_add(&sc->reinit_timeout, hz * 30);
}
else {
#ifdef TROPICDEBUG
@@ -1718,8 +1720,11 @@ void
tr_sleep(sc)
struct tr_softc *sc;
{
- timeout(tr_timeout, sc, hz*30);
- sleep(&sc->tr_sleepevent, 1);
+ int error;
+
+ error = tsleep(&sc->tr_sleepevent, 1, "trsleep", hz * 30);
+ if (error == EWOULDBLOCK)
+ printf("%s: sleep event timeout\n", sc->sc_dev.dv_xname);
}
void
@@ -1733,16 +1738,3 @@ struct ifnet *ifp;
tr_reset(sc);
}
-
-/*
- * tr_timeout - timeout routine if adapter does not open in 30 seconds
- */
-void
-tr_timeout(arg)
-void *arg;
-{
- struct tr_softc *sc = arg;
-
- printf("Token Ring timeout\n");
- wakeup(&sc->tr_sleepevent);
-}
diff --git a/sys/dev/ic/tropicvar.h b/sys/dev/ic/tropicvar.h
index d0ce12396d9..6e03c4aa694 100644
--- a/sys/dev/ic/tropicvar.h
+++ b/sys/dev/ic/tropicvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tropicvar.h,v 1.1 1999/12/27 21:51:35 fgsch Exp $ */
+/* $OpenBSD: tropicvar.h,v 1.2 2001/08/19 15:07:30 miod Exp $ */
/* $NetBSD: tropicvar.h,v 1.4 1999/10/17 23:53:45 cgd Exp $ */
/*
@@ -70,6 +70,9 @@ struct tr_softc {
bus_space_handle_t sc_sramh; /* handle for the shared ram area */
bus_space_handle_t sc_mmioh; /* handle for the bios/mmio area */
+ struct timeout init_timeout;
+ struct timeout reinit_timeout;
+
int (*sc_mediachange) __P((struct tr_softc *));
void (*sc_mediastatus) __P((struct tr_softc *, struct ifmediareq *));
struct rbcb rbc; /* receiver buffer control block */
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index 3d9838ad666..af7ffc56ce6 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brgphy.c,v 1.4 2001/04/12 04:51:27 deraadt Exp $ */
+/* $OpenBSD: brgphy.c,v 1.5 2001/08/19 15:07:34 miod Exp $ */
/*
* Copyright (c) 2000
@@ -385,7 +385,8 @@ brgphy_mii_phy_auto(mii, waitfor)
*/
if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) {
mii->mii_flags |= MIIF_DOINGAUTO;
- timeout(mii_phy_auto_timeout, mii, hz >> 1);
+ timeout_set(&mii->mii_phy_timo, mii_phy_auto_timeout, mii);
+ timeout_add(&mii->mii_phy_timo, hz >> 1);
}
return (EJUSTRETURN);
}
diff --git a/sys/dev/mii/miivar.h b/sys/dev/mii/miivar.h
index 95ce35035db..f9a911daa98 100644
--- a/sys/dev/mii/miivar.h
+++ b/sys/dev/mii/miivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: miivar.h,v 1.11 2001/06/25 20:24:13 nate Exp $ */
+/* $OpenBSD: miivar.h,v 1.12 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: miivar.h,v 1.17 2000/03/06 20:56:57 thorpej Exp $ */
/*-
@@ -144,12 +144,12 @@ struct mii_softc {
#if defined(__NetBSD__)
struct callout mii_nway_ch; /* NWAY callout */
+#elif defined(__OpenBSD__)
+ struct timeout mii_phy_timo; /* timeout handle */
#endif
int mii_media_active; /* last active media */
int mii_media_status; /* last active status */
-
- struct timeout mii_phy_timo; /* timeout handle */
};
typedef struct mii_softc mii_softc_t;
diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c
index 98ad07ce97e..3de1da37026 100644
--- a/sys/dev/mii/nsgphy.c
+++ b/sys/dev/mii/nsgphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nsgphy.c,v 1.3 2001/07/02 06:29:49 nate Exp $ */
+/* $OpenBSD: nsgphy.c,v 1.4 2001/08/19 15:07:34 miod Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 2001
@@ -424,7 +424,8 @@ nsgphy_mii_phy_auto(mii, waitfor)
*/
if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) {
mii->mii_flags |= MIIF_DOINGAUTO;
- timeout(mii_phy_auto_timeout, mii, hz >> 1);
+ timeout_set(&mii->mii_phy_timo, mii_phy_auto_timeout, mii);
+ timeout_add(&mii->mii_phy_timo, hz >> 1);
}
return (EJUSTRETURN);
}
diff --git a/sys/dev/mii/xmphy.c b/sys/dev/mii/xmphy.c
index e71e5cff455..916e639c9ed 100644
--- a/sys/dev/mii/xmphy.c
+++ b/sys/dev/mii/xmphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xmphy.c,v 1.2 2000/08/29 19:00:36 jason Exp $ */
+/* $OpenBSD: xmphy.c,v 1.3 2001/08/19 15:07:34 miod Exp $ */
/*
* Copyright (c) 2000
@@ -335,7 +335,8 @@ xmphy_mii_phy_auto(mii, waitfor)
*/
if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) {
mii->mii_flags |= MIIF_DOINGAUTO;
- timeout(mii_phy_auto_timeout, mii, hz >> 1);
+ timeout_set(&mii->mii_phy_timo, mii_phy_auto_timeout, mii);
+ timeout_add(&mii->mii_phy_timo, hz >> 1);
}
return (EJUSTRETURN);
}
diff --git a/sys/dev/pci/ncr.c b/sys/dev/pci/ncr.c
index 61f7f668160..05b1574b2a2 100644
--- a/sys/dev/pci/ncr.c
+++ b/sys/dev/pci/ncr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr.c,v 1.58 2001/08/12 20:03:49 mickey Exp $ */
+/* $OpenBSD: ncr.c,v 1.59 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: ncr.c,v 1.63 1997/09/23 02:39:15 perry Exp $ */
/**************************************************************************
@@ -222,6 +222,8 @@
#ifndef __OpenBSD__
#include <sys/sysctl.h>
#include <machine/clock.h>
+#else
+#include <sys/timeout.h>
#endif
#include <vm/vm.h>
#include <vm/vm_extern.h>
@@ -1213,6 +1215,8 @@ struct ncb {
u_long lasttime;
#ifdef __FreeBSD__
struct callout_handle timeout_ch;
+#elif defined (__OpenBSD__)
+ struct timeout sc_timeout;
#endif
/*-----------------------------------------------
@@ -1463,7 +1467,7 @@ static void ncr_attach (pcici_t tag, int unit);
#if 0
static char ident[] =
- "\n$OpenBSD: ncr.c,v 1.58 2001/08/12 20:03:49 mickey Exp $\n";
+ "\n$OpenBSD: ncr.c,v 1.59 2001/08/19 15:07:34 miod Exp $\n";
#endif
static const u_long ncr_version = NCR_VERSION * 11
@@ -4261,6 +4265,7 @@ static void ncr_attach (pcici_t config_id, int unit)
/*
** start the timeout daemon
*/
+ timeout_set(&np->sc_timeout, ncr_timeout, np);
ncr_timeout (np);
np->lasttime=0;
@@ -5866,7 +5871,7 @@ static void ncr_timeout (void *arg)
#ifdef __FreeBSD__
np->timeout_ch = timeout (ncr_timeout, (caddr_t) np, step ? step : 1);
#else
- timeout (ncr_timeout, (caddr_t) np, step ? step : 1);
+ timeout_add(&np->sc_timeout, step ? step : 1);
#endif
if (INB(nc_istat) & (INTF|SIP|DIP)) {
@@ -6237,7 +6242,7 @@ void ncr_exception (ncb_p np)
#ifdef __FreeBSD__
untimeout (ncr_timeout, (caddr_t) np, np->timeout_ch);
#else
- untimeout (ncr_timeout, (caddr_t) np);
+ timeout_del(&np->sc_timeout);
#endif
printf ("%s: halted!\n", ncr_name(np));
diff --git a/sys/dev/rcons/rcons.h b/sys/dev/rcons/rcons.h
index 156feca0d19..2f21a2c44f3 100644
--- a/sys/dev/rcons/rcons.h
+++ b/sys/dev/rcons/rcons.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcons.h,v 1.2 1996/04/18 23:48:13 niklas Exp $ */
+/* $OpenBSD: rcons.h,v 1.3 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: rcons.h,v 1.4 1996/03/14 19:02:32 christos Exp $ */
/*
@@ -45,6 +45,7 @@
* @(#)fbvar.h 8.1 (Berkeley) 6/11/93
*/
+#include <sys/timeout.h>
#include <dev/rcons/raster.h>
struct rconsole {
@@ -83,6 +84,8 @@ struct rconsole {
int rc_ras_blank; /* current screen blank raster op */
struct raster_font *rc_font; /* font and related info */
+
+ struct timeout bell_timeout;
};
#define FB_INESC 0x001 /* processing an escape sequence */
diff --git a/sys/dev/rcons/rcons_kern.c b/sys/dev/rcons/rcons_kern.c
index 2cbf0d64a1d..dac0b162946 100644
--- a/sys/dev/rcons/rcons_kern.c
+++ b/sys/dev/rcons/rcons_kern.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcons_kern.c,v 1.4 2000/07/19 13:55:07 art Exp $ */
+/* $OpenBSD: rcons_kern.c,v 1.5 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: rcons_kern.c,v 1.4 1996/03/14 19:02:33 christos Exp $ */
/*
@@ -137,7 +137,7 @@ rcons_bell(rc)
splx(s);
(*rc->rc_bell)(1);
/* XXX Chris doesn't like the following divide */
- timeout(rcons_belltmr, rc, hz/10);
+ timeout_add(&rc->bell_timeout, hz / 10);
}
}
@@ -156,12 +156,12 @@ rcons_belltmr(p)
(*rc->rc_bell)(0);
if (i != 0)
/* XXX Chris doesn't like the following divide */
- timeout(rcons_belltmr, rc, hz/30);
+ timeout_add(&rc->bell_timeout, hz / 30);
} else {
rc->rc_ringing = 1;
splx(s);
(*rc->rc_bell)(1);
- timeout(rcons_belltmr, rc, hz/10);
+ timeout_add(&rc->bell_timeout, hz / 10);
}
}
@@ -248,6 +248,8 @@ rcons_init(rc)
rc->rc_bits |= FB_CURSOR;
}
+ timeout_set(&rc->bell_timeout, rcons_belltmr, rc);
+
/* Initialization done; hook us up */
fbconstty->t_oproc = rcons_output;
/*fbconstty->t_stop = (void (*)()) nullop;*/
diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c
index 2fb2f0e1179..7c6148d652c 100644
--- a/sys/netatalk/aarp.c
+++ b/sys/netatalk/aarp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aarp.c,v 1.2 2001/08/12 12:03:03 heko Exp $ */
+/* $OpenBSD: aarp.c,v 1.3 2001/08/19 15:07:34 miod Exp $ */
/*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -62,6 +62,7 @@
#include <sys/errno.h>
#include <sys/syslog.h>
#include <sys/proc.h>
+#include <sys/timeout.h>
#include <net/if.h>
#include <net/route.h>
@@ -103,6 +104,9 @@ void aarp_clean __P((void));
struct aarptab aarptab[AARPTAB_SIZE];
int aarptab_size = AARPTAB_SIZE;
+struct timeout aarpprobe_timeout;
+struct timeout aarptimer_timeout;
+
#define AARPTAB_HASH(a) \
((((a).s_net << 8 ) + (a).s_node ) % AARPTAB_NB )
@@ -140,7 +144,7 @@ aarptimer(v)
struct aarptab *aat;
int i, s;
- timeout( aarptimer, (caddr_t)0, AARPT_AGE * hz );
+ timeout_add(&aarptimer_timeout, AARPT_AGE * hz);
aat = aarptab;
for ( i = 0; i < AARPTAB_SIZE; i++, aat++ ) {
if ( aat->aat_flags == 0 || ( aat->aat_flags & ATF_PERM ))
@@ -437,7 +441,7 @@ at_aarpinput( ac, m )
* probed for the same address we'd like to use. Change the
* address we're probing for.
*/
- untimeout( aarpprobe, ac );
+ timeout_del(&aarpprobe_timeout);
wakeup( aa );
m_freem( m );
return;
@@ -567,7 +571,8 @@ aarptnew( addr )
if ( first ) {
first = 0;
- timeout( aarptimer, (caddr_t)0, hz );
+ timeout_set(&aarptimer_timeout, aarptimer, NULL);
+ timeout_add(&aarptimer_timeout, hz);
}
aat = &aarptab[ AARPTAB_HASH( *addr ) * AARPTAB_BSIZ ];
for ( n = 0; n < AARPTAB_BSIZ; n++, aat++ ) {
@@ -626,7 +631,8 @@ aarpprobe( arg )
wakeup( aa );
return;
} else {
- timeout( aarpprobe, (caddr_t)ac, hz / 5 );
+ timeout_set(&aarpprobe_timeout, aarpprobe, ac);
+ timeout_add(&aarpprobe_timeout, hz / 5);
}
if (( m = m_gethdr( M_DONTWAIT, MT_DATA )) == NULL ) {
@@ -686,7 +692,7 @@ aarp_clean(void)
struct aarptab *aat;
int i;
- untimeout( aarptimer, 0 );
+ timeout_del(&aarptimer_timeout);
for ( i = 0, aat = aarptab; i < AARPTAB_SIZE; i++, aat++ ) {
if ( aat->aat_hold ) {
m_freem( aat->aat_hold );
diff --git a/sys/netatalk/at_control.c b/sys/netatalk/at_control.c
index eac2e17a656..da460915145 100644
--- a/sys/netatalk/at_control.c
+++ b/sys/netatalk/at_control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: at_control.c,v 1.2 1997/07/24 00:25:22 deraadt Exp $ */
+/* $OpenBSD: at_control.c,v 1.3 2001/08/19 15:07:34 miod Exp $ */
/*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -62,6 +62,7 @@
#include <sys/errno.h>
#include <sys/syslog.h>
#include <sys/proc.h>
+#include <sys/timeout.h>
#include <net/if.h>
#include <net/route.h>
@@ -97,6 +98,8 @@ static int aa_dosingleroute __P((struct ifaddr *, struct at_addr *,
(a)->sat_addr.s_net == (b)->sat_addr.s_net && \
(a)->sat_addr.s_node == (b)->sat_addr.s_node )
+extern struct timeout aarpprobe_timeout;
+
int
at_control( cmd, data, ifp, p )
u_long cmd;
@@ -413,8 +416,9 @@ at_ifinit( ifp, aa, sat )
continue;
}
aa->aa_probcnt = 10;
+ timeout_set(&aarpprobe_timeout, aarpprobe, ifp);
/* XXX don't use hz so badly */
- timeout( aarpprobe, (caddr_t)ifp, hz / 5 );
+ timeout_add(&aarpprobe_timeout, hz / 5);
if ( tsleep( aa, PPAUSE|PCATCH, "at_ifinit", 0 )) {
printf( "at_ifinit why did this happen?!\n" );
aa->aa_addr = oldaddr;
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 1e6aaac6440..d4015082b14 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_mroute.c,v 1.21 2001/06/23 16:15:56 fgsch Exp $ */
+/* $OpenBSD: ip_mroute.c,v 1.22 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: ip_mroute.c,v 1.27 1996/05/07 02:40:50 thorpej Exp $ */
/*
@@ -26,9 +26,12 @@
#include <sys/kernel.h>
#include <sys/ioctl.h>
#include <sys/syslog.h>
+#include <sys/timeout.h>
+
#include <net/if.h>
#include <net/route.h>
#include <net/raw_cb.h>
+
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/in_systm.h>
@@ -82,6 +85,8 @@ extern int rsvp_on;
#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
#define UPCALL_EXPIRE 6 /* number of timeouts */
+struct timeout upcalls_timeout;
+struct timeout tbf_timeout;
/*
* Define the token bucket filter structures
@@ -413,7 +418,8 @@ ip_mrouter_init(so, m)
pim_assert = 0;
- timeout(expire_upcalls, (caddr_t)0, EXPIRE_TIMEOUT);
+ timeout_set(&upcalls_timeout, expire_upcalls, NULL);
+ timeout_add(&upcalls_timeout, EXPIRE_TIMEOUT);
if (mrtdebug)
log(LOG_DEBUG, "ip_mrouter_init\n");
@@ -445,7 +451,7 @@ ip_mrouter_done()
numvifs = 0;
pim_assert = 0;
- untimeout(expire_upcalls, (caddr_t)NULL);
+ timeout_del(&upcalls_timeout);
/*
* Free all multicast forwarding cache entries.
@@ -1211,7 +1217,7 @@ expire_upcalls(v)
}
splx(s);
- timeout(expire_upcalls, (caddr_t)0, EXPIRE_TIMEOUT);
+ timeout_add(&upcalls_timeout, EXPIRE_TIMEOUT);
}
/*
@@ -1554,7 +1560,8 @@ tbf_control(vifp, m, ip, p_len)
} else {
/* queue packet and timeout till later */
tbf_queue(vifp, m, ip);
- timeout(tbf_reprocess_q, vifp, 1);
+ timeout_set(&tbf_timeout, tbf_reprocess_q, vifp);
+ timeout_add(&tbf_timeout, 1);
}
} else {
if (vifp->v_tbf.q_len >= MAXQSIZE &&
@@ -1665,7 +1672,7 @@ tbf_reprocess_q(arg)
tbf_process_q(vifp);
if (vifp->v_tbf.q_len)
- timeout(tbf_reprocess_q, vifp, 1);
+ timeout_add(&tbf_timeout, 1);
}
/* function that will selectively discard a member of the queue
diff --git a/sys/netiso/esis.c b/sys/netiso/esis.c
index 6cf5d0a0409..21a10ff9015 100644
--- a/sys/netiso/esis.c
+++ b/sys/netiso/esis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: esis.c,v 1.5 2001/05/16 12:54:06 ho Exp $ */
+/* $OpenBSD: esis.c,v 1.6 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: esis.c,v 1.14 1996/05/07 02:45:04 thorpej Exp $ */
/*-
@@ -74,6 +74,7 @@ SOFTWARE.
#include <sys/socketvar.h>
#include <sys/errno.h>
#include <sys/kernel.h>
+#include <sys/timeout.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -109,6 +110,9 @@ extern int iso_systype;
struct sockaddr_dl esis_dl = {sizeof(esis_dl), AF_LINK};
extern char all_es_snpa[], all_is_snpa[];
+struct timeout snpac_timeout;
+struct timeout esis_timeout;
+
#define EXTEND_PACKET(m, mhdr, cp)\
if (((m)->m_next = m_getclr(M_DONTWAIT, MT_HEADER)) == NULL) {\
esis_stat.es_nomem++;\
@@ -137,8 +141,10 @@ esis_init()
LIST_INIT(&esis_pcb);
- timeout(snpac_age, (caddr_t) 0, hz);
- timeout(esis_config, (caddr_t) 0, hz);
+ timeout_set(&snpac_timeout, snpac_age, NULL);
+ timeout_set(&esis_timeout, esis_config, NULL);
+ timeout_add(&snpac_timeout, hz);
+ timeout_add(&esis_timeout, hz);
clnl_protox[ISO9542_ESIS].clnl_input = esis_input;
clnl_protox[ISO10589_ISIS].clnl_input = isis_input;
@@ -651,7 +657,7 @@ esis_ishinput(m, shp)
goto bad;
CTOH(buf[2], buf[3], newct);
if ((u_short) esis_config_time != newct) {
- untimeout(esis_config, 0);
+ timeout_del(&esis_timeout);
esis_config_time = newct;
esis_config(NULL);
}
@@ -795,7 +801,7 @@ esis_config(v)
{
register struct ifnet *ifp;
- timeout(esis_config, (caddr_t) 0, hz * esis_config_time);
+ timeout_add(&esis_timeout, hz * esis_config_time);
/*
* Report configuration for each interface that - is UP - has
diff --git a/sys/netiso/iso_snpac.c b/sys/netiso/iso_snpac.c
index ce97a40a6bd..083066ff3bd 100644
--- a/sys/netiso/iso_snpac.c
+++ b/sys/netiso/iso_snpac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iso_snpac.c,v 1.6 2001/01/19 06:37:38 itojun Exp $ */
+/* $OpenBSD: iso_snpac.c,v 1.7 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: iso_snpac.c,v 1.13 1996/05/07 02:45:16 thorpej Exp $ */
/*-
@@ -75,6 +75,7 @@ SOFTWARE.
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/syslog.h>
+#include <sys/timeout.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -523,6 +524,7 @@ snpac_ioctl(so, cmd, data)
caddr_t data; /* data for the cmd */
{
register struct systype_req *rq = (struct systype_req *) data;
+ extern struct timeout esis_timeout;
#ifdef ARGO_DEBUG
if (argo_debug[D_IOCTL]) {
@@ -549,7 +551,7 @@ snpac_ioctl(so, cmd, data)
esis_holding_time = rq->sr_holdt;
esis_config_time = rq->sr_configt;
if (esis_esconfig_time != rq->sr_esconfigt) {
- untimeout(esis_config, (caddr_t) 0);
+ timeout_del(&esis_timeout);
esis_esconfig_time = rq->sr_esconfigt;
esis_config(NULL);
}
@@ -628,7 +630,8 @@ snpac_age(v)
register struct llinfo_llc *lc, *nlc;
register struct rtentry *rt;
- timeout(snpac_age, (caddr_t) 0, SNPAC_AGE * hz);
+ extern struct timeout snpac_timeout;
+ timeout_add(&snpac_timeout, SNPAC_AGE * hz);
for (lc = llinfo_llc.lh_first; lc != 0; lc = nlc) {
nlc = lc->lc_list.le_next;
diff --git a/sys/netiso/tuba_table.c b/sys/netiso/tuba_table.c
index c52f19956f3..0bf518cb28a 100644
--- a/sys/netiso/tuba_table.c
+++ b/sys/netiso/tuba_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tuba_table.c,v 1.3 1996/03/04 10:36:50 mickey Exp $ */
+/* $OpenBSD: tuba_table.c,v 1.4 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: tuba_table.c,v 1.6 1996/02/13 22:12:34 christos Exp $ */
/*
@@ -46,6 +46,7 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/kernel.h>
+#include <sys/timeout.h>
#include <net/if.h>
#include <net/radix.h>
@@ -57,6 +58,7 @@ int tuba_table_size;
struct tuba_cache **tuba_table;
struct radix_node_head *tuba_tree;
extern int arpt_keep, arpt_prune; /* use same values as arp cache */
+struct timeout tuba_timeout;
void
tuba_timer(v)
@@ -67,7 +69,7 @@ tuba_timer(v)
register struct tuba_cache *tc;
long timelimit = time.tv_sec - arpt_keep;
- timeout(tuba_timer, (caddr_t) 0, arpt_prune * hz);
+ timeout_add(&tuba_timeout, arpt_prune * hz);
for (i = tuba_table_size; i > 0; i--)
if ((tc = tuba_table[i]) && (tc->tc_refcnt == 0) &&
(tc->tc_time < timelimit)) {
@@ -82,7 +84,8 @@ void
tuba_table_init()
{
rn_inithead((void **) &tuba_tree, 40);
- timeout(tuba_timer, (caddr_t) 0, arpt_prune * hz);
+ timeout_set(&tuba_timeout, tuba_timer, NULL);
+ timeout_add(&tuba_timeout, arpt_prune * hz);
}
int
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index b83822f1375..14a0195467d 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.29 2001/06/22 14:35:42 deraadt Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.30 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -555,11 +555,7 @@ sc_err1(xs, async)
else if ((xs->flags & SCSI_NOSLEEP) == 0) {
tsleep(&lbolt, PRIBIO, "scbusy", 0);
} else
-#if 0
- timeout(scsi_requeue, xs, hz);
-#else
goto lose;
-#endif
}
case XS_TIMEOUT:
retry:
diff --git a/sys/ufs/lfs/lfs_bio.c b/sys/ufs/lfs/lfs_bio.c
index f95957927cb..6b18e8b1a03 100644
--- a/sys/ufs/lfs/lfs_bio.c
+++ b/sys/ufs/lfs/lfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lfs_bio.c,v 1.6 2001/02/23 14:52:52 csapuntz Exp $ */
+/* $OpenBSD: lfs_bio.c,v 1.7 2001/08/19 15:07:34 miod Exp $ */
/* $NetBSD: lfs_bio.c,v 1.5 1996/02/09 22:28:49 christos Exp $ */
/*
@@ -44,6 +44,7 @@
#include <sys/resourcevar.h>
#include <sys/mount.h>
#include <sys/kernel.h>
+#include <sys/timeout.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
@@ -72,6 +73,8 @@ int lfs_writing; /* Set if already kicked off a writer
#define WRITE_THRESHHOLD ((nbuf >> 1) - 10)
#define LFS_BUFWAIT 2
+struct timeout wakeup_timeout;
+
int
lfs_bwrite(v)
void *v;
@@ -124,10 +127,11 @@ lfs_bwrite(v)
bp->b_synctime = time.tv_sec + 30;
s = splbio();
if (bdirties.tqh_first == bp) {
- untimeout((void (*)__P((void *)))wakeup,
- &bdirties);
- timeout((void (*)__P((void *)))wakeup,
- &bdirties, 30 * hz);
+ if (timeout_triggered(&wakeup_timeout))
+ timeout_del(&wakeup_timeout);
+ if (!timeout_intialized(&wakeup_timeout))
+ timeout_set(&wakeup_timeout, wakeup, &bdirties);
+ timeout_add(&wakeup_timeout, 30 * hz);
}
bp->b_flags &= ~(B_READ | B_ERROR);
buf_dirty(bp);