aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGuy Eilam <guy@wizery.com>2011-08-16 12:49:12 -0400
committerLuciano Coelho <coelho@ti.com>2011-08-25 03:10:41 -0400
commite9eb8cbe77139470651c858b8b7a3d20d332cf47 (patch)
tree28b83a2cf3365db633608c3baf32c9a7741a862a /drivers/net
parent04b4d69c89593d907d81a4aa33e4e42a632fe436 (diff)
wl12xx: use 2 spare TX blocks for GEM cipher
Add tx_spare_blocks member to the wl1271 struct for more generic configuration of the amount of spare TX blocks that should be used. The default value is 1. In case GEM cipher is used by the STA, we need 2 spare TX blocks instead of just 1. Signed-off-by: Guy Eilam <guy@wizery.com> Acked-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/wl12xx/main.c13
-rw-r--r--drivers/net/wireless/wl12xx/tx.c8
-rw-r--r--drivers/net/wireless/wl12xx/tx.h1
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h3
4 files changed, 22 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 82f4408e89ad..20e7bc78a7fe 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2064,6 +2064,7 @@ deinit:
2064 wl->session_counter = 0; 2064 wl->session_counter = 0;
2065 wl->rate_set = CONF_TX_RATE_MASK_BASIC; 2065 wl->rate_set = CONF_TX_RATE_MASK_BASIC;
2066 wl->vif = NULL; 2066 wl->vif = NULL;
2067 wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT;
2067 wl1271_free_ap_keys(wl); 2068 wl1271_free_ap_keys(wl);
2068 memset(wl->ap_hlid_map, 0, sizeof(wl->ap_hlid_map)); 2069 memset(wl->ap_hlid_map, 0, sizeof(wl->ap_hlid_map));
2069 wl->ap_fw_ps_map = 0; 2070 wl->ap_fw_ps_map = 0;
@@ -2653,6 +2654,17 @@ static int wl1271_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
2653 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 2654 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
2654 }; 2655 };
2655 2656
2657 /*
2658 * A STA set to GEM cipher requires 2 tx spare blocks.
2659 * Return to default value when GEM cipher key is removed
2660 */
2661 if (key_type == KEY_GEM) {
2662 if (action == KEY_ADD_OR_REPLACE)
2663 wl->tx_spare_blocks = 2;
2664 else if (action == KEY_REMOVE)
2665 wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT;
2666 }
2667
2656 addr = sta ? sta->addr : bcast_addr; 2668 addr = sta ? sta->addr : bcast_addr;
2657 2669
2658 if (is_zero_ether_addr(addr)) { 2670 if (is_zero_ether_addr(addr)) {
@@ -4599,6 +4611,7 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
4599 wl->sched_scanning = false; 4611 wl->sched_scanning = false;
4600 wl->tx_security_seq = 0; 4612 wl->tx_security_seq = 0;
4601 wl->tx_security_last_seq_lsb = 0; 4613 wl->tx_security_last_seq_lsb = 0;
4614 wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT;
4602 wl->role_id = WL12XX_INVALID_ROLE_ID; 4615 wl->role_id = WL12XX_INVALID_ROLE_ID;
4603 wl->system_hlid = WL12XX_SYSTEM_HLID; 4616 wl->system_hlid = WL12XX_SYSTEM_HLID;
4604 wl->sta_hlid = WL12XX_INVALID_LINK_ID; 4617 wl->sta_hlid = WL12XX_INVALID_LINK_ID;
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index 0f1578577b1a..08227e69616b 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -204,9 +204,7 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra,
204 u32 len; 204 u32 len;
205 u32 total_blocks; 205 u32 total_blocks;
206 int id, ret = -EBUSY, ac; 206 int id, ret = -EBUSY, ac;
207 207 u32 spare_blocks = wl->tx_spare_blocks;
208 /* we use 1 spare block */
209 u32 spare_blocks = 1;
210 208
211 if (buf_offset + total_len > WL1271_AGGR_BUFFER_SIZE) 209 if (buf_offset + total_len > WL1271_AGGR_BUFFER_SIZE)
212 return -EAGAIN; 210 return -EAGAIN;
@@ -220,6 +218,10 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra,
220 in the firmware */ 218 in the firmware */
221 len = wl12xx_calc_packet_alignment(wl, total_len); 219 len = wl12xx_calc_packet_alignment(wl, total_len);
222 220
221 /* in case of a dummy packet, use default amount of spare mem blocks */
222 if (unlikely(wl12xx_is_dummy_packet(wl, skb)))
223 spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT;
224
223 total_blocks = (len + TX_HW_BLOCK_SIZE - 1) / TX_HW_BLOCK_SIZE + 225 total_blocks = (len + TX_HW_BLOCK_SIZE - 1) / TX_HW_BLOCK_SIZE +
224 spare_blocks; 226 spare_blocks;
225 227
diff --git a/drivers/net/wireless/wl12xx/tx.h b/drivers/net/wireless/wl12xx/tx.h
index 7da35c0e411b..6519be4b2c38 100644
--- a/drivers/net/wireless/wl12xx/tx.h
+++ b/drivers/net/wireless/wl12xx/tx.h
@@ -25,6 +25,7 @@
25#ifndef __TX_H__ 25#ifndef __TX_H__
26#define __TX_H__ 26#define __TX_H__
27 27
28#define TX_HW_BLOCK_SPARE_DEFAULT 1
28#define TX_HW_BLOCK_SIZE 252 29#define TX_HW_BLOCK_SIZE 252
29 30
30#define TX_HW_MGMT_PKT_LIFETIME_TU 2000 31#define TX_HW_MGMT_PKT_LIFETIME_TU 2000
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index 61a7c2163ea2..fb2753c46300 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -425,6 +425,9 @@ struct wl1271 {
425 u32 tx_allocated_blocks; 425 u32 tx_allocated_blocks;
426 u32 tx_results_count; 426 u32 tx_results_count;
427 427
428 /* amount of spare TX blocks to use */
429 u32 tx_spare_blocks;
430
428 /* Accounting for allocated / available Tx packets in HW */ 431 /* Accounting for allocated / available Tx packets in HW */
429 u32 tx_pkts_freed[NUM_TX_QUEUES]; 432 u32 tx_pkts_freed[NUM_TX_QUEUES];
430 u32 tx_allocated_pkts[NUM_TX_QUEUES]; 433 u32 tx_allocated_pkts[NUM_TX_QUEUES];