diff options
author | Adrian Chadd <adrian@FreeBSD.org> | 2016-04-26 01:30:29 +0000 |
---|---|---|
committer | Adrian Chadd <adrian@FreeBSD.org> | 2016-04-26 01:30:29 +0000 |
commit | 6605a047e734723fabdfc9f78ae5acec0cc4153f (patch) | |
tree | 4de837e6c243d7efa5f97460756f7ef462f6fc91 /sbin/ifconfig/ifieee80211.c | |
parent | ec3763bbeb3c081fe92eb55a57a2f13cd802d455 (diff) |
[ifconfig] add STBC TX/RX configuration
This adds the ability to view and configure the STBC parameter for
both transmit and receive.
Whilst here, fix a typo for AMSDU.
TODO:
* manpage update
Notes
Notes:
svn path=/head/; revision=298606
Diffstat (limited to 'sbin/ifconfig/ifieee80211.c')
-rw-r--r-- | sbin/ifconfig/ifieee80211.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 356fdb73498d..532c931c5ea1 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -1697,7 +1697,7 @@ set80211ampdu(const char *val, int d, int s, const struct afswtch *rafp) int ampdu; if (get80211val(s, IEEE80211_IOC_AMPDU, &du) < 0) - errx(-1, "cannot get AMPDU setting"); + errx(-1, "cannot set AMPDU setting"); if (d < 0) { d = -d; ampdu &= ~d; @@ -1706,6 +1706,21 @@ set80211ampdu(const char *val, int d, int s, const struct afswtch *rafp) set80211(s, IEEE80211_IOC_AMPDU, ampdu, 0, NULL); } +static void +set80211stbc(const char *val, int d, int s, const struct afswtch *rafp) +{ + int stbc; + + if (get80211val(s, IEEE80211_IOC_STBC, &stbc) < 0) + errx(-1, "cannot set STBC setting"); + if (d < 0) { + d = -d; + stbc &= ~d; + } else + stbc |= d; + set80211(s, IEEE80211_IOC_STBC, stbc, 0, NULL); +} + static DECL_CMD_FUNC(set80211ampdulimit, val, d) { @@ -4828,6 +4843,23 @@ end: else if (verbose) LINE_CHECK("-rifs"); } + if (get80211val(s, IEEE80211_IOC_STBC, &val) != -1) { + switch (val) { + case 0: + LINE_CHECK("-stbc"); + break; + case 1: + LINE_CHECK("stbctx -stbcrx"); + break; + case 2: + LINE_CHECK("-stbctx stbcrx"); + break; + case 3: + if (verbose) + LINE_CHECK("stbc"); + break; + } + } } if (get80211val(s, IEEE80211_IOC_WME, &wme) != -1) { @@ -5324,6 +5356,12 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("amsdu", 3, set80211amsdu), /* NB: tx+rx */ DEF_CMD("-amsdu", -3, set80211amsdu), DEF_CMD_ARG("amsdulimit", set80211amsdulimit), + DEF_CMD("stbcrx", 2, set80211stbc), + DEF_CMD("-stbcrx", -2, set80211stbc), + DEF_CMD("stbctx", 1, set80211stbc), + DEF_CMD("-stbctx", -1, set80211stbc), + DEF_CMD("stbc", 3, set80211stbc), /* NB: tx+rx */ + DEF_CMD("-ampdu", -3, set80211stbc), DEF_CMD("puren", 1, set80211puren), DEF_CMD("-puren", 0, set80211puren), DEF_CMD("doth", 1, set80211doth), |