From owner-svn-src-head@freebsd.org Sat Jan 7 01:51:55 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 80D3ACA2974; Sat, 7 Jan 2017 01:51:55 +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 3846A16AD; Sat, 7 Jan 2017 01:51:55 +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 v071psi7008604; Sat, 7 Jan 2017 01:51:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v071psNl008603; Sat, 7 Jan 2017 01:51:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701070151.v071psNl008603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 7 Jan 2017 01:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311574 - 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: Sat, 07 Jan 2017 01:51:55 -0000 Author: adrian Date: Sat Jan 7 01:51:54 2017 New Revision: 311574 URL: https://svnweb.freebsd.org/changeset/base/311574 Log: [net80211] add FVHT flags for channel widths. The 11n code uses these bits for both configuration /and/ controlling the channel width on softmac chips - it uses it to find the widest width for all VAPs (eg a HT20 vap and a HT40 vap) to know what to configure the ic_curchan. For fullmac devices it isn't /as/ important, as each virtual device exposed by the firmware will likely have its own configuration and the firmware figures out what to do to enable it. Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Jan 7 01:49:34 2017 (r311573) +++ head/sys/net80211/ieee80211_var.h Sat Jan 7 01:51:54 2017 (r311574) @@ -653,8 +653,12 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FVEN_BITS "\20" #define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ +#define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ +#define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000008 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_USEVHT160 0x000000010 /* CONF: Use VHT160 */ #define IEEE80211_VFHT_BITS \ - "\20\1VHT" + "\20\1VHT\2VHT40\3VHT80\4VHT80P80\5VHT160" int ic_printf(struct ieee80211com *, const char *, ...) __printflike(2, 3); void ieee80211_ifattach(struct ieee80211com *); @@ -830,6 +834,27 @@ ieee80211_htchanflags(const struct ieee8 } /* + * Calculate VHT channel promotion flags for a channel. + * XXX belongs in ieee80211_vht.h but needs IEEE80211_FVHT_* + */ +static __inline int +ieee80211_vhtchanflags(const struct ieee80211_channel *c) +{ + + if (IEEE80211_IS_CHAN_VHT160(c)) + return IEEE80211_FVHT_USEVHT160; + if (IEEE80211_IS_CHAN_VHT80_80(c)) + return IEEE80211_FVHT_USEVHT80P80; + if (IEEE80211_IS_CHAN_VHT80(c)) + return IEEE80211_FVHT_USEVHT80; + if (IEEE80211_IS_CHAN_VHT40(c)) + return IEEE80211_FVHT_USEVHT40; + if (IEEE80211_IS_CHAN_VHT(c)) + return IEEE80211_FVHT_VHT; + return (0); +} + +/* * Fetch the current TX power (cap) for the given node. * * This includes the node and ic/vap TX power limit as needed,