aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-rx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c52
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}
370EXPORT_SYMBOL(iwl_rx_queue_reset); 370EXPORT_SYMBOL(iwl_rx_queue_reset);
371 371
372int 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