diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-01-08 18:47:07 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-16 08:19:14 -0500 |
commit | 22dc3c9561825a7c2cd18d01b01358c2141a8e16 (patch) | |
tree | 85e7001820ab48ec8bd648862cd3a8ffb7c59595 /drivers/net/wireless/iwlwifi/pcie/tx.c | |
parent | 01387ffd19f37b4026fd0e4c32260bc25f6469d4 (diff) |
iwlwifi: simplify scheduler memory clearing
Writing 130 dwords into the device one by one is
rather inefficient, every one needs to lock, grab
NIC access (a few register reads/writes) and then
write the address and data registers.
Use the new memory clearing function to make this
easier and faster.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie/tx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/tx.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index 3ff3e8b72fb0..d3c4e8f017ef 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c | |||
@@ -641,9 +641,11 @@ static void iwl_pcie_txq_set_sched(struct iwl_trans *trans, u32 mask) | |||
641 | void iwl_pcie_tx_start(struct iwl_trans *trans, u32 scd_base_addr) | 641 | void iwl_pcie_tx_start(struct iwl_trans *trans, u32 scd_base_addr) |
642 | { | 642 | { |
643 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 643 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
644 | u32 a; | 644 | int nq = trans->cfg->base_params->num_of_queues; |
645 | int chan; | 645 | int chan; |
646 | u32 reg_val; | 646 | u32 reg_val; |
647 | int clear_dwords = (SCD_TRANS_TBL_OFFSET_QUEUE(nq) - | ||
648 | SCD_CONTEXT_MEM_LOWER_BOUND) / sizeof(u32); | ||
647 | 649 | ||
648 | /* make sure all queue are not stopped/used */ | 650 | /* make sure all queue are not stopped/used */ |
649 | memset(trans_pcie->queue_stopped, 0, sizeof(trans_pcie->queue_stopped)); | 651 | memset(trans_pcie->queue_stopped, 0, sizeof(trans_pcie->queue_stopped)); |
@@ -655,20 +657,10 @@ void iwl_pcie_tx_start(struct iwl_trans *trans, u32 scd_base_addr) | |||
655 | WARN_ON(scd_base_addr != 0 && | 657 | WARN_ON(scd_base_addr != 0 && |
656 | scd_base_addr != trans_pcie->scd_base_addr); | 658 | scd_base_addr != trans_pcie->scd_base_addr); |
657 | 659 | ||
658 | a = trans_pcie->scd_base_addr + SCD_CONTEXT_MEM_LOWER_BOUND; | 660 | /* reset context data, TX status and translation data */ |
659 | /* reset conext data memory */ | 661 | iwl_trans_write_mem(trans, trans_pcie->scd_base_addr + |
660 | for (; a < trans_pcie->scd_base_addr + SCD_CONTEXT_MEM_UPPER_BOUND; | 662 | SCD_CONTEXT_MEM_LOWER_BOUND, |
661 | a += 4) | 663 | NULL, clear_dwords); |
662 | iwl_trans_write_mem32(trans, a, 0); | ||
663 | /* reset tx status memory */ | ||
664 | for (; a < trans_pcie->scd_base_addr + SCD_TX_STTS_MEM_UPPER_BOUND; | ||
665 | a += 4) | ||
666 | iwl_trans_write_mem32(trans, a, 0); | ||
667 | for (; a < trans_pcie->scd_base_addr + | ||
668 | SCD_TRANS_TBL_OFFSET_QUEUE( | ||
669 | trans->cfg->base_params->num_of_queues); | ||
670 | a += 4) | ||
671 | iwl_trans_write_mem32(trans, a, 0); | ||
672 | 664 | ||
673 | iwl_write_prph(trans, SCD_DRAM_BASE_ADDR, | 665 | iwl_write_prph(trans, SCD_DRAM_BASE_ADDR, |
674 | trans_pcie->scd_bc_tbls.dma >> 10); | 666 | trans_pcie->scd_bc_tbls.dma >> 10); |