Index: sys/dev/re/if_re.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/dev/re/if_re.c,v retrieving revision 1.35 diff -u -r1.35 if_re.c --- sys/dev/re/if_re.c 28 Sep 2004 18:22:24 -0000 1.35 +++ sys/dev/re/if_re.c 17 Nov 2004 02:27:08 -0000 @@ -215,7 +215,6 @@ #endif static void re_intr (void *); static void re_tick (void *); -static void re_tick_locked (struct rl_softc *); static void re_start (struct ifnet *); static void re_start_locked (struct ifnet *); static int re_ioctl (struct ifnet *, u_long, caddr_t); @@ -1206,7 +1205,7 @@ ifp->if_snd.ifq_maxlen = RL_IFQ_MAXLEN; ifp->if_capenable = ifp->if_capabilities; - callout_handle_init(&sc->rl_stat_ch); + callout_init_mtx(&sc->rl_stat_callout, &sc->rl_mtx, 0); /* * Call MI attach routine. @@ -1352,6 +1351,7 @@ if (sc->rl_parent_tag) bus_dma_tag_destroy(sc->rl_parent_tag); + callout_drain(&sc->rl_stat_callout); mtx_destroy(&sc->rl_mtx); return (0); @@ -1733,26 +1733,16 @@ void *xsc; { struct rl_softc *sc; - - sc = xsc; - RL_LOCK(sc); - re_tick_locked(sc); - RL_UNLOCK(sc); -} - -static void -re_tick_locked(sc) - struct rl_softc *sc; -{ struct mii_data *mii; + sc = xsc; RL_LOCK_ASSERT(sc); mii = device_get_softc(sc->rl_miibus); mii_tick(mii); - sc->rl_stat_ch = timeout(re_tick, sc, hz); + callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); } #ifdef DEVICE_POLLING @@ -1865,8 +1855,8 @@ } if (status & RL_ISR_LINKCHG) { - untimeout(re_tick, sc, sc->rl_stat_ch); - re_tick_locked(sc); + callout_stop(&sc->rl_stat_callout); + re_tick(sc); } } @@ -2238,7 +2228,7 @@ ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; - sc->rl_stat_ch = timeout(re_tick, sc, hz); + callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); } /* @@ -2368,7 +2358,7 @@ ifp = &sc->arpcom.ac_if; ifp->if_timer = 0; - untimeout(re_tick, sc, sc->rl_stat_ch); + callout_stop(&sc->rl_stat_callout); ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); Index: sys/pci/if_rlreg.h =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/pci/if_rlreg.h,v retrieving revision 1.48 diff -u -r1.48 if_rlreg.h --- sys/pci/if_rlreg.h 28 Sep 2004 18:22:24 -0000 1.48 +++ sys/pci/if_rlreg.h 16 Nov 2004 00:59:50 -0000 @@ -693,7 +693,8 @@ int rl_txthresh; struct rl_chain_data rl_cdata; struct rl_list_data rl_ldata; - struct callout_handle rl_stat_ch; + struct callout_handle rl_stat_ch; /* XXX */ + struct callout rl_stat_callout; struct mtx rl_mtx; struct mbuf *rl_head; struct mbuf *rl_tail;