From owner-svn-src-all@freebsd.org Sat Jan 7 01:56:11 2017 Return-Path: Delivered-To: svn-src-all@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 BF7C9CA2CE1; Sat, 7 Jan 2017 01:56:11 +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 9A3B71DB9; Sat, 7 Jan 2017 01:56:11 +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 v071uAJA008910; Sat, 7 Jan 2017 01:56:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v071uAnx008908; Sat, 7 Jan 2017 01:56:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701070156.v071uAnx008908@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:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311577 - head/lib/lib80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2017 01:56:11 -0000 Author: adrian Date: Sat Jan 7 01:56:10 2017 New Revision: 311577 URL: https://svnweb.freebsd.org/changeset/base/311577 Log: [lib80211] add VHT bands and channel flags. This is preparation work for 11ac support. The regulatory database needs to know about VHT channel flags and 80MHz (and later 160MHz) available channel bands. Whilst here, add the 2GHz VHT band (which is a terrible, terrible vendor extension that almost all vendors do) just in preparation, even though I don't (yet) plan on supporting it. Modified: head/lib/lib80211/lib80211_regdomain.c head/lib/lib80211/lib80211_regdomain.h Modified: head/lib/lib80211/lib80211_regdomain.c ============================================================================== --- head/lib/lib80211/lib80211_regdomain.c Sat Jan 7 01:54:32 2017 (r311576) +++ head/lib/lib80211/lib80211_regdomain.c Sat Jan 7 01:56:10 2017 (r311577) @@ -123,6 +123,10 @@ start_element(void *data, const char *na mt->curband = &mt->rd->bands_11ng; else if (iseq(mode, "11na")) mt->curband = &mt->rd->bands_11na; + else if (iseq(mode, "11ac")) + mt->curband = &mt->rd->bands_11ac; + else if (iseq(mode, "11acg")) + mt->curband = &mt->rd->bands_11acg; else warnx("unknown mode \"%s\" at line %ld", __DECONST(char *, mode), @@ -184,6 +188,14 @@ decode_flag(struct mystate *mt, const ch FLAG(IEEE80211_CHAN_G), FLAG(IEEE80211_CHAN_HT20), FLAG(IEEE80211_CHAN_HT40), + FLAG(IEEE80211_CHAN_VHT20), + FLAG(IEEE80211_CHAN_VHT40), + FLAG(IEEE80211_CHAN_VHT80), + /* + * XXX VHT80_80? This likely should be done by + * 80MHz chan logic in net80211 / ifconfig. + */ + FLAG(IEEE80211_CHAN_VHT160), FLAG(IEEE80211_CHAN_ST), FLAG(IEEE80211_CHAN_TURBO), FLAG(IEEE80211_CHAN_PASSIVE), @@ -515,6 +527,24 @@ lib80211_regdomain_readconfig(struct reg } nb->band = id; } + LIST_FOREACH(nb, &dp->bands_11ac, next) { + id = findid(rdp, nb->band, FREQBAND); + if (id == NULL) { + warnx("undefined 11ac band \"%s\"", + __DECONST(char *, nb->band)); + errors++; + } + nb->band = id; + } + LIST_FOREACH(nb, &dp->bands_11acg, next) { + id = findid(rdp, nb->band, FREQBAND); + if (id == NULL) { + warnx("undefined 11acg band \"%s\"", + __DECONST(char *, nb->band)); + errors++; + } + nb->band = id; + } } LIST_FOREACH(cp, &rdp->countries, next) { id = cp->rd; @@ -562,6 +592,8 @@ lib80211_regdomain_cleanup(struct regdat cleanup_bands(&dp->bands_11a); cleanup_bands(&dp->bands_11ng); cleanup_bands(&dp->bands_11na); + cleanup_bands(&dp->bands_11ac); + cleanup_bands(&dp->bands_11acg); if (dp->name != NULL) free(__DECONST(char *, dp->name)); } Modified: head/lib/lib80211/lib80211_regdomain.h ============================================================================== --- head/lib/lib80211/lib80211_regdomain.h Sat Jan 7 01:54:32 2017 (r311576) +++ head/lib/lib80211/lib80211_regdomain.h Sat Jan 7 01:56:10 2017 (r311577) @@ -75,6 +75,8 @@ struct regdomain { netband_head bands_11a; /* 11a operation */ netband_head bands_11ng;/* 11ng operation */ netband_head bands_11na;/* 11na operation */ + netband_head bands_11ac;/* 11ac 5GHz operation */ + netband_head bands_11acg;/* 11ac 2GHz operation */ LIST_ENTRY(regdomain) next; };