Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3930642ybl; Mon, 13 Jan 2020 05:12:38 -0800 (PST) X-Google-Smtp-Source: APXvYqy0BjnmFO+oAdYjm3tsokjtj93J+juDHvUcwmkWtz27S4+TTe7ZmccMohK433ixnMZRRAnm X-Received: by 2002:a9d:3f61:: with SMTP id m88mr12167988otc.56.1578921158203; Mon, 13 Jan 2020 05:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578921158; cv=none; d=google.com; s=arc-20160816; b=ZdCqo3vMV+weMtKzTM07CuoGCPmvgzNVgM5eEa8tcMyGGoYddr8KRmIqbaCWkGFXsv FEizZ6VMTzp8WYTN2GrlFvhjP4yYK7X6vZUk/wRxk7QHxGfWukionFCh3PwPI/r5kzV7 u0QtB6neIUfvwKs8wwpRpABgROWIMVibX74rrBq0zuZ1URTKKHTjrq7Axq8GGehEXXQ/ bEPG9cVq9BkUxNR0ltSsMC8FvjJDm8Ns6gt67oUpGp3JV9qBDel0680QxhB/3WCS6J92 O5Mu2b5QiDa9TF8V/Gml4iZYwlVP9EB01GGzYM2DXDLWZiMH+G6Kv9kr7Z3cSIQswoXC StBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=fa2dPezte4xe7W3VHwC3S0Oaq7l7V7MlQz4H00dK8z8=; b=0cezZISXn9HYJHSGgEqNV8w1GuxVWlYWYzSI9gyNOXRFFvdiCiz5ekTt316tUL4ozL r1l07HhKupw0nQJtf5EYx+OEa0aTrX2XRSr9XiTLMFHDOnfYYiFwR8XeGMKLevasVmjj lVWFqa2BT8yvDOuG7ELPf7k/XV2m0/4LnoRK2t6KzWAi3bOo1FsvC3GxOWBqla8yWLTX ASxOp46WJFiN5uCse05+y5EnFcw+TR4I1cwoiOVXbhAoMKHedAOo4vX+WxwMldSqprgA /3Hane9LaA+ZrPp4YFtwyutAFz05/uPN5swk/3nEoR2jop2dwCSLlvH7vmxkE8d1mUYn JreQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=aYP5KjRB; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l78si5915720oih.182.2020.01.13.05.12.27; Mon, 13 Jan 2020 05:12:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=aYP5KjRB; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728734AbgAMNMB (ORCPT + 99 others); Mon, 13 Jan 2020 08:12:01 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:55873 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728682AbgAMNMA (ORCPT ); Mon, 13 Jan 2020 08:12:00 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1578921119; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=fa2dPezte4xe7W3VHwC3S0Oaq7l7V7MlQz4H00dK8z8=; b=aYP5KjRBb5/Nb84z5TwFnPY88Ywdjm6fv/Qeo3QPu2MY9aqbjXeiz47qA+lzWCvtBsVWbwnH WVLzv6bVBp4f0nb5FBWIABKzFypSs7dtJ6cpbDyZBIsK5kysJ4fvLzmmZh9pz9N0JFrXmarB Bx9h+Vdf2PhphTan9KSiWtVM0bA= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e1c6c9e.7f82c35a45a8-smtp-out-n02; Mon, 13 Jan 2020 13:11:58 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 8AB42C447A3; Mon, 13 Jan 2020 13:11:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from akolli-ThinkPad-L560.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) by smtp.codeaurora.org (Postfix) with ESMTPSA id A5C7DC4479C; Mon, 13 Jan 2020 13:11:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A5C7DC4479C Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh Chelvam To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Tamizh chelvam Subject: [PATCHv9 6/6] mac80211: Add api to support configuring TID specific configuration Date: Mon, 13 Jan 2020 18:41:30 +0530 Message-Id: <1578921090-9758-7-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1578921090-9758-1-git-send-email-tamizhr@codeaurora.org> References: <1578921090-9758-1-git-send-email-tamizhr@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Tamizh chelvam Implement drv_set_tid_config api to allow TID specific configuration and drv_reset_tid_config api to reset peer specific TID configuration. This per-TID onfiguration will be applied for all the connected stations when MAC is NULL. Signed-off-by: Tamizh chelvam --- include/net/mac80211.h | 10 ++++++++ net/mac80211/cfg.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ net/mac80211/driver-ops.h | 27 ++++++++++++++++++++++ 3 files changed, 93 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 682fd2f..c50713a 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3775,6 +3775,9 @@ enum ieee80211_reconfig_type { * * @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep) * @abort_pmsr: abort peer measurement (this call can sleep) + * @set_tid_config: Apply TID specific configurations. This callback may sleep. + * @reset_tid_config: Reset TID specific configuration for the peer. + * This callback may sleep. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -4079,6 +4082,13 @@ struct ieee80211_ops { struct cfg80211_pmsr_request *request); void (*abort_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_pmsr_request *request); + int (*set_tid_config)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ieee80211_tid_config *tid_conf); + int (*reset_tid_config)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, u8 tid); }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 4fb7f1f..f0f7e42 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3942,6 +3942,60 @@ static int ieee80211_get_txq_stats(struct wiphy *wiphy, return drv_abort_pmsr(local, sdata, request); } +static int ieee80211_set_tid_config(struct wiphy *wiphy, + struct net_device *dev, + struct ieee80211_tid_config *tid_conf) +{ + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct sta_info *sta; + int ret; + + if (!sdata->local->ops->set_tid_config) + return -EOPNOTSUPP; + + if (!tid_conf->peer) + return drv_set_tid_config(sdata->local, sdata, NULL, tid_conf); + + mutex_lock(&sdata->local->sta_mtx); + + sta = sta_info_get_bss(sdata, tid_conf->peer); + if (!sta) { + mutex_unlock(&sdata->local->sta_mtx); + return -ENOENT; + } + + ret = drv_set_tid_config(sdata->local, sdata, &sta->sta, tid_conf); + mutex_unlock(&sdata->local->sta_mtx); + return ret; +} + +static int ieee80211_reset_tid_config(struct wiphy *wiphy, + struct net_device *dev, + const u8 *peer, u8 tid) +{ + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct sta_info *sta; + int ret; + + if (!sdata->local->ops->reset_tid_config) + return -EOPNOTSUPP; + + if (!peer) + return -EINVAL; + + mutex_lock(&sdata->local->sta_mtx); + + sta = sta_info_get_bss(sdata, peer); + if (!sta) { + mutex_unlock(&sdata->local->sta_mtx); + return -ENOENT; + } + + ret = drv_reset_tid_config(sdata->local, sdata, &sta->sta, tid); + mutex_unlock(&sdata->local->sta_mtx); + return ret; +} + const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, @@ -4040,4 +4094,6 @@ static int ieee80211_get_txq_stats(struct wiphy *wiphy, .start_pmsr = ieee80211_start_pmsr, .abort_pmsr = ieee80211_abort_pmsr, .probe_mesh_link = ieee80211_probe_mesh_link, + .set_tid_config = ieee80211_set_tid_config, + .reset_tid_config = ieee80211_reset_tid_config, }; diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 2c9b3eb8..dcbd105 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1358,4 +1358,31 @@ static inline void drv_del_nan_func(struct ieee80211_local *local, trace_drv_return_void(local); } +static inline int drv_set_tid_config(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct ieee80211_sta *sta, + struct ieee80211_tid_config *tid_conf) +{ + int ret; + + might_sleep(); + ret = local->ops->set_tid_config(&local->hw, &sdata->vif, sta, + tid_conf); + trace_drv_return_int(local, ret); + + return ret; +} + +static inline int drv_reset_tid_config(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct ieee80211_sta *sta, u8 tid) +{ + int ret; + + might_sleep(); + ret = local->ops->reset_tid_config(&local->hw, &sdata->vif, sta, tid); + trace_drv_return_int(local, ret); + + return ret; +} #endif /* __MAC80211_DRIVER_OPS */ -- 1.7.9.5