Deleted Added
full compact
80c80
< __FBSDID("$FreeBSD: head/sys/dev/ti/if_ti.c 195049 2009-06-26 11:45:06Z rwatson $");
---
> __FBSDID("$FreeBSD: head/sys/dev/ti/if_ti.c 199559 2009-11-19 22:06:40Z jhb $");
197c197
< static void ti_watchdog(struct ifnet *);
---
> static void ti_watchdog(void *);
2287a2288
> callout_init_mtx(&sc->ti_watchdog, &sc->ti_mtx, 0);
2489d2489
< ifp->if_watchdog = ti_watchdog;
2568d2567
< int attached;
2574,2575d2572
< attached = device_is_attached(dev);
< TI_LOCK(sc);
2577,2580c2574
< if (attached)
< ti_stop(sc);
< TI_UNLOCK(sc);
< if (attached)
---
> if (device_is_attached(dev)) {
2581a2576,2579
> TI_LOCK(sc);
> ti_stop(sc);
> TI_UNLOCK(sc);
> }
2584,2585c2582,2583
< if (attached)
< bus_generic_detach(dev);
---
> callout_drain(&sc->ti_watchdog);
> bus_generic_detach(dev);
2869c2867
< ifp->if_timer = sc->ti_txcnt > 0 ? 5 : 0;
---
> sc->ti_timer = sc->ti_txcnt > 0 ? 5 : 0;
3124c3122
< ifp->if_timer = 5;
---
> sc->ti_timer = 5;
3227a3226
> callout_reset(&sc->ti_watchdog, hz, ti_watchdog, sc);
3789,3790c3788
< ti_watchdog(ifp)
< struct ifnet *ifp;
---
> ti_watchdog(void *arg)
3792a3791
> struct ifnet *ifp;
3794,3795c3793,3797
< sc = ifp->if_softc;
< TI_LOCK(sc);
---
> sc = arg;
> TI_LOCK_ASSERT(sc);
> callout_reset(&sc->ti_watchdog, hz, ti_watchdog, sc);
> if (sc->ti_timer == 0 || --sc->ti_timer > 0)
> return;
3802,3803c3804
< if (sc->ti_flags & TI_FLAG_DEBUGING) {
< TI_UNLOCK(sc);
---
> if (sc->ti_flags & TI_FLAG_DEBUGING)
3805d3805
< }
3806a3807
> ifp = sc->ti_ifp;
3812d3812
< TI_UNLOCK(sc);
3861a3862
> callout_stop(&sc->ti_watchdog);