From patchwork Tue Feb 14 13:22:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 9571941 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 07E0A60578 for ; Tue, 14 Feb 2017 13:22:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAD4F27C2D for ; Tue, 14 Feb 2017 13:22:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC1C728417; Tue, 14 Feb 2017 13:22:38 +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=-6.9 required=2.0 tests=BAYES_00,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 493FF27C2D for ; Tue, 14 Feb 2017 13:22:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753849AbdBNNWh (ORCPT ); Tue, 14 Feb 2017 08:22:37 -0500 Received: from s3.sipsolutions.net ([5.9.151.49]:43608 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753836AbdBNNWO (ORCPT ); Tue, 14 Feb 2017 08:22:14 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.88) (envelope-from ) id 1cdd3c-0004HA-Tr; Tue, 14 Feb 2017 14:22:13 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: j@w1.fi, greearb@candelatech.com, Johannes Berg Subject: [RFC v2 5/7] mac80211: introduce capability flags for VHT EXT NSS support Date: Tue, 14 Feb 2017 14:22:06 +0100 Message-Id: <20170214132208.8715-6-johannes@sipsolutions.net> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170214132208.8715-1-johannes@sipsolutions.net> References: <20170214132208.8715-1-johannes@sipsolutions.net> 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 From: Johannes Berg Depending on whether or not rate control supports selecting rates depending on the bandwidth, we can use VHT extended NSS support. In essence, this is dot11VHTExtendedNSSBWCapable from the spec, since depending on that we'll need to parse the bandwidth. Signed-off-by: Johannes Berg --- include/net/mac80211.h | 18 ++++++++++++++++++ net/mac80211/debugfs.c | 1 + net/mac80211/main.c | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b9a08cd1d97d..68f90180a470 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -2043,6 +2043,11 @@ struct ieee80211_txq { * The stack will not do fragmentation. * The callback for @set_frag_threshold should be set as well. * + * @IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW: (Hardware) rate control supports VHT + * extended NSS BW (dot11VHTExtendedNSSBWCapable). This flag will be set if + * the selected rate control algorithm sets %RATE_CTRL_CAPA_VHT_EXT_NSS_BW + * but if the rate control is built-in then it must be set by the driver. + * * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { @@ -2085,6 +2090,7 @@ enum ieee80211_hw_flags { IEEE80211_HW_TX_FRAG_LIST, IEEE80211_HW_REPORTS_LOW_ACK, IEEE80211_HW_SUPPORTS_TX_FRAG, + IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS @@ -5458,7 +5464,19 @@ struct ieee80211_tx_rate_control { bool bss; }; +/** + * enum rate_control_capabilities - rate control capabilities + */ +enum rate_control_capabilities { + /** + * @RATE_CTRL_CAPA_VHT_EXT_NSS_BW: + * support for extended NSS BW support (dot11VHTExtendedNSSCapable) + */ + RATE_CTRL_CAPA_VHT_EXT_NSS_BW = BIT(0), +}; + struct rate_control_ops { + unsigned long capa; const char *name; void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); void (*free)(void *priv); diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index 5fae001f286c..a431514ea01c 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -211,6 +211,7 @@ static const char *hw_flag_names[] = { FLAG(TX_FRAG_LIST), FLAG(REPORTS_LOW_ACK), FLAG(SUPPORTS_TX_FRAG), + FLAG(SUPPORTS_VHT_EXT_NSS_BW), #undef FLAG }; diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 56fb47953b72..91e2faf174dd 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1095,6 +1095,12 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) goto fail_rate; } + if (local->rate_ctrl) { + clear_bit(IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW, hw->flags); + if (local->rate_ctrl->ops->capa & RATE_CTRL_CAPA_VHT_EXT_NSS_BW) + ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW); + } + /* add one default STA interface if supported */ if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) && !ieee80211_hw_check(hw, NO_AUTO_VIF)) {