From owner-svn-src-head@freebsd.org Tue Apr 19 05:17:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D2E6B0208B; Tue, 19 Apr 2016 05:17:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15D45128D; Tue, 19 Apr 2016 05:17:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3J5HhPx059790; Tue, 19 Apr 2016 05:17:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3J5Hh8e059789; Tue, 19 Apr 2016 05:17:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604190517.u3J5Hh8e059789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 19 Apr 2016 05:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298252 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 05:17:44 -0000 Author: adrian Date: Tue Apr 19 05:17:43 2016 New Revision: 298252 URL: https://svnweb.freebsd.org/changeset/base/298252 Log: Add VHT power envelope parsing to ifconfig. Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Apr 19 05:04:39 2016 (r298251) +++ head/sbin/ifconfig/ifieee80211.c Tue Apr 19 05:17:43 2016 (r298252) @@ -2573,6 +2573,39 @@ printvhtinfo(const char *tag, const u_in } static void +printvhtpwrenv(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) +{ + printf("%s", tag); + static const char *txpwrmap[] = { + "20", + "40", + "80", + "160", + }; + if (verbose) { + const struct ieee80211_ie_vht_txpwrenv *vhtpwr = + (const struct ieee80211_ie_vht_txpwrenv *) ie; + int i, n; + const char *sep = ""; + + /* Get count; trim at ielen */ + n = (vhtpwr->tx_info & + IEEE80211_VHT_TXPWRENV_INFO_COUNT_MASK) + 1; + /* Trim at ielen */ + if (n > ielen - 3) + n = ielen - 3; + printf("tx_info); + for (i = 0; i < n; i++) { + printf("%s%s:%.2f", sep, txpwrmap[i], + ((float) ((int8_t) ie[i+3])) / 2.0); + sep = " "; + } + + printf("]>"); + } +} + +static void printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) { printf("%s", tag); @@ -3151,7 +3184,6 @@ iename(int elemid) case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS"; case IEEE80211_ELEMID_TPC: return " TPC"; case IEEE80211_ELEMID_CCKM: return " CCKM"; - case IEEE80211_ELEMID_VHT_PWR_ENV: return " VHTPWRENV"; } return " ???"; } @@ -3222,6 +3254,9 @@ printies(const u_int8_t *vp, int ielen, case IEEE80211_ELEMID_VHT_OPMODE: printvhtinfo(" VHTOPMODE", vp, 2+vp[1], maxcols); break; + case IEEE80211_ELEMID_VHT_PWR_ENV: + printvhtpwrenv(" VHTPWRENV", vp, 2+vp[1], maxcols); + break; case IEEE80211_ELEMID_BSSLOAD: printbssload(" BSSLOAD", vp, 2+vp[1], maxcols); break;