Date: Tue, 26 Apr 2016 01:30:29 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298606 - head/sbin/ifconfig Message-ID: <201604260130.u3Q1UT1v088385@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Tue Apr 26 01:30:29 2016 New Revision: 298606 URL: https://svnweb.freebsd.org/changeset/base/298606 Log: [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 Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Apr 26 01:29:26 2016 (r298605) +++ head/sbin/ifconfig/ifieee80211.c Tue Apr 26 01:30:29 2016 (r298606) @@ -1697,7 +1697,7 @@ set80211ampdu(const char *val, int d, in 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, in 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),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604260130.u3Q1UT1v088385>