linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <egrumbach@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 20/36] iwlwifi: trans: refactor txq_enable arguments
Date: Wed,  3 Sep 2014 22:56:08 +0300	[thread overview]
Message-ID: <1409774184-24665-20-git-send-email-egrumbach@gmail.com> (raw)
In-Reply-To: <540771E5.6080908@gmail.com>

From: Johannes Berg <johannes.berg@intel.com>

Instead of having all arguments passed to the function,
add a struct to hold them and only pass some directly.

This will make future work in this area cleaner.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-trans.h     | 21 +++++++++++++++++----
 drivers/net/wireless/iwlwifi/pcie/internal.h |  4 ++--
 drivers/net/wireless/iwlwifi/pcie/tx.c       | 13 +++++++------
 3 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 656371a..c198dde 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -401,6 +401,13 @@ struct iwl_trans_dump_data {
 
 struct iwl_trans;
 
+struct iwl_trans_txq_scd_cfg {
+	u8 fifo;
+	s8 sta_id;
+	u8 tid;
+	int frame_limit;
+};
+
 /**
  * struct iwl_trans_ops - transport specific operations
  *
@@ -492,8 +499,8 @@ struct iwl_trans_ops {
 	void (*reclaim)(struct iwl_trans *trans, int queue, int ssn,
 			struct sk_buff_head *skbs);
 
-	void (*txq_enable)(struct iwl_trans *trans, int queue, int fifo,
-			   int sta_id, int tid, int frame_limit, u16 ssn);
+	void (*txq_enable)(struct iwl_trans *trans, int queue, u16 ssn,
+			   const struct iwl_trans_txq_scd_cfg *cfg);
 	void (*txq_disable)(struct iwl_trans *trans, int queue);
 
 	int (*dbgfs_register)(struct iwl_trans *trans, struct dentry* dir);
@@ -775,13 +782,19 @@ static inline void iwl_trans_txq_enable(struct iwl_trans *trans, int queue,
 					int fifo, int sta_id, int tid,
 					int frame_limit, u16 ssn)
 {
+	struct iwl_trans_txq_scd_cfg cfg = {
+		.fifo = fifo,
+		.sta_id = sta_id,
+		.tid = tid,
+		.frame_limit = frame_limit,
+	};
+
 	might_sleep();
 
 	if (unlikely((trans->state != IWL_TRANS_FW_ALIVE)))
 		IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state);
 
-	trans->ops->txq_enable(trans, queue, fifo, sta_id, tid,
-				 frame_limit, ssn);
+	trans->ops->txq_enable(trans, queue, ssn, &cfg);
 }
 
 static inline void iwl_trans_ac_txq_enable(struct iwl_trans *trans, int queue,
diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h
index 78f72c3..5760405 100644
--- a/drivers/net/wireless/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/iwlwifi/pcie/internal.h
@@ -364,8 +364,8 @@ int iwl_pcie_tx_init(struct iwl_trans *trans);
 void iwl_pcie_tx_start(struct iwl_trans *trans, u32 scd_base_addr);
 int iwl_pcie_tx_stop(struct iwl_trans *trans);
 void iwl_pcie_tx_free(struct iwl_trans *trans);
-void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo,
-			       int sta_id, int tid, int frame_limit, u16 ssn);
+void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int queue, u16 ssn,
+			       const struct iwl_trans_txq_scd_cfg *cfg);
 void iwl_trans_pcie_txq_disable(struct iwl_trans *trans, int queue);
 int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb,
 		      struct iwl_device_cmd *dev_cmd, int txq_id);
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
index 84c3a01..5c95386 100644
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -1066,10 +1066,11 @@ static int iwl_pcie_txq_set_ratid_map(struct iwl_trans *trans, u16 ra_tid,
  * combined with Traffic ID (QOS priority), in format used by Tx Scheduler */
 #define BUILD_RAxTID(sta_id, tid)	(((sta_id) << 4) + (tid))
 
-void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo,
-			       int sta_id, int tid, int frame_limit, u16 ssn)
+void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, u16 ssn,
+			       const struct iwl_trans_txq_scd_cfg *cfg)
 {
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
+	u8 frame_limit = cfg->frame_limit;
 
 	if (test_and_set_bit(txq_id, trans_pcie->queue_used))
 		WARN_ONCE(1, "queue %d already used - expect issues", txq_id);
@@ -1082,8 +1083,8 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo,
 		iwl_scd_txq_set_chain(trans, txq_id);
 
 	/* If this queue is mapped to a certain station: it is an AGG queue */
-	if (sta_id >= 0) {
-		u16 ra_tid = BUILD_RAxTID(sta_id, tid);
+	if (cfg->sta_id >= 0) {
+		u16 ra_tid = BUILD_RAxTID(cfg->sta_id, cfg->tid);
 
 		/* Map receiver-address / traffic-ID to this queue */
 		iwl_pcie_txq_set_ratid_map(trans, ra_tid, txq_id);
@@ -1124,12 +1125,12 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo,
 	/* Set up Status area in SRAM, map to Tx DMA/FIFO, activate the queue */
 	iwl_write_prph(trans, SCD_QUEUE_STATUS_BITS(txq_id),
 		       (1 << SCD_QUEUE_STTS_REG_POS_ACTIVE) |
-		       (fifo << SCD_QUEUE_STTS_REG_POS_TXF) |
+		       (cfg->fifo << SCD_QUEUE_STTS_REG_POS_TXF) |
 		       (1 << SCD_QUEUE_STTS_REG_POS_WSL) |
 		       SCD_QUEUE_STTS_REG_MSK);
 	trans_pcie->txq[txq_id].active = true;
 	IWL_DEBUG_TX_QUEUES(trans, "Activate queue %d on FIFO %d WrPtr: %d\n",
-			    txq_id, fifo, ssn & 0xff);
+			    txq_id, cfg->fifo, ssn & 0xff);
 }
 
 void iwl_trans_pcie_txq_disable(struct iwl_trans *trans, int txq_id)
-- 
1.9.1


  parent reply	other threads:[~2014-09-03 19:56 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 19:54 pull request: iwlwifi-next 2014-09-03 Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 01/36] iwlwifi: mvm: Add set NIC temperature debug option Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 02/36] iwlwifi: mvm: reduce the AMPDU size in low latency mode Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 03/36] iwlwifi: mvm: use dynamic SMPS for P2P Client Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 04/36] iwlwifi: mvm: add use_ps-poll debugfs power option Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 05/36] iwlwifi: mvm: force protection for P2P Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 06/36] iwlwifi: mvm: reset the temperature when temperature test is disabled Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 07/36] iwlwifi: mvm: don't run automatic checks if CT was caused by debugfs Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 08/36] iwlwifi: mvm: Add marker command 0xcb Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 09/36] iwlwifi: mvm: fix the dump_umac_error_log Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 10/36] iwlwifi: make U-APSD default configurable at compile time Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 11/36] iwlwifi: mvm: add debugfs entry for ps_disabled Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 12/36] iwlwifi: mvm: disable tx aggregation on low latency vifs Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 13/36] iwlwifi: mvm: clear d0i3 state on recovery Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 14/36] iwlwifi: mvm: re-enable ps when monitor interfaces are removed Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 15/36] iwlwifi: mvm: refactor iwl_mvm_power_set_pm() to spin the ps part off Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 16/36] iwlwifi: mvm: add function to update only ps Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 17/36] iwlwifi: mvm: add option that allows a vif to disable PS Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 18/36] iwlwifi: mvm: wait for TE notif when protecting TDLS session Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 19/36] iwlwifi: consolidate hw scheduler configuration code Emmanuel Grumbach
2014-09-03 19:56 ` Emmanuel Grumbach [this message]
2014-09-03 19:56 ` [PATCH 21/36] iwlwifi: mvm: enable passive fragmented scan changes Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 22/36] iwlwifi: mvm: add some debugging to quota allocation Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 23/36] iwlwifi: don't export tracepoints unnecessarily Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 24/36] iwlwifi: mvm: fix comment typo Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 25/36] iwlwifi: trans: allow skipping scheduler hardware config Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 26/36] iwlwifi: trans: make aggregation explicit for TX queue handling Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 27/36] iwlwifi: trans: configure the scheduler enable register Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 28/36] iwlwifi: add Intel Mobile Communications copyright Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 29/36] iwlwifi: mvm: set the TX disable bit when doing a chanctx switch Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 30/36] iwlwifi: mvm: correct firmware disassoc command sequence Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 31/36] iwlwifi: mvm: clean up FIFO definitions Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 32/36] iwlwifi: mvm: clarify stop_count, remove transport_stopped Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 33/36] iwlwifi: mvm: use tdls indication from mac80211 Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 34/36] iwlwifi: mvm: use iwl_mvm_mac_get_queues_mask() more Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 35/36] iwlwifi: mvm: clean up broadcast station handling Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 36/36] iwlwifi: mvm: clean up AUX " Emmanuel Grumbach
2014-09-04 18:05 ` pull request: iwlwifi-next 2014-09-03 John W. Linville

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=1409774184-24665-20-git-send-email-egrumbach@gmail.com \
    --to=egrumbach@gmail.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=johannes.berg@intel.com \
    --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).