From patchwork Fri Feb 22 05:32:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10825223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E60A6C2 for ; Fri, 22 Feb 2019 05:34:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B1092E25B for ; Fri, 22 Feb 2019 05:34:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F1BB2EEA9; Fri, 22 Feb 2019 05:34:33 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF0892E25B for ; Fri, 22 Feb 2019 05:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=uTEpAwFtE2HGfImljxcPQXuRjGwcuwb/75Yf2+7NgDI=; b=nmbVTXRsbSQ6uj3WbYpc+SElaR YvYYh3vkm5HuafPHlQQhY+5O6HaIe0F81nD0G27XmAAn13fmhhaXCOXVkycBB+oblG+58+TxZNgNV DiBRyZfUgbnZ3dkWJpRrAkTgCdQ57gzj6HZZkvZ8VoZuD8XjYEmNJbrZCUSiu6mqAEcLSatlYaKMg RJnc4+VqiFNRb9cZ1ia2k8S5tPIViHQCTczBus+vQVIxzPpGgeeWk/h8kBQpk8dstVXqoMCAMAz/q UXjCHcT7VclNqS2c3quR52gQfmIxCQKFx45AP5y+UKIcXiwok27xUfcKSEJdspkt/7VNEJssiLbcv fxIRbl6g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gx3Tj-0001S0-97; Fri, 22 Feb 2019 05:34:31 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gx3Te-0001Ly-55 for ath10k@lists.infradead.org; Fri, 22 Feb 2019 05:34:28 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C94D0609B4; Fri, 22 Feb 2019 05:34:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550813665; bh=ORQcyt9VZmjvF9lfbAx56QatEhXt2kgUL9PCULWcm+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LLRMt0U4bDE+2YSxkR9rT1bAZYRCNCjpB4ee91lk+8px2DcTSfXbsK+UVyQHUDPkY god6PLhz2qv9c2NNBYfNu9x9q1qvf48iNoaZB92pAiOtNtdCapTrkNHf5YPWRPsJNl u8XcXWxASmUCf5g9/rPjn+LF8dyKzUI3sSo7K+pE= Received: from cheath10p342229-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7B642608CB; Fri, 22 Feb 2019 05:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550813664; bh=ORQcyt9VZmjvF9lfbAx56QatEhXt2kgUL9PCULWcm+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WmG8iZR0KeyWLcgwiOsHr7/bhH0huStl2FePGu9SCgFD4MMGv9FErFjOsHFgzeE+x 7JkUG6pxLlsHlSnLnZ1whKNJA6DkT1wqh9ajHhH32Fq2TkCtfJVxZwrMKyB9NIfkpA Wa2GRrdHxNMxzdhz2o1xkLaBaO7qY++8gdLTq5/c= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7B642608CB Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh chelvam To: johannes@sipsolutions.net, ath10k@lists.infradead.org Subject: [PATCHv2 4/9] nl80211: Add netlink attribute to enable/disable RTS_CTS Date: Fri, 22 Feb 2019 11:02:29 +0530 Message-Id: <1550813554-11581-5-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550813554-11581-1-git-send-email-tamizhr@codeaurora.org> References: <1550813554-11581-1-git-send-email-tamizhr@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190221_213426_682847_C3C62396 X-CRM114-Status: GOOD ( 15.64 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Tamizh chelvam MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce NL80211_ATTR_TID_CONFIG_RTSCTS_CTRL in nl80211_attr_tid_config to accept TID specific RTS_CTS enable/disable configuration through NL80211_CMD_SET_TID_CONFIG command. TID for which the RTS_CTS control configuration is to be applied is passed in NL80211_ATTR_TID_CONFIG_TID attribute. When the user-space wants this configuration peer specific rather than being applied for all the connected stations, MAC address of the peer can be passed in NL80211_ATTR_MAC attribute. Driver supporting this feature should advertise NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL and supporting per-STA data TID RTS_CTS configuration should advertise NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL. Signed-off-by: Tamizh chelvam --- include/net/cfg80211.h | 3 +++ include/uapi/linux/nl80211.h | 22 ++++++++++++++++++++++ net/wireless/nl80211.c | 17 +++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index fcf33c9..cf4a3f0 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -513,6 +513,7 @@ enum ieee80211_tid_conf_mask { IEEE80211_TID_CONF_NOACK = BIT(0), IEEE80211_TID_CONF_RETRY = BIT(1), IEEE80211_TID_CONF_AMPDU = BIT(2), + IEEE80211_TID_CONF_RTSCTS = BIT(3), }; /** @@ -524,6 +525,7 @@ enum ieee80211_tid_conf_mask { * @retry_long: retry count value * @retry_short: retry count value * @ampdu: Enable/Disable aggregation + * @rtscts: Enable/Disable RTS/CTS */ struct ieee80211_tid_cfg { u8 tid; @@ -532,6 +534,7 @@ struct ieee80211_tid_cfg { int retry_long; int retry_short; u8 ampdu; + u8 rtscts; }; /** diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index f94651d..996b4d4 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -4630,6 +4630,21 @@ enum nl80211_tid_config { * NL80211_EXT_FEATURE_PER_TID_AMPDU_CTRL and supporting per station * aggregation configuration should advertise * NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL. + * @NL80211_ATTR_TID_CONFIG_RTSCTS_CTRL: Enable/Disable RTS_CTS for the TID + * specified in %%NL80211_ATTR_TID_CONFIG_TID. It is u8 type, if the + * peer MAC address is passed in %NL80211_ATTR_MAC, then this + * configuration is applied to the data frame for the tid to that + * connected station. + * Station specific RTS_CTS configuration is valid only for STA's + * current connection. i.e. the configuration will be reset to default when + * the station connects back after disconnection/roaming. + * when user-space does not include %NL80211_ATTR_MAC, this configuration + * should be treated as per-netdev configuration. This configuration will + * be cleared when the interface goes down and on the disconnection from a + * BSS. Driver supporting this feature should advertise + * NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL and supporting per station + * RTS_CTS configuration should advertise + * NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL. */ enum nl80211_attr_tid_config { __NL80211_ATTR_TID_INVALID, @@ -4639,6 +4654,7 @@ enum nl80211_attr_tid_config { NL80211_ATTR_TID_CONFIG_RETRY_SHORT, NL80211_ATTR_TID_CONFIG_RETRY_LONG, NL80211_ATTR_TID_CONFIG_AMPDU_CTRL, + NL80211_ATTR_TID_CONFIG_RTSCTS_CTRL, /* keep last */ __NL80211_ATTR_TID_CONFIG_AFTER_LAST, @@ -5457,6 +5473,10 @@ enum nl80211_feature_flags { * aggregation control(enable/disable). * @NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL: Driver supports per STA * specific TID aggregation control(enable/disable). + * @NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL: Driver supports TID specific + * RTS_CTS control(enable/disable). + * @NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL: Driver supports STA specific + * RTS_CTS control(enable/disable). * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. @@ -5505,6 +5525,8 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_PER_STA_RETRY_CONFIG, NL80211_EXT_FEATURE_PER_TID_AMPDU_CTRL, NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL, + NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL, + NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d4a88fa..cd1e1e8 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -290,6 +290,8 @@ static int validate_ie_attr(const struct nlattr *attr, [NL80211_ATTR_TID_CONFIG_RETRY_LONG] = NLA_POLICY_MIN(NLA_U8, 1), [NL80211_ATTR_TID_CONFIG_AMPDU_CTRL] = NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE), + [NL80211_ATTR_TID_CONFIG_RTSCTS_CTRL] = + NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE), }; const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { @@ -13319,6 +13321,21 @@ static int parse_tid_conf(struct cfg80211_registered_device *rdev, tid_conf->ampdu = nla_get_u8(attrs[NL80211_ATTR_TID_CONFIG_AMPDU_CTRL]); } + + if (attrs[NL80211_ATTR_TID_CONFIG_RTSCTS_CTRL]) { + if (!wiphy_ext_feature_isset(&rdev->wiphy, + NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL)) + return -ENOTSUPP; + + if (peer && !wiphy_ext_feature_isset(&rdev->wiphy, + NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL)) + return -ENOTSUPP; + + tid_conf->tid_conf_mask |= IEEE80211_TID_CONF_RTSCTS; + tid_conf->rtscts = + nla_get_u8(attrs[NL80211_ATTR_TID_CONFIG_RTSCTS_CTRL]); + } + return 0; }