[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.
This commit is contained in:
Adrian Chadd 2017-01-07 01:56:10 +00:00
parent 55c68c64a4
commit 36ea5759aa
2 changed files with 34 additions and 0 deletions

View File

@ -123,6 +123,10 @@ start_element(void *data, const char *name, const char **attr)
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 char *p, int len)
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 regdata *rdp, const void *p, size_t len)
}
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 regdata *rdp)
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));
}

View File

@ -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;
};