Index: if_an.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/an/if_an.c,v retrieving revision 1.84 diff -u -r1.84 if_an.c --- if_an.c 10 Sep 2007 12:53:34 -0000 1.84 +++ if_an.c 30 Oct 2007 14:28:37 -0000 @@ -790,7 +790,7 @@ */ ether_ifattach(ifp, sc->an_caps.an_oemaddr); - callout_handle_init(&sc->an_stat_ch); + callout_init_mtx(&sc->an_stat_ch, &sc->an_mtx); return(0); fail:; @@ -818,6 +818,7 @@ AN_UNLOCK(sc); ether_ifdetach(ifp); bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); + callout_drain(&sc->an_stat_ch); if_free(ifp); an_release_resources(dev); mtx_destroy(&sc->an_mtx); @@ -1150,7 +1151,7 @@ struct ifnet *ifp; sc = xsc; - AN_LOCK(sc); + AN_LOCK_ASSERT(sc); ifp = sc->an_ifp; sc->an_status.an_type = AN_RID_STATUS; @@ -1164,8 +1165,7 @@ /* Don't do this while we're transmitting */ if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { - sc->an_stat_ch = timeout(an_stats_update, sc, hz); - AN_UNLOCK(sc); + callout_reset(&sc->an_stat_ch, hz, an_stats_update, sc); return; } @@ -1173,8 +1173,7 @@ sc->an_stats.an_type = AN_RID_32BITS_CUM; an_read_record(sc, (struct an_ltv_gen *)&sc->an_stats.an_len); - sc->an_stat_ch = timeout(an_stats_update, sc, hz); - AN_UNLOCK(sc); + callout_reset(&sc->an_stat_ch, hz, an_stats_update, sc); return; } @@ -2615,7 +2614,7 @@ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - sc->an_stat_ch = timeout(an_stats_update, sc, hz); + callout_reset(&sc->an_stat_ch, hz, an_stats_update, sc); AN_UNLOCK(sc); return; @@ -2828,7 +2827,7 @@ for (i = 0; i < AN_TX_RING_CNT; i++) an_cmd(sc, AN_CMD_DEALLOC_MEM, sc->an_rdata.an_tx_fids[i]); - untimeout(an_stats_update, sc, sc->an_stat_ch); + callout_stop(&sc->an_stat_ch); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); Index: if_anreg.h =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/an/if_anreg.h,v retrieving revision 1.23 diff -u -r1.23 if_anreg.h --- if_anreg.h 10 Jun 2005 16:49:03 -0000 1.23 +++ if_anreg.h 30 Oct 2007 14:24:50 -0000 @@ -485,7 +485,7 @@ int an_have_rssimap; struct an_ltv_rssi_map an_rssimap; #endif - struct callout_handle an_stat_ch; + struct callout an_stat_ch; struct mtx an_mtx; device_t an_dev; struct ifmedia an_ifmedia;