summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl18xx
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-05-18 07:46:37 +0300
committerLuciano Coelho <coelho@ti.com>2012-06-06 19:28:05 +0300
commit32bb2c03f990d015c0fec67e9134ea8625aaf784 (patch)
tree625379f953c7b11754f6d5ee09023fc1ad04d939 /drivers/net/wireless/ti/wl18xx
parent2c0133a437905591cdaa39cf65a3f7188d20a094 (diff)
wlcore/wl12xx/wl18xx: handle spare blocks spacial cases per arch
Add a HW op for getting spare blocks. 12xx cards require 2 spare blocks for GEM encrypted SKBs, regardless of VIFs or keys programmed into the FW. 18xx cards require 2 spare blocks when there are any connected TKIP or GEM VIFs. For now always return 2 spare blocks, as this works with all networks. The special case TKIP/GEM functionality is added at a later patch. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c11
-rw-r--r--drivers/net/wireless/ti/wl18xx/tx.h3
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index d67be3eae3d..c651f872d7d 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -874,7 +874,7 @@ static int wl18xx_hw_init(struct wl1271 *wl)
ret = wl18xx_acx_host_if_cfg_bitmap(wl, host_cfg_bitmap,
sdio_align_size,
- WL18XX_TX_HW_BLOCK_SPARE,
+ WL18XX_TX_HW_EXTRA_BLOCK_SPARE,
WL18XX_HOST_IF_LEN_SIZE_FIELD);
if (ret < 0)
return ret;
@@ -1034,6 +1034,12 @@ static int wl18xx_handle_static_data(struct wl1271 *wl,
return 0;
}
+static int wl18xx_get_spare_blocks(struct wl1271 *wl, bool is_gem)
+{
+ /* TODO: dynamically change to extra only when we have GEM or TKIP */
+ return WL18XX_TX_HW_EXTRA_BLOCK_SPARE;
+}
+
static struct wlcore_ops wl18xx_ops = {
.identify_chip = wl18xx_identify_chip,
.boot = wl18xx_boot,
@@ -1056,6 +1062,7 @@ static struct wlcore_ops wl18xx_ops = {
.get_mac = wl18xx_get_mac,
.debugfs_init = wl18xx_debugfs_add_files,
.handle_static_data = wl18xx_handle_static_data,
+ .get_spare_blocks = wl18xx_get_spare_blocks,
};
/* HT cap appropriate for wide channels */
@@ -1129,8 +1136,6 @@ static int __devinit wl18xx_probe(struct platform_device *pdev)
wl->rtable = wl18xx_rtable;
wl->num_tx_desc = 32;
wl->num_rx_desc = 16;
- wl->normal_tx_spare = WL18XX_TX_HW_BLOCK_SPARE;
- wl->gem_tx_spare = WL18XX_TX_HW_GEM_BLOCK_SPARE;
wl->band_rate_to_idx = wl18xx_band_rate_to_idx;
wl->hw_tx_rate_tbl_size = WL18XX_CONF_HW_RXTX_RATE_MAX;
wl->hw_min_ht_rate = WL18XX_CONF_HW_RXTX_RATE_MCS0;
diff --git a/drivers/net/wireless/ti/wl18xx/tx.h b/drivers/net/wireless/ti/wl18xx/tx.h
index 2417262de20..8aecaf09da9 100644
--- a/drivers/net/wireless/ti/wl18xx/tx.h
+++ b/drivers/net/wireless/ti/wl18xx/tx.h
@@ -25,7 +25,8 @@
#include "../wlcore/wlcore.h"
#define WL18XX_TX_HW_BLOCK_SPARE 1
-#define WL18XX_TX_HW_GEM_BLOCK_SPARE 2
+/* for special cases - namely, TKIP and GEM */
+#define WL18XX_TX_HW_EXTRA_BLOCK_SPARE 2
#define WL18XX_TX_HW_BLOCK_SIZE 268
#define WL18XX_TX_STATUS_DESC_ID_MASK 0x7F