summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2016-04-26 01:30:29 +0000
committeradrian <adrian@FreeBSD.org>2016-04-26 01:30:29 +0000
commit3807945a67cc2ad93ba386e2699e0eae27a84bcd (patch)
tree4de837e6c243d7efa5f97460756f7ef462f6fc91
parenta99e12d2911355a8bb07bc823b9ec7b605e9b6c3 (diff)
downloadFreeBSD-src-3807945a67cc2ad93ba386e2699e0eae27a84bcd.zip
FreeBSD-src-3807945a67cc2ad93ba386e2699e0eae27a84bcd.tar.gz
[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
-rw-r--r--sbin/ifconfig/ifieee80211.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 356fdb7..532c931 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, &ampdu) < 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),
OpenPOWER on IntegriCloud