Commit 61932ba5 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

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: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <luca@coelho.fi>
parent e166de55
...@@ -66,7 +66,13 @@ ...@@ -66,7 +66,13 @@
/* HW limitation: maximum possible chunk size is 4095 bytes */ /* HW limitation: maximum possible chunk size is 4095 bytes */
#define WSPI_MAX_CHUNK_SIZE 4092 #define WSPI_MAX_CHUNK_SIZE 4092
#define WSPI_MAX_NUM_OF_CHUNKS (WL1271_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) /*
* only support SPI for 12xx - this code should be reworked when 18xx
* support is introduced
*/
#define SPI_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
#define WSPI_MAX_NUM_OF_CHUNKS (SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE)
struct wl12xx_spi_glue { struct wl12xx_spi_glue {
struct device *dev; struct device *dev;
...@@ -271,7 +277,7 @@ static int __must_check wl12xx_spi_raw_write(struct device *child, int addr, ...@@ -271,7 +277,7 @@ static int __must_check wl12xx_spi_raw_write(struct device *child, int addr,
u32 chunk_len; u32 chunk_len;
int i; int i;
WARN_ON(len > WL1271_AGGR_BUFFER_SIZE); WARN_ON(len > SPI_AGGR_BUFFER_SIZE);
spi_message_init(&m); spi_message_init(&m);
memset(t, 0, sizeof(t)); memset(t, 0, sizeof(t));
......
...@@ -83,8 +83,6 @@ ...@@ -83,8 +83,6 @@
#define WL1271_AP_BSS_INDEX 0 #define WL1271_AP_BSS_INDEX 0
#define WL1271_AP_DEF_BEACON_EXP 20 #define WL1271_AP_DEF_BEACON_EXP 20
#define WL1271_AGGR_BUFFER_SIZE (5 * PAGE_SIZE)
enum wlcore_state { enum wlcore_state {
WLCORE_STATE_OFF, WLCORE_STATE_OFF,
WLCORE_STATE_RESTARTING, WLCORE_STATE_RESTARTING,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment