change list wme to only print the channel parameters; to

get channel+bss use -v
This commit is contained in:
Sam Leffler 2008-08-02 18:10:14 +00:00
parent 7842b6be31
commit 87a8e294f5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181199
2 changed files with 57 additions and 38 deletions

View File

@ -1300,7 +1300,11 @@ are displayed in a short form; the
.Fl v .Fl v
flag causes this information to be displayed symbolicaly. flag causes this information to be displayed symbolicaly.
.It Cm list wme .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 When WME mode is enabled for an adaptor this information will be
displayed with the regular status; this command is mostly useful displayed with the regular status; this command is mostly useful
for examining parameters when WME mode is disabled. for examining parameters when WME mode is disabled.

View File

@ -3113,49 +3113,64 @@ get80211wme(int s, int param, int ac, int *val)
return 0; return 0;
} }
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 static void
list_wme(int s) list_wme(int s)
{ {
static const char *acnames[] = { "AC_BE", "AC_BK", "AC_VI", "AC_VO" }; 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++) { if (verbose) {
again: /* display both BSS and local settings */
if (ac & IEEE80211_WMEPARAM_BSS) for (ac = WME_AC_BE; ac <= WME_AC_VO; ac++) {
printf("\t%s", " "); again:
else if (ac & IEEE80211_WMEPARAM_BSS)
printf("\t%s", acnames[ac]); list_wme_aci(s, " ", ac);
else
/* show WME BSS parameters */ list_wme_aci(s, acnames[ac], ac);
if (get80211wme(s, IEEE80211_IOC_WME_CWMIN, ac, &val) != -1) if ((ac & IEEE80211_WMEPARAM_BSS) == 0) {
printf(" cwmin %2u", val); ac |= IEEE80211_WMEPARAM_BSS;
if (get80211wme(s, IEEE80211_IOC_WME_CWMAX, ac, &val) != -1) goto again;
printf(" cwmax %2u", val); } else
if (get80211wme(s, IEEE80211_IOC_WME_AIFS, ac, &val) != -1) ac &= ~IEEE80211_WMEPARAM_BSS;
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 */ } else {
if ((ac & IEEE80211_WMEPARAM_BSS) == 0) { /* display only channel settings */
if (get80211wme(s, IEEE80211_IOC_WME_ACKPOLICY, ac, &val) != -1) { for (ac = WME_AC_BE; ac <= WME_AC_VO; ac++)
if (!val) list_wme_aci(s, acnames[ac], ac);
printf(" -ack");
else if (verbose)
printf(" ack");
}
}
printf("\n");
if ((ac & IEEE80211_WMEPARAM_BSS) == 0) {
ac |= IEEE80211_WMEPARAM_BSS;
goto again;
} else
ac &= ~IEEE80211_WMEPARAM_BSS;
} }
} }