[PATCH] Fix cs firmware loading

Ryan Mallon ryan at bluewatersys.com
Wed Oct 15 16:06:32 EDT 2008


Dan Williams wrote:
> On Wed, 2008-10-15 at 09:29 +1300, Ryan Mallon wrote:
>   
>> The function if_cs_poll_while_fw_download returns the number of 
>> iterations through the loop on success. This value is returned by
>> the functions if_cs_prog_helper and if_cs_prog_real, however they
>> should return zero on success. This patch corrects that. An 
>> alternative would be to just return zero on success from 
>> if_cs_poll_while_fw_download.
>>     
>
> Yeah, just have if_cs_poll_while_fw_download() return 0 on success,
> since nowhere acutally cares how many iterations were used.
>   
Okay. Updated patch at bottom.

> BTW, I assume you guys are using 8335 hardware version b2 and later,
> right?
>
>   
We are using the Wistron Neweb DRCM 81 module, which uses the Marvell
8385. We have mostly been using it with the 2.6.20 kernel (we patched
the Libertas driver into our kernel at the time). One of our 
customers who uses the wireless on their board quite heavily has 
noticed some problems with scanning, which we believe may be related 
to the older code, hence I am doing some testing with the newest 
driver. Some prelim testing shows the that driver is still working
fine (with my patch applied) on the hardware that I have. 

--

Change the return value of if_cs_poll_while_fw_download to zero on 
success, so that the firmware loading functions also correctly 
return zero on success.

Signed-off-by: Ryan Mallon <ryan at bluewatersys.com>

diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 842a08d..8f8934a 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -151,7 +151,7 @@ static int if_cs_poll_while_fw_download(struct if_cs_card *card, uint addr, u8 r
 	for (i = 0; i < 100000; i++) {
 		u8 val = if_cs_read8(card, addr);
 		if (val == reg)
-			return i;
+			return 0;
 		udelay(5);
 	}
 	return -ETIME;

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

       Ryan Mallon                              Unit 5, Amuri Park
       Phone: +64 3 3779127                     404 Barbadoes St
       Fax:   +64 3 3779135                     PO Box 13 889
       Email: ryan at bluewatersys.com             Christchurch, 8013
       Web:   http://www.bluewatersys.com       New Zealand
       Freecall Australia  1800 148 751         USA 1800 261 2934




More information about the libertas-dev mailing list