linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wl12xx: Clamp byte mode transfers for 128x chips
@ 2011-03-18 12:49 Arik Nemtsov
  2011-03-21 14:00 ` Luciano Coelho
  0 siblings, 1 reply; 2+ messages in thread
From: Arik Nemtsov @ 2011-03-18 12:49 UTC (permalink / raw)
  To: coelho; +Cc: linux-wireless, Arik Nemtsov, Ido Yariv

On wl128x based devices, when TX packets are aggregated, each packet
size must be aligned to the SDIO block size, and sent using block mode
transfers.

The block size is set to 256 bytes, which is less than the maximum
possible byte transfer. Thus, if two small packets (< 256 bytes) are
aggregated, the aggregation buffer size would be 512, and will be sent
using byte mode transfers. This can have undesired side effects.

Fix this by setting the MMC_QUIRK_BLKSZ_FOR_BYTE_MODE mmc card quirk.
For 127x chips this has no effect, as the block size is set to 512
bytes.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
---
 drivers/net/wireless/wl12xx/sdio.c      |    3 +++
 drivers/net/wireless/wl12xx/sdio_test.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index ff77361..26dcd44 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -246,6 +246,9 @@ static int __devinit wl1271_probe(struct sdio_func *func,
 	/* Grab access to FN0 for ELP reg. */
 	func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
 
+	/* Use block mode for transferring over one block size of data */
+	func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
+
 	wlan_data = wl12xx_get_platform_data();
 	if (IS_ERR(wlan_data)) {
 		ret = PTR_ERR(wlan_data);
diff --git a/drivers/net/wireless/wl12xx/sdio_test.c b/drivers/net/wireless/wl12xx/sdio_test.c
index 968249a..f289153 100644
--- a/drivers/net/wireless/wl12xx/sdio_test.c
+++ b/drivers/net/wireless/wl12xx/sdio_test.c
@@ -417,6 +417,9 @@ static int __devinit wl1271_probe(struct sdio_func *func,
 	/* Grab access to FN0 for ELP reg. */
 	func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
 
+	/* Use block mode for transferring over one block size of data */
+	func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
+
 	wlan_data = wl12xx_get_platform_data();
 	if (IS_ERR(wlan_data)) {
 		ret = PTR_ERR(wlan_data);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wl12xx: Clamp byte mode transfers for 128x chips
  2011-03-18 12:49 [PATCH] wl12xx: Clamp byte mode transfers for 128x chips Arik Nemtsov
@ 2011-03-21 14:00 ` Luciano Coelho
  0 siblings, 0 replies; 2+ messages in thread
From: Luciano Coelho @ 2011-03-21 14:00 UTC (permalink / raw)
  To: Ido Yariv; +Cc: linux-wireless, Arik Nemtsov

On Fri, 2011-03-18 at 14:49 +0200, Arik Nemtsov wrote:
> On wl128x based devices, when TX packets are aggregated, each packet
> size must be aligned to the SDIO block size, and sent using block mode
> transfers.
> 
> The block size is set to 256 bytes, which is less than the maximum
> possible byte transfer. Thus, if two small packets (< 256 bytes) are
> aggregated, the aggregation buffer size would be 512, and will be sent
> using byte mode transfers. This can have undesired side effects.
> 
> Fix this by setting the MMC_QUIRK_BLKSZ_FOR_BYTE_MODE mmc card quirk.
> For 127x chips this has no effect, as the block size is set to 512
> bytes.
> 
> Signed-off-by: Arik Nemtsov <arik@wizery.com>
> Signed-off-by: Ido Yariv <ido@wizery.com>
> ---

Thanks! Applied and fixed Arik's email address, which was corrupted (or
rather Ido-ized :P)

-- 
Cheers,
Luca.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-21 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18 12:49 [PATCH] wl12xx: Clamp byte mode transfers for 128x chips Arik Nemtsov
2011-03-21 14:00 ` Luciano Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).