diff options
author | avos <avos@FreeBSD.org> | 2015-11-05 17:58:18 +0000 |
---|---|---|
committer | avos <avos@FreeBSD.org> | 2015-11-05 17:58:18 +0000 |
commit | fcbc78cfbd33efe295170e5a0e20d50176097679 (patch) | |
tree | f20767b769fe09be0303686007317b0e0753dc05 /sys/dev/usb/wlan/if_run.c | |
parent | 8ad428a4e9b7776a56ab64e20e0e080778bd2d6c (diff) | |
download | FreeBSD-src-fcbc78cfbd33efe295170e5a0e20d50176097679.zip FreeBSD-src-fcbc78cfbd33efe295170e5a0e20d50176097679.tar.gz |
net80211: WME callback cleanup in various drivers
Since r288350, ic_wme_task() is called via ieee80211_runtask(),
so, any additional deferring from the driver side is not needed.
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4072
Diffstat (limited to 'sys/dev/usb/wlan/if_run.c')
-rw-r--r-- | sys/dev/usb/wlan/if_run.c | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index d5b5288..bb52a09 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -381,7 +381,6 @@ static struct ieee80211_node *run_node_alloc(struct ieee80211vap *, static int run_media_change(struct ifnet *); static int run_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int run_wme_update(struct ieee80211com *); -static void run_wme_update_cb(void *); static void run_key_set_cb(void *); static int run_key_set(struct ieee80211vap *, struct ieee80211_key *); static void run_key_delete_cb(void *); @@ -2174,19 +2173,16 @@ run_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) return(rvp->newstate(vap, nstate, arg)); } -/* ARGSUSED */ -static void -run_wme_update_cb(void *arg) +static int +run_wme_update(struct ieee80211com *ic) { - struct ieee80211com *ic = arg; struct run_softc *sc = ic->ic_softc; const struct wmeParams *ac = ic->ic_wme.wme_chanParams.cap_wmeParams; int aci, error = 0; - RUN_LOCK_ASSERT(sc, MA_OWNED); - /* update MAC TX configuration registers */ + RUN_LOCK(sc); for (aci = 0; aci < WME_NUM_AC; aci++) { error = run_write(sc, RT2860_EDCA_AC_CFG(aci), ac[aci].wmep_logcwmax << 16 | @@ -2224,33 +2220,11 @@ run_wme_update_cb(void *arg) ac[WME_AC_VI].wmep_txopLimit); err: + RUN_UNLOCK(sc); if (error) DPRINTF("WME update failed\n"); - return; -} - -static int -run_wme_update(struct ieee80211com *ic) -{ - struct run_softc *sc = ic->ic_softc; - - /* sometime called wothout lock */ - if (mtx_owned(&ic->ic_comlock.mtx)) { - uint32_t i = RUN_CMDQ_GET(&sc->cmdq_store); - DPRINTF("cmdq_store=%d\n", i); - sc->cmdq[i].func = run_wme_update_cb; - sc->cmdq[i].arg0 = ic; - ieee80211_runtask(ic, &sc->cmdq_task); - return (0); - } - - RUN_LOCK(sc); - run_wme_update_cb(ic); - RUN_UNLOCK(sc); - - /* return whatever, upper layer doesn't care anyway */ - return (0); + return (error); } static void |