diff options
author | Winkler, Tomas <tomas.winkler@intel.com> | 2008-11-07 12:58:39 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-21 11:07:22 -0500 |
commit | 8d86422a83d79e3d3241cf0f269fca0c2640bcee (patch) | |
tree | b9791deaa104a7254891d962dceb551864235ee0 /drivers/net/wireless/iwlwifi/iwl-rx.c | |
parent | 5c5aa3f13a50881b8f6e529e321bbefb5faec37b (diff) |
iwlwifi: move rx queue read pointer into rxq
This patch moves rx status/read registers into
iwl_rx_queue structures. This solution is more memory
hungry but is more structured and provides needed RX/TX
separation
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@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 | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index b3c35c64d042..48d55741b769 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -317,7 +317,10 @@ void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
317 | 317 | ||
318 | pci_free_consistent(priv->pci_dev, 4 * RX_QUEUE_SIZE, rxq->bd, | 318 | pci_free_consistent(priv->pci_dev, 4 * RX_QUEUE_SIZE, rxq->bd, |
319 | rxq->dma_addr); | 319 | rxq->dma_addr); |
320 | pci_free_consistent(priv->pci_dev, sizeof(struct iwl_rb_status), | ||
321 | rxq->rb_stts, rxq->rb_stts_dma); | ||
320 | rxq->bd = NULL; | 322 | rxq->bd = NULL; |
323 | rxq->rb_stts = NULL; | ||
321 | } | 324 | } |
322 | EXPORT_SYMBOL(iwl_rx_queue_free); | 325 | EXPORT_SYMBOL(iwl_rx_queue_free); |
323 | 326 | ||
@@ -334,7 +337,12 @@ int iwl_rx_queue_alloc(struct iwl_priv *priv) | |||
334 | /* Alloc the circular buffer of Read Buffer Descriptors (RBDs) */ | 337 | /* Alloc the circular buffer of Read Buffer Descriptors (RBDs) */ |
335 | rxq->bd = pci_alloc_consistent(dev, 4 * RX_QUEUE_SIZE, &rxq->dma_addr); | 338 | rxq->bd = pci_alloc_consistent(dev, 4 * RX_QUEUE_SIZE, &rxq->dma_addr); |
336 | if (!rxq->bd) | 339 | if (!rxq->bd) |
337 | return -ENOMEM; | 340 | goto err_bd; |
341 | |||
342 | rxq->rb_stts = pci_alloc_consistent(dev, sizeof(struct iwl_rb_status), | ||
343 | &rxq->rb_stts_dma); | ||
344 | if (!rxq->rb_stts) | ||
345 | goto err_rb; | ||
338 | 346 | ||
339 | /* Fill the rx_used queue with _all_ of the Rx buffers */ | 347 | /* Fill the rx_used queue with _all_ of the Rx buffers */ |
340 | for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++) | 348 | for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++) |
@@ -346,6 +354,12 @@ int iwl_rx_queue_alloc(struct iwl_priv *priv) | |||
346 | rxq->free_count = 0; | 354 | rxq->free_count = 0; |
347 | rxq->need_update = 0; | 355 | rxq->need_update = 0; |
348 | return 0; | 356 | return 0; |
357 | |||
358 | err_rb: | ||
359 | pci_free_consistent(priv->pci_dev, 4 * RX_QUEUE_SIZE, rxq->bd, | ||
360 | rxq->dma_addr); | ||
361 | err_bd: | ||
362 | return -ENOMEM; | ||
349 | } | 363 | } |
350 | EXPORT_SYMBOL(iwl_rx_queue_alloc); | 364 | EXPORT_SYMBOL(iwl_rx_queue_alloc); |
351 | 365 | ||
@@ -412,7 +426,7 @@ int iwl_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
412 | 426 | ||
413 | /* Tell device where in DRAM to update its Rx status */ | 427 | /* Tell device where in DRAM to update its Rx status */ |
414 | iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG, | 428 | iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG, |
415 | (priv->shared_phys + priv->rb_closed_offset) >> 4); | 429 | rxq->rb_stts_dma >> 4); |
416 | 430 | ||
417 | /* Enable Rx DMA | 431 | /* Enable Rx DMA |
418 | * FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY is set because of HW bug in | 432 | * FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY is set because of HW bug in |