[PATCH] Fix cs firmware loading

Dan Williams dcbw at redhat.com
Thu Oct 16 11:21:03 EDT 2008


On Thu, 2008-10-16 at 12:07 +1300, Ryan Mallon wrote:
> Dan Williams wrote:
> 
> >>> 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.
> 
> I'm not actually sure what the hardware version is. I get the following
> in Linux:
> 
> root at snapper:~$ pccardctl insert
> pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0
> pcmcia 0.0: pcmcia: registering new device pcmcia0.0
> firmware: requesting libertas_cs_helper.fw
> firmware: requesting libertas_cs.fw
> libertas: 00:0b:6b:0c:b8:cb, fw 5.0.11p0, cap 0x00000393
> libertas: eth1: Marvell WLAN 802.11 adapter
> 
> root at snapper:~$ pccardctl ident
> Socket 0:
>   product info: "Marvell", "802.11 CF", "ID: 04", ""
>   manfid: 0x02df, 0x8103
>   function: 6 (network)
> 
> We aren't doing any particular work arounds. What were the hardware
> problems with the compact flash 8385?

B1 and earlier HW versions (AmbiCom WL54-CF for example) will eventually
time out and stop responding to commands because the hardware gets
interrupt confirmations mixed up or something.  Holger had prototyped a
workaround that used polling instead, and there are references to the
issue in the gumstix driver.  If you're not having problems, then you're
probably using b2 or later hardware.

> > 
> >> 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?
> 
> I'm not on the linux-wireless list, so can you push it through for me.
> Thanks.

Sure.

Dan




More information about the libertas-dev mailing list