All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: linux-wireless@vger.kernel.org
Cc: kvalo@codeaurora.org, luciano.coelho@intel.com,
	Sara Sharon <sara.sharon@intel.com>
Subject: [PATCH 24/25] iwlwifi: mvm: use mvm_disable_queue instead of sharing logic
Date: Tue, 24 Jan 2017 00:03:49 +0200	[thread overview]
Message-ID: <20170123220350.25305-25-luca@coelho.fi> (raw)
In-Reply-To: <20170123220350.25305-1-luca@coelho.fi>

From: Sara Sharon <sara.sharon@intel.com>

When removing inactive queue - use the central disable queue
function. This is needed due to a000 changes to come, but is
a proper cleanup anyway.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h   |  4 ++--
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c   | 22 ++++++++--------------
 drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 10 ++++++----
 3 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 4a9cb76b7611..a672aa71c656 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1657,8 +1657,8 @@ void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
  * Disable a TXQ.
  * Note that in non-DQA mode the %mac80211_queue and %tid params are ignored.
  */
-void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
-			 u8 tid, u8 flags);
+int iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
+			u8 tid, u8 flags);
 int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 sta_id, u8 minq, u8 maxq);
 
 /* Return a bitmask with all the hw supported queues, except for the
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index cf8222a8b588..4ea9589e8823 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -755,28 +755,22 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
 	 * first
 	 */
 	if (using_inactive_queue) {
-		struct iwl_scd_txq_cfg_cmd cmd = {
-			.scd_queue = queue,
-			.action = SCD_CFG_DISABLE_QUEUE,
-		};
-		u8 txq_curr_ac;
-
-		disable_agg_tids = iwl_mvm_remove_sta_queue_marking(mvm, queue);
+		u8 txq_curr_ac, sta_id;
 
 		spin_lock_bh(&mvm->queue_info_lock);
 		txq_curr_ac = mvm->queue_info[queue].mac80211_ac;
-		cmd.sta_id = mvm->queue_info[queue].ra_sta_id;
-		cmd.tx_fifo = iwl_mvm_ac_to_tx_fifo[txq_curr_ac];
-		cmd.tid = mvm->queue_info[queue].txq_tid;
+		sta_id = mvm->queue_info[queue].ra_sta_id;
 		spin_unlock_bh(&mvm->queue_info_lock);
 
+		disable_agg_tids = iwl_mvm_remove_sta_queue_marking(mvm, queue);
 		/* Disable the queue */
 		if (disable_agg_tids)
 			iwl_mvm_invalidate_sta_queue(mvm, queue,
 						     disable_agg_tids, false);
-		iwl_trans_txq_disable(mvm->trans, queue, false);
-		ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, sizeof(cmd),
-					   &cmd);
+
+		ret = iwl_mvm_disable_txq(mvm, queue,
+					  mvmsta->vif->hw_queue[txq_curr_ac],
+					  tid, 0);
 		if (ret) {
 			IWL_ERR(mvm,
 				"Failed to free inactive queue %d (ret=%d)\n",
@@ -791,7 +785,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
 		}
 
 		/* If TXQ is allocated to another STA, update removal in FW */
-		if (cmd.sta_id != mvmsta->sta_id)
+		if (sta_id != mvmsta->sta_id)
 			iwl_mvm_invalidate_sta_queue(mvm, queue, 0, true);
 	}
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index d04babd99b53..2beea3b98e52 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -706,8 +706,8 @@ void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
 	}
 }
 
-void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
-			 u8 tid, u8 flags)
+int iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
+			u8 tid, u8 flags)
 {
 	struct iwl_scd_txq_cfg_cmd cmd = {
 		.scd_queue = queue,
@@ -720,7 +720,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
 
 	if (WARN_ON(mvm->queue_info[queue].hw_queue_refcount == 0)) {
 		spin_unlock_bh(&mvm->queue_info_lock);
-		return;
+		return 0;
 	}
 
 	mvm->queue_info[queue].tid_bitmap &= ~BIT(tid);
@@ -760,7 +760,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
 	/* If the queue is still enabled - nothing left to do in this func */
 	if (cmd.action == SCD_CFG_ENABLE_QUEUE) {
 		spin_unlock_bh(&mvm->queue_info_lock);
-		return;
+		return 0;
 	}
 
 	cmd.sta_id = mvm->queue_info[queue].ra_sta_id;
@@ -791,6 +791,8 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
 	if (ret)
 		IWL_ERR(mvm, "Failed to disable queue %d (ret=%d)\n",
 			queue, ret);
+
+	return ret;
 }
 
 /**
-- 
2.11.0

  parent reply	other threads:[~2017-01-23 22:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 22:03 [PATCH 00/25] iwlwifi: updates intended for v4.11 2017-01-23 Luca Coelho
2017-01-23 22:03 ` [PATCH 01/25] iwlwifi: mvm: expose device timestamp in radiotap Luca Coelho
2017-01-23 22:03 ` [PATCH 02/25] iwlwifi: mvm: don't restart HW if suspend fails with unified image Luca Coelho
2017-01-23 22:03 ` [PATCH 03/25] iwlwifi: mvm: accept arbitrary memory dump TLVs Luca Coelho
2017-01-23 22:03 ` [PATCH 04/25] iwlwifi: mvm: make iwl_dump_prph() void Luca Coelho
2017-01-23 22:03 ` [PATCH 05/25] iwlwifi: allow memory debug TLV to specify the memory type Luca Coelho
2017-01-26  7:43   ` [PATCH v2] " Luca Coelho
2017-01-23 22:03 ` [PATCH 06/25] iwlwifi: mvm: properly check for transport data in dump Luca Coelho
2017-01-23 22:03 ` [PATCH 07/25] iwlwifi: mvm: bump max API to 28 Luca Coelho
2017-01-23 22:03 ` [PATCH 08/25] iwlwifi: mvm: simplify paging allocation code Luca Coelho
2017-01-23 22:03 ` [PATCH 09/25] iwlwifi: mvm: replace the number of blocks calculation Luca Coelho
2017-01-23 22:03 ` [PATCH 10/25] iwlwifi: enlarge number of ucode sections Luca Coelho
2017-01-23 22:03 ` [PATCH 11/25] iwlwifi: mvm: change iwl_mvm_tx_csum to return value Luca Coelho
2017-01-26  7:24   ` [PATCH v2] " Luca Coelho
2017-01-23 22:03 ` [PATCH 12/25] iwlwifi: mvm: separate rate calculation to a new function Luca Coelho
2017-01-23 22:03 ` [PATCH 13/25] iwlwifi: mvm: support version 2 of stored beacon notification Luca Coelho
2017-01-23 22:03 ` [PATCH 14/25] iwlwifi: fix MODULE_FIRMWARE for 6030 Luca Coelho
2017-01-23 22:03 ` [PATCH 15/25] iwlwifi: mvm: remove unused variable in iwl_mvm_handle_statistics() Luca Coelho
2017-01-23 22:03 ` [PATCH 16/25] iwlwifi: mvm: rs: Remove unused 'mvmvif'/'mvmsta' variables Luca Coelho
2017-01-23 22:03 ` [PATCH 17/25] iwlwifi: mvm: rs: Remove unused 'mcs' variable Luca Coelho
2017-01-23 22:03 ` [PATCH 18/25] iwlwifi: pcie: trans: Remove unused 'shift_param' Luca Coelho
2017-01-23 22:03 ` [PATCH 19/25] iwlwifi: dvm: make rs_tl_get_load() return void Luca Coelho
2017-01-23 22:03 ` [PATCH 20/25] iwlwifi: pcie: cleanup rfkill checks Luca Coelho
2017-01-23 22:03 ` [PATCH 21/25] iwlwifi: mvm: remove unused sta_id variable in iwl_mvm_change_queue_owner() Luca Coelho
2017-01-23 22:03 ` [PATCH 22/25] iwlwifi: dvm: remove unused variable compiler warning in debugfs.c Luca Coelho
2017-01-23 22:03 ` [PATCH 23/25] iwlwifi: mvm: mark ret as maybe_unused in iwl_dbgfs_fw_restart_write() Luca Coelho
2017-01-23 22:03 ` Luca Coelho [this message]
2017-01-26  7:34   ` [PATCH v2] iwlwifi: mvm: use mvm_disable_queue instead of sharing logic Luca Coelho
2017-01-23 22:03 ` [PATCH 25/25] iwlwifi: mvm: cleanup redundant assignment Luca Coelho

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=20170123220350.25305-25-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=sara.sharon@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.