Date: Sat, 7 Jan 2017 07:35:27 +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: r311583 - head/sys/net80211 Message-ID: <201701070735.v077ZRJH052572@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Sat Jan 7 07:35:27 2017 New Revision: 311583 URL: https://svnweb.freebsd.org/changeset/base/311583 Log: [net80211] add syncflags methods for the VHT flags configuration. I missed this in my last commit. Pointy hat to me. Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sat Jan 7 05:10:06 2017 (r311582) +++ head/sys/net80211/ieee80211.c Sat Jan 7 07:35:27 2017 (r311583) @@ -90,6 +90,7 @@ const uint8_t ieee80211broadcastaddr[IEE static void ieee80211_syncflag_locked(struct ieee80211com *ic, int flag); static void ieee80211_syncflag_ht_locked(struct ieee80211com *ic, int flag); static void ieee80211_syncflag_ext_locked(struct ieee80211com *ic, int flag); +static void ieee80211_syncflag_vht_locked(struct ieee80211com *ic, int flag); static int ieee80211_media_setup(struct ieee80211com *ic, struct ifmedia *media, int caps, int addsta, ifm_change_cb_t media_change, ifm_stat_cb_t media_stat); @@ -652,6 +653,12 @@ ieee80211_vap_attach(struct ieee80211vap ieee80211_syncflag_locked(ic, IEEE80211_F_BURST); ieee80211_syncflag_ht_locked(ic, IEEE80211_FHT_HT); ieee80211_syncflag_ht_locked(ic, IEEE80211_FHT_USEHT40); + + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_VHT); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT40); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80P80); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT160); IEEE80211_UNLOCK(ic); return 1; @@ -699,6 +706,13 @@ ieee80211_vap_detach(struct ieee80211vap ieee80211_syncflag_locked(ic, IEEE80211_F_BURST); ieee80211_syncflag_ht_locked(ic, IEEE80211_FHT_HT); ieee80211_syncflag_ht_locked(ic, IEEE80211_FHT_USEHT40); + + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_VHT); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT40); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80P80); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT160); + /* NB: this handles the bpfdetach done below */ ieee80211_syncflag_ext_locked(ic, IEEE80211_FEXT_BPF); if (vap->iv_ifflags & IFF_PROMISC) @@ -853,6 +867,46 @@ ieee80211_syncflag_ht(struct ieee80211va } /* + * Synchronize flags_vht bit state in the com structure + * according to the state of all vap's. This is used, + * for example, to handle state changes via ioctls. + */ +static void +ieee80211_syncflag_vht_locked(struct ieee80211com *ic, int flag) +{ + struct ieee80211vap *vap; + int bit; + + IEEE80211_LOCK_ASSERT(ic); + + bit = 0; + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + if (vap->iv_flags_vht & flag) { + bit = 1; + break; + } + if (bit) + ic->ic_flags_vht |= flag; + else + ic->ic_flags_vht &= ~flag; +} + +void +ieee80211_syncflag_vht(struct ieee80211vap *vap, int flag) +{ + struct ieee80211com *ic = vap->iv_ic; + + IEEE80211_LOCK(ic); + if (flag < 0) { + flag = -flag; + vap->iv_flags_vht &= ~flag; + } else + vap->iv_flags_vht |= flag; + ieee80211_syncflag_vht_locked(ic, flag); + IEEE80211_UNLOCK(ic); +} + +/* * Synchronize flags_ext bit state in the com structure * according to the state of all vap's. This is used, * for example, to handle state changes via ioctls. Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Sat Jan 7 05:10:06 2017 (r311582) +++ head/sys/net80211/ieee80211_proto.h Sat Jan 7 07:35:27 2017 (r311583) @@ -77,6 +77,7 @@ void ieee80211_promisc(struct ieee80211v void ieee80211_allmulti(struct ieee80211vap *, bool); void ieee80211_syncflag(struct ieee80211vap *, int flag); void ieee80211_syncflag_ht(struct ieee80211vap *, int flag); +void ieee80211_syncflag_vht(struct ieee80211vap *, int flag); void ieee80211_syncflag_ext(struct ieee80211vap *, int flag); #define ieee80211_input(ni, m, rssi, nf) \ @@ -361,7 +362,8 @@ struct ieee80211_beacon_offsets { uint8_t *bo_csa; /* start of CSA element */ uint8_t *bo_quiet; /* start of Quiet element */ uint8_t *bo_meshconf; /* start of MESHCONF element */ - uint8_t *bo_spare[3]; + uint8_t *bo_vhtinfo; /* start of VHT info element (XXX VHTCAP?) */ + uint8_t *bo_spare[2]; }; struct mbuf *ieee80211_beacon_alloc(struct ieee80211_node *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701070735.v077ZRJH052572>