Protect the "ratectl_ch" callout in the "run" driver by the "run"

softc's "sc->sc_mtx" mutex. Currently the callout was marked
multi-processor safe, which is fine, but it is better to
start/stop/reset callouts while holding the "run" drivers own
mutex. While at it add a missing "ULL" at end of the 64-bit unsigned
integer constant.

MFC after:	1 week
This commit is contained in:
hselasky 2013-11-05 18:27:25 +00:00
parent c5f4e2274d
commit 84531bbbc3

View File

@ -700,7 +700,7 @@ run_attach(device_t self)
TASK_INIT(&sc->cmdq_task, 0, run_cmdq_cb, sc);
TASK_INIT(&sc->ratectl_task, 0, run_ratectl_cb, sc);
callout_init((struct callout *)&sc->ratectl_ch, 1);
usb_callout_init_mtx(&sc->ratectl_ch, &sc->sc_mtx, 0);
if (bootverbose)
ieee80211_announce(ic);
@ -1010,7 +1010,7 @@ run_load_microcode(struct run_softc *sc)
/* cheap sanity check */
temp = fw->data;
bytes = *temp;
if (bytes != be64toh(0xffffff0210280210)) {
if (bytes != be64toh(0xffffff0210280210ULL)) {
device_printf(sc->sc_dev, "firmware checksum failed\n");
error = EINVAL;
goto fail;
@ -2237,8 +2237,10 @@ run_ratectl_cb(void *arg, int pending)
ieee80211_iterate_nodes(&ic->ic_sta, run_iter_func, sc);
}
RUN_LOCK(sc);
if(sc->ratectl_run != RUN_RATECTL_OFF)
usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc);
RUN_UNLOCK(sc);
}
static void