linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>
Subject: [PATCH 01/28] iwlwifi: add fw_alive to transport layer API, kill tx_start
Date: Thu,  2 Feb 2012 15:08:52 -0800	[thread overview]
Message-ID: <1328224159-18134-2-git-send-email-wey-yi.w.guy@intel.com> (raw)
In-Reply-To: <1328224159-18134-1-git-send-email-wey-yi.w.guy@intel.com>

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Define a new handler in the transport layer API: fw_alive.
Move iwl_reset_ict to this new handler, and move the content
of tx_start to this handler.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c            |    3 ---
 drivers/net/wireless/iwlwifi/iwl-agn.h            |    2 --
 drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h |    2 +-
 drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c  |    6 ++----
 drivers/net/wireless/iwlwifi/iwl-trans-pcie.c     |   10 ++++++++--
 drivers/net/wireless/iwlwifi/iwl-trans.h          |   15 +++++++--------
 drivers/net/wireless/iwlwifi/iwl-ucode.c          |    2 +-
 7 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 90315c6..9d9185f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1243,9 +1243,6 @@ int iwl_alive_start(struct iwl_priv *priv)
 	int ret = 0;
 	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
 
-	/*TODO: this should go to the transport layer */
-	iwl_reset_ict(trans(priv));
-
 	IWL_DEBUG_INFO(priv, "Runtime Alive received.\n");
 
 	/* After the ALIVE response, we can send host commands to the uCode */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index 39cbe1a..0f5133a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -73,8 +73,6 @@ struct iwlagn_ucode_capabilities {
 
 extern struct ieee80211_ops iwlagn_hw_ops;
 
-int iwl_reset_ict(struct iwl_trans *trans);
-
 static inline void iwl_set_calib_hdr(struct iwl_calib_hdr *hdr, u8 cmd)
 {
 	hdr->op_code = cmd;
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
index 0ac9b4d..0f73778 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
@@ -258,7 +258,7 @@ void iwl_rx_queue_update_write_ptr(struct iwl_trans *trans,
 /*****************************************************
 * ICT
 ******************************************************/
-int iwl_reset_ict(struct iwl_trans *trans);
+void iwl_reset_ict(struct iwl_trans *trans);
 void iwl_disable_ict(struct iwl_trans *trans);
 int iwl_alloc_isr_ict(struct iwl_trans *trans);
 void iwl_free_isr_ict(struct iwl_trans *trans);
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
index 848c598..2822b7e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
@@ -1213,7 +1213,7 @@ int iwl_alloc_isr_ict(struct iwl_trans *trans)
 /* Device is going up inform it about using ICT interrupt table,
  * also we need to tell the driver to start using ICT interrupt.
  */
-int iwl_reset_ict(struct iwl_trans *trans)
+void iwl_reset_ict(struct iwl_trans *trans)
 {
 	u32 val;
 	unsigned long flags;
@@ -1221,7 +1221,7 @@ int iwl_reset_ict(struct iwl_trans *trans)
 		IWL_TRANS_GET_PCIE_TRANS(trans);
 
 	if (!trans_pcie->ict_tbl)
-		return 0;
+		return;
 
 	spin_lock_irqsave(&trans->shrd->lock, flags);
 	iwl_disable_interrupts(trans);
@@ -1241,8 +1241,6 @@ int iwl_reset_ict(struct iwl_trans *trans)
 	iwl_write32(bus(trans), CSR_INT, trans_pcie->inta_mask);
 	iwl_enable_interrupts(trans);
 	spin_unlock_irqrestore(&trans->shrd->lock, flags);
-
-	return 0;
 }
 
 /* Device is going down disable ict interrupt usage */
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index 5e6af4b..affa56f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -835,7 +835,7 @@ static void iwl_trans_txq_set_sched(struct iwl_trans *trans, u32 mask)
 	iwl_write_prph(bus(trans), SCD_TXFACT, mask);
 }
 
-static void iwl_trans_pcie_tx_start(struct iwl_trans *trans)
+static void iwl_tx_start(struct iwl_trans *trans)
 {
 	const struct queue_to_fifo_ac *queue_to_fifo;
 	struct iwl_trans_pcie *trans_pcie =
@@ -948,6 +948,12 @@ static void iwl_trans_pcie_tx_start(struct iwl_trans *trans)
 			  APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
 }
 
+static void iwl_trans_pcie_fw_alive(struct iwl_trans *trans)
+{
+	iwl_reset_ict(trans);
+	iwl_tx_start(trans);
+}
+
 /**
  * iwlagn_txq_ctx_stop - Stop all Tx DMA channels
  */
@@ -1903,11 +1909,11 @@ static int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans,
 const struct iwl_trans_ops trans_ops_pcie = {
 	.alloc = iwl_trans_pcie_alloc,
 	.request_irq = iwl_trans_pcie_request_irq,
+	.fw_alive = iwl_trans_pcie_fw_alive,
 	.start_device = iwl_trans_pcie_start_device,
 	.prepare_card_hw = iwl_trans_pcie_prepare_card_hw,
 	.stop_device = iwl_trans_pcie_stop_device,
 
-	.tx_start = iwl_trans_pcie_tx_start,
 	.wake_any_queue = iwl_trans_pcie_wake_any_queue,
 
 	.send_cmd = iwl_trans_pcie_send_cmd,
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 42a9f30..9795a23 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -139,8 +139,7 @@ struct iwl_host_cmd {
  *                layer.
  * @prepare_card_hw: claim the ownership on the HW. Will be called during
  *                   probe.
- * @tx_start: starts and configures all the Tx fifo - usually done once the fw
- *           is alive.
+ * @fw_alive: called when the fw sends alive notification
  * @wake_any_queue: wake all the queues of a specfic context IWL_RXON_CTX_*
  * @stop_device:stops the whole device (embedded CPU put to reset)
  * @send_cmd:send a host command
@@ -166,9 +165,9 @@ struct iwl_trans_ops {
 	struct iwl_trans *(*alloc)(struct iwl_shared *shrd);
 	int (*request_irq)(struct iwl_trans *iwl_trans);
 	int (*start_device)(struct iwl_trans *trans);
+	void (*fw_alive)(struct iwl_trans *trans);
 	int (*prepare_card_hw)(struct iwl_trans *trans);
 	void (*stop_device)(struct iwl_trans *trans);
-	void (*tx_start)(struct iwl_trans *trans);
 
 	void (*wake_any_queue)(struct iwl_trans *trans,
 			       enum iwl_rxon_context_id ctx,
@@ -264,6 +263,11 @@ static inline int iwl_trans_request_irq(struct iwl_trans *trans)
 	return trans->ops->request_irq(trans);
 }
 
+static inline void iwl_trans_fw_alive(struct iwl_trans *trans)
+{
+	trans->ops->fw_alive(trans);
+}
+
 static inline int iwl_trans_start_device(struct iwl_trans *trans)
 {
 	return trans->ops->start_device(trans);
@@ -279,11 +283,6 @@ static inline void iwl_trans_stop_device(struct iwl_trans *trans)
 	trans->ops->stop_device(trans);
 }
 
-static inline void iwl_trans_tx_start(struct iwl_trans *trans)
-{
-	trans->ops->tx_start(trans);
-}
-
 static inline void iwl_trans_wake_any_queue(struct iwl_trans *trans,
 					    enum iwl_rxon_context_id ctx,
 					    const char *msg)
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c
index 2edf0ef..0d7f207 100644
--- a/drivers/net/wireless/iwlwifi/iwl-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c
@@ -447,7 +447,7 @@ static int iwl_alive_notify(struct iwl_trans *trans)
 	if (!priv->tx_cmd_pool)
 		return -ENOMEM;
 
-	iwl_trans_tx_start(trans);
+	iwl_trans_fw_alive(trans);
 	for_each_context(priv, ctx)
 		ctx->last_tx_rejected = false;
 
-- 
1.7.0.4


  reply	other threads:[~2012-02-03  0:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 23:08 [PATCH 00/28] update for 3.4: iwlwifi 2012-02-02 Wey-Yi Guy
2012-02-02 23:08 ` Wey-Yi Guy [this message]
2012-02-02 23:08 ` [PATCH 02/28] iwlwifi: Connect IDI transport to driver Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 03/28] iwlwifi: separate the APM from the EEPROM Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 04/28] iwlwifi: move the shrd memory from priv Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 05/28] iwlwifi: allocate the transport from the bus layer Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 06/28] iwlwifi: move the bus configuration to transport Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 07/28] iwlwifi: the read / write register ops move " Wey-Yi Guy
2012-02-02 23:08 ` [PATCH 08/28] iwlwifi: give trans to all the read / write functions Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 09/28] iwlwifi: remove the pointer to dev from the bus layer Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 10/28] iwlwifi: don't use the bus for ucode fw_desc any more Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 11/28] iwlwifi: rename trans_ops->request_irq to trans_ops->start_hw Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 12/28] iwlwifi: move prepare_card_hw to start_hw Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 13/28] iwlwifi: move apm_init " Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 14/28] iwlwifi: introduce trans_ops->stop_hw Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 15/28] iwlwifi: move the RF kill logic from iwl_probe to transport Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 16/28] iwlwifi: consolidate the start_device flow Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 17/28] iwlwifi: kill bus_apm_config Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 18/28] iwlwifi: kill bus_is_pm_supported Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 19/28] iwlwifi: kill bus_get_hw_id_string Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 20/28] iwlwifi: kill bus_get_hw_id Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 21/28] iwlwifi: move hw_rev to transport layer Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 22/28] iwlwifi: stop_hw replace enable_rfkill_int Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 23/28] iwlwifi: debug print in tx_queue_set_status is more clear Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 24/28] iwlwifi: clarify comment Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 25/28] iwlwifi: move bcast_sta_id init to common routine Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 26/28] iwlwifi: move all ucode routines to iwl-ucode.c Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 27/28] iwlwifi: release IRQ in error path Wey-Yi Guy
2012-02-02 23:09 ` [PATCH 28/28] iwlwifi: range check to testmode direct reg access Wey-Yi Guy

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=1328224159-18134-2-git-send-email-wey-yi.w.guy@intel.com \
    --to=wey-yi.w.guy@intel.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).