From patchwork Wed Mar 4 07:04:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashok Raj Nagarajan X-Patchwork-Id: 5931391 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A93AE9F373 for ; Wed, 4 Mar 2015 07:10:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3693203A5 for ; Wed, 4 Mar 2015 07:10:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC8C2203B5 for ; Wed, 4 Mar 2015 07:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934359AbbCDHKI (ORCPT ); Wed, 4 Mar 2015 02:10:08 -0500 Received: from wolverine01.qualcomm.com ([199.106.114.254]:52284 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933317AbbCDHKF (ORCPT ); Wed, 4 Mar 2015 02:10:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1425453005; x=1456989005; h=from:to:cc:subject:date:message-id:mime-version; bh=JU3cBiclVufQQORCGgs0aG82z7HUrfUYN1ht0zyFWJ4=; b=dODSvtVdoPD4+VR1tiJQAaA6UW34UYaCy205fabKvBqZgMJgm2ESSYTi JI/+QtnrKPqfnSEmP8Nw9oR9PRYYpqnugXJTd7RXWELA3jubGRvhy2QtJ ejJe3CiM3rRIJiMKaqecNp+3E019YjDw7pxK7euJ/fHeir8952XYdqEze g=; X-IronPort-AV: E=McAfee;i="5600,1067,7729"; a="106186817" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Mar 2015 23:10:04 -0800 X-IronPort-AV: E=Sophos;i="5.09,686,1418112000"; d="scan'208";a="916878995" Received: from nasanexm02g.na.qualcomm.com ([10.85.0.88]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 03 Mar 2015 23:10:02 -0800 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by nasanexm02g.na.qualcomm.com (10.85.0.88) with Microsoft SMTP Server (TLS) id 15.0.995.29; Tue, 3 Mar 2015 23:05:05 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01f.ap.qualcomm.com (10.252.127.15) with Microsoft SMTP Server (TLS) id 15.0.995.29; Tue, 3 Mar 2015 23:04:56 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Wed, 04 Mar 2015 12:34:47 +0530 From: Ashok Raj Nagarajan To: CC: , , , Ashok Raj Nagarajan Subject: [PATCH v2] iw: display allowable channel bandwidth information Date: Wed, 4 Mar 2015 12:34:46 +0530 Message-ID: <1425452686-28196-1-git-send-email-arnagara@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01f.ap.qualcomm.com (10.252.127.15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We already have allowable channel bandwidth information at userspace. Display this information with 'iw list'. Excerpt of iw list command Frequencies: * 5180 MHz [36] (17.0 dBm) (10MHZ, 20MHZ, HT40+, VHT80, VHT160) * 5200 MHz [40] (17.0 dBm) (10MHZ, 20MHZ, HT40-, HT40+, VHT80, VHT160) Signed-off-by: Ashok Raj Nagarajan --- v2: Display channel bw information in separate line (Johannes) Updated commit log to reflect above change. info.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/info.c b/info.c index 1df503f..728cb87 100644 --- a/info.c +++ b/info.c @@ -189,6 +189,31 @@ next: printf(")"); printf("\n"); + if (!tb_freq[NL80211_FREQUENCY_ATTR_DISABLED]) { + open = 0; + printf("\t\t\t "); + if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_10MHZ]) + print_flag("10MHz", &open); + + if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_20MHZ]) + print_flag("20MHz", &open); + + if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40_MINUS]) + print_flag("HT40-", &open); + + if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40_PLUS]) + print_flag("HT40+", &open); + + if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_80MHZ]) + print_flag("VHT80", &open); + + if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_160MHZ]) + print_flag("VHT160", &open); + if (open) + printf(")"); + printf("\n"); + } + if (!tb_freq[NL80211_FREQUENCY_ATTR_DISABLED] && tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]) { enum nl80211_dfs_state state = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]); unsigned long time;