Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: linux-wireless@vger.kernel.org
Cc: Liad Kaufman <liad.kaufman@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 05/16] iwlwifi: mvm: keep track of tid associated with each queue
Date: Tue, 30 Aug 2016 14:38:51 +0300	[thread overview]
Message-ID: <1472557142-14782-5-git-send-email-luca@coelho.fi> (raw)
In-Reply-To: <1472557142-14782-1-git-send-email-luca@coelho.fi>

From: Liad Kaufman <liad.kaufman@intel.com>

When sending the SCD_QUEUE_CONFIG command, the queue is
associated to a specific TID. If later there is a need to
use this TID on a different queue instead, it first needs to
be unassociated from the first queue.

Keep track for every queue what TID is associated with it.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h   | 1 +
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c   | 7 +++++++
 drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index ee5a9ad..1806495 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -772,6 +772,7 @@ struct iwl_mvm {
 		u8 ra_sta_id; /* The RA this queue is mapped to, if exists */
 		bool reserved; /* Is this the TXQ reserved for a STA */
 		u8 mac80211_ac; /* The mac80211 AC this queue is mapped to */
+		u8 txq_tid; /* The TID "owner" of this queue*/
 		u16 tid_bitmap; /* Bitmap of the TIDs mapped to this queue */
 		/* Timestamp for inactivation per TID of this queue */
 		unsigned long last_frame_time[IWL_MAX_TID_COUNT + 1];
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 1f235e8..730ba78 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -562,6 +562,7 @@ int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int queue, int tid,
 
 	cmd.sta_id = mvm->queue_info[queue].ra_sta_id;
 	cmd.tx_fifo = iwl_mvm_ac_to_tx_fifo[mvm->queue_info[queue].mac80211_ac];
+	cmd.tid = mvm->queue_info[queue].txq_tid;
 	mq = mvm->queue_info[queue].hw_queue_to_mac80211;
 	shared_queue = (mvm->queue_info[queue].hw_queue_refcount > 1);
 	spin_unlock_bh(&mvm->queue_info_lock);
@@ -591,6 +592,11 @@ int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int queue, int tid,
 			     cmd.sta_id, tid, LINK_QUAL_AGG_FRAME_LIMIT_DEF,
 			     ssn, wdg_timeout);
 
+	/* Update the TID "owner" of the queue */
+	spin_lock_bh(&mvm->queue_info_lock);
+	mvm->queue_info[queue].txq_tid = tid;
+	spin_unlock_bh(&mvm->queue_info_lock);
+
 	/* TODO: Work-around SCD bug when moving back by multiples of 0x40 */
 
 	/* Redirect to lower AC */
@@ -749,6 +755,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
 		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[ac];
+		cmd.tid = mvm->queue_info[queue].txq_tid;
 		spin_unlock_bh(&mvm->queue_info_lock);
 
 		/* Disable the queue */
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index dae64a6..423efab 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -669,6 +669,8 @@ void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
 				tid_to_mac80211_ac[cfg->tid];
 		else
 			mvm->queue_info[queue].mac80211_ac = IEEE80211_AC_VO;
+
+		mvm->queue_info[queue].txq_tid = cfg->tid;
 	}
 
 	IWL_DEBUG_TX_QUEUES(mvm,
@@ -761,6 +763,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
 	}
 
 	cmd.sta_id = mvm->queue_info[queue].ra_sta_id;
+	cmd.tid = mvm->queue_info[queue].txq_tid;
 
 	/* Make sure queue info is correct even though we overwrite it */
 	WARN(mvm->queue_info[queue].hw_queue_refcount ||
-- 
2.8.1

  parent reply	other threads:[~2016-08-30 11:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 11:36 pull-request: iwlwifi-next 2016-08-30-2 Luca Coelho
2016-08-30 11:38 ` [PATCH 01/16] iwlwifi: mvm: allow same PN for de-aggregated AMSDU Luca Coelho
2016-08-30 11:38   ` [PATCH 02/16] iwlwifi: mvm: support GMAC protocol Luca Coelho
2016-08-30 11:38   ` [PATCH 03/16] iwlwifi: mvm: support new paging command format Luca Coelho
2016-08-30 11:38   ` [PATCH 04/16] iwlwifi: mvm: re-aggregate shared queue after unsharing Luca Coelho
2016-08-30 11:38   ` Luca Coelho [this message]
2016-08-30 11:38   ` [PATCH 06/16] iwlwifi: mvm: re-assign old queues after hw restart in dqa mode Luca Coelho
2016-08-30 11:38   ` [PATCH 07/16] iwlwifi: mvm: use defines for SCD_CONFIG_CMD enablement Luca Coelho
2016-08-30 11:38   ` [PATCH 08/16] iwlwifi: mvm: support txq tid owner change Luca Coelho
2016-08-30 11:38   ` [PATCH 09/16] iwlwifi: rename and reorder 9000 series configuration structs Luca Coelho
2016-08-30 11:38   ` [PATCH 10/16] iwlwifi: add a new series 9460 with new PCI ID Luca Coelho
2016-08-30 11:38   ` [PATCH 11/16] iwlwifi: add new 9460 series PCI IDs Luca Coelho
2016-08-30 11:38   ` [PATCH 12/16] iwlwifi: add the new 9270 series Luca Coelho
2016-08-30 11:38   ` [PATCH 13/16] iwlwifi: add the new 9170 series Luca Coelho
2016-08-30 11:39   ` [PATCH 14/16] iwlwifi: pcie: refrain from SCD accesses Luca Coelho
2016-08-30 11:39   ` [PATCH 15/16] iwlwifi: pcie: fix ucode load flow for a000 devices Luca Coelho
2016-08-30 11:39   ` [PATCH 16/16] iwlwifi: pcie: remove dead code Luca Coelho
2016-09-01 14:28 ` pull-request: iwlwifi-next 2016-08-30-2 Kalle Valo
  -- strict thread matches above, loose matches on Subject: below --
2016-08-29 21:23 pull-request: iwlwifi-next 2016-08-30 Luca Coelho
2016-08-29 21:26 ` [PATCH 01/16] iwlwifi: mvm: allow same PN for de-aggregated AMSDU Luca Coelho
2016-08-29 21:26   ` [PATCH 05/16] iwlwifi: mvm: keep track of tid associated with each queue 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=1472557142-14782-5-git-send-email-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=liad.kaufman@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox