aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-hw.h13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fh.h15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c15
5 files changed, 25 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index db7b949020c2..8a378bd1a7ab 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2485,7 +2485,7 @@ int iwl3945_hw_set_hw_params(struct iwl_priv *priv)
2485 return -ENOMEM; 2485 return -ENOMEM;
2486 } 2486 }
2487 2487
2488 priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE; 2488 priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_3K;
2489 priv->hw_params.max_pkt_size = 2342; 2489 priv->hw_params.max_pkt_size = 2342;
2490 priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; 2490 priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
2491 priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; 2491 priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index be3013453359..491313baba63 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -96,7 +96,6 @@ enum iwl3945_antenna {
96 * else RTS for data/management frames where MPDU is larger 96 * else RTS for data/management frames where MPDU is larger
97 * than RTS value. 97 * than RTS value.
98 */ 98 */
99#define IWL_RX_BUF_SIZE 3000U
100#define DEFAULT_RTS_THRESHOLD 2347U 99#define DEFAULT_RTS_THRESHOLD 2347U
101#define MIN_RTS_THRESHOLD 0U 100#define MIN_RTS_THRESHOLD 0U
102#define MAX_RTS_THRESHOLD 2347U 101#define MAX_RTS_THRESHOLD 2347U
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index e751c53ae1f8..ed6baa539f50 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -110,19 +110,6 @@
110 110
111#define IWL_DEFAULT_TX_RETRY 15 111#define IWL_DEFAULT_TX_RETRY 15
112 112
113#define RX_QUEUE_SIZE 256
114#define RX_QUEUE_MASK 255
115#define RX_QUEUE_SIZE_LOG 8
116
117/*
118 * RX related structures and functions
119 */
120#define RX_FREE_BUFFERS 64
121#define RX_LOW_WATERMARK 8
122
123/* Size of one Rx buffer in host DRAM */
124#define IWL_RX_BUF_SIZE_4K (4 * 1024)
125#define IWL_RX_BUF_SIZE_8K (8 * 1024)
126 113
127/* Sizes and addresses for instruction and data memory (SRAM) in 114/* Sizes and addresses for instruction and data memory (SRAM) in
128 * 4965's embedded processor. Driver access is via HBUS_TARG_MEM_* regs. */ 115 * 4965's embedded processor. Driver access is via HBUS_TARG_MEM_* regs. */
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h
index a72aa1b32c8a..ad5a24ecc2de 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fh.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fh.h
@@ -399,6 +399,21 @@
399 */ 399 */
400#define FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN (0x00000002) 400#define FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN (0x00000002)
401 401
402#define RX_QUEUE_SIZE 256
403#define RX_QUEUE_MASK 255
404#define RX_QUEUE_SIZE_LOG 8
405
406/*
407 * RX related structures and functions
408 */
409#define RX_FREE_BUFFERS 64
410#define RX_LOW_WATERMARK 8
411
412/* Size of one Rx buffer in host DRAM */
413#define IWL_RX_BUF_SIZE_3K (3 * 1000) /* 3945 only */
414#define IWL_RX_BUF_SIZE_4K (4 * 1024)
415#define IWL_RX_BUF_SIZE_8K (8 * 1024)
416
402/** 417/**
403 * struct iwl_rb_status - reseve buffer status 418 * struct iwl_rb_status - reseve buffer status
404 * host memory mapped FH registers 419 * host memory mapped FH registers
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);