PERFORCE change 145337 for review
Sam Leffler
sam at FreeBSD.org
Wed Jul 16 16:50:38 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=145337
Change 145337 by sam at sam_ebb on 2008/07/16 16:50:25
change list wme to only print the channel parameters; to
get channel+bss use -v
Affected files ...
.. //depot/projects/vap/sbin/ifconfig/ifieee80211.c#23 edit
Differences ...
==== //depot/projects/vap/sbin/ifconfig/ifieee80211.c#23 (text+ko) ====
@@ -3114,48 +3114,63 @@
}
static void
-list_wme(int s)
+list_wme_aci(int s, const char *tag, int ac)
{
- static const char *acnames[] = { "AC_BE", "AC_BK", "AC_VI", "AC_VO" };
- int ac, val;
+ int val;
- 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]);
+ 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");
+ /* 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(" -acm");
+ printf(" ack");
}
- /* !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;
+
+ 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);
}
}
More information about the p4-projects
mailing list