Date: Mon, 13 Mar 2017 16:44:07 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315198 - head/sys/net80211 Message-ID: <201703131644.v2DGi7mY041759@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Mon Mar 13 16:44:06 2017 New Revision: 315198 URL: https://svnweb.freebsd.org/changeset/base/315198 Log: [net80211] begin fleshing out per-VAP WME configurations. As part of (eventual) p2p/tdls/multi-STA support, a lot of global configuration parameters (WME, ERP (slot, preamble), channel width, HT protmode, etc are the biggest offenders) should be per-VAP. For multi-BSS VAP operation they may be linked, but for p2p/TDLS operation that can be off-channel they can definitely be different (think: 2GHz STA, 5GHz p2p.) The global configuration view of these is mostly a "configure the current non-smart-firmware NIC" view. This should be split up into per-VAP state, then a global non-smart-firmware-NIC management layer to handle channel changes and such in software. This is step one in a loooong road for this. It should be a big non-functional change for everyone. * create a per-VAP WME update call. * call it if its set, and call the global callback if it isn't This still uses global WME state - it's just preparation for a future change which will make the WME state per-VAP and fall through to a shared WME configuration for hostap operation. Note: this requires a full kernel recompile; the internal net80211 ABI has changed. Reviewed by: avos Differential Revision: https://reviews.freebsd.org/D9986 Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Mon Mar 13 15:34:21 2017 (r315197) +++ head/sys/net80211/ieee80211.c Mon Mar 13 16:44:06 2017 (r315198) @@ -727,6 +727,7 @@ ieee80211_vap_detach(struct ieee80211vap */ ieee80211_draintask(ic, &vap->iv_nstate_task); ieee80211_draintask(ic, &vap->iv_swbmiss_task); + ieee80211_draintask(ic, &vap->iv_wme_task); /* XXX band-aid until ifnet handles this for us */ taskqueue_drain(taskqueue_swi, &ifp->if_linktask); Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Mon Mar 13 15:34:21 2017 (r315197) +++ head/sys/net80211/ieee80211_proto.c Mon Mar 13 16:44:06 2017 (r315198) @@ -241,7 +241,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 vap_update_wme(void *, int); static void restart_vaps(void *, int); static void ieee80211_newstate_cb(void *, int); @@ -280,7 +280,6 @@ ieee80211_proto_attach(struct ieee80211c 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); TASK_INIT(&ic->ic_restart_task, 0, restart_vaps, ic); ic->ic_wme.wme_hipri_switch_hysteresis = @@ -338,6 +337,7 @@ ieee80211_proto_vattach(struct ieee80211 callout_init(&vap->iv_mgtsend, 1); TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap); TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap); + TASK_INIT(&vap->iv_wme_task, 0, vap_update_wme, vap); /* * Install default tx rate handling: no fixed rate, lowest * supported rate for mgmt and multicast frames. Default @@ -1285,7 +1285,7 @@ ieee80211_wme_updateparams_locked(struct } /* schedule the deferred WME update */ - ieee80211_runtask(ic, &ic->ic_wme_task); + ieee80211_runtask(ic, &vap->iv_wme_task); IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, "%s: WME params updated, cap_info 0x%x\n", __func__, @@ -1350,15 +1350,25 @@ update_chw(void *arg, int npending) ic->ic_update_chw(ic); } +/* + * Deferred WME update. + * + * In preparation for per-VAP WME configuration, call the VAP + * method if the VAP requires it. Otherwise, just call the + * older global method. There isn't a per-VAP WME configuration + * just yet so for now just use the global configuration. + */ static void -update_wme(void *arg, int npending) +vap_update_wme(void *arg, int npending) { - struct ieee80211com *ic = arg; + struct ieee80211vap *vap = arg; + struct ieee80211com *ic = vap->iv_ic; - /* - * XXX should we defer the WME configuration update until now? - */ - ic->ic_wme.wme_update(ic); + if (vap->iv_wme_update != NULL) + vap->iv_wme_update(vap, + ic->ic_wme.wme_chanParams.cap_wmeParams); + else + ic->ic_wme.wme_update(ic); } static void @@ -1385,7 +1395,6 @@ ieee80211_waitfor_parent(struct ieee8021 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); } Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Mon Mar 13 15:34:21 2017 (r315197) +++ head/sys/net80211/ieee80211_var.h Mon Mar 13 16:44:06 2017 (r315198) @@ -149,7 +149,6 @@ 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 */ struct task ic_restart_task; /* deferred device restart */ counter_u64_t ic_ierrors; /* input errors */ @@ -557,6 +556,10 @@ struct ieee80211vap { int (*iv_output)(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); + int (*iv_wme_update)(struct ieee80211vap *, + const struct wmeParams *wme_params); + struct task iv_wme_task; /* deferred VAP WME update */ + uint64_t iv_spare[6]; }; MALLOC_DECLARE(M_80211_VAP);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703131644.v2DGi7mY041759>