From patchwork Fri Mar 30 20:45:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Lebed X-Patchwork-Id: 10318311 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3DF4D60467 for ; Fri, 30 Mar 2018 20:45:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CC8E2A6A4 for ; Fri, 30 Mar 2018 20:45:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F7402A6A9; Fri, 30 Mar 2018 20:45:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A0AF2A6A4 for ; Fri, 30 Mar 2018 20:45:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752753AbeC3Upz (ORCPT ); Fri, 30 Mar 2018 16:45:55 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:39471 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752600AbeC3Upx (ORCPT ); Fri, 30 Mar 2018 16:45:53 -0400 Received: by mail-lf0-f66.google.com with SMTP id p142-v6so13844857lfd.6 for ; Fri, 30 Mar 2018 13:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zZn6EsMDw3drupmn05Tbx98s3I3YG1eZHe5slDSTwAk=; b=aNg+VnvQ30RDboifSjKZyx9gR3ntRYXv3BSRjc4XK8J7S/GtkjFvW2sG5oRHjQnuIL WyqBJdr6kRGoxSffg6Fu79f5yM7Dx9A7c4Iss7p/T3uuhkU3eJr6uLouNJm3dGt5o9+s BR0QVxbQC4BJQOnkEroqUeEDIXQcckoVuyjHGD+F6TGN5Z0KJJd1HXOrHqQcn1aSIHUU JIRvOOna4DhibU569i1yTozv6xPIz7BYAy125PY4OSo7YLqMlQlIu1P12F1ZcS7Rl2O2 snBTys7LDLrOZn69Xd82aDAldEtZJ57fRqwrUIsETeb4GbYdCjrLy4WBRwwQODEBTUf4 GIKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zZn6EsMDw3drupmn05Tbx98s3I3YG1eZHe5slDSTwAk=; b=AkzbUsT6I2cy11uRHiBnhDODOwzNqsj1KT+Q8qyOCeELp+MB5RBQWH5CXFUd1WSqUc RQKX+xF9V1Ma4SmLrWKppbUZW+a52FaMG9drSj0U2tlxy2IoLpbO6pN8gfwr5T91usVQ u62DjrKpOIvHp0LXNXk7rx+PbpNBhrLgfXjjmaimUJBLF43JOPouSpm7S8262kbXqt/3 Tk+PzVMBmP2QHKbk0e69KZs1wWxeaw4YMFL64l7tfjela2AV84vIcWUZfbLenvzMY6lh uHT4J4aPbPJAyrX8zOWXDTsFjCl6IQSenmXxYO9p0yhx2TuqJo5jtxTc2ZnXq85pUrkG BLcQ== X-Gm-Message-State: ALQs6tCKG1CBONsJGxKqM7iOoF0c9Hi7adN6mdgZwf1hxu2q+98n3te/ 7JadAU/bn7UPQ+n1VICESGI= X-Google-Smtp-Source: AIpwx4+AF7Y2PoPKscwmL2heK4zW9ph1I/5FweN0k7YQqMHNegQ/NY665Y4Y8pxkzELuxRnyNkKJxQ== X-Received: by 2002:a19:3bc6:: with SMTP id d67-v6mr260037lfl.100.1522442751892; Fri, 30 Mar 2018 13:45:51 -0700 (PDT) Received: from dimaz-laptop.quantenna.com (ip-195-182-157-78.clients.cmk.ru. [195.182.157.78]) by smtp.gmail.com with ESMTPSA id 94-v6sm1837196lft.85.2018.03.30.13.45.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Mar 2018 13:45:51 -0700 (PDT) From: Dmitry Lebed To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Dmitry Lebed Subject: [PATCH 2/2] iw: add printout of all supported ext_features to phy info Date: Fri, 30 Mar 2018 23:45:09 +0300 Message-Id: <20180330204509.4395-2-lebed.dmitry@gmail.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180330204509.4395-1-lebed.dmitry@gmail.com> References: <20180330204509.4395-1-lebed.dmitry@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Dmitry Lebed --- info.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 80 insertions(+), 6 deletions(-) diff --git a/info.c b/info.c index 1eba5c9..be68571 100644 --- a/info.c +++ b/info.c @@ -69,6 +69,14 @@ static int ext_feature_isset(const unsigned char *ext_features, int ext_features return (ft_byte & BIT(ftidx % 8)) != 0; } +static void ext_feat_print(const struct nlattr *tb, + enum nl80211_ext_feature_index idx, + const char *feature_name, const char *feature_desc) +{ + if (ext_feature_isset(nla_data(tb), nla_len(tb),idx)) + printf("\t\t* [ %s ]: %s\n", feature_name, feature_desc); +} + static int print_phy_handler(struct nl_msg *msg, void *arg) { struct nlattr *tb_msg[NL80211_ATTR_MAX + 1]; @@ -603,17 +611,83 @@ broken_combination: printf("\tDevice supports TDLS channel switching\n"); } + if (tb_msg[NL80211_ATTR_TDLS_SUPPORT]) + printf("\tDevice supports T-DLS.\n"); + if (tb_msg[NL80211_ATTR_EXT_FEATURES]) { struct nlattr *tb = tb_msg[NL80211_ATTR_EXT_FEATURES]; - if (ext_feature_isset(nla_data(tb), nla_len(tb), - NL80211_EXT_FEATURE_VHT_IBSS)) - printf("\tDevice supports VHT-IBSS.\n"); + printf("\tSupported extended features:\n"); + + ext_feat_print(tb, NL80211_EXT_FEATURE_VHT_IBSS, + "VHT_IBSS", "VHT-IBSS"); + ext_feat_print(tb, NL80211_EXT_FEATURE_RRM, + "RRM", "RRM"); + ext_feat_print(tb, NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER, + "MU_MIMO_AIR_SNIFFER", "MU-MIMO sniffer"); + ext_feat_print(tb, NL80211_EXT_FEATURE_SCAN_START_TIME, + "SCAN_START_TIME", "scan start timestamp"); + ext_feat_print(tb, NL80211_EXT_FEATURE_BSS_PARENT_TSF, + "BSS_PARENT_TSF", "BSS last beacon/probe TSF"); + ext_feat_print(tb, NL80211_EXT_FEATURE_SET_SCAN_DWELL, + "SET_SCAN_DWELL", "scan dwell setting"); + ext_feat_print(tb, NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, + "BEACON_RATE_LEGACY", "legacy beacon rate setting"); + ext_feat_print(tb, NL80211_EXT_FEATURE_BEACON_RATE_HT, + "BEACON_RATE_HT", "HT beacon rate setting"); + ext_feat_print(tb, NL80211_EXT_FEATURE_BEACON_RATE_VHT, + "BEACON_RATE_VHT", "VHT beacon rate setting"); + ext_feat_print(tb, NL80211_EXT_FEATURE_FILS_STA, + "FILS_STA", "STA FILS (Fast Initial Link Setup)"); + ext_feat_print(tb, NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA, + "MGMT_TX_RANDOM_TA", + "randomized TA while not associated"); + ext_feat_print(tb, NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED, + "MGMT_TX_RANDOM_TA_CONNECTED", + "randomized TA while associated"); + ext_feat_print(tb, NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI, + "SCHED_SCAN_RELATIVE_RSSI", + "sched_scan for BSS with better RSSI report"); + ext_feat_print(tb, NL80211_EXT_FEATURE_CQM_RSSI_LIST, + "CQM_RSSI_LIST", + "multiple CQM_RSSI_THOLD records"); + ext_feat_print(tb, NL80211_EXT_FEATURE_FILS_SK_OFFLOAD, + "FILS_SK_OFFLOAD", + "FILS shared key authentication offload"); + ext_feat_print(tb, NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK, + "4WAY_HANDSHAKE_STA_PSK", + "4-way handshake with PSK in station mode"); + ext_feat_print(tb, NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X, + "4WAY_HANDSHAKE_STA_1X", + "4-way handshake with 802.1X in station mode"); + ext_feat_print(tb, NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME, + "FILS_MAX_CHANNEL_TIME", + "FILS max channel attribute override with dwell time"); + ext_feat_print(tb, NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP, + "ACCEPT_BCAST_PROBE_RESP", + "accepts broadcast probe response"); + ext_feat_print(tb, NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE, + "OCE_PROBE_REQ_HIGH_TX_RATE", + "probe request TX at high rate (at least 5.5Mbps)"); + ext_feat_print(tb, NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION, + "OCE_PROBE_REQ_DEFERRAL_SUPPRESSION", + "probe request tx deferral and suppression"); + ext_feat_print(tb, NL80211_EXT_FEATURE_MFP_OPTIONAL, + "MFP_OPTIONAL", + "MFP_OPTIONAL value in ATTR_USE_MFP"); + ext_feat_print(tb, NL80211_EXT_FEATURE_LOW_SPAN_SCAN, + "LOW_SPAN_SCAN", "low span scan"); + ext_feat_print(tb, NL80211_EXT_FEATURE_LOW_POWER_SCAN, + "LOW_POWER_SCAN", "low power scan"); + ext_feat_print(tb, NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN, + "HIGH_ACCURACY_SCAN", "high accuracy scan"); + ext_feat_print(tb, NL80211_EXT_FEATURE_DFS_OFFLOAD, + "DFS_OFFLOAD", "DFS offload"); + ext_feat_print(tb, NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211, + "CONTROL_PORT_OVER_NL80211", + "control port over nl80211"); } - if (tb_msg[NL80211_ATTR_TDLS_SUPPORT]) - printf("\tDevice supports T-DLS.\n"); - if (tb_msg[NL80211_ATTR_COALESCE_RULE]) { struct nl80211_coalesce_rule_support *rule; struct nl80211_pattern_support *pat;