aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-08-26 02:11:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-29 15:33:00 -0400
commit5f178cd2ebe8ac196b245428c574f1def1964b14 (patch)
treefcf8fb7326c374304e4cfbc376b828f863f94b4f /drivers/net/wireless/iwlwifi/iwl-agn-lib.c
parentc91bd12489f50809af94c46d7c4c4d98b70c6f47 (diff)
iwlagn: move wait_for_tx_queue_empty to transport layer
This one is really transport related. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 359bd9060560..7c036b9c2b30 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -634,37 +634,6 @@ int iwlagn_manage_ibss_station(struct iwl_priv *priv,
634 vif->bss_conf.bssid); 634 vif->bss_conf.bssid);
635} 635}
636 636
637#define IWL_FLUSH_WAIT_MS 2000
638
639int iwlagn_wait_tx_queue_empty(struct iwl_priv *priv)
640{
641 struct iwl_tx_queue *txq;
642 struct iwl_queue *q;
643 int cnt;
644 unsigned long now = jiffies;
645 int ret = 0;
646
647 /* waiting for all the tx frames complete might take a while */
648 for (cnt = 0; cnt < hw_params(priv).max_txq_num; cnt++) {
649 if (cnt == priv->shrd->cmd_queue)
650 continue;
651 txq = &priv->txq[cnt];
652 q = &txq->q;
653 while (q->read_ptr != q->write_ptr && !time_after(jiffies,
654 now + msecs_to_jiffies(IWL_FLUSH_WAIT_MS)))
655 msleep(1);
656
657 if (q->read_ptr != q->write_ptr) {
658 IWL_ERR(priv, "fail to flush all tx fifo queues\n");
659 ret = -ETIMEDOUT;
660 break;
661 }
662 }
663 return ret;
664}
665
666#define IWL_TX_QUEUE_MSK 0xfffff
667
668/** 637/**
669 * iwlagn_txfifo_flush: send REPLY_TXFIFO_FLUSH command to uCode 638 * iwlagn_txfifo_flush: send REPLY_TXFIFO_FLUSH command to uCode
670 * 639 *
@@ -715,7 +684,7 @@ void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
715 goto done; 684 goto done;
716 } 685 }
717 IWL_DEBUG_INFO(priv, "wait transmit/flush all frames\n"); 686 IWL_DEBUG_INFO(priv, "wait transmit/flush all frames\n");
718 iwlagn_wait_tx_queue_empty(priv); 687 iwl_trans_wait_tx_queue_empty(trans(priv));
719done: 688done:
720 ieee80211_wake_queues(priv->hw); 689 ieee80211_wake_queues(priv->hw);
721 mutex_unlock(&priv->shrd->mutex); 690 mutex_unlock(&priv->shrd->mutex);