Questions on libertas driver

Cyril HAENEL chaenel at free.fr
Thu Jan 31 08:04:19 EST 2008


Hi all,

I finally solved all my problems and now libertas driver works on my 
BF537 processor (blackfin arch).
I followed this procedure :

I downloaded the last libertas tree version, on 
http://git.kernel.org/?p=linux/kernel/git/linville/wireless-2.6.git;a=tree;f=drivers/net/wireless/libertas;h=5acf0f79b8fec9e41e17973e23c4ce11c40dfd59;hb=everything
I dowloaded every file one by one using the "raw" link.

I replaced all compare_ether_addr() functions call by a memcmp() of 6 bytes.

In fact the function compare_ether_addr()  gets 2 u8 pointers in 
parameters, but converts it in u16 pointers to do 3 u16 comparaison 
instead of 6 u8 comparaison....
When the first byte of the parameters is not 16 bits aligned (not on 
even address), the blackfin hang up and generate a kernel panic 
(misaligned data access).

With the last driver version, the "tx timeout" problem I got with a 
previous driver version doesn't appear anymore...

I made a script to dowload a 10Mo file on internet every 10s, and it 
worked without error during 2 days. So now I think the driver is stable 
for my use.

Regards,
Cyril




Dan Williams a écrit :

>On Mon, 2008-01-28 at 17:29 +0100, Cyril HAENEL wrote:
>  
>
>>In fact I modified ALL le16_to_cpu() function calls to implement the 
>>get_unaligned((u16*), to be sure !!
>>
>>Instead of use get_unaligned, which surely eat cpu time, it cannot be 
>>possible to directly align data used by the driver ? In structure and 
>>other ?
>>Or maybe it exists an option in the blackfin gcc to do this automaticaly 
>>at compilation ?
>>    
>>
>
>I don't think the driver can do anything here; it's the firmware passing
>back a structure in which the fields don't align on the boundaries your
>platform expects.
>
>There's not too much you can do about that besides changing the firmware
>or using a different architecture that doesn't have such a big problem
>with unaligned reads, I guess.  Maybe there's some magic that smarter
>people than I know of to make the hit lighter though.
>
>Besides, the hit will only happen when you scan, which shouldn't be that
>often (maybe once a minute max).
>
>Dan
>
>  
>
>>
>>Vladimir Davydov a écrit :
>>
>>    
>>
>>>>I become crazy !! :)
>>>>
>>>>But I continue to have kernel Oops with non aligned data.
>>>>The kernel panic happen when I use iwconfig to change the essid. When I
>>>>use essid "any", we can some communication between the driver and the
>>>>card, but when I use essid "a3ipWifi", It hangs directly.
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>About kernel Oops with non aligned data.
>>>You can try to change following lines in scan.c:
>>>
>>>bytesleft = le16_to_cpu(pscan->bssdescriptsize);
>>>to
>>>bytesleft = le16_to_cpu(get_unaligned((u16*)&pscan->bssdescriptsize));
>>>
>>>
>>>and
>>>scanrespsize = le16_to_cpu(resp->size);
>>>to
>>>scanrespsize = le16_to_cpu(get_unaligned((u16*)&resp->size));
>>>
>>>I don't known why David Woodhouse has changed those lines.
>>>
>>>Vladimir
>>> 
>>>
>>>      
>>>
>
>
>
>  
>

-- 

Cyril Haenel
Registered Linux User #332632




More information about the libertas-dev mailing list