diff options
author | sam <sam@FreeBSD.org> | 2008-08-02 18:10:14 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-08-02 18:10:14 +0000 |
commit | ddf87cb1a8b2c7d47271b84b2ec340c96163187f (patch) | |
tree | a817d8d350ba51ea4127bebfa3ca2bc5f4dbb740 /sbin | |
parent | 1a57b0b9b6bd985b252029106805892f64a45841 (diff) | |
download | FreeBSD-src-ddf87cb1a8b2c7d47271b84b2ec340c96163187f.zip FreeBSD-src-ddf87cb1a8b2c7d47271b84b2ec340c96163187f.tar.gz |
change list wme to only print the channel parameters; to
get channel+bss use -v
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifconfig.8 | 6 | ||||
-rw-r--r-- | sbin/ifconfig/ifieee80211.c | 89 |
2 files changed, 57 insertions, 38 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index d9f9151..ef0699a 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -1300,7 +1300,11 @@ are displayed in a short form; the .Fl v flag causes this information to be displayed symbolicaly. .It Cm list wme -Display the current parameters to use when operating in WME mode. +Display the current channel parameters to use when operating in WME mode. +If the +.Fl v +option is specified then both channel and BSS parameters are displayed +for each AC (first channel, then BSS). When WME mode is enabled for an adaptor this information will be displayed with the regular status; this command is mostly useful for examining parameters when WME mode is disabled. diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index ae8a281..2ba32a9 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -3114,48 +3114,63 @@ get80211wme(int s, int param, int ac, int *val) } static void +list_wme_aci(int s, const char *tag, int ac) +{ + int val; + + printf("\t%s", tag); + + /* show WME BSS parameters */ + if (get80211wme(s, IEEE80211_IOC_WME_CWMIN, ac, &val) != -1) + printf(" cwmin %2u", val); + if (get80211wme(s, IEEE80211_IOC_WME_CWMAX, ac, &val) != -1) + printf(" cwmax %2u", val); + if (get80211wme(s, IEEE80211_IOC_WME_AIFS, ac, &val) != -1) + printf(" aifs %2u", val); + if (get80211wme(s, IEEE80211_IOC_WME_TXOPLIMIT, ac, &val) != -1) + printf(" txopLimit %3u", val); + if (get80211wme(s, IEEE80211_IOC_WME_ACM, ac, &val) != -1) { + if (val) + printf(" acm"); + else if (verbose) + printf(" -acm"); + } + /* !BSS only */ + if ((ac & IEEE80211_WMEPARAM_BSS) == 0) { + if (get80211wme(s, IEEE80211_IOC_WME_ACKPOLICY, ac, &val) != -1) { + if (!val) + printf(" -ack"); + else if (verbose) + printf(" ack"); + } + } + printf("\n"); +} + +static void list_wme(int s) { static const char *acnames[] = { "AC_BE", "AC_BK", "AC_VI", "AC_VO" }; - int ac, val; + int ac; - for (ac = WME_AC_BE; ac <= WME_AC_VO; ac++) { -again: - if (ac & IEEE80211_WMEPARAM_BSS) - printf("\t%s", " "); - else - printf("\t%s", acnames[ac]); - - /* show WME BSS parameters */ - if (get80211wme(s, IEEE80211_IOC_WME_CWMIN, ac, &val) != -1) - printf(" cwmin %2u", val); - if (get80211wme(s, IEEE80211_IOC_WME_CWMAX, ac, &val) != -1) - printf(" cwmax %2u", val); - if (get80211wme(s, IEEE80211_IOC_WME_AIFS, ac, &val) != -1) - printf(" aifs %2u", val); - if (get80211wme(s, IEEE80211_IOC_WME_TXOPLIMIT, ac, &val) != -1) - printf(" txopLimit %3u", val); - if (get80211wme(s, IEEE80211_IOC_WME_ACM, ac, &val) != -1) { - if (val) - printf(" acm"); - else if (verbose) - printf(" -acm"); - } - /* !BSS only */ - if ((ac & IEEE80211_WMEPARAM_BSS) == 0) { - if (get80211wme(s, IEEE80211_IOC_WME_ACKPOLICY, ac, &val) != -1) { - if (!val) - printf(" -ack"); - else if (verbose) - printf(" ack"); - } + if (verbose) { + /* display both BSS and local settings */ + for (ac = WME_AC_BE; ac <= WME_AC_VO; ac++) { + again: + if (ac & IEEE80211_WMEPARAM_BSS) + list_wme_aci(s, " ", ac); + else + list_wme_aci(s, acnames[ac], ac); + if ((ac & IEEE80211_WMEPARAM_BSS) == 0) { + ac |= IEEE80211_WMEPARAM_BSS; + goto again; + } else + ac &= ~IEEE80211_WMEPARAM_BSS; } - printf("\n"); - if ((ac & IEEE80211_WMEPARAM_BSS) == 0) { - ac |= IEEE80211_WMEPARAM_BSS; - goto again; - } else - ac &= ~IEEE80211_WMEPARAM_BSS; + } else { + /* display only channel settings */ + for (ac = WME_AC_BE; ac <= WME_AC_VO; ac++) + list_wme_aci(s, acnames[ac], ac); } } |