public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Ron Rindjunsky <ron.rindjunsky@intel.com>,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH 15/25] iwlwifi: create disable SCD Tx FIFOs handler
Date: Mon,  5 May 2008 10:22:42 +0800	[thread overview]
Message-ID: <1209954172-3092-16-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <1209954172-3092-15-git-send-email-yi.zhu@intel.com>

From: Ron Rindjunsky <ron.rindjunsky@intel.com>

This patch moves disabeling Tx FIFOs in NIC SCD to seperate handlers
in 4965 and 5000 cards.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965.c |   40 ++++++++++++++++++++-----------
 drivers/net/wireless/iwlwifi/iwl-5000.c |   22 +++++++++++++++++
 drivers/net/wireless/iwlwifi/iwl-core.h |    2 +
 3 files changed, 50 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 3453e99..d5ee512 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -470,6 +470,27 @@ static void iwl4965_kw_free(struct iwl_priv *priv)
 	}
 }
 
+static int iwl4965_disable_tx_fifo(struct iwl_priv *priv)
+{
+	unsigned long flags;
+	int ret;
+
+	spin_lock_irqsave(&priv->lock, flags);
+
+	ret = iwl_grab_nic_access(priv);
+	if (unlikely(ret)) {
+		IWL_ERROR("Tx fifo reset failed");
+		spin_unlock_irqrestore(&priv->lock, flags);
+		return ret;
+	}
+
+	iwl_write_prph(priv, IWL49_SCD_TXFACT, 0);
+	iwl_release_nic_access(priv);
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	return 0;
+}
+
 /**
  * iwl4965_txq_ctx_reset - Reset TX queue context
  * Destroys all DMA structures and initialise them again
@@ -481,7 +502,6 @@ static int iwl4965_txq_ctx_reset(struct iwl_priv *priv)
 {
 	int rc = 0;
 	int txq_id, slots_num;
-	unsigned long flags;
 
 	iwl4965_kw_free(priv);
 
@@ -495,19 +515,10 @@ static int iwl4965_txq_ctx_reset(struct iwl_priv *priv)
 		goto error_kw;
 	}
 
-	spin_lock_irqsave(&priv->lock, flags);
-
-	rc = iwl_grab_nic_access(priv);
-	if (unlikely(rc)) {
-		IWL_ERROR("TX reset failed");
-		spin_unlock_irqrestore(&priv->lock, flags);
+	/* Turn off all Tx DMA fifos */
+	rc = priv->cfg->ops->lib->disable_tx_fifo(priv);
+	if (unlikely(rc))
 		goto error_reset;
-	}
-
-	/* Turn off all Tx DMA channels */
-	iwl_write_prph(priv, IWL49_SCD_TXFACT, 0);
-	iwl_release_nic_access(priv);
-	spin_unlock_irqrestore(&priv->lock, flags);
 
 	/* Tell 4965 where to find the keep-warm buffer */
 	rc = iwl4965_kw_init(priv);
@@ -538,6 +549,7 @@ static int iwl4965_txq_ctx_reset(struct iwl_priv *priv)
  error_kw:
 	return rc;
 }
+
 static int iwl4965_apm_init(struct iwl_priv *priv)
 {
 	unsigned long flags;
@@ -621,7 +633,6 @@ static void iwl4965_nic_config(struct iwl_priv *priv)
 	spin_unlock_irqrestore(&priv->lock, flags);
 }
 
-
 int iwl4965_hw_nic_init(struct iwl_priv *priv)
 {
 	unsigned long flags;
@@ -4041,6 +4052,7 @@ static struct iwl_lib_ops iwl4965_lib = {
 	.free_shared_mem = iwl4965_free_shared_mem,
 	.txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl,
 	.hw_nic_init = iwl4965_hw_nic_init,
+	.disable_tx_fifo = iwl4965_disable_tx_fifo,
 	.rx_handler_setup = iwl4965_rx_handler_setup,
 	.is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr,
 	.alive_notify = iwl4965_alive_notify,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index f9c2274..feffcaf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -430,6 +430,27 @@ static u16 iwl5000_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data)
 }
 
 
+static int iwl5000_disable_tx_fifo(struct iwl_priv *priv)
+{
+	unsigned long flags;
+	int ret;
+
+	spin_lock_irqsave(&priv->lock, flags);
+
+	ret = iwl_grab_nic_access(priv);
+	if (unlikely(ret)) {
+		IWL_ERROR("Tx fifo reset failed");
+		spin_unlock_irqrestore(&priv->lock, flags);
+		return ret;
+	}
+
+	iwl_write_prph(priv, IWL50_SCD_TXFACT, 0);
+	iwl_release_nic_access(priv);
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	return 0;
+}
+
 static struct iwl_hcmd_ops iwl5000_hcmd = {
 };
 
@@ -446,6 +467,7 @@ static struct iwl_lib_ops iwl5000_lib = {
 	.alloc_shared_mem = iwl5000_alloc_shared_mem,
 	.free_shared_mem = iwl5000_free_shared_mem,
 	.txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl,
+	.disable_tx_fifo = iwl5000_disable_tx_fifo,
 	.apm_ops = {
 		.init =	iwl5000_apm_init,
 		.config = iwl5000_nic_config,
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 1241806..c29f8b3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -110,6 +110,8 @@ struct iwl_lib_ops {
 	void (*rx_handler_setup)(struct iwl_priv *priv);
 	/* nic init */
 	int (*hw_nic_init)(struct iwl_priv *priv);
+	/* nic Tx fifo handling */
+	int (*disable_tx_fifo)(struct iwl_priv *priv);
 	/* alive notification */
 	int (*alive_notify)(struct iwl_priv *priv);
 	/* check validity of rtc data address */
-- 
1.5.3.6


  reply	other threads:[~2008-05-05  2:24 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1209954172-3092-1-git-send-email-yi.zhu@intel.com>
2008-05-05  2:22 ` [PATCH 01/25] iwlwifi: move RX code to iwl-rx.c Zhu Yi
2008-05-05  2:22   ` [PATCH 02/25] iwlwifi-5000: rename iwl5000_init_nic to iwl5000_init_config Zhu Yi
2008-05-05  2:22     ` [PATCH 03/25] iwlwifi: don't override association channel with control channel Zhu Yi
2008-05-05  2:22       ` [PATCH 04/25] iwlwifi: remove 4965 from station_entry Zhu Yi
2008-05-05  2:22         ` [PATCH 05/25] iwlwifi: debugfs EEPROM dump Zhu Yi
2008-05-05  2:22           ` [PATCH 06/25] iwlwifi: remove 4965 from rx_packet Zhu Yi
2008-05-05  2:22             ` [PATCH 07/25] iwlwifi: generalize iwl4965_send_add_station function Zhu Yi
2008-05-05  2:22               ` [PATCH 08/25] iwlwifi-5000: add build_addsta_hcmd handler for 5000 HW Zhu Yi
2008-05-05  2:22                 ` [PATCH 09/25] iwlwifi: Fix unconditional access to station->tidp[].agg Zhu Yi
2008-05-05  2:22                   ` [PATCH 10/25] iwlwifi: Fix built-in compilation of iwlcore Zhu Yi
2008-05-05  2:22                     ` [PATCH 11/25] iwlwifi: Fix built-in compilation of iwlcore (part 2) Zhu Yi
2008-05-05  2:22                       ` [PATCH 12/25] iwlwifi: Allow building iwl3945 without iwl4965 Zhu Yi
2008-05-05  2:22                         ` [PATCH 13/25] iwlwifi: move per driverdebug_level to per device Zhu Yi
2008-05-05  2:22                           ` [PATCH 14/25] iwlwifi: move iwl4965_set_rxon_ht into iwlcore Zhu Yi
2008-05-05  2:22                             ` Zhu Yi [this message]
2008-05-05  2:22                               ` [PATCH 16/25] iwlwifi: move NIC init and Tx queues init to iwlcore Zhu Yi
2008-05-05  2:22                                 ` [PATCH 17/25] iwlwifi: compile iwl-sta into iwlcore Zhu Yi
2008-05-05  2:22                                   ` [PATCH 18/25] iwlwifi: move iwl4965_init_alive_start to iwl-4965.c Zhu Yi
2008-05-05  2:22                                     ` [PATCH 19/25] iwlwifi: fix compile error when CONFIG_MAC80211_DEBUGFS is not selected Zhu Yi
2008-05-05  2:22                                       ` [PATCH 20/25] iwlwifi : Set monitor mode for 4965 Zhu Yi
2008-05-05  2:22                                         ` [PATCH 21/25] iwlwifi : Set monitor mode for 3945 Zhu Yi
2008-05-05  2:22                                           ` [PATCH 22/25] iwlwifi: handle shared memory Rx index access Zhu Yi
2008-05-05  2:22                                             ` [PATCH 23/25] iwlwifi: remove 4965 prefix from iwl4965_kw and iwl4965_tx_queue Zhu Yi
2008-05-05  2:22                                               ` [PATCH 24/25] iwlwifi: fix spinlock used before initialized Zhu Yi
2008-05-05  2:22                                                 ` [PATCH 25/25] iwlwifi: map A-MPDU HW queue to mac80211 A-MPDU SW queue Zhu Yi
2008-05-06  9:09                                                   ` Tomas Winkler
2008-05-06  9:11                                                     ` Tomas Winkler
2008-05-06  9:38                                                       ` Johannes Berg
2008-05-06 10:34                                                         ` Tomas Winkler
2008-05-06 10:37                                                           ` Johannes Berg
2008-05-06 10:46                                                             ` Tomas Winkler
2008-05-06 10:48                                                               ` Johannes Berg
2008-05-06  9:16                                                     ` Johannes Berg
2008-05-05  7:11                                         ` [PATCH 20/25] iwlwifi : Set monitor mode for 4965 Johannes Berg
2008-05-05  8:05                                           ` Zhu Yi
2008-05-05  8:28                                             ` Johannes Berg
2008-05-05  8:53                                               ` Zhu Yi
2008-05-05  9:05                                                 ` Johannes Berg
2008-05-05  9:31                                                   ` Tomas Winkler

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=1209954172-3092-16-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=ron.rindjunsky@intel.com \
    --cc=tomas.winkler@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