diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2008-05-04 22:22:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-14 16:29:46 -0400 |
commit | 1053d35f4ed6876ad9d3a14cdae363db0a7e9b0a (patch) | |
tree | 64c30d5add3bd5be8857803c06c2aedf71182c72 /drivers/net/wireless/iwlwifi/iwl-rx.c | |
parent | 5a676bbeaf9e534b75286f2294ec57a4c544f1d2 (diff) |
iwlwifi: move NIC init and Tx queues init to iwlcore
This patch does the following:
1 - change hw_nic_init from a handler to a function
2 - move hw_nic_init function to iwlcore
3 - open a new file - iwl-tx.c
4 - move all Tx queues initialization (part of NIC init) to iwl-tx.c
5 - move iwl_rx_init, previously as part of the NIC init, to iwl-rx.c
6 - iwl4965_tfd_frame rename to iwl_tfd_frame
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
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-rx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index 667b592e6ade..171751e417d5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -369,3 +369,55 @@ void iwl_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
369 | } | 369 | } |
370 | EXPORT_SYMBOL(iwl_rx_queue_reset); | 370 | EXPORT_SYMBOL(iwl_rx_queue_reset); |
371 | 371 | ||
372 | int iwl_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | ||
373 | { | ||
374 | int ret; | ||
375 | unsigned long flags; | ||
376 | unsigned int rb_size; | ||
377 | |||
378 | spin_lock_irqsave(&priv->lock, flags); | ||
379 | ret = iwl_grab_nic_access(priv); | ||
380 | if (ret) { | ||
381 | spin_unlock_irqrestore(&priv->lock, flags); | ||
382 | return ret; | ||
383 | } | ||
384 | |||
385 | if (priv->cfg->mod_params->amsdu_size_8K) | ||
386 | rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_8K; | ||
387 | else | ||
388 | rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K; | ||
389 | |||
390 | /* Stop Rx DMA */ | ||
391 | iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0); | ||
392 | |||
393 | /* Reset driver's Rx queue write index */ | ||
394 | iwl_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_WPTR_REG, 0); | ||
395 | |||
396 | /* Tell device where to find RBD circular buffer in DRAM */ | ||
397 | iwl_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_BASE_REG, | ||
398 | rxq->dma_addr >> 8); | ||
399 | |||
400 | /* Tell device where in DRAM to update its Rx status */ | ||
401 | iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG, | ||
402 | (priv->shared_phys + | ||
403 | offsetof(struct iwl4965_shared, rb_closed)) >> 4); | ||
404 | |||
405 | /* Enable Rx DMA, enable host interrupt, Rx buffer size 4k, 256 RBDs */ | ||
406 | iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, | ||
407 | FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL | | ||
408 | FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL | | ||
409 | rb_size | | ||
410 | /* 0x10 << 4 | */ | ||
411 | (RX_QUEUE_SIZE_LOG << | ||
412 | FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT)); | ||
413 | |||
414 | /* | ||
415 | * iwl_write32(priv,CSR_INT_COAL_REG,0); | ||
416 | */ | ||
417 | |||
418 | iwl_release_nic_access(priv); | ||
419 | spin_unlock_irqrestore(&priv->lock, flags); | ||
420 | |||
421 | return 0; | ||
422 | } | ||
423 | |||