linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tamizh Chelvam <tamizhr@codeaurora.org>
To: ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, Tamizh Chelvam <tamizhr@codeaurora.org>
Subject: [PATCH 4/4] ath10k: Add new api to support reset TID config
Date: Sun, 28 Jun 2020 22:31:58 +0530	[thread overview]
Message-ID: <1593363718-5148-5-git-send-email-tamizhr@codeaurora.org> (raw)
In-Reply-To: <1593363718-5148-1-git-send-email-tamizhr@codeaurora.org>

Add ops for reset_tid_config to support reset TID
configuration. This send default configuration to the
target for the TIDs and stores default value in the host.

Signed-off-by: Tamizh Chelvam <tamizhr@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/core.h |  1 +
 drivers/net/wireless/ath/ath10k/mac.c  | 88 ++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 939cf01..4cf5bd4 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -633,6 +633,7 @@ struct ath10k_vif {
 	u8 rate_ctrl[ATH10K_TID_MAX];
 	u32 rate_code[ATH10K_TID_MAX];
 	int rtscts[ATH10K_TID_MAX];
+	u32 tids_rst;
 };
 
 struct ath10k_vif_iter {
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index b1a89c5..587df7d 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6689,6 +6689,7 @@ static int ath10k_sta_set_txpwr(struct ieee80211_hw *hw,
 struct ath10k_mac_iter_tid_conf_data {
 	struct ieee80211_vif *curr_vif;
 	struct ath10k *ar;
+	bool reset_config;
 };
 
 static bool
@@ -7071,6 +7072,54 @@ int ath10k_mac_set_tid_config(struct ath10k *ar, struct ieee80211_sta *sta,
 	return ret;
 }
 
+static int ath10k_mac_reset_tid_config(struct ath10k *ar,
+				       struct ieee80211_sta *sta,
+				       struct ath10k_vif *arvif,
+				       u8 tids)
+{
+	struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
+	struct wmi_per_peer_per_tid_cfg_arg arg;
+	int ret = 0, i;
+
+	arg.vdev_id = arvif->vdev_id;
+	while (i < ATH10K_TID_MAX) {
+		if (!(tids & BIT(i))) {
+			i++;
+			continue;
+		}
+
+		arg.tid = i;
+		arg.ack_policy = WMI_PEER_TID_CONFIG_ACK;
+		arg.retry_count = ATH10K_MAX_RETRY_COUNT;
+		arg.rate_ctrl = WMI_TID_CONFIG_RATE_CONTROL_AUTO;
+		arg.aggr_control = WMI_TID_CONFIG_AGGR_CONTROL_ENABLE;
+		arg.rtscts_ctrl = WMI_TID_CONFIG_RTSCTS_CONTROL_ENABLE;
+		arg.ext_tid_cfg_bitmap = WMI_EXT_TID_RTS_CTS_CONFIG;
+		ether_addr_copy(arg.peer_macaddr.addr, sta->addr);
+		ret = ath10k_wmi_set_per_peer_per_tid_cfg(ar, &arg);
+		if (ret)
+			return ret;
+
+		if (!arvif->tids_rst) {
+			arsta->retry_long[i] = -1;
+			arsta->noack[i] = -1;
+			arsta->ampdu[i] = -1;
+			arsta->rate_code[i] = -1;
+			arsta->rate_ctrl[i] = 0;
+			arsta->rtscts[i] = -1;
+		} else {
+			arvif->retry_long[i] = 0;
+			arvif->noack[i] = 0;
+			arvif->ampdu[i] = 0;
+			arvif->rate_code[i] = 0;
+			arvif->rate_ctrl[i] = 0;
+			arvif->rtscts[i] = 0;
+		}
+		i++;
+	}
+	return ret;
+}
+
 static void ath10k_sta_tid_cfg_wk(struct work_struct *wk)
 {
 	struct wmi_per_peer_per_tid_cfg_arg arg = {};
@@ -7091,6 +7140,12 @@ static void ath10k_sta_tid_cfg_wk(struct work_struct *wk)
 
 	mutex_lock(&ar->conf_mutex);
 
+	if (arvif->tids_rst) {
+		ret = ath10k_mac_reset_tid_config(ar, sta, arvif,
+						  arvif->tids_rst);
+		goto exit;
+	}
+
 	ether_addr_copy(arg.peer_macaddr.addr, sta->addr);
 	for (i = 0; i < ATH10K_TID_MAX; i++) {
 		config_apply = false;
@@ -7179,6 +7234,7 @@ static void ath10k_sta_tid_cfg_wk(struct work_struct *wk)
 		arg.rcode_flags = 0;
 	}
 
+exit:
 	mutex_unlock(&ar->conf_mutex);
 }
 
@@ -9080,6 +9136,7 @@ static int ath10k_mac_op_set_tid_config(struct ieee80211_hw *hw,
 	mutex_lock(&ar->conf_mutex);
 	arg.vdev_id = arvif->vdev_id;
 
+	arvif->tids_rst = 0;
 	memset(arvif->tid_conf_changed, 0, sizeof(arvif->tid_conf_changed));
 
 	for (i = 0; i < tid_config->n_tid_conf; i++) {
@@ -9094,6 +9151,7 @@ static int ath10k_mac_op_set_tid_config(struct ieee80211_hw *hw,
 		goto exit;
 
 	ret = 0;
+	arvif->tids_rst = 0;
 	data.curr_vif = vif;
 	data.ar = ar;
 
@@ -9105,6 +9163,35 @@ static int ath10k_mac_op_set_tid_config(struct ieee80211_hw *hw,
 	return ret;
 }
 
+static int ath10k_mac_op_reset_tid_config(struct ieee80211_hw *hw,
+					  struct ieee80211_vif *vif,
+					  struct ieee80211_sta *sta,
+					  u8 tids)
+{
+	struct ath10k_vif *arvif = (void *)vif->drv_priv;
+	struct ath10k_mac_iter_tid_conf_data data = {};
+	struct ath10k *ar = hw->priv;
+	int ret = 0;
+
+	mutex_lock(&ar->conf_mutex);
+
+	if (sta) {
+		arvif->tids_rst = 0;
+		ret = ath10k_mac_reset_tid_config(ar, sta, arvif, tids);
+		goto exit;
+	}
+
+	arvif->tids_rst = tids;
+	data.curr_vif = vif;
+	data.ar = ar;
+	ieee80211_iterate_stations_atomic(hw, ath10k_mac_vif_stations_tid_conf,
+					  &data);
+
+exit:
+	mutex_unlock(&ar->conf_mutex);
+	return ret;
+}
+
 static const struct ieee80211_ops ath10k_ops = {
 	.tx				= ath10k_mac_op_tx,
 	.wake_tx_queue			= ath10k_mac_op_wake_tx_queue,
@@ -9149,6 +9236,7 @@ static int ath10k_mac_op_set_tid_config(struct ieee80211_hw *hw,
 	.sta_pre_rcu_remove		= ath10k_mac_op_sta_pre_rcu_remove,
 	.sta_statistics			= ath10k_sta_statistics,
 	.set_tid_config			= ath10k_mac_op_set_tid_config,
+	.reset_tid_config		= ath10k_mac_op_reset_tid_config,
 
 	CFG80211_TESTMODE_CMD(ath10k_tm_cmd)
 
-- 
1.9.1


  parent reply	other threads:[~2020-06-28 17:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28 17:01 [PATCH 0/4] ath10k: Add support for TID specific configuration Tamizh Chelvam
2020-06-28 17:01 ` [PATCH 1/4] ath10k: Add wmi command support for station specific TID config Tamizh Chelvam
2020-06-28 17:01 ` [PATCH 2/4] ath10k: Move rate mask validation function up in the file Tamizh Chelvam
2020-06-28 17:01 ` [PATCH 3/4] ath10k: Add new api to support TID specific configuration Tamizh Chelvam
2020-06-29  8:39   ` kernel test robot
2020-06-29 10:02   ` kernel test robot
2020-06-29 10:02   ` [RFC PATCH] ath10k: ath10k_mac_set_tid_config() can be static kernel test robot
2020-06-28 17:01 ` Tamizh Chelvam [this message]
2020-06-29  9:11   ` [PATCH 4/4] ath10k: Add new api to support reset TID config kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1593363718-5148-5-git-send-email-tamizhr@codeaurora.org \
    --to=tamizhr@codeaurora.org \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).