diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-06-30 01:05:20 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-06-30 01:05:20 +0000 |
commit | 9f4ec21dbc20e504e07b8f7d1315b6561c284d98 (patch) | |
tree | b93968478dcd3b22bd671540da75e15f8a2b7f5c /sys | |
parent | f0a1c73c54dab14ed95af7efc7f7a1ad395ef175 (diff) |
Convert to use new timeout API.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pcmcia/if_wi.c | 13 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_wireg.h | 3 | ||||
-rw-r--r-- | sys/net/if_pppvar.h | 3 | ||||
-rw-r--r-- | sys/net/ppp_tty.c | 7 |
4 files changed, 14 insertions, 12 deletions
diff --git a/sys/dev/pcmcia/if_wi.c b/sys/dev/pcmcia/if_wi.c index 8607786ee47..b0fc4f31877 100644 --- a/sys/dev/pcmcia/if_wi.c +++ b/sys/dev/pcmcia/if_wi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi.c,v 1.14 2000/06/20 07:24:36 todd Exp $ */ +/* $OpenBSD: if_wi.c,v 1.15 2000/06/30 01:04:28 art Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -108,8 +108,6 @@ #include <dev/pcmcia/if_wireg.h> #include <dev/pcmcia/if_wavelan_ieee.h> -#define TIMEOUT(handle,func,arg,time) timeout((func), (arg), (time)) -#define UNTIMEOUT(func,arg,handle) untimeout((func), (arg)) #define BPF_MTAP(if,mbuf) bpf_mtap((if)->if_bpf, (mbuf)) #define BPFATTACH(if_bpf,if,dlt,sz) bpfattach((if_bpf), (if), (dlt), (sz)) #define STATIC @@ -135,7 +133,7 @@ u_int32_t widebug = WIDEBUG; #if !defined(lint) && !defined(__OpenBSD__) static const char rcsid[] = - "$OpenBSD: if_wi.c,v 1.14 2000/06/20 07:24:36 todd Exp $"; + "$OpenBSD: if_wi.c,v 1.15 2000/06/30 01:04:28 art Exp $"; #endif /* lint */ #ifdef foo @@ -598,7 +596,7 @@ wi_inquire(xsc) sc = xsc; ifp = &sc->arpcom.ac_if; - TIMEOUT(sc->wi_stat_ch, wi_inquire, sc, hz * 60); + timeout_add(&sc->sc_timo, hz * 60); /* Don't do this while we're transmitting */ if (ifp->if_flags & IFF_OACTIVE) @@ -1277,7 +1275,8 @@ wi_init(xsc) ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; - TIMEOUT(sc->wi_stat_ch, wi_inquire, sc, hz * 60); + timeout_set(&sc->sc_timo, wi_inquire, sc); + timeout_add(&sc->sc_timo, hz * 60); return; } @@ -1431,7 +1430,7 @@ wi_stop(sc) CSR_WRITE_2(sc, WI_INT_EN, 0); wi_cmd(sc, WI_CMD_DISABLE|sc->wi_portnum, 0); - UNTIMEOUT(wi_inquire, sc, sc->wi_stat_ch); + timeout_del(&sc->sc_timo); ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); diff --git a/sys/dev/pcmcia/if_wireg.h b/sys/dev/pcmcia/if_wireg.h index 34759fd2a9c..46447988d60 100644 --- a/sys/dev/pcmcia/if_wireg.h +++ b/sys/dev/pcmcia/if_wireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wireg.h,v 1.5 2000/02/03 00:56:45 angelos Exp $ */ +/* $OpenBSD: if_wireg.h,v 1.6 2000/06/30 01:04:28 art Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -114,6 +114,7 @@ struct wi_softc { struct pcmcia_io_handle sc_pcioh; int sc_io_window; struct pcmcia_function *sc_pf; + struct timeout sc_timo; }; #define WI_TIMEOUT 65536 diff --git a/sys/net/if_pppvar.h b/sys/net/if_pppvar.h index 69fb536960c..6372adb38de 100644 --- a/sys/net/if_pppvar.h +++ b/sys/net/if_pppvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppvar.h,v 1.7 1998/05/08 05:02:08 millert Exp $ */ +/* $OpenBSD: if_pppvar.h,v 1.8 2000/06/30 01:05:19 art Exp $ */ /* $NetBSD: if_pppvar.h,v 1.5 1997/01/03 07:23:29 mikel Exp $ */ /* * if_pppvar.h - private structures and declarations for PPP. @@ -57,6 +57,7 @@ */ struct ppp_softc { struct ifnet sc_if; /* network-visible interface */ + struct timeout sc_timo; /* timeout control (for ptys) */ int sc_unit; /* XXX unit number */ u_int sc_flags; /* control/status bits; see if_ppp.h */ void *sc_devp; /* pointer to device-dep structure */ diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index 2e19891e0f6..73b49d61f00 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppp_tty.c,v 1.8 1999/07/04 20:39:28 deraadt Exp $ */ +/* $OpenBSD: ppp_tty.c,v 1.9 2000/06/30 01:05:19 art Exp $ */ /* $NetBSD: ppp_tty.c,v 1.12 1997/03/24 21:23:10 christos Exp $ */ /* @@ -192,6 +192,7 @@ pppopen(dev, tp) if (sc->sc_relinq) (*sc->sc_relinq)(sc); /* get previous owner to relinquish the unit */ + timeout_set(&sc->sc_timo, ppp_timeout, sc); sc->sc_ilen = 0; sc->sc_m = NULL; bzero(sc->sc_asyncmap, sizeof(sc->sc_asyncmap)); @@ -262,7 +263,7 @@ pppasyncrelinq(sc) sc->sc_m = NULL; } if (sc->sc_flags & SC_TIMEOUT) { - untimeout(ppp_timeout, (void *) sc); + timeout_del(&sc->sc_timo); sc->sc_flags &= ~SC_TIMEOUT; } splx(s); @@ -670,7 +671,7 @@ pppasyncstart(sc) * drained the t_outq. */ if (!idle && (sc->sc_flags & SC_TIMEOUT) == 0) { - timeout(ppp_timeout, (void *) sc, 1); + timeout_add(&sc->sc_timo, 1); sc->sc_flags |= SC_TIMEOUT; } |