From fcbc78cfbd33efe295170e5a0e20d50176097679 Mon Sep 17 00:00:00 2001 From: avos Date: Thu, 5 Nov 2015 17:58:18 +0000 Subject: 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 --- sys/dev/usb/wlan/if_run.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'sys/dev/usb/wlan/if_run.c') 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 -- cgit v1.1