Use callout mechanism instead of timeout()/untimeout().

MFC after:	1 week
This commit is contained in:
ume 2006-12-05 18:54:21 +00:00
parent 43eb9a52dd
commit 4146b6c5f4
3 changed files with 4 additions and 3 deletions

View File

@ -220,6 +220,7 @@ ppp_clone_create(struct if_clone *ifc, int unit, caddr_t params)
return (ENOSPC);
}
callout_init(&sc->sc_timo_ch, 0);
ifp->if_softc = sc;
if_initname(ifp, ifc->ifc_name, unit);
ifp->if_mtu = PPP_MTU;

View File

@ -57,7 +57,7 @@
struct ppp_softc {
struct ifnet *sc_ifp; /* network-visible interface */
/*hi*/ u_int sc_flags; /* control/status bits; see if_ppp.h */
struct callout_handle sc_ch; /* Used for scheduling timeouts */
struct callout sc_timo_ch; /* Used for scheduling timeouts */
void *sc_devp; /* pointer to device-dep structure */
void (*sc_start)(struct ppp_softc *); /* start output proc */
void (*sc_ctlp)(struct ppp_softc *); /* rcvd control pkt */

View File

@ -277,7 +277,7 @@ pppasyncrelinq(sc)
sc->sc_m = NULL;
}
if (sc->sc_flags & SC_TIMEOUT) {
untimeout(ppp_timeout, (void *) sc, sc->sc_ch);
callout_stop(&sc->sc_timo_ch);
sc->sc_flags &= ~SC_TIMEOUT;
}
splx(s);
@ -698,7 +698,7 @@ pppasyncstart(sc)
* drained the t_outq.
*/
if (!idle && (sc->sc_flags & SC_TIMEOUT) == 0) {
sc->sc_ch = timeout(ppp_timeout, (void *) sc, 1);
callout_reset(&sc->sc_timo_ch, 1, ppp_timeout, sc);
sc->sc_flags |= SC_TIMEOUT;
}