aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-08-06 04:21:39 -0400
committerLuciano Coelho <luca@coelho.fi>2012-09-27 05:13:52 -0400
commit61932ba59f5278e3f0c9fbded1a1af39ef89333f (patch)
tree4e3c0d0b1f2ce9db562d18041f5efc933ea0df43 /drivers/net/wireless/ti
parente166de556f7795a3061e49deca28d61b3764d512 (diff)
wlcore: spi: use private max-buf-size limit
Limit SPI transmissions to the wl12xx max buffer size, as only 12xx was tested with SPI. This allows us to remove the global aggregation buffer constant. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r--drivers/net/wireless/ti/wlcore/spi.c10
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore_i.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index 8da4ed243ebc..a519bc3adec1 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -66,7 +66,13 @@
66/* HW limitation: maximum possible chunk size is 4095 bytes */ 66/* HW limitation: maximum possible chunk size is 4095 bytes */
67#define WSPI_MAX_CHUNK_SIZE 4092 67#define WSPI_MAX_CHUNK_SIZE 4092
68 68
69#define WSPI_MAX_NUM_OF_CHUNKS (WL1271_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) 69/*
70 * only support SPI for 12xx - this code should be reworked when 18xx
71 * support is introduced
72 */
73#define SPI_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
74
75#define WSPI_MAX_NUM_OF_CHUNKS (SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE)
70 76
71struct wl12xx_spi_glue { 77struct wl12xx_spi_glue {
72 struct device *dev; 78 struct device *dev;
@@ -271,7 +277,7 @@ static int __must_check wl12xx_spi_raw_write(struct device *child, int addr,
271 u32 chunk_len; 277 u32 chunk_len;
272 int i; 278 int i;
273 279
274 WARN_ON(len > WL1271_AGGR_BUFFER_SIZE); 280 WARN_ON(len > SPI_AGGR_BUFFER_SIZE);
275 281
276 spi_message_init(&m); 282 spi_message_init(&m);
277 memset(t, 0, sizeof(t)); 283 memset(t, 0, sizeof(t));
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index 58fbdcac6452..a7472bf8e8ba 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -83,8 +83,6 @@
83#define WL1271_AP_BSS_INDEX 0 83#define WL1271_AP_BSS_INDEX 0
84#define WL1271_AP_DEF_BEACON_EXP 20 84#define WL1271_AP_DEF_BEACON_EXP 20
85 85
86#define WL1271_AGGR_BUFFER_SIZE (5 * PAGE_SIZE)
87
88enum wlcore_state { 86enum wlcore_state {
89 WLCORE_STATE_OFF, 87 WLCORE_STATE_OFF,
90 WLCORE_STATE_RESTARTING, 88 WLCORE_STATE_RESTARTING,