]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Defer calling into the driver to update the QOS (WME) configuration.
authoradrian <adrian@FreeBSD.org>
Tue, 29 Sep 2015 03:40:21 +0000 (03:40 +0000)
committeradrian <adrian@FreeBSD.org>
Tue, 29 Sep 2015 03:40:21 +0000 (03:40 +0000)
This gets called from the driver RX path which leads to driver re-entry.

sys/net80211/ieee80211_proto.c
sys/net80211/ieee80211_var.h

index 15188d8a1e46aef7940bc3f7c31329851f7d883d..52e92ba477766a691c2f163f23553f5a913b1a91 100644 (file)
@@ -107,6 +107,7 @@ static void update_mcast(void *, int);
 static void update_promisc(void *, int);
 static void update_channel(void *, int);
 static void update_chw(void *, int);
+static void update_wme(void *, int);
 static void ieee80211_newstate_cb(void *, int);
 
 static int
@@ -144,6 +145,7 @@ ieee80211_proto_attach(struct ieee80211com *ic)
        TASK_INIT(&ic->ic_chan_task, 0, update_channel, ic);
        TASK_INIT(&ic->ic_bmiss_task, 0, beacon_miss, ic);
        TASK_INIT(&ic->ic_chw_task, 0, update_chw, ic);
+       TASK_INIT(&ic->ic_wme_task, 0, update_wme, ic);
 
        ic->ic_wme.wme_hipri_switch_hysteresis =
                AGGRESSIVE_MODE_SWITCH_HYSTERESIS;
@@ -1133,7 +1135,8 @@ ieee80211_wme_updateparams_locked(struct ieee80211vap *vap)
                ieee80211_beacon_notify(vap, IEEE80211_BEACON_WME);
        }
 
-       wme->wme_update(ic);
+       /* schedule the deferred WME update */
+       ieee80211_runtask(ic, &ic->ic_wme_task);
 
        IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME,
            "%s: WME params updated, cap_info 0x%x\n", __func__,
@@ -1198,6 +1201,17 @@ update_chw(void *arg, int npending)
        ic->ic_update_chw(ic);
 }
 
+static void
+update_wme(void *arg, int npending)
+{
+       struct ieee80211com *ic = arg;
+
+       /*
+        * XXX should we defer the WME configuration update until now?
+        */
+       ic->ic_wme.wme_update(ic);
+}
+
 /*
  * Block until the parent is in a known state.  This is
  * used after any operations that dispatch a task (e.g.
@@ -1213,6 +1227,7 @@ ieee80211_waitfor_parent(struct ieee80211com *ic)
        ieee80211_draintask(ic, &ic->ic_chan_task);
        ieee80211_draintask(ic, &ic->ic_bmiss_task);
        ieee80211_draintask(ic, &ic->ic_chw_task);
+       ieee80211_draintask(ic, &ic->ic_wme_task);
        taskqueue_unblock(ic->ic_tq);
 }
 
index 8438d458fefeab40eca6245c3ef16a8f1f5f8748..17f37d364c1dc9b51b38a22a41e3a09f5bf7500f 100644 (file)
@@ -133,6 +133,7 @@ struct ieee80211com {
        struct task             ic_chan_task;   /* deferred channel change */
        struct task             ic_bmiss_task;  /* deferred beacon miss hndlr */
        struct task             ic_chw_task;    /* deferred HT CHW update */
+       struct task             ic_wme_task;    /* deferred WME update */
 
        counter_u64_t           ic_ierrors;     /* input errors */
        counter_u64_t           ic_oerrors;     /* output errors */