aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-05-29 04:35:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-03 15:00:21 -0400
commitda1bc4539f9b10dc30ac1750fbaaf5afae4b3446 (patch)
tree697cbfd1f1eb6ce8117e86612988abb4ea861b97 /drivers/net/wireless/iwlwifi/iwl-4965.c
parent46315e012236af887cf442fd494a91b1d36858b9 (diff)
iwlwifi: move txq_ctx_stop into iwl-tx.c
This patch moves txq_ctx_stop into iwl-tx.c iwlcore module. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c59
1 files changed, 8 insertions, 51 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index c5864903f5ef..fe731918c2f4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -468,25 +468,13 @@ int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src)
468 return ret; 468 return ret;
469} 469}
470 470
471static int iwl4965_disable_tx_fifo(struct iwl_priv *priv) 471/*
472 * Activate/Deactivat Tx DMA/FIFO channels according tx fifos mask
473 * must be called under priv->lock and mac access
474 */
475static void iwl4965_txq_set_sched(struct iwl_priv *priv, u32 mask)
472{ 476{
473 unsigned long flags; 477 iwl_write_prph(priv, IWL49_SCD_TXFACT, mask);
474 int ret;
475
476 spin_lock_irqsave(&priv->lock, flags);
477
478 ret = iwl_grab_nic_access(priv);
479 if (unlikely(ret)) {
480 IWL_ERROR("Tx fifo reset failed");
481 spin_unlock_irqrestore(&priv->lock, flags);
482 return ret;
483 }
484
485 iwl_write_prph(priv, IWL49_SCD_TXFACT, 0);
486 iwl_release_nic_access(priv);
487 spin_unlock_irqrestore(&priv->lock, flags);
488
489 return 0;
490} 478}
491 479
492static int iwl4965_apm_init(struct iwl_priv *priv) 480static int iwl4965_apm_init(struct iwl_priv *priv)
@@ -579,36 +567,6 @@ static void iwl4965_nic_config(struct iwl_priv *priv)
579 spin_unlock_irqrestore(&priv->lock, flags); 567 spin_unlock_irqrestore(&priv->lock, flags);
580} 568}
581 569
582/**
583 * iwl4965_hw_txq_ctx_stop - Stop all Tx DMA channels, free Tx queue memory
584 */
585void iwl4965_hw_txq_ctx_stop(struct iwl_priv *priv)
586{
587
588 int txq_id;
589 unsigned long flags;
590
591 /* Stop each Tx DMA channel, and wait for it to be idle */
592 for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) {
593 spin_lock_irqsave(&priv->lock, flags);
594 if (iwl_grab_nic_access(priv)) {
595 spin_unlock_irqrestore(&priv->lock, flags);
596 continue;
597 }
598
599 iwl_write_direct32(priv,
600 FH_TCSR_CHNL_TX_CONFIG_REG(txq_id), 0x0);
601 iwl_poll_direct_bit(priv, FH_TSSR_TX_STATUS_REG,
602 FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE
603 (txq_id), 200);
604 iwl_release_nic_access(priv);
605 spin_unlock_irqrestore(&priv->lock, flags);
606 }
607
608 /* Deallocate memory for all Tx queues */
609 iwl_hw_txq_ctx_free(priv);
610}
611
612static int iwl4965_apm_stop_master(struct iwl_priv *priv) 570static int iwl4965_apm_stop_master(struct iwl_priv *priv)
613{ 571{
614 int ret = 0; 572 int ret = 0;
@@ -995,8 +953,7 @@ int iwl4965_alive_notify(struct iwl_priv *priv)
995 (1 << priv->hw_params.max_txq_num) - 1); 953 (1 << priv->hw_params.max_txq_num) - 1);
996 954
997 /* Activate all Tx DMA/FIFO channels */ 955 /* Activate all Tx DMA/FIFO channels */
998 iwl_write_prph(priv, IWL49_SCD_TXFACT, 956 priv->cfg->ops->lib->txq_set_sched(priv, IWL_MASK(0, 7));
999 SCD_TXFACT_REG_TXFIFO_MASK(0, 7));
1000 957
1001 iwl4965_set_wr_ptrs(priv, IWL_CMD_QUEUE_NUM, 0); 958 iwl4965_set_wr_ptrs(priv, IWL_CMD_QUEUE_NUM, 0);
1002 959
@@ -3622,7 +3579,7 @@ static struct iwl_lib_ops iwl4965_lib = {
3622 .free_shared_mem = iwl4965_free_shared_mem, 3579 .free_shared_mem = iwl4965_free_shared_mem,
3623 .shared_mem_rx_idx = iwl4965_shared_mem_rx_idx, 3580 .shared_mem_rx_idx = iwl4965_shared_mem_rx_idx,
3624 .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, 3581 .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl,
3625 .disable_tx_fifo = iwl4965_disable_tx_fifo, 3582 .txq_set_sched = iwl4965_txq_set_sched,
3626 .rx_handler_setup = iwl4965_rx_handler_setup, 3583 .rx_handler_setup = iwl4965_rx_handler_setup,
3627 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, 3584 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr,
3628 .alive_notify = iwl4965_alive_notify, 3585 .alive_notify = iwl4965_alive_notify,