diff options
author | Winkler, Tomas <tomas.winkler@intel.com> | 2009-01-08 13:19:57 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:00:14 -0500 |
commit | 1e33dc64475790c10a7cda3ca23d2eb678760d85 (patch) | |
tree | d570577118248d83e3ca8af6578ab79db62d832c /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | d45aadd04b60c6d4f846e7ec2564654567065e5f (diff) |
iwl3945: use hw_params.rx_buf_size
This patch makes 3945 use of hw_params.rx_buf_size instead of
IWL_RX_BUF_SIZE. It also renames IWL_RX_BUF_SIZE to IWL_RX_BUF_SIZE_3K
and moves rx buffer defines into iwl-fh.h.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@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 | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index e05a9d604b9b..d145002d0a69 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3281,7 +3281,8 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv) | |||
3281 | 3281 | ||
3282 | /* Alloc a new receive buffer */ | 3282 | /* Alloc a new receive buffer */ |
3283 | rxb->skb = | 3283 | rxb->skb = |
3284 | alloc_skb(IWL_RX_BUF_SIZE, __GFP_NOWARN | GFP_ATOMIC); | 3284 | alloc_skb(priv->hw_params.rx_buf_size, |
3285 | __GFP_NOWARN | GFP_ATOMIC); | ||
3285 | if (!rxb->skb) { | 3286 | if (!rxb->skb) { |
3286 | if (net_ratelimit()) | 3287 | if (net_ratelimit()) |
3287 | IWL_CRIT(priv, ": Can not allocate SKB buffers\n"); | 3288 | IWL_CRIT(priv, ": Can not allocate SKB buffers\n"); |
@@ -3303,9 +3304,10 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv) | |||
3303 | list_del(element); | 3304 | list_del(element); |
3304 | 3305 | ||
3305 | /* Get physical address of RB/SKB */ | 3306 | /* Get physical address of RB/SKB */ |
3306 | rxb->real_dma_addr = | 3307 | rxb->real_dma_addr = pci_map_single(priv->pci_dev, |
3307 | pci_map_single(priv->pci_dev, rxb->skb->data, | 3308 | rxb->skb->data, |
3308 | IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); | 3309 | priv->hw_params.rx_buf_size, |
3310 | PCI_DMA_FROMDEVICE); | ||
3309 | list_add_tail(&rxb->list, &rxq->rx_free); | 3311 | list_add_tail(&rxb->list, &rxq->rx_free); |
3310 | rxq->free_count++; | 3312 | rxq->free_count++; |
3311 | } | 3313 | } |
@@ -3454,7 +3456,7 @@ static void iwl3945_rx_handle(struct iwl_priv *priv) | |||
3454 | rxq->queue[i] = NULL; | 3456 | rxq->queue[i] = NULL; |
3455 | 3457 | ||
3456 | pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->real_dma_addr, | 3458 | pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->real_dma_addr, |
3457 | IWL_RX_BUF_SIZE, | 3459 | priv->hw_params.rx_buf_size, |
3458 | PCI_DMA_FROMDEVICE); | 3460 | PCI_DMA_FROMDEVICE); |
3459 | pkt = (struct iwl_rx_packet *)rxb->skb->data; | 3461 | pkt = (struct iwl_rx_packet *)rxb->skb->data; |
3460 | 3462 | ||
@@ -3504,7 +3506,8 @@ static void iwl3945_rx_handle(struct iwl_priv *priv) | |||
3504 | } | 3506 | } |
3505 | 3507 | ||
3506 | pci_unmap_single(priv->pci_dev, rxb->real_dma_addr, | 3508 | pci_unmap_single(priv->pci_dev, rxb->real_dma_addr, |
3507 | IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); | 3509 | priv->hw_params.rx_buf_size, |
3510 | PCI_DMA_FROMDEVICE); | ||
3508 | spin_lock_irqsave(&rxq->lock, flags); | 3511 | spin_lock_irqsave(&rxq->lock, flags); |
3509 | list_add_tail(&rxb->list, &priv->rxq.rx_used); | 3512 | list_add_tail(&rxb->list, &priv->rxq.rx_used); |
3510 | spin_unlock_irqrestore(&rxq->lock, flags); | 3513 | spin_unlock_irqrestore(&rxq->lock, flags); |