From patchwork Mon Mar 30 10:56:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 6119901 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 1B1359F2EC for ; Mon, 30 Mar 2015 10:57:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4DDED201D3 for ; Mon, 30 Mar 2015 10:57:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C386920303 for ; Mon, 30 Mar 2015 10:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752624AbbC3K5Z (ORCPT ); Mon, 30 Mar 2015 06:57:25 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:35853 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbbC3K5T (ORCPT ); Mon, 30 Mar 2015 06:57:19 -0400 Received: by wibg7 with SMTP id g7so98066719wib.1 for ; Mon, 30 Mar 2015 03:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=KVY85Zf22LNCT8j+xC2at6KPiFt8AtlPs20FxBZIHBg=; b=Bi60EKp+Aw5c9/0SAiwAgdGSWgMlFITFepGqNqRGF+gDt5ocQ8vRvgQU3YPHjc4K9i SYofP3efvTM/LVX4CSgy3cVsMA74wpRipqr4bfaS7hwuoDlYKwFu0cUhH3ZjHy3PlRRQ 81OjflSNwyhTA6YTq5Jd5ezVExwtEpB/82G0s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KVY85Zf22LNCT8j+xC2at6KPiFt8AtlPs20FxBZIHBg=; b=C8E2m7Nrd8cyXB0HtgtCnBl4HqEwBrT++iEedROsJAIY4W7sxdWTeRreTt//d8wKth NMLz8Ak7AVjWz3HAmbl8bzbx5UyQ0KB1lrmMmHlTNck+uUHSbdGQ8GrSKaKvjwlw/HOG MKLum+Zqmll6Q891+Ru9QgZqBEFBPCmLCL+ZU/mOw9TFCU8ZNyzJk/gQbG6ybtWafkBc nXtP0MFRudY4H4St4Feq7/IrSH9yHf3rhHxQ5LgeyYARwA+ErgXQguNGKPudoN18E7Oj gsDnCNdc8HmUlAdp7S6JSPiP499NSLtr3musaXxTHyaTSHEcnacwFdNfrviGiMBvuxzz Tkmw== X-Gm-Message-State: ALoCoQl96Uc4bZSTN4yzvSm/HQHX6L5GAn/YCPc9PsAKyD4UM/vnizqrJCF31+tMiHxysO4qY2ldAWVDVZdWdZogb7zaUV9l0gwlhCG8ZFOlJ/4FyJzWJjEaJENqoyR5KiRqmGiAqV4i0YPCWUCoy9GaFlg/EEk+0ZtereOX2WqsShWi6IVsT0u3G95m1MY+lL/jYhDbBCt4 X-Received: by 10.194.190.10 with SMTP id gm10mr62727177wjc.91.1427713038193; Mon, 30 Mar 2015 03:57:18 -0700 (PDT) Received: from localhost.localdomain (apn-46-169-246-95.dynamic.gprs.plus.pl. [46.169.246.95]) by mx.google.com with ESMTPSA id kv10sm1922836lac.23.2015.03.30.03.57.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Mar 2015 03:57:17 -0700 (PDT) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Janusz Dziedzic Subject: [PATCH] iw: handle NL80211_ATTR_EXT_FEATURES attribute Date: Mon, 30 Mar 2015 12:56:31 +0200 Message-Id: <1427712991-26839-1-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 X-DomainID: tieto.com 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=ham 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 Print if VHT-IBSS is supported. Signed-off-by: Janusz Dziedzic --- info.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/info.c b/info.c index 66887e3..91dff15 100644 --- a/info.c +++ b/info.c @@ -63,6 +63,18 @@ static char *dfs_state_name(enum nl80211_dfs_state state) } } +static int ext_feature_isset(const unsigned char *ext_features, int ext_features_len, + enum nl80211_ext_feature_index ftidx) +{ + unsigned char ft_byte; + + if ((int) ftidx / 8 >= ext_features_len) + return 0; + + ft_byte = ext_features[ftidx / 8]; + return (ft_byte & BIT(ftidx % 8)) != 0; +} + static int print_phy_handler(struct nl_msg *msg, void *arg) { struct nlattr *tb_msg[NL80211_ATTR_MAX + 1]; @@ -601,6 +613,14 @@ broken_combination: printf("\tDevice supports TDLS channel switching\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"); + } + if (tb_msg[NL80211_ATTR_TDLS_SUPPORT]) printf("\tDevice supports T-DLS.\n");