Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jul 2008 16:50:36 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 145337 for review
Message-ID:  <200807161650.m6GGoau5087062@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=145337

Change 145337 by sam@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);
 	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807161650.m6GGoau5087062>