8686 with SDIO on AT91SAM9263 [SOLVED]

Hans-Jürgen Koch hjk at linutronix.de
Mon Jan 28 09:24:43 EST 2008


Am Sun, 27 Jan 2008 00:45:08 +0100
schrieb Eric BENARD <ebenard at free.fr>:

> Hi,
> 
> Hans-Jürgen Koch a écrit :
> > Is that enough?
> 
> I'm checking the size before each sdio_writesb & sdio_readsb.
> I'll check tomorrow if this still doesn't work for you.

Hi Eric,
I added the padding not only in if_sdio_host_to_card but also in
if_sdio_card_to_host, that makes it work. Stupid, that's exactly what
the header of if_sdio.c says...
Here's what I do now:

Index: net-2.6.25/drivers/net/wireless/libertas/if_sdio.c
===================================================================
--- net-2.6.25.orig/drivers/net/wireless/libertas/if_sdio.c	2008-01-26 23:05:46.000000000 +0100
+++ net-2.6.25/drivers/net/wireless/libertas/if_sdio.c	2008-01-28 10:34:15.000000000 +0100
@@ -280,6 +280,8 @@
 	 * The transfer must be in one transaction or the firmware
 	 * goes suicidal.
 	 */
+	/* round up size to next multiple of 4 */
+	size = (size + 3) & ~3;
 	chunk = size;
 	if ((chunk > card->func->cur_blksize) || (chunk > 512)) {
 		chunk = (chunk + card->func->cur_blksize - 1) /
@@ -711,6 +713,8 @@
 	 * goes suicidal.
 	 */
 	size = nb + 4;
+	/* round up to next multiple of 4 */
+	size = (size + 3) & ~3;
 	if ((size > card->func->cur_blksize) || (size > 512)) {
 		size = (size + card->func->cur_blksize - 1) /
 			card->func->cur_blksize * card->func->cur_blksize;

Now I can bring my device up. It seems it doesn't work correctly yet,
at least iwconfig crashes, but that'll be another thread :-)

Thanks a lot to all for your valuable help!

Hans




More information about the libertas-dev mailing list