From owner-svn-src-head@freebsd.org Mon Mar 13 16:44:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E51FD0A521; Mon, 13 Mar 2017 16:44:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C7A7153D; Mon, 13 Mar 2017 16:44:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2DGi7Rb041763; Mon, 13 Mar 2017 16:44:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2DGi7mY041759; Mon, 13 Mar 2017 16:44:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201703131644.v2DGi7mY041759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 13 Mar 2017 16:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315198 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Mar 2017 16:44:08 -0000 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);