Commit 5262c12d authored by Kalle Valo's avatar Kalle Valo Committed by John W. Linville

wl12xx: allocate buffer the spi busy word from struct wl12xx

Needed for DMA transfers.
Signed-off-by: default avatarKalle Valo <kalle.valo@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 56343a3c
...@@ -262,10 +262,11 @@ void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf, ...@@ -262,10 +262,11 @@ void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf,
{ {
struct spi_transfer t[3]; struct spi_transfer t[3];
struct spi_message m; struct spi_message m;
char busy_buf[TNETWIF_READ_OFFSET_BYTES]; u8 *busy_buf;
u32 *cmd; u32 *cmd;
cmd = &wl->buffer_cmd; cmd = &wl->buffer_cmd;
busy_buf = wl->buffer_busyword;
*cmd = 0; *cmd = 0;
*cmd |= WSPI_CMD_READ; *cmd |= WSPI_CMD_READ;
...@@ -281,7 +282,7 @@ void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf, ...@@ -281,7 +282,7 @@ void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf,
/* Busy and non busy words read */ /* Busy and non busy words read */
t[1].rx_buf = busy_buf; t[1].rx_buf = busy_buf;
t[1].len = TNETWIF_READ_OFFSET_BYTES; t[1].len = WL12XX_BUSY_WORD_LEN;
spi_message_add_tail(&t[1], &m); spi_message_add_tail(&t[1], &m);
t[2].rx_buf = buf; t[2].rx_buf = buf;
......
...@@ -65,9 +65,8 @@ ...@@ -65,9 +65,8 @@
#define WSPI_INIT_CMD_LEN 8 #define WSPI_INIT_CMD_LEN 8
#define TNETWIF_READ_OFFSET_BYTES 8
#define HW_ACCESS_WSPI_FIXED_BUSY_LEN \ #define HW_ACCESS_WSPI_FIXED_BUSY_LEN \
((TNETWIF_READ_OFFSET_BYTES - 4) / sizeof(u32)) ((WL12XX_BUSY_WORD_LEN - 4) / sizeof(u32))
#define HW_ACCESS_WSPI_INIT_CMD_MASK 0 #define HW_ACCESS_WSPI_INIT_CMD_MASK 0
......
...@@ -105,6 +105,7 @@ enum { ...@@ -105,6 +105,7 @@ enum {
CFG_RX_AUTH_EN | \ CFG_RX_AUTH_EN | \
CFG_RX_ASSOC_EN) CFG_RX_ASSOC_EN)
#define WL12XX_BUSY_WORD_LEN 8
struct boot_attr { struct boot_attr {
u32 radio_type; u32 radio_type;
...@@ -385,6 +386,7 @@ struct wl12xx { ...@@ -385,6 +386,7 @@ struct wl12xx {
u32 buffer_32; u32 buffer_32;
u32 buffer_cmd; u32 buffer_cmd;
u8 buffer_busyword[WL12XX_BUSY_WORD_LEN];
}; };
int wl12xx_plt_start(struct wl12xx *wl); int wl12xx_plt_start(struct wl12xx *wl);
......
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