aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-03-14 08:05:13 -0400
committerLuciano Coelho <coelho@ti.com>2011-04-19 09:19:48 -0400
commita81159edf8d64011933df177ec42f82d7896a0c7 (patch)
treea37129b5a2d18e0306f40c4f3c3882416d4769a4 /drivers/net/wireless/wl12xx
parent48a61477bdc04896bd96d259388a0c42a7019943 (diff)
wl12xx: 1281/1283 support - add block size handling for sdio and spi
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>
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r--drivers/net/wireless/wl12xx/sdio.c18
-rw-r--r--drivers/net/wireless/wl12xx/spi.c3
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index 1b6a1adb81a..7491b3d8487 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -51,6 +51,18 @@ static const struct sdio_device_id wl1271_devices[] = {
51}; 51};
52MODULE_DEVICE_TABLE(sdio, wl1271_devices); 52MODULE_DEVICE_TABLE(sdio, wl1271_devices);
53 53
54/* The max SDIO block size is 256 when working with tx padding to SDIO block */
55#define TX_PAD_SDIO_BLK_SIZE 256
56
57static void wl1271_sdio_set_block_size(struct wl1271 *wl)
58{
59 wl->block_size = TX_PAD_SDIO_BLK_SIZE;
60
61 sdio_claim_host(wl->if_priv);
62 sdio_set_block_size(wl->if_priv, TX_PAD_SDIO_BLK_SIZE);
63 sdio_release_host(wl->if_priv);
64}
65
54static inline struct sdio_func *wl_to_func(struct wl1271 *wl) 66static inline struct sdio_func *wl_to_func(struct wl1271 *wl)
55{ 67{
56 return wl->if_priv; 68 return wl->if_priv;
@@ -166,6 +178,9 @@ static int wl1271_sdio_power_on(struct wl1271 *wl)
166 sdio_claim_host(func); 178 sdio_claim_host(func);
167 sdio_enable_func(func); 179 sdio_enable_func(func);
168 180
181 /* Set the default block size in case it was modified */
182 sdio_set_block_size(func, 0);
183
169out: 184out:
170 return ret; 185 return ret;
171} 186}
@@ -203,7 +218,8 @@ static struct wl1271_if_operations sdio_ops = {
203 .power = wl1271_sdio_set_power, 218 .power = wl1271_sdio_set_power,
204 .dev = wl1271_sdio_wl_to_dev, 219 .dev = wl1271_sdio_wl_to_dev,
205 .enable_irq = wl1271_sdio_enable_interrupts, 220 .enable_irq = wl1271_sdio_enable_interrupts,
206 .disable_irq = wl1271_sdio_disable_interrupts 221 .disable_irq = wl1271_sdio_disable_interrupts,
222 .set_block_size = wl1271_sdio_set_block_size,
207}; 223};
208 224
209static int __devinit wl1271_probe(struct sdio_func *func, 225static int __devinit wl1271_probe(struct sdio_func *func,
diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c
index 80295f55f23..bfb1171176c 100644
--- a/drivers/net/wireless/wl12xx/spi.c
+++ b/drivers/net/wireless/wl12xx/spi.c
@@ -355,7 +355,8 @@ static struct wl1271_if_operations spi_ops = {
355 .power = wl1271_spi_set_power, 355 .power = wl1271_spi_set_power,
356 .dev = wl1271_spi_wl_to_dev, 356 .dev = wl1271_spi_wl_to_dev,
357 .enable_irq = wl1271_spi_enable_interrupts, 357 .enable_irq = wl1271_spi_enable_interrupts,
358 .disable_irq = wl1271_spi_disable_interrupts 358 .disable_irq = wl1271_spi_disable_interrupts,
359 .set_block_size = NULL,
359}; 360};
360 361
361static int __devinit wl1271_probe(struct spi_device *spi) 362static int __devinit wl1271_probe(struct spi_device *spi)