rsu: do not restart calibration task when going out of RUN state.

Clear 'sc_calibrating' flag and stop calibration task when interface
is not associated; this fixes possible panic after detach.

Reported and tested by:	hselasky
Reviewed by:	adrian
MFC after:	6 days
This commit is contained in:
Andriy Voskoboinyk 2016-09-25 19:13:07 +00:00
parent 9eeaa0ea1f
commit fbc9d202d8

View File

@ -1270,9 +1270,12 @@ rsu_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
default:
break;
}
sc->sc_calibrating = 1;
/* Start periodic calibration. */
taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, hz);
if (startcal != 0) {
sc->sc_calibrating = 1;
/* Start periodic calibration. */
taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task,
hz);
}
RSU_UNLOCK(sc);
IEEE80211_LOCK(ic);
return (uvp->newstate(vap, nstate, arg));