Deleted Added
full compact
28c28
< __FBSDID("$FreeBSD: head/sys/dev/iwn/if_iwn.c 266545 2014-05-22 15:00:32Z trasz $");
---
> __FBSDID("$FreeBSD: head/sys/dev/iwn/if_iwn.c 266546 2014-05-22 15:29:25Z trasz $");
334a335
> static void iwn_panicked(void *, int);
673a675
> TASK_INIT(&sc->sc_panic_task, 0, iwn_panicked, sc);
674a677,684
> sc->sc_tq = taskqueue_create("iwn_taskq", M_WAITOK,
> taskqueue_thread_enqueue, &sc->sc_tq);
> error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "iwn_taskq");
> if (error != 0) {
> device_printf(dev, "can't start threads, error %d\n", error);
> goto fail;
> }
>
1336a1347,1350
>
> taskqueue_drain_all(sc->sc_tq);
> taskqueue_free(sc->sc_tq);
>
3947,3948c3961,3962
< ifp->if_flags &= ~IFF_UP;
< iwn_stop_locked(sc);
---
>
> taskqueue_enqueue(sc->sc_tq, &sc->sc_panic_task);
8414a8429,8460
> iwn_panicked(void *arg0, int pending)
> {
> struct iwn_softc *sc = arg0;
> struct ifnet *ifp = sc->sc_ifp;
> struct ieee80211com *ic = ifp->if_l2com;
> struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
> int error;
>
> if (vap == NULL) {
> printf("%s: null vap\n", __func__);
> return;
> }
>
> device_printf(sc->sc_dev, "%s: controller panicked, iv_state = %d; "
> "resetting...\n", __func__, vap->iv_state);
>
> iwn_stop(sc);
> iwn_init(sc);
> iwn_start(sc->sc_ifp);
> if (vap->iv_state >= IEEE80211_S_AUTH &&
> (error = iwn_auth(sc, vap)) != 0) {
> device_printf(sc->sc_dev,
> "%s: could not move to auth state\n", __func__);
> }
> if (vap->iv_state >= IEEE80211_S_RUN &&
> (error = iwn_run(sc, vap)) != 0) {
> device_printf(sc->sc_dev,
> "%s: could not move to run state\n", __func__);
> }
> }
>
> static void