diff options
author | Zhu Yi <yi.zhu@intel.com> | 2009-12-10 17:37:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-21 11:31:55 -0500 |
commit | 64a76b504b04b5da16d1e7658a95dd126594e02f (patch) | |
tree | 88f458acc3d304fc0d625ea4eecf816ed0f7bc28 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | d24deb2580823ab0b8425790c6f5d18e2ff749d8 (diff) |
iwlwifi: allocated rx page accounting cleanup
In iwlwifi, priv->alloc_rxb_page is used to keep track of the Rx
pages allocated by the driver. This cleans up the page free routines
by introducing __iwl_free_pages/iwl_free_pages so that the accounting
is more accurate and less error prone. This also fixes two instances where
the counter was not updated.
Signed-off-by: Zhu Yi <yi.zhu@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/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 2a28a1f8b1fe..994db4a2e1c4 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -812,7 +812,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv, | |||
812 | break; | 812 | break; |
813 | } | 813 | } |
814 | 814 | ||
815 | free_pages(cmd.reply_page, priv->hw_params.rx_page_order); | 815 | iwl_free_pages(priv, cmd.reply_page); |
816 | 816 | ||
817 | return rc; | 817 | return rc; |
818 | } | 818 | } |
@@ -1198,9 +1198,7 @@ void iwl3945_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
1198 | pci_unmap_page(priv->pci_dev, rxq->pool[i].page_dma, | 1198 | pci_unmap_page(priv->pci_dev, rxq->pool[i].page_dma, |
1199 | PAGE_SIZE << priv->hw_params.rx_page_order, | 1199 | PAGE_SIZE << priv->hw_params.rx_page_order, |
1200 | PCI_DMA_FROMDEVICE); | 1200 | PCI_DMA_FROMDEVICE); |
1201 | priv->alloc_rxb_page--; | 1201 | __iwl_free_pages(priv, rxq->pool[i].page); |
1202 | __free_pages(rxq->pool[i].page, | ||
1203 | priv->hw_params.rx_page_order); | ||
1204 | rxq->pool[i].page = NULL; | 1202 | rxq->pool[i].page = NULL; |
1205 | } | 1203 | } |
1206 | list_add_tail(&rxq->pool[i].list, &rxq->rx_used); | 1204 | list_add_tail(&rxq->pool[i].list, &rxq->rx_used); |
@@ -1247,10 +1245,8 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx | |||
1247 | pci_unmap_page(priv->pci_dev, rxq->pool[i].page_dma, | 1245 | pci_unmap_page(priv->pci_dev, rxq->pool[i].page_dma, |
1248 | PAGE_SIZE << priv->hw_params.rx_page_order, | 1246 | PAGE_SIZE << priv->hw_params.rx_page_order, |
1249 | PCI_DMA_FROMDEVICE); | 1247 | PCI_DMA_FROMDEVICE); |
1250 | __free_pages(rxq->pool[i].page, | 1248 | __iwl_free_pages(priv, rxq->pool[i].page); |
1251 | priv->hw_params.rx_page_order); | ||
1252 | rxq->pool[i].page = NULL; | 1249 | rxq->pool[i].page = NULL; |
1253 | priv->alloc_rxb_page--; | ||
1254 | } | 1250 | } |
1255 | } | 1251 | } |
1256 | 1252 | ||