[PATCH] Fix cs firmware loading

Dan Williams dcbw at redhat.com
Wed Oct 15 18:55:21 EDT 2008


On Thu, 2008-10-16 at 09:06 +1300, Ryan Mallon wrote:
> 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

Sorry, I mean 8385 b2, not 8335.  The hardware version is the important
part, because previous versions had hardware bugs in the CF interface.
Just wondering if you'd worked around those somehow, or if you were
using up-to-date hardware versions.

> 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;

Looks good to me, care to post to linux-wireless or would you like me to
do that for you?

Dan





More information about the libertas-dev mailing list