change list wme to only print the channel parameters; to
get channel+bss use -v
This commit is contained in:
parent
7842b6be31
commit
87a8e294f5
@ -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.
|
||||
|
@ -3113,49 +3113,64 @@ get80211wme(int s, int param, int ac, int *val)
|
||||
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
|
||||
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");
|
||||
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;
|
||||
}
|
||||
/* !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");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user