wl12xx: allocate buffer the spi busy word from struct wl12xx
authorKalle Valo <kalle.valo@nokia.com>
Fri, 12 Jun 2009 11:14:55 +0000 (14:14 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 10 Jul 2009 18:57:43 +0000 (14:57 -0400)
Needed for DMA transfers.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/spi.c
drivers/net/wireless/wl12xx/spi.h
drivers/net/wireless/wl12xx/wl12xx.h

index 939274291a0726cd8946f2701c1163d07786d1f0..bcdcfbca77b33bcfd9cd2c2ea0f7469a2295231a 100644 (file)
@@ -262,10 +262,11 @@ void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf,
 {
        struct spi_transfer t[3];
        struct spi_message m;
-       char busy_buf[TNETWIF_READ_OFFSET_BYTES];
+       u8 *busy_buf;
        u32 *cmd;
 
        cmd = &wl->buffer_cmd;
+       busy_buf = wl->buffer_busyword;
 
        *cmd = 0;
        *cmd |= WSPI_CMD_READ;
@@ -281,7 +282,7 @@ void wl12xx_spi_read(struct wl12xx *wl, int addr, void *buf,
 
        /* Busy and non busy words read */
        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);
 
        t[2].rx_buf = buf;
index 7edb218ee76cab3f60f7b86af7b7333c8fcdbf89..1a19557b0b427d95319597fe41e3e4e1a441e87a 100644 (file)
@@ -65,9 +65,8 @@
 
 #define WSPI_INIT_CMD_LEN           8
 
-#define TNETWIF_READ_OFFSET_BYTES  8
 #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
 
 
index 586593563511511ff7579d99580b0f9cf3ad8b76..b81102098c7d7da6bdebb344440e01b669baed52 100644 (file)
@@ -105,6 +105,7 @@ enum {
                                  CFG_RX_AUTH_EN |  \
                                  CFG_RX_ASSOC_EN)
 
+#define WL12XX_BUSY_WORD_LEN 8
 
 struct boot_attr {
        u32 radio_type;
@@ -385,6 +386,7 @@ struct wl12xx {
 
        u32 buffer_32;
        u32 buffer_cmd;
+       u8 buffer_busyword[WL12XX_BUSY_WORD_LEN];
 };
 
 int wl12xx_plt_start(struct wl12xx *wl);