timeout/untimeout ==> callout_*
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 16 Sep 2004 04:39:31 +0000 (04:39 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 16 Sep 2004 04:39:31 +0000 (04:39 +0000)
29 files changed:
sys/net/i4b/driver/i4b_ing.c
sys/net/i4b/driver/i4b_ipr.c
sys/net/i4b/driver/i4b_isppp.c
sys/net/i4b/driver/i4b_rbch.c
sys/net/i4b/include/i386/i4b_isppp.h
sys/net/i4b/include/i4b_l3l4.h
sys/net/i4b/layer1/ifpi/i4b_ifpi_l1fsm.c
sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c
sys/net/i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c
sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c
sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c
sys/net/i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c
sys/net/i4b/layer1/ihfc/i4b_ihfc.h
sys/net/i4b/layer1/isic/i4b_isic.c
sys/net/i4b/layer1/isic/i4b_isic.h
sys/net/i4b/layer1/isic/i4b_l1fsm.c
sys/net/i4b/layer1/itjc/i4b_itjc_l1fsm.c
sys/net/i4b/layer1/itjc/i4b_itjc_pci.c
sys/net/i4b/layer2/i4b_iframe.c
sys/net/i4b/layer2/i4b_l2.c
sys/net/i4b/layer2/i4b_l2.h
sys/net/i4b/layer2/i4b_l2timer.c
sys/net/i4b/layer3/i4b_l3timer.c
sys/net/i4b/layer4/i4b_l4.c
sys/net/i4b/layer4/i4b_l4mgmt.c
sys/net/i4b/layer4/i4b_l4timer.c
sys/net/ppp/if_ppp.c
sys/net/ppp/if_pppvar.h
sys/net/ppp_layer/ppp_tty.c

index d5bbff6..6f24a7a 100644 (file)
@@ -28,7 +28,7 @@
  *     -------------------------------------------------
  *
  * $FreeBSD: src/sys/i4b/driver/i4b_ing.c,v 1.10.2.4 2002/07/02 23:44:02 archie Exp $
- * $DragonFly: src/sys/net/i4b/driver/i4b_ing.c,v 1.5 2004/04/22 04:21:59 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/driver/i4b_ing.c,v 1.6 2004/09/16 04:36:30 dillon Exp $
  *
  *     last edit-date: [Tue Jan  1 10:43:58 2002]
  *
@@ -85,7 +85,7 @@ struct ing_softc {
        int             sc_lastdialresp;/* last dialresponse            */
        
 #if I4BINGACCT
-       struct callout_handle sc_callout;
+       struct callout  sc_timeout;
        int             sc_iinb;        /* isdn driver # of inbytes     */
        int             sc_ioutb;       /* isdn driver # of outbytes    */
        int             sc_inb;         /* # of bytes rx'd              */
@@ -250,7 +250,7 @@ i4bingattach(void *dummy)
                sc->sc_fastq.ifq_maxlen = I4BINGMAXQLEN;
                
 #if I4BINGACCT
-               callout_handle_init(&sc->sc_callout);
+               callout_init(&sc->sc_timeout);
                sc->sc_iinb = 0;
                sc->sc_ioutb = 0;
                sc->sc_inb = 0;
@@ -327,8 +327,8 @@ ing_timeout(struct ing_softc *sc)
                         sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_ioutb, sc->sc_iinb);
        }
 
-       sc->sc_callout = timeout((TIMEOUT_FUNC_T)ing_timeout,
-                                       (void *)sc, I4BINGACCTINTVL*hz);
+       callout_reset(&sc->sc_timeout, I4BINGACCTINTVL * hz,
+                       (TIMEOUT_FUNC_T)ing_timeout, sc);
 }
 #endif /* I4BINGACCT */
 
@@ -385,8 +385,8 @@ ing_connect(int unit, void *cdp)
        sc->sc_outb = 0;
        sc->sc_linb = 0;
        sc->sc_loutb = 0;
-       sc->sc_callout = timeout((TIMEOUT_FUNC_T)ing_timeout,
-                               (void *)sc, I4BINGACCTINTVL*hz);
+       callout_reset(&sc->sc_timeout, I4BINGACCTINTVL * hz,
+                       (TIMEOUT_FUNC_T)ing_timeout, sc);
 #endif
 
        sc->sc_state = ST_CONNECTED;
@@ -413,8 +413,7 @@ ing_disconnect(int unit, void *cdp)
        }
 
 #if I4BINGACCT
-       untimeout((TIMEOUT_FUNC_T)ing_timeout,
-               (void *)sc, sc->sc_callout);
+       callout_stop(&sc->sc_timeout);
 #endif
 
        i4b_l4_accounting(BDRV_ING, cd->driver_unit, ACCT_FINAL,
index 6d32a53..c04cf18 100644 (file)
@@ -28,7 +28,7 @@
  *     ---------------------------------------------------------
  *
  * $FreeBSD: src/sys/i4b/driver/i4b_ipr.c,v 1.8.2.3 2001/10/27 15:48:17 hm Exp $
- * $DragonFly: src/sys/net/i4b/driver/i4b_ipr.c,v 1.11 2004/04/01 07:27:17 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/driver/i4b_ipr.c,v 1.12 2004/09/16 04:36:30 dillon Exp $
  *
  *     last edit-date: [Fri Oct 26 19:32:38 2001]
  *
@@ -196,12 +196,7 @@ struct ipr_softc {
        int             sc_fn;          /* flag, first null acct        */
 #endif 
 
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
-       struct callout  sc_callout;
-#endif
-#if defined(__DragonFly__) || defined(__FreeBSD__)
-       struct callout_handle   sc_callout;
-#endif
+       struct callout  sc_timeout;
 
 #ifdef I4BIPRADJFRXP
        int             sc_first_pkt;   /* flag, first rxd packet       */
@@ -309,9 +304,7 @@ i4biprattach()
                sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_SIMPLEX;
 #endif
 
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
-               callout_init(&sc->sc_callout);
-#endif
+               callout_init(&sc->sc_timeout);
 
                sc->sc_if.if_mtu = I4BIPRMTU;
                sc->sc_if.if_type = IFT_ISDNBASIC;
@@ -801,7 +794,8 @@ ipr_connect(int unit, void *cdp)
                        delay /= 100;
                }
 
-               START_TIMER(sc->sc_callout, (TIMEOUT_FUNC_T)i4bipr_connect_startio, (void *)sc,  delay);
+               callout_reset(&sc->sc_timeout, delay,
+                               (TIMEOUT_FUNC_T)i4bipr_connect_startio, sc);
        }
        else
        {
index c69d430..139b819 100644 (file)
@@ -37,7 +37,7 @@
  *     $Id: i4b_isppp.c,v 1.44 2000/08/31 07:07:26 hm Exp $
  *
  * $FreeBSD: src/sys/i4b/driver/i4b_isppp.c,v 1.7.2.3 2003/02/06 14:50:53 gj Exp $
- * $DragonFly: src/sys/net/i4b/driver/i4b_isppp.c,v 1.9 2004/04/01 07:27:17 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/driver/i4b_isppp.c,v 1.10 2004/09/16 04:36:30 dillon Exp $
  *
  *     last edit-date: [Thu Aug 31 09:02:27 2000]
  *
 #endif
                
 # if defined(__DragonFly__) || __FreeBSD_version >= 300001
-#  define CALLOUT_INIT(chan)           callout_handle_init(chan)
-#  define TIMEOUT(fun, arg, chan, tick)        chan = timeout(fun, arg, tick)
-#  define UNTIMEOUT(fun, arg, chan)    untimeout(fun, arg, chan)
 #  define IOCTL_CMD_T u_long
 # else
-#  define CALLOUT_INIT(chan)           do {} while(0)
-#  define TIMEOUT(fun, arg, chan, tick)        timeout(fun, arg, tick)
-#  define UNTIMEOUT(fun, arg, chan)    untimeout(fun, arg)
 #  define IOCTL_CMD_T int
 # endif
 
@@ -172,7 +166,7 @@ struct i4bisppp_softc {
 #endif
 
 #if defined(__DragonFly__) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300001)
-       struct callout_handle sc_ch;
+       struct callout  sc_timeout;
 #endif
 
 } i4bisppp_softc[NI4BISPPP];
@@ -308,7 +302,7 @@ i4bispppattach()
 /* XXX: validate / add proper code */
                ether_ifattach_bpf(&sc->sc_if, ((struct arpcom*)sc)->ac_enaddr,
                                   DLT_PPP, PPP_HDRLEN);
-               CALLOUT_INIT(&sc->sc_ch);
+               callout_init(&sc->sc_timeout);
        }
 }
 
@@ -337,7 +331,7 @@ i4bisppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data,
 #if 0 /* never used ??? */
                x = splimp();
                if ((ifp->if_flags & IFF_UP) == 0)
-                       UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
+                       callout_stop(&sc->sc_timeout);
                splx(x);
 #endif
                break;
@@ -498,7 +492,7 @@ i4bisppp_tlf(struct sppp *sp)
                return;
 
 #if 0 /* never used ??? */
-       UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
+       callout_stop(&sc->sc_timeout);
 #endif
 
        i4b_l4_drvrdisc(BDRV_ISPPP, IFP2UNIT(ifp));
@@ -555,7 +549,7 @@ i4bisppp_connect(int unit, void *cdp)
 #endif
        
 #if 0 /* never used ??? */
-       UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
+       callout_stop(&sc->sc_timeout);
 #endif
 
        sp->pp_up(sp);          /* tell PPP we are ready */
@@ -595,7 +589,7 @@ i4bisppp_disconnect(int unit, void *cdp)
        if (sc->sc_state == ST_CONNECTED)
        {
 #if 0 /* never used ??? */
-               UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
+               callout_stop(&sc->sc_timeout);
 #endif
                sc->sc_cdp = (call_desc_t *)0;  
                /* do this here because pp_down calls i4bisppp_tlf */
index 0e4e2e9..bf1c182 100644 (file)
@@ -28,7 +28,7 @@
  *     ---------------------------------------------------
  *
  * $FreeBSD: src/sys/i4b/driver/i4b_rbch.c,v 1.10.2.3 2001/08/12 16:22:48 hm Exp $
- * $DragonFly: src/sys/net/i4b/driver/i4b_rbch.c,v 1.11 2004/05/19 22:52:59 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/driver/i4b_rbch.c,v 1.12 2004/09/16 04:36:30 dillon Exp $
  *
  *     last edit-date: [Sat Aug 11 18:06:57 2001]
  *
@@ -131,12 +131,7 @@ static struct rbch_softc {
        struct selinfo selp;            /* select / poll        */
 
 #if I4BRBCHACCT
-#if defined(__DragonFly__) || defined(__FreeBSD__)
-       struct callout_handle sc_callout;
-#endif 
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
-       struct callout  sc_callout;
-#endif
+       struct callout  sc_timeout;
 
        int             sc_iinb;        /* isdn driver # of inbytes     */
        int             sc_ioutb;       /* isdn driver # of outbytes    */
@@ -282,12 +277,7 @@ i4brbchattach()
 #endif
 
 #if I4BRBCHACCT
-#if defined(__DragonFly__) || defined(__FreeBSD__)
-               callout_handle_init(&rbch_softc[i].sc_callout);
-#endif
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
-               callout_init(&rbch_softc[i].sc_callout);
-#endif
+               callout_init(&rbch_softc[i].sc_timeout);
                rbch_softc[i].sc_fn = 1;
 #endif
                rbch_softc[i].sc_unit = i;
@@ -819,7 +809,8 @@ rbch_timeout(struct rbch_softc *sc)
                i4b_l4_accounting(BDRV_RBCH, unit, ACCT_DURING,
                         sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_ioutb, sc->sc_iinb);
        }
-       START_TIMER(sc->sc_callout, rbch_timeout, sc, I4BRBCHACCTINTVL*hz);
+       callout_reset(&sc->sc_timeout, I4BRBCHACCTINTVL * hz,
+                       (void *)rbch_timeout, sc);
 }
 #endif /* I4BRBCHACCT */
 
@@ -846,7 +837,8 @@ rbch_connect(int unit, void *cdp)
                sc->sc_linb = 0;
                sc->sc_loutb = 0;
 
-               START_TIMER(sc->sc_callout, rbch_timeout, sc, I4BRBCHACCTINTVL*hz);
+               callout_reset(&sc->sc_timeout, I4BRBCHACCTINTVL * hz,
+                               (void *)rbch_timeout, sc);
        }
 #endif         
        if(!(sc->sc_devstate & ST_CONNECTED))
@@ -887,8 +879,7 @@ rbch_disconnect(int unit, void *cdp)
 #if I4BRBCHACCT
        i4b_l4_accounting(BDRV_RBCH, unit, ACCT_FINAL,
                 sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_ioutb, sc->sc_iinb);
-
-       STOP_TIMER(sc->sc_callout, rbch_timeout, sc);
+       callout_stop(&sc->sc_timeout);
 #endif         
        CRIT_END;
 }
index 1794348..9774466 100644 (file)
@@ -21,7 +21,7 @@
  * $Id: i4b_isppp.h,v 1.5 2000/07/18 15:05:37 hm Exp $
  *
  * $FreeBSD: src/sys/i386/include/i4b_isppp.h,v 1.1.2.2 2001/09/28 07:43:19 gj Exp $
- * $DragonFly: src/sys/net/i4b/include/i386/i4b_isppp.h,v 1.3 2004/02/13 17:45:49 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/include/i386/i4b_isppp.h,v 1.4 2004/09/16 04:36:32 dillon Exp $
  */
 
 #ifndef _I4B_ISPPP_H_
@@ -125,8 +125,8 @@ struct sppp {
        int     rst_counter[IDX_COUNT]; /* restart counter */
        int     fail_counter[IDX_COUNT]; /* negotiation failure counter */
 #if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD__ >= 3)
-       struct callout_handle ch[IDX_COUNT]; /* per-proto and if callouts */
-       struct callout_handle pap_my_to_ch; /* PAP needs one more... */
+       struct callout timeout[IDX_COUNT]; /* per-proto and if callouts */
+       struct callout pap_my_to; /* PAP needs one more... */
 #endif
        struct slcp lcp;                /* LCP params */
        struct sipcp ipcp;              /* IPCP params */
index e5021f5..88efab0 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id: i4b_l3l4.h,v 1.32 2000/08/24 11:48:57 hm Exp $
  *
  * $FreeBSD: src/sys/i4b/include/i4b_l3l4.h,v 1.6.2.2 2001/12/16 15:12:57 hm Exp $
- * $DragonFly: src/sys/net/i4b/include/i4b_l3l4.h,v 1.3 2004/02/13 17:45:49 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/include/i4b_l3l4.h,v 1.4 2004/09/16 04:36:32 dillon Exp $
  *
  *     last edit-date: [Fri Jun  2 14:29:35 2000]
  *
@@ -192,29 +192,15 @@ typedef struct
 
        int     timeout_active;         /* idle timeout() active flag   */
 
-#if defined(__DragonFly__) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || \
-       (!defined(__FreeBSD_version) && defined(__FreeBSD__) && __FreeBSD__ >= 3)
-       struct  callout_handle  idle_timeout_handle;
-       struct  callout_handle  T303_callout;
-       struct  callout_handle  T305_callout;
-       struct  callout_handle  T308_callout;
-       struct  callout_handle  T309_callout;
-       struct  callout_handle  T310_callout;
-       struct  callout_handle  T313_callout;
-       struct  callout_handle  T400_callout;
+       struct  callout idle_timeout;
+       struct  callout T303_timeout;
+       struct  callout T305_timeout;
+       struct  callout T308_timeout;
+       struct  callout T309_timeout;
+       struct  callout T310_timeout;
+       struct  callout T313_timeout;
+       struct  callout T400_timeout;
        int     callouts_inited;                /* must init before use */
-#endif
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
-       struct  callout idle_timeout_handle;
-       struct  callout T303_callout;
-       struct  callout T305_callout;
-       struct  callout T308_callout;
-       struct  callout T309_callout;
-       struct  callout T310_callout;
-       struct  callout T313_callout;
-       struct  callout T400_callout;
-       int     callouts_inited;                /* must init before use */
-#endif
 
        int     idletime_state;         /* wait for idle_time begin     */
 #define IST_IDLE       0       /* shorthold mode disabled      */
index ac84e4a..14cc775 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id: i4b_ifpi_l1fsm.c,v 1.4 2000/05/29 15:41:41 hm Exp $ 
  *
  * $FreeBSD: src/sys/i4b/layer1/ifpi/i4b_ifpi_l1fsm.c,v 1.4.2.1 2001/08/10 14:08:37 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/ifpi/i4b_ifpi_l1fsm.c,v 1.4 2003/08/07 21:54:31 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/ifpi/i4b_ifpi_l1fsm.c,v 1.5 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Mon May 29 15:23:15 2000]
  *
@@ -163,7 +163,8 @@ T3_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", ifpi_printstate(sc));
        sc->sc_I430T3 = 1;
-       sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
+       callout_reset(&sc->sc_T3_timeout, 2 * hz,
+                       (TIMEOUT_FUNC_T)timer3_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -179,7 +180,7 @@ T3_stop(struct l1_softc *sc)
        if(sc->sc_I430T3)
        {
                sc->sc_I430T3 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
+               callout_stop(&sc->sc_T3_timeout);
        }
 }
 
@@ -220,7 +221,8 @@ T4_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", ifpi_printstate(sc));
        sc->sc_I430T4 = 1;
-       sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
+       callout_reset(&sc->sc_T4_timeout, hz,
+                       (TIMEOUT_FUNC_T)timer4_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -234,7 +236,7 @@ T4_stop(struct l1_softc *sc)
        if(sc->sc_I430T4)
        {
                sc->sc_I430T4 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
+               callout_stop(&sc->sc_T4_timeout);
        }
 }
 
index 6e4947b..59916d8 100644 (file)
@@ -36,7 +36,7 @@
  *     $Id: i4b_ifpi_pci.c,v 1.4 2000/06/02 11:58:56 hm Exp $
  *
  * $FreeBSD: src/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c,v 1.6.2.1 2001/08/10 14:08:37 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c,v 1.7 2004/05/04 12:03:49 hmp Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c,v 1.8 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Fri Jan 12 17:01:26 2001]
  *
@@ -687,10 +687,8 @@ avma1pp_attach_avma1pp(device_t dev)
        sc->sc_obuf2 = NULL;
        sc->sc_freeflag2 = 0;
 
-#if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD__ >=3)
-       callout_handle_init(&sc->sc_T3_callout);
-       callout_handle_init(&sc->sc_T4_callout);        
-#endif
+       callout_init(&sc->sc_T3_timeout);
+       callout_init(&sc->sc_T4_timeout);       
        
        /* init higher protocol layers */
        
index 9cce070..7fd2e15 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id$ 
  *
  * $FreeBSD: src/sys/i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c,v 1.1.2.1 2002/04/25 20:26:50 gj Exp $
- * $DragonFly: src/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c,v 1.3 2003/08/07 21:17:25 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c,v 1.4 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Mon May 29 15:23:15 2000]
  *
@@ -163,7 +163,8 @@ T3_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", ifpi2_printstate(sc));
        sc->sc_I430T3 = 1;
-       sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
+       callout_reset(&sc->sc_T3_timeout, 2 * hz,
+                       (TIMEOUT_FUNC_T)timer3_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -179,7 +180,7 @@ T3_stop(struct l1_softc *sc)
        if(sc->sc_I430T3)
        {
                sc->sc_I430T3 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
+               callout_stop(&sc->sc_T3_timeout);
        }
 }
 
@@ -220,7 +221,8 @@ T4_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", ifpi2_printstate(sc));
        sc->sc_I430T4 = 1;
-       sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
+       callout_reset(&sc->sc_T4_timeout, hz,
+                       (TIMEOUT_FUNC_T)timer4_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -234,7 +236,7 @@ T4_stop(struct l1_softc *sc)
        if(sc->sc_I430T4)
        {
                sc->sc_I430T4 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
+               callout_stop(&sc->sc_T4_timeout);
        }
 }
 
index a47221a..45bcf54 100644 (file)
@@ -36,7 +36,7 @@
  *     $Id$
  *
  * $FreeBSD: src/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c,v 1.6.2.2 2002/05/15 08:12:42 gj Exp $
- * $DragonFly: src/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c,v 1.6 2004/05/04 12:03:49 hmp Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c,v 1.7 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Fri Jan 12 17:01:26 2001]
  *
@@ -618,10 +618,8 @@ avma1pp2_attach_avma1pp(device_t dev)
        sc->sc_obuf2 = NULL;
        sc->sc_freeflag2 = 0;
 
-#if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD__ >=3)
-       callout_handle_init(&sc->sc_T3_callout);
-       callout_handle_init(&sc->sc_T4_callout);        
-#endif
+       callout_init(&sc->sc_T3_timeout);
+       callout_init(&sc->sc_T4_timeout);       
        
        /* init higher protocol layers */
        
index 06a0db1..e1e467c 100644 (file)
@@ -34,7 +34,7 @@
  *     ---------------------------------------------------
  *
  * $FreeBSD: src/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c,v 1.5.2.1 2001/08/10 14:08:37 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c,v 1.4 2003/08/07 21:17:26 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c,v 1.5 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Fri Jan 12 17:05:28 2001]
  *
@@ -612,8 +612,8 @@ avm_pnp_attach(device_t dev)
        sc->sc_obuf2 = NULL;
        sc->sc_freeflag2 = 0;
 
-       callout_handle_init(&sc->sc_T3_callout);
-       callout_handle_init(&sc->sc_T4_callout);        
+       callout_init(&sc->sc_T3_timeout);
+       callout_init(&sc->sc_T4_timeout);       
        
        /* init higher protocol layers */
        
index f5b30b5..2177685 100644 (file)
@@ -31,7 +31,7 @@
  *     $Ust: src/i4b/layer1-nb/ifpnp/i4b_ifpnp_l1fsm.c,v 1.4 2000/04/18 08:03:05 ust Exp $
  *
  * $FreeBSD: src/sys/i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c,v 1.4.2.1 2001/08/10 14:08:37 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c,v 1.3 2003/08/07 21:17:26 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c,v 1.4 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Mon May 29 15:25:04 2000]
  *
@@ -163,7 +163,8 @@ T3_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", ifpnp_printstate(sc));
        sc->sc_I430T3 = 1;
-       sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
+       callout_reset(&sc->sc_T3_timeout, 2 * hz,
+                       (TIMEOUT_FUNC_T)timer3_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -179,7 +180,7 @@ T3_stop(struct l1_softc *sc)
        if(sc->sc_I430T3)
        {
                sc->sc_I430T3 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
+               callout_stop(&sc->sc_T3_timeout);
        }
 }
 
@@ -220,7 +221,8 @@ T4_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", ifpnp_printstate(sc));
        sc->sc_I430T4 = 1;
-       sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
+       callout_reset(&sc->sc_T4_timeout, hz,
+                       (TIMEOUT_FUNC_T)timer4_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -234,7 +236,7 @@ T4_stop(struct l1_softc *sc)
        if(sc->sc_I430T4)
        {
                sc->sc_I430T4 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
+               callout_stop(&sc->sc_T4_timeout);
        }
 }
 
index 20e600e..c909ed4 100644 (file)
@@ -32,7 +32,7 @@
  *     $Id: i4b_ihfc.h,v 1.9 2000/09/19 13:50:36 hm Exp $
  *
  * $FreeBSD: src/sys/i4b/layer1/ihfc/i4b_ihfc.h,v 1.1.2.1 2001/08/10 14:08:37 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/ihfc/i4b_ihfc.h,v 1.3 2003/08/07 21:17:26 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/ihfc/i4b_ihfc.h,v 1.4 2004/09/16 04:36:32 dillon Exp $
  *
  *---------------------------------------------------------------------------*/
 
 
 #define        S_PHSTATE       sc->sc_statemachine.state
 #define        S_STM_T3        sc->sc_statemachine.T3
-#define        S_STM_T3CALLOUT sc->sc_statemachine.T3callout
+#define        S_STM_T3TIMEOUT sc->sc_statemachine.T3timeout
 
 /* unitnumbers */
 
@@ -303,7 +303,7 @@ struct sc_statemachine {
        u_char                  state;          /* see i4b_ihfc_drv.h */
        u_char                  usync;
        u_char                  T3;             /* T3 running         */
-       struct callout_handle   T3callout;
+       struct callout          T3timeout;
 };
 
 /*---------------------------------------------------------------------------*
index 8cdaf54..c3acd17 100644 (file)
@@ -28,7 +28,7 @@
  *     ==============================
  *
  * $FreeBSD: src/sys/i4b/layer1/isic/i4b_isic.c,v 1.4.2.1 2001/08/10 14:08:38 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_isic.c,v 1.4 2003/08/07 21:17:26 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_isic.c,v 1.5 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Wed Jan 24 09:29:42 2001]
  *
@@ -366,8 +366,8 @@ isic_attach_common(device_t dev)
 
        /* timer setup */
        
-       callout_handle_init(&sc->sc_T3_callout);
-       callout_handle_init(&sc->sc_T4_callout);        
+       callout_init(&sc->sc_T3_timeout);
+       callout_init(&sc->sc_T4_timeout);       
        
        /* init higher protocol layers */
        
index 4b95faf..5b6e4ef 100644 (file)
@@ -28,7 +28,7 @@
  *     ---------------------------------------
  *
  * $FreeBSD: src/sys/i4b/layer1/isic/i4b_isic.h,v 1.3.2.1 2001/08/10 14:08:38 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_isic.h,v 1.3 2003/08/07 21:17:26 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_isic.h,v 1.4 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Fri Jan 26 13:55:12 2001]
  *
@@ -185,11 +185,11 @@ struct l1_softc
 
        int             sc_I430T3;      /* I.430 Timer T3 running */    
 
-       struct callout_handle sc_T3_callout;
+       struct callout  sc_T3_timeout;
 
        int             sc_I430T4;      /* Timer T4 running */  
 
-       struct callout_handle sc_T4_callout;
+       struct callout  sc_T4_timeout;
 
        /*
         * byte fields for the AVM Fritz!Card PCI. These are packed into
index 7af1188..1c41b7b 100644 (file)
@@ -28,7 +28,7 @@
  *     --------------------------------------------------
  *
  * $FreeBSD: src/sys/i4b/layer1/isic/i4b_l1fsm.c,v 1.5.2.1 2001/08/10 14:08:38 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_l1fsm.c,v 1.3 2003/08/07 21:17:26 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_l1fsm.c,v 1.4 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Wed Jan 24 09:12:18 2001]
  *
@@ -158,7 +158,8 @@ T3_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", isic_printstate(sc));
        sc->sc_I430T3 = 1;
-       sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
+       callout_reset(&sc->sc_T3_timeout, 2 * hz,
+                       (TIMEOUT_FUNC_T)timer3_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -174,7 +175,7 @@ T3_stop(struct l1_softc *sc)
        if(sc->sc_I430T3)
        {
                sc->sc_I430T3 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
+               callout_stop(&sc->sc_T3_timeout);
        }
 }
 
@@ -215,7 +216,8 @@ T4_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", isic_printstate(sc));
        sc->sc_I430T4 = 1;
-       sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
+       callout_reset(&sc->sc_T4_timeout, hz,
+                       (TIMEOUT_FUNC_T)timer4_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -229,7 +231,7 @@ T4_stop(struct l1_softc *sc)
        if(sc->sc_I430T4)
        {
                sc->sc_I430T4 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
+               callout_stop(&sc->sc_T4_timeout);
        }
 }
 
index 5b09555..825f5c2 100644 (file)
@@ -28,7 +28,7 @@
  *     ------------------------------------------------------------
  *
  * $FreeBSD: src/sys/i4b/layer1/itjc/i4b_itjc_l1fsm.c,v 1.1.2.1 2001/08/10 14:08:39 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/itjc/i4b_itjc_l1fsm.c,v 1.3 2003/08/07 21:17:28 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/itjc/i4b_itjc_l1fsm.c,v 1.4 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Wed Jan 10 17:16:33 2001]
  *
@@ -168,7 +168,8 @@ T3_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", itjc_printstate(sc));
        sc->sc_I430T3 = 1;
-       sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
+       callout_reset(&sc->sc_T3_timeout, 2 * hz,
+                       (TIMEOUT_FUNC_T)timer3_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -184,7 +185,7 @@ T3_stop(struct l1_softc *sc)
        if(sc->sc_I430T3)
        {
                sc->sc_I430T3 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
+               callout_stop(&sc->sc_T3_timeout);
        }
 }
 
@@ -225,7 +226,8 @@ T4_start(struct l1_softc *sc)
 {
        NDBGL1(L1_T_MSG, "state = %s", itjc_printstate(sc));
        sc->sc_I430T4 = 1;
-       sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
+       callout_reset(&sc->sc_T4_timeout, hz,
+                       (TIMEOUT_FUNC_T)timer4_expired, (struct l1_softc *)sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -239,7 +241,7 @@ T4_stop(struct l1_softc *sc)
        if(sc->sc_I430T4)
        {
                sc->sc_I430T4 = 0;
-               untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
+               callout_stop(&sc->sc_T4_timeout);
        }
 }
 
index 76eac5b..d1bd788 100644 (file)
@@ -34,7 +34,7 @@
  *     ----------------------------------------
  *
  * $FreeBSD: src/sys/i4b/layer1/itjc/i4b_itjc_pci.c,v 1.1.2.1 2001/08/10 14:08:39 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c,v 1.6 2004/06/21 06:02:21 dillon Exp $
+ * $DragonFly: src/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c,v 1.7 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Thu Jan 11 11:29:38 2001]
  *
@@ -1721,10 +1721,8 @@ itjc_attach(device_t dev)
        sc->sc_obuf2 = NULL;
        sc->sc_freeflag2 = 0;
 
-#if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD__ >=3)
-       callout_handle_init(&sc->sc_T3_callout);
-       callout_handle_init(&sc->sc_T4_callout);        
-#endif
+       callout_init(&sc->sc_T3_timeout);
+       callout_init(&sc->sc_T4_timeout);       
        
        /* init higher protocol layers */
        
index c3c0f7e..55bca7d 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id: i4b_iframe.c,v 1.25 2000/08/24 11:48:57 hm Exp $ 
  *
  * $FreeBSD: src/sys/i4b/layer2/i4b_iframe.c,v 1.6.2.1 2001/08/10 14:08:41 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer2/i4b_iframe.c,v 1.4 2004/02/13 17:45:50 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/layer2/i4b_iframe.c,v 1.5 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Thu Aug 24 12:49:18 2000]
  *
@@ -236,7 +236,8 @@ i4b_i_frame_queued_up(l2_softc_t *l2sc)
                if(!(IF_QEMPTY(&l2sc->i_queue)))
                {
                        NDBGL2(L2_I_MSG, "re-scheduling IFQU call!");
-                       START_TIMER(l2sc->IFQU_callout, i4b_i_frame_queued_up, l2sc, IFQU_DLY);
+                       callout_reset(&l2sc->IFQU_timeout, IFQU_DLY,
+                                       (void *)i4b_i_frame_queued_up, l2sc);
                }
                CRIT_END;
                return;
index 1f6a4e1..852bc26 100644 (file)
@@ -28,7 +28,7 @@
  *     -------------------------------
  *
  * $FreeBSD: src/sys/i4b/layer2/i4b_l2.c,v 1.6.2.1 2001/08/10 14:08:41 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer2/i4b_l2.c,v 1.4 2004/02/13 17:45:50 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/layer2/i4b_l2.c,v 1.5 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Fri Jan 12 16:43:31 2001]
  *
@@ -284,20 +284,11 @@ i4b_mph_status_ind(int unit, int status, int parm)
                        bzero(&l2sc->stat, sizeof(lapdstat_t));                 
                        i4b_l2_unit_init(unit);
                        
-#if defined(__DragonFly__) || defined(__FreeBSD__)
                        /* initialize the callout handles for timeout routines */
-                       callout_handle_init(&l2sc->T200_callout);
-                       callout_handle_init(&l2sc->T202_callout);
-                       callout_handle_init(&l2sc->T203_callout);
-                       callout_handle_init(&l2sc->IFQU_callout);
-#endif
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
-                       /* initialize the callout handles for timeout routines */
-                       callout_init(&l2sc->T200_callout);
-                       callout_init(&l2sc->T202_callout);
-                       callout_init(&l2sc->T203_callout);
-                       callout_init(&l2sc->IFQU_callout);
-#endif
+                       callout_init(&l2sc->T200_timeout);
+                       callout_init(&l2sc->T202_timeout);
+                       callout_init(&l2sc->T203_timeout);
+                       callout_init(&l2sc->IFQU_timeout);
 
                        break;
 
index fd9932e..409ade2 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id: i4b_l2.h,v 1.23 2000/08/24 11:48:58 hm Exp $ 
  *
  * $FreeBSD: src/sys/i4b/layer2/i4b_l2.h,v 1.6.2.1 2001/08/10 14:08:41 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer2/i4b_l2.h,v 1.3 2004/02/13 17:45:50 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/layer2/i4b_l2.h,v 1.4 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Sat Mar 18 10:28:22 2000]
  *
@@ -64,18 +64,10 @@ typedef struct {
        void(*T202func)(void *);/* function to be called when T202 expires */
        int     T203;           /* max line idle time */
 
-#if defined(__DragonFly__) || defined(__FreeBSD__)
-       struct  callout_handle T200_callout;
-       struct  callout_handle T202_callout;
-       struct  callout_handle T203_callout;
-       struct  callout_handle IFQU_callout;    
-#endif
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
-       struct  callout T200_callout;
-       struct  callout T202_callout;
-       struct  callout T203_callout;
-       struct  callout IFQU_callout;   
-#endif
+       struct  callout T200_timeout;
+       struct  callout T202_timeout;
+       struct  callout T203_timeout;
+       struct  callout IFQU_timeout;   
 
 /*
  * i4b_iframe.c, i4b_i_frame_queued_up(): value of IFQU_DLY
index c08989f..c4aa8be 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id: i4b_l2timer.c,v 1.20 2000/08/24 11:48:58 hm Exp $ 
  *
  * $FreeBSD: src/sys/i4b/layer2/i4b_l2timer.c,v 1.6.2.1 2001/08/10 14:08:41 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer2/i4b_l2timer.c,v 1.4 2004/02/13 17:45:50 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/layer2/i4b_l2timer.c,v 1.5 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Thu Aug 24 12:48:52 2000]
  *
@@ -87,7 +87,8 @@ i4b_T200_start(l2_softc_t *l2sc)
        NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
        l2sc->T200 = TIMER_ACTIVE;
 
-       START_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc, T200DEF);
+       callout_reset(&l2sc->T200_timeout, T200DEF, 
+                       (void *)i4b_T200_timeout, l2sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -100,7 +101,7 @@ i4b_T200_stop(l2_softc_t *l2sc)
        CRIT_BEG;
        if(l2sc->T200 != TIMER_IDLE)
        {
-               STOP_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc);
+               callout_stop(&l2sc->T200_timeout);
                l2sc->T200 = TIMER_IDLE;
        }
        CRIT_END;
@@ -117,14 +118,15 @@ i4b_T200_restart(l2_softc_t *l2sc)
        CRIT_BEG;
        if(l2sc->T200 != TIMER_IDLE)
        {
-               STOP_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc);
+               callout_stop(&l2sc->T200_timeout);
        }
        else
        {
                l2sc->T200 = TIMER_ACTIVE;
        }
 
-       START_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc, T200DEF);
+       callout_reset(&l2sc->T200_timeout, T200DEF, 
+                       (void *)i4b_T200_timeout, l2sc);
        CRIT_END;
        NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
 }
@@ -156,7 +158,8 @@ i4b_T202_start(l2_softc_t *l2sc)
        l2sc->N202 = N202DEF;   
        l2sc->T202 = TIMER_ACTIVE;
 
-       START_TIMER(l2sc->T202_callout, i4b_T202_timeout, l2sc, T202DEF);
+       callout_reset(&l2sc->T202_timeout, T202DEF, 
+                       (void *)i4b_T202_timeout, l2sc);
 }
 
 /*---------------------------------------------------------------------------*
@@ -169,7 +172,7 @@ i4b_T202_stop(l2_softc_t *l2sc)
        CRIT_BEG;
        if(l2sc->T202 != TIMER_IDLE)
        {
-               STOP_TIMER(l2sc->T202_callout, i4b_T202_timeout, l2sc);
+               callout_stop(&l2sc->T202_timeout);
                l2sc->T202 = TIMER_IDLE;
        }
        CRIT_END;
@@ -201,7 +204,7 @@ i4b_T203_start(l2_softc_t *l2sc)
        NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
        l2sc->T203 = TIMER_ACTIVE;
 
-       START_TIMER(l2sc->T203_callout, i4b_T203_timeout, l2sc, T203DEF);
+       callout_reset(&l2sc->T203_timeout, T203DEF, i4b_T203_timeout, l2sc);
 #endif
 }
 
@@ -216,7 +219,7 @@ i4b_T203_stop(l2_softc_t *l2sc)
        CRIT_BEG;
        if(l2sc->T203 != TIMER_IDLE)
        {
-               STOP_TIMER(l2sc->T203_callout, i4b_T203_timeout, l2sc);
+               callout_stop(&l2sc->T203_timeout);
                l2sc->T203 = TIMER_IDLE;
        }
        CRIT_END;
@@ -236,14 +239,14 @@ i4b_T203_restart(l2_softc_t *l2sc)
 
        if(l2sc->T203 != TIMER_IDLE)
        {
-               STOP_TIMER(l2sc->T203_callout, i4b_T203_timerout, l2sc);
+               callout_stop(&l2sc->T203_timeout);
        }
        else
        {
                l2sc->T203 = TIMER_ACTIVE;
        }
 
-       START_TIMER(l2sc->T203_callout, i4b_T203_timerout, l2sc, T203DEF);      
+       callout_reset(&l2sc->T203_timeout, T203DEF, i4b_T203_timerout, l2sc);
        CRIT_END;
        NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
 #endif
index 0928095..8076bb2 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id: i4b_l3timer.c,v 1.17 2000/08/24 11:48:58 hm Exp $ 
  *
  * $FreeBSD: src/sys/i4b/layer3/i4b_l3timer.c,v 1.6.2.1 2001/08/10 14:08:42 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer3/i4b_l3timer.c,v 1.4 2004/02/13 17:45:50 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/layer3/i4b_l3timer.c,v 1.5 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Thu Aug 24 12:49:50 2000]
  *
@@ -102,7 +102,7 @@ T303_start(call_desc_t *cd)
        NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
        cd->T303 = TIMER_ACTIVE;
 
-       START_TIMER(cd->T303_callout, T303_timeout, cd, T303VAL);
+       callout_reset(&cd->T303_timeout, T303VAL, (void *)T303_timeout, cd);
 }
 
 /*---------------------------------------------------------------------------*
@@ -116,7 +116,7 @@ T303_stop(call_desc_t *cd)
        
        if(cd->T303 != TIMER_IDLE)
        {
-               STOP_TIMER(cd->T303_callout, T303_timeout, cd);
+               callout_stop(&cd->T303_timeout);
                cd->T303 = TIMER_IDLE;
        }
        CRIT_END;
@@ -145,7 +145,7 @@ T305_start(call_desc_t *cd)
        NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
        cd->T305 = TIMER_ACTIVE;
 
-       START_TIMER(cd->T305_callout, T305_timeout, cd, T305VAL);
+       callout_reset(&cd->T305_timeout, T305VAL, (void *)T305_timeout, cd);
 }
 
 /*---------------------------------------------------------------------------*
@@ -159,7 +159,7 @@ T305_stop(call_desc_t *cd)
        
        if(cd->T305 != TIMER_IDLE)
        {
-               STOP_TIMER(cd->T305_callout, T305_timeout, cd);
+               callout_stop(&cd->T305_timeout);
                cd->T305 = TIMER_IDLE;
        }
        CRIT_END;
@@ -189,7 +189,7 @@ T308_start(call_desc_t *cd)
        NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
        cd->T308 = TIMER_ACTIVE;
 
-       START_TIMER(cd->T308_callout, T308_timeout, cd, T308VAL);
+       callout_reset(&cd->T308_timeout, T308VAL, (void *)T308_timeout, cd);
 }
 
 /*---------------------------------------------------------------------------*
@@ -203,7 +203,7 @@ T308_stop(call_desc_t *cd)
        
        if(cd->T308 != TIMER_IDLE)
        {
-               STOP_TIMER(cd->T308_callout, T308_timeout, cd);
+               callout_stop(&cd->T308_timeout);
                cd->T308 = TIMER_IDLE;
        }
        CRIT_END;
@@ -233,7 +233,7 @@ T309_start(call_desc_t *cd)
        NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
        cd->T309 = TIMER_ACTIVE;
 
-       START_TIMER(cd->T309_callout, T309_timeout, cd, T309VAL);
+       callout_reset(&cd->T309_timeout, T309VAL, (void *)T309_timeout, cd);
 }
 
 /*---------------------------------------------------------------------------*
@@ -247,7 +247,7 @@ T309_stop(call_desc_t *cd)
        
        if(cd->T309 != TIMER_IDLE)
        {
-               STOP_TIMER(cd->T309_callout, T309_timeout, cd);
+               callout_stop(&cd->T309_timeout);
                cd->T309 = TIMER_IDLE;
        }
        CRIT_END;
@@ -277,7 +277,7 @@ T310_start(call_desc_t *cd)
        NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
        cd->T310 = TIMER_ACTIVE;
 
-       START_TIMER(cd->T310_callout, T310_timeout, cd, T310VAL);
+       callout_reset(&cd->T310_timeout, T310VAL, (void *)T310_timeout, cd);
 }
 
 /*---------------------------------------------------------------------------*
@@ -291,7 +291,7 @@ T310_stop(call_desc_t *cd)
        
        if(cd->T310 != TIMER_IDLE)
        {
-               STOP_TIMER(cd->T310_callout, T310_timeout, cd);
+               callout_stop(&cd->T310_timeout);
                cd->T310 = TIMER_IDLE;
        }
        CRIT_END;
@@ -321,7 +321,7 @@ T313_start(call_desc_t *cd)
        NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
        cd->T313 = TIMER_ACTIVE;
 
-       START_TIMER(cd->T313_callout, T313_timeout, cd, T313VAL);
+       callout_reset(&cd->T313_timeout, T313VAL, (void *)T313_timeout, cd);
 }
 
 /*---------------------------------------------------------------------------*
@@ -336,7 +336,7 @@ T313_stop(call_desc_t *cd)
        if(cd->T313 != TIMER_IDLE)
        {
                cd->T313 = TIMER_IDLE;
-               STOP_TIMER(cd->T313_callout, T313_timeout, cd);
+               callout_stop(&cd->T313_timeout);
        }
        CRIT_END;
        
index d788644..fa0d6e4 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id: i4b_l4.c,v 1.54 2000/08/28 07:24:59 hm Exp $ 
  *
  * $FreeBSD: src/sys/i4b/layer4/i4b_l4.c,v 1.6.2.2 2001/12/16 15:12:59 hm Exp $
- * $DragonFly: src/sys/net/i4b/layer4/i4b_l4.c,v 1.4 2004/02/13 17:45:51 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/layer4/i4b_l4.c,v 1.5 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Sun Aug 27 14:53:42 2000]
  *
@@ -123,7 +123,7 @@ i4b_l4_pdeact(int controller, int numactive)
                        
                        if(cd->timeout_active)
                        {
-                               STOP_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd);
+                               callout_stop(&cd->idle_timeout);
                        }
                        
                        if(cd->dlt != NULL)
@@ -458,7 +458,7 @@ i4b_l4_disconnect_ind(call_desc_t *cd)
        struct mbuf *m;
 
        if(cd->timeout_active)
-               STOP_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd);
+               callout_stop(&cd->idle_timeout);
 
        if(cd->dlt != NULL)
        {
@@ -832,7 +832,8 @@ i4b_l4_setup_timeout(call_desc_t *cd)
        {
                /* incoming call: simple max idletime check */
        
-               START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz/2);
+               callout_reset(&cd->idle_timeout, hz / 2,
+                               (void *)i4b_idle_check, cd);
                cd->timeout_active = 1;
                NDBGL4(L4_TIMO, "%ld: incoming-call, setup max_idle_time to %ld", (long)SECOND, (long)cd->max_idle_time);
        }
@@ -868,7 +869,8 @@ i4b_l4_setup_timeout_fix_unit(call_desc_t *cd)
        {
                /* outgoing call: simple max idletime check */
                
-               START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz/2);
+               callout_reset(&cd->idle_timeout, hz / 2,
+                               (void *)i4b_idle_check, cd);
                cd->timeout_active = 1;
                NDBGL4(L4_TIMO, "%ld: outgoing-call, setup idle_time to %ld",
                        (long)SECOND, (long)cd->shorthold_data.idle_time);
@@ -877,7 +879,11 @@ i4b_l4_setup_timeout_fix_unit(call_desc_t *cd)
        {
                /* outgoing call: full shorthold mode check */
                
-               START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz*(cd->shorthold_data.unitlen_time - (cd->shorthold_data.idle_time + cd->shorthold_data.earlyhup_time)));
+               callout_reset(&cd->idle_timeout, 
+                       hz * (cd->shorthold_data.unitlen_time - 
+                         (cd->shorthold_data.idle_time + 
+                         cd->shorthold_data.earlyhup_time)),
+                       (void *)i4b_idle_check, cd);
                cd->timeout_active = 1;
                cd->idletime_state = IST_NONCHK;
                NDBGL4(L4_TIMO, "%ld: outgoing-call, start %ld sec nocheck window", 
@@ -914,7 +920,9 @@ i4b_l4_setup_timeout_var_unit(call_desc_t *cd)
         */
        cd->idletime_state = IST_CHECK; /* move directly to the checking state */
 
-       START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz * (cd->shorthold_data.unitlen_time - 1) );
+       callout_reset(&cd->idle_timeout, 
+                       hz * (cd->shorthold_data.unitlen_time - 1),
+                       (void *)i4b_idle_check, cd);
        cd->timeout_active = 1;
        NDBGL4(L4_TIMO, "%ld: outgoing-call, var idle time - setup to %ld",
                (long)SECOND, (long)cd->shorthold_data.unitlen_time);
@@ -960,7 +968,8 @@ i4b_idle_check(call_desc_t *cd)
                {
                        NDBGL4(L4_TIMO, "%ld: incoming-call, activity, last_active=%ld, max_idle=%ld", (long)SECOND, (long)i4b_get_idletime(cd), (long)cd->max_idle_time);
 
-                       START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz/2);
+                       callout_reset(&cd->idle_timeout, hz / 2,
+                                       (void *)i4b_idle_check, cd);
                        cd->timeout_active = 1;
                }
        }
@@ -1008,7 +1017,8 @@ i4b_idle_check_fix_unit(call_desc_t *cd)
                {
                        NDBGL4(L4_TIMO, "%ld: outgoing-call-st, activity, last_active=%ld, max_idle=%ld",
                                        (long)SECOND, (long)i4b_get_idletime(cd), (long)cd->shorthold_data.idle_time);
-                       START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz/2);
+                       callout_reset(&cd->idle_timeout, hz / 2,
+                                       (void *)i4b_idle_check, cd);
                        cd->timeout_active = 1;
                }
        }
@@ -1023,7 +1033,9 @@ i4b_idle_check_fix_unit(call_desc_t *cd)
 
                case IST_NONCHK:        /* end of non-check time */
 
-                       START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz*(cd->shorthold_data.idle_time));
+                       callout_reset(&cd->idle_timeout,
+                                       hz*(cd->shorthold_data.idle_time),
+                                       (void *)i4b_idle_check, cd);
                        cd->idletimechk_start = SECOND;
                        cd->idletime_state = IST_CHECK;
                        cd->timeout_active = 1;
@@ -1034,7 +1046,9 @@ i4b_idle_check_fix_unit(call_desc_t *cd)
                        if((i4b_get_idletime(cd) > cd->idletimechk_start) &&
                           (i4b_get_idletime(cd) <= SECOND))
                        {       /* activity detected */
-                               START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz*(cd->shorthold_data.earlyhup_time));
+                               callout_reset(&cd->idle_timeout,
+                                       hz*(cd->shorthold_data.earlyhup_time),
+                                       (void *)i4b_idle_check, cd);
                                cd->timeout_active = 1;
                                cd->idletime_state = IST_SAFE;
                                NDBGL4(L4_TIMO, "%ld: outgoing-call, activity at %ld, wait earlyhup-end", (long)SECOND, (long)i4b_get_idletime(cd));
@@ -1050,7 +1064,11 @@ i4b_idle_check_fix_unit(call_desc_t *cd)
 
                case IST_SAFE:  /* end of earlyhup time */
 
-                       START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz*(cd->shorthold_data.unitlen_time - (cd->shorthold_data.idle_time+cd->shorthold_data.earlyhup_time)));
+                       callout_reset(&cd->idle_timeout,
+                               hz*(cd->shorthold_data.unitlen_time - 
+                                 (cd->shorthold_data.idle_time +
+                                 cd->shorthold_data.earlyhup_time)),
+                               (void *)i4b_idle_check, cd); 
                        cd->timeout_active = 1;
                        cd->idletime_state = IST_NONCHK;
 
@@ -1085,11 +1103,9 @@ i4b_idle_check_var_unit(call_desc_t *cd)
        case IST_CHECK:
                if( i4b_get_idletime(cd) > (SECOND - cd->shorthold_data.idle_time))
                {       /* activity detected */
-#if defined(__DragonFly__) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300001)
-                       cd->idle_timeout_handle =
-#endif
                        /* check again in one second */
-                       START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz);
+                       callout_reset(&cd->idle_timeout, hz,
+                                       (void *)i4b_idle_check, cd);
                        cd->timeout_active = 1;
                        cd->idletime_state = IST_CHECK;
                        NDBGL4(L4_TIMO, "%ld: outgoing-call, var idle timeout - activity at %ld, continuing", (long)SECOND, (long)i4b_get_idletime(cd));
index 43c1c97..a6c356b 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id: i4b_l4mgmt.c,v 1.34 2000/09/01 14:11:51 hm Exp $ 
  *
  * $FreeBSD: src/sys/i4b/layer4/i4b_l4mgmt.c,v 1.6.2.2 2001/08/10 14:08:43 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer4/i4b_l4mgmt.c,v 1.5 2004/02/13 17:45:51 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/layer4/i4b_l4mgmt.c,v 1.6 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Fri Oct 13 15:58:34 2000]
  *
@@ -307,25 +307,14 @@ i4b_init_callout(call_desc_t *cd)
 {
        if(cd->callouts_inited == 0)
        {
-#if defined(__DragonFly__) || defined(__FreeBSD__)
-               callout_handle_init(&cd->idle_timeout_handle);
-               callout_handle_init(&cd->T303_callout);
-               callout_handle_init(&cd->T305_callout);
-               callout_handle_init(&cd->T308_callout);
-               callout_handle_init(&cd->T309_callout);
-               callout_handle_init(&cd->T310_callout);
-               callout_handle_init(&cd->T313_callout);
-               callout_handle_init(&cd->T400_callout);
-#else
-               callout_init(&cd->idle_timeout_handle);
-               callout_init(&cd->T303_callout);
-               callout_init(&cd->T305_callout);
-               callout_init(&cd->T308_callout);
-               callout_init(&cd->T309_callout);
-               callout_init(&cd->T310_callout);
-               callout_init(&cd->T313_callout);
-               callout_init(&cd->T400_callout);
-#endif
+               callout_init(&cd->idle_timeout);
+               callout_init(&cd->T303_timeout);
+               callout_init(&cd->T305_timeout);
+               callout_init(&cd->T308_timeout);
+               callout_init(&cd->T309_timeout);
+               callout_init(&cd->T310_timeout);
+               callout_init(&cd->T313_timeout);
+               callout_init(&cd->T400_timeout);
                cd->callouts_inited = 1;
        }
 }
index e4f2482..51ea8b8 100644 (file)
@@ -30,7 +30,7 @@
  *     $Id: i4b_l4timer.c,v 1.18 2000/08/24 11:48:58 hm Exp $ 
  *
  * $FreeBSD: src/sys/i4b/layer4/i4b_l4timer.c,v 1.6.2.1 2001/08/10 14:08:43 obrien Exp $
- * $DragonFly: src/sys/net/i4b/layer4/i4b_l4timer.c,v 1.4 2004/02/13 17:45:51 joerg Exp $
+ * $DragonFly: src/sys/net/i4b/layer4/i4b_l4timer.c,v 1.5 2004/09/16 04:36:32 dillon Exp $
  *
  *      last edit-date: [Thu Aug 24 12:50:17 2000]
  *
@@ -82,7 +82,7 @@ T400_start(call_desc_t *cd)
        NDBGL4(L4_MSG, "cr = %d", cd->cr);
        cd->T400 = TIMER_ACTIVE;
 
-       START_TIMER(cd->T400_callout, T400_timeout, cd, T400DEF);
+       callout_reset(&cd->T400_timeout, T400DEF, (void *)T400_timeout, cd);
 }
 
 /*---------------------------------------------------------------------------*
@@ -96,7 +96,7 @@ T400_stop(call_desc_t *cd)
 
        if(cd->T400 == TIMER_ACTIVE)
        {
-               STOP_TIMER(cd->T400_callout, T400_timeout, cd);
+               callout_stop(&cd->T400_timeout);
                cd->T400 = TIMER_IDLE;
        }
        CRIT_END;
index 49a08de..2d60be1 100644 (file)
@@ -70,7 +70,7 @@
  */
 
 /* $FreeBSD: src/sys/net/if_ppp.c,v 1.67.2.4 2002/04/14 21:41:48 luigi Exp $ */
-/* $DragonFly: src/sys/net/ppp/if_ppp.c,v 1.19 2004/08/10 22:05:30 dillon Exp $ */
+/* $DragonFly: src/sys/net/ppp/if_ppp.c,v 1.20 2004/09/16 04:39:30 dillon Exp $ */
 /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
 /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */
 
@@ -246,6 +246,7 @@ pppattach(dummy)
        sc->sc_inq.ifq_maxlen = IFQ_MAXLEN;
        sc->sc_fastq.ifq_maxlen = IFQ_MAXLEN;
        sc->sc_rawq.ifq_maxlen = IFQ_MAXLEN;
+       callout_init(&sc->sc_timeout);
        if_attach(&sc->sc_if);
        bpfattach(&sc->sc_if, DLT_PPP, PPP_HDRLEN);
     }
index 9d9b4b4..bb19837 100644 (file)
@@ -40,7 +40,7 @@
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * $FreeBSD: src/sys/net/if_pppvar.h,v 1.15 2000/01/29 16:56:23 peter Exp $
- * $DragonFly: src/sys/net/ppp/if_pppvar.h,v 1.4 2003/08/26 20:49:48 rob Exp $
+ * $DragonFly: src/sys/net/ppp/if_pppvar.h,v 1.5 2004/09/16 04:39:30 dillon Exp $
  */
 
 /*
@@ -56,7 +56,7 @@
 struct ppp_softc {
        struct  ifnet sc_if;            /* 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_timeout;     /* 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 */
index c868e41..192c06f 100644 (file)
@@ -71,7 +71,7 @@
  */
 
 /* $FreeBSD: src/sys/net/ppp_tty.c,v 1.43.2.1 2002/02/13 00:43:11 dillon Exp $ */
-/* $DragonFly: src/sys/net/ppp_layer/ppp_tty.c,v 1.10 2004/06/02 14:42:59 eirikn Exp $ */
+/* $DragonFly: src/sys/net/ppp_layer/ppp_tty.c,v 1.11 2004/09/16 04:39:31 dillon Exp $ */
 
 #include "opt_ppp.h"           /* XXX for ppp_defs.h */
 
@@ -305,7 +305,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_timeout);
        sc->sc_flags &= ~SC_TIMEOUT;
     }
     splx(s);
@@ -733,7 +733,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_timeout, 1, ppp_timeout, sc);
        sc->sc_flags |= SC_TIMEOUT;
     }