Skip to contentSkip to conversation

libertas: speeds up downloading of CF firmware

PATH Holger Schurig 3 participants 4 messages May 23, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

Keep the timeout the same (1000*500 == 100000 * 5), but take shorter naps. Makes downloading the firmware slightly faster.

drivers/net/wireless/libertas/if_cs.c +2 -2
@@ -148,11 +148,11 @@
 {
 	int i;
 
-	for (i = 0; i < 1000; i++) {
+	for (i = 0; i < 100000; i++) {
 		u8 val = if_cs_read8(card, addr);
 		if (val == reg)
 			return i;
-		udelay(500);
+		udelay(5);
 	}
 	return -ETIME;
 }
#1 lore raw
Quoted 1 line · Holger Schurig

Keep the timeout the same (1000*500 =3D=3D 100000 * 5), but take shor=

ter

Quoted 10 lines

naps. Makes downloading the firmware slightly faster.

drivers/net/wireless/libertas/if_cs.c +0 -0
@@ -148,11 +148,11 @@
 {
 	int i;

=20

drivers/net/wireless/libertas/if_cs.c

Quoted 5 lines
drivers/net/wireless/libertas/if_cs.c +1 -1
-	for (i =3D 0; i < 1000; i++) {
+	for (i =3D 0; i < 100000; i++) {
 		u8 val =3D if_cs_read8(card, addr);
 		if (val =3D=3D reg)
 			return i;

That changes the return value. Although it doesn't matter since all callers only check for < 0, it should perhaps be changed to return 0 here to avoid confusion.

Andreas.

--=20
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany PGP key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4= ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 3 lines

That changes the return value. Although it doesn't matter since all callers only check for < 0, it should perhaps be changed to return 0 here to avoid confusion.

You're right, the function returns now different things. But no caller cares for the different return value, therefore the code is correct as it is.

I actually used the return value to find out how many loops usually are needed to program, and found that I wait way to long in usleep() function.

Acked-by
#3 lore raw
In reply to Holger Schurig
Quoted 4 lines · Holger Schurig

Keep the timeout the same (1000*500 == 100000 * 5), but take shorter naps. Makes downloading the firmware slightly faster.

Quoted 16 lines
drivers/net/wireless/libertas/if_cs.c +2 -2
@@ -148,11 +148,11 @@
 {
 	int i;
 
-	for (i = 0; i < 1000; i++) {
+	for (i = 0; i < 100000; i++) {
 		u8 val = if_cs_read8(card, addr);
 		if (val == reg)
 			return i;
-		udelay(500);
+		udelay(5);
 	}
 	return -ETIME;
 }