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, Don Fry <donald.h.fry@intel.com>,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>
Subject: [PATCH 08/28] iwlagn: move ucode_write_complete from priv to trans structure
Date: Wed,  9 Nov 2011 16:39:11 -0800	[thread overview]
Message-ID: <1320885571-19122-9-git-send-email-wey-yi.w.guy@intel.com> (raw)
In-Reply-To: <1320885571-19122-1-git-send-email-wey-yi.w.guy@intel.com>

From: Don Fry <donald.h.fry@intel.com>

ucode_write_complete is used for ucode loading.  Move it as part of
restructuring work out of the priv structure.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c     |   29 +++++++++++----------
 drivers/net/wireless/iwlwifi/iwl-dev.h           |    1 -
 drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c |    2 +-
 drivers/net/wireless/iwlwifi/iwl-trans.h         |    3 ++
 4 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
index 8ba0dd5..502659a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
@@ -75,48 +75,49 @@ static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = {
 /*
  * ucode
  */
-static int iwlagn_load_section(struct iwl_priv *priv, const char *name,
+static int iwlagn_load_section(struct iwl_trans *trans, const char *name,
 				struct fw_desc *image, u32 dst_addr)
 {
+	struct iwl_bus *bus = bus(trans);
 	dma_addr_t phy_addr = image->p_addr;
 	u32 byte_cnt = image->len;
 	int ret;
 
-	priv->ucode_write_complete = 0;
+	trans->ucode_write_complete = 0;
 
-	iwl_write_direct32(bus(priv),
+	iwl_write_direct32(bus,
 		FH_TCSR_CHNL_TX_CONFIG_REG(FH_SRVC_CHNL),
 		FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE);
 
-	iwl_write_direct32(bus(priv),
+	iwl_write_direct32(bus,
 		FH_SRVC_CHNL_SRAM_ADDR_REG(FH_SRVC_CHNL), dst_addr);
 
-	iwl_write_direct32(bus(priv),
+	iwl_write_direct32(bus,
 		FH_TFDIB_CTRL0_REG(FH_SRVC_CHNL),
 		phy_addr & FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK);
 
-	iwl_write_direct32(bus(priv),
+	iwl_write_direct32(bus,
 		FH_TFDIB_CTRL1_REG(FH_SRVC_CHNL),
 		(iwl_get_dma_hi_addr(phy_addr)
 			<< FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_cnt);
 
-	iwl_write_direct32(bus(priv),
+	iwl_write_direct32(bus,
 		FH_TCSR_CHNL_TX_BUF_STS_REG(FH_SRVC_CHNL),
 		1 << FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM |
 		1 << FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_IDX |
 		FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID);
 
-	iwl_write_direct32(bus(priv),
+	iwl_write_direct32(bus,
 		FH_TCSR_CHNL_TX_CONFIG_REG(FH_SRVC_CHNL),
 		FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE	|
 		FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE	|
 		FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_ENDTFD);
 
-	IWL_DEBUG_FW(priv, "%s uCode section being loaded...\n", name);
-	ret = wait_event_timeout(priv->shrd->wait_command_queue,
-				 priv->ucode_write_complete, 5 * HZ);
+	IWL_DEBUG_FW(bus, "%s uCode section being loaded...\n", name);
+	ret = wait_event_timeout(trans->shrd->wait_command_queue,
+				 trans->ucode_write_complete, 5 * HZ);
 	if (!ret) {
-		IWL_ERR(priv, "Could not load the %s uCode section\n",
+		IWL_ERR(trans, "Could not load the %s uCode section\n",
 			name);
 		return -ETIMEDOUT;
 	}
@@ -129,12 +130,12 @@ static int iwlagn_load_given_ucode(struct iwl_priv *priv,
 {
 	int ret = 0;
 
-	ret = iwlagn_load_section(priv, "INST", &image->code,
+	ret = iwlagn_load_section(trans(priv), "INST", &image->code,
 				   IWLAGN_RTC_INST_LOWER_BOUND);
 	if (ret)
 		return ret;
 
-	return iwlagn_load_section(priv, "DATA", &image->data,
+	return iwlagn_load_section(trans(priv), "DATA", &image->data,
 				    IWLAGN_RTC_DATA_LOWER_BOUND);
 }
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index ef8620b..4279e01 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -920,7 +920,6 @@ struct iwl_priv {
 	struct fw_img ucode_wowlan;
 
 	enum iwlagn_ucode_type ucode_type;
-	u8 ucode_write_complete;	/* the image write is complete */
 	char firmware_name[25];
 
 	struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
index 374c68c..ee126f8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
@@ -1108,7 +1108,7 @@ void iwl_irq_tasklet(struct iwl_trans *trans)
 		isr_stats->tx++;
 		handled |= CSR_INT_BIT_FH_TX;
 		/* Wake up uCode load routine, now that load is complete */
-		priv(trans)->ucode_write_complete = 1;
+		trans->ucode_write_complete = 1;
 		wake_up(&trans->shrd->wait_command_queue);
 	}
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index c592312..34b817f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -212,12 +212,15 @@ struct iwl_trans_ops {
  * @ops - pointer to iwl_trans_ops
  * @shrd - pointer to iwl_shared which holds shared data from the upper layer
  * @hcmd_lock: protects HCMD
+ * @ucode_write_complete: indicates that the ucode has been copied.
  */
 struct iwl_trans {
 	const struct iwl_trans_ops *ops;
 	struct iwl_shared *shrd;
 	spinlock_t hcmd_lock;
 
+	u8 ucode_write_complete;	/* the image write is complete */
+
 	/* pointer to trans specific struct */
 	/*Ensure that this pointer will always be aligned to sizeof pointer */
 	char trans_specific[0] __attribute__((__aligned__(sizeof(void *))));
-- 
1.7.0.4


  parent reply	other threads:[~2011-11-10  1:33 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-10  0:39 [PATCH 00/28] update for 3.3 Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 01/28] iwlagn: add P2P NoA to probe responses Wey-Yi Guy
2011-11-10  8:05   ` Johannes Berg
2011-11-10  0:39 ` [PATCH 02/28] iwlwifi: Suppress noisy syslog messages when RF_KILL switch engaged Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 03/28] iwlwifi: two more SKUs for 6x05 series Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 04/28] iwlagn: check for SMPS mode Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 05/28] iwlagn: fix NULL ptr deref when reprogramming sta w/o LQ Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 06/28] iwlagn: use per-vif AC parameters Wey-Yi Guy
2011-11-10  8:05   ` Johannes Berg
2011-11-10  0:39 ` [PATCH 07/28] iwlwifi: remove un-supported SKUs Wey-Yi Guy
2011-11-10  0:39 ` Wey-Yi Guy [this message]
2011-11-10  0:39 ` [PATCH 09/28] iwlagn: remove knowledge of ucode image location from upper layers Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 10/28] iwlagn: push knowledge of ucode image lower down Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 11/28] iwlagn: move ucode files out of the iwl_priv structure Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 12/28] iwlwifi: move all mac80211 related functions to one place Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 13/28] iwlagn: explicitly program P2P QoS parameters Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 14/28] iwlwifi: move more mac80211 callback function Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 15/28] iwlwifi: move hw_scan into _mac80211 file Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 16/28] iwlwifi: move station functions to mac80211 Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 17/28] iwlwifi: Move the core suspend function to iwl-agn-lib Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 18/28] iwlwifi: set "echo" host command length Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 19/28] iwlwifi: check status before send command Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 20/28] iwlwifi: fix unused label in iwl_send_cmd_sync Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 21/28] iwlagn: convert remain-on-channel duration to TU Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 22/28] iwlagn: don't always split remain-on-channel Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 23/28] iwlwifi: remove the use of the QOS debug flag Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 24/28] iwlwifi: add debug information on queue stop / wake Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 25/28] iwlwifi: fix an RCU sparse warning Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 26/28] iwlwifi: fix rate-scaling algorithm for BT combo devices Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 27/28] iwlagn: Remove dependence of iwl_priv from eeprom routines Wey-Yi Guy
2011-11-10  0:39 ` [PATCH 28/28] iwlagn: move nvm_device_type from iwl_priv to iwl_trans Wey-Yi Guy
2011-11-10 14:16 ` [PATCH 00/28] update for 3.3 Guy, Wey-Yi

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=1320885571-19122-9-git-send-email-wey-yi.w.guy@intel.com \
    --to=wey-yi.w.guy@intel.com \
    --cc=donald.h.fry@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).