wl12xx: 1281/1283 support - add block size handling for sdio and spi
authorLuciano Coelho <coelho@ti.com>
Mon, 14 Mar 2011 12:05:13 +0000 (14:05 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 19 Apr 2011 13:19:48 +0000 (16:19 +0300)
Add the the set_block_size op in the SDIO and in the SPI modules.
Since it is only used with SDIO, just explicitly set the op to NULL in
spi.c

Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/sdio.c
drivers/net/wireless/wl12xx/spi.c

index 1b6a1adb81afef750a378dc208de98c13cdfe56a..7491b3d8487a6b0dab5d386ea8bca67e838ef64a 100644 (file)
@@ -51,6 +51,18 @@ static const struct sdio_device_id wl1271_devices[] = {
 };
 MODULE_DEVICE_TABLE(sdio, wl1271_devices);
 
+/* The max SDIO block size is 256 when working with tx padding to SDIO block */
+#define TX_PAD_SDIO_BLK_SIZE                  256
+
+static void wl1271_sdio_set_block_size(struct wl1271 *wl)
+{
+       wl->block_size = TX_PAD_SDIO_BLK_SIZE;
+
+       sdio_claim_host(wl->if_priv);
+       sdio_set_block_size(wl->if_priv, TX_PAD_SDIO_BLK_SIZE);
+       sdio_release_host(wl->if_priv);
+}
+
 static inline struct sdio_func *wl_to_func(struct wl1271 *wl)
 {
        return wl->if_priv;
@@ -166,6 +178,9 @@ static int wl1271_sdio_power_on(struct wl1271 *wl)
        sdio_claim_host(func);
        sdio_enable_func(func);
 
+       /* Set the default block size in case it was modified */
+       sdio_set_block_size(func, 0);
+
 out:
        return ret;
 }
@@ -203,7 +218,8 @@ static struct wl1271_if_operations sdio_ops = {
        .power          = wl1271_sdio_set_power,
        .dev            = wl1271_sdio_wl_to_dev,
        .enable_irq     = wl1271_sdio_enable_interrupts,
-       .disable_irq    = wl1271_sdio_disable_interrupts
+       .disable_irq    = wl1271_sdio_disable_interrupts,
+       .set_block_size = wl1271_sdio_set_block_size,
 };
 
 static int __devinit wl1271_probe(struct sdio_func *func,
index 80295f55f23fa72539361328b0125e5cb5d41dcf..bfb1171176ca500796d2edbc2cb2f29e321778e5 100644 (file)
@@ -355,7 +355,8 @@ static struct wl1271_if_operations spi_ops = {
        .power          = wl1271_spi_set_power,
        .dev            = wl1271_spi_wl_to_dev,
        .enable_irq     = wl1271_spi_enable_interrupts,
-       .disable_irq    = wl1271_spi_disable_interrupts
+       .disable_irq    = wl1271_spi_disable_interrupts,
+       .set_block_size = NULL,
 };
 
 static int __devinit wl1271_probe(struct spi_device *spi)