From owner-p4-projects@FreeBSD.ORG Wed Jul 16 16:50:38 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 363C61065679; Wed, 16 Jul 2008 16:50:37 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19E7B106569F for ; Wed, 16 Jul 2008 16:50:37 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0497B8FC2D for ; Wed, 16 Jul 2008 16:50:37 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m6GGoaEC087064 for ; Wed, 16 Jul 2008 16:50:36 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m6GGoau5087062 for perforce@freebsd.org; Wed, 16 Jul 2008 16:50:36 GMT (envelope-from sam@freebsd.org) Date: Wed, 16 Jul 2008 16:50:36 GMT Message-Id: <200807161650.m6GGoau5087062@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 145337 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2008 16:50:38 -0000 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); } }