Bug 5238

Summary: generic-x86 image does not have broadcom wifi modules enabled
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Razvan Ionescu <razvanx.ionescu>
Component: meta-yoctoAssignee: Laurentiu Palcu <laurentiu.palcu>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: corneliux.stoicescu, laurentiu.palcu, mihai.lindner, nitin.a.kamble, poky.bs.watcher, poky.watcher, sgw
Version: 1.5   
Target Milestone: 1.5.1   
Hardware: x86   
OS: x86   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
linux-yocto: meta patch none

Description Razvan Ionescu 2013-09-19 16:08:27 UTC
Environment:
Lenovo S10-3 - AtomPC
Generic-x86 image
Build: 1.5_M5_RC4

poky 853bc53cd58a621918f0e5ce662dba263d1befb4
meta-intel 66def4d09cbdf1614622a7ab1d84bef312b5f55d

Issueing lspci command, I obtain:
09:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)

But: iwconfig returns:
sit0      no wireless extensions.
lo        no wireless extensions.
eth0      no wireless extensions.

Please add the wifi module in generic-x86 image.
Comment 1 Nitin Kamble 2013-09-24 18:56:36 UTC
I added some kernel config options for broadcom wifi drivers into genericx86 BSP. that should resolve the issue. The fix is being sent to linux-yocto ML for review.

Thanks,
Nitin
Comment 2 Nitin Kamble 2013-10-02 20:10:26 UTC
A kernel commit went in to fix this:

commit 37c617df7e61b200d8e8aebbd6c450e21a4d6e80
Author: Nitin A Kamble <nitin.a.kamble@intel.com>
Date:   Tue Sep 24 18:31:45 2013 +0000

    common-pc-wifi.cfg: add support for broadcom wifi drivers
    
    This enables broadcom wifi driver modules for the common-pc(-64)
    machines.
    
    Fixes Bug:
    [YOCTO #5238]
    
    Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Comment 3 Nitin Kamble 2013-10-02 20:17:03 UTC
This is the oecore commit pulling in the kernel fixes:

commit 41875facc982f1c96a5ddf275adba1634b1a5ced
Author: Bruce Ashfield <bruce.ashfield@windriver.com>
Date:   Wed Sep 25 15:30:12 2013 -0400

    linux-yocto/3.10: common-pc* config updates
    
    Bumping the 3.10 meta branch SRCREV to import the following config changes
    for tghe sugarbay and common-pc wifi fragments.
    
       dad2b7e common-pc-64: add kernel CONFIG options for sugarbay platform
       37c617d common-pc-wifi.cfg: add support for broadcom wifi drivers
    
    [YOCTO #5117]
    [YOCTO #5238]
    
    (From OE-Core rev: 180f465b0cab13e17dc92ac5c88d7d9001cd5b11)
    
    Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
    Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 4 Razvan Ionescu 2013-10-03 12:01:05 UTC
Verified with: dora:a02280f99f05b1c21de2a78de9222a2f62a0dabc (1.5 M5 RC6)
which contains the "fixing" commit, but unfortunately the bug still appears.

I tried to issue iwconfig wlan0 - iwconfig wlan10 and each time I obtained: No such device.
I now that the wifi is turned on (using the button), but in terminal I cannot see any result.

Also, lspci command returns the same result as in the bug description.
Comment 5 Nitin Kamble 2013-10-03 16:03:17 UTC
I do not have the h/w to test here. I have enabled all the broadcom wifi drivers in the kernel. Do you know what kernel driver is needed for this?
Comment 6 Nitin Kamble 2013-10-03 16:16:18 UTC
Do you see, this file on the target image?

brcmfmac.ko

Also check if it is getting loaded by command

lsmod

And check weather this command makes any difference?

modprobe brcmfmac
Comment 7 Razvan Ionescu 2013-10-04 06:33:41 UTC
Thanks for your info.

The file exists. It is not loaded by default, but it is loaded after lsmod.
But, the wifi still does not work as expected. No wlan0 or any other wifi interface name turns on.

Do you still have any suggestions?

sh-4.2# pwd
/
sh-4.2# find ./ -name brcmfmac.ko
./lib/modules/3.10.11-yocto-standard/kernel/drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko
sh-4.2# lsmod
Module                  Size  Used by
xt_connmark             1511  2 
iptable_nat             2294  0 
nf_conntrack_ipv4      11367  3 
nf_defrag_ipv4          1069  1 nf_conntrack_ipv4
nf_nat_ipv4             3175  1 iptable_nat
nf_nat                 13395  2 nf_nat_ipv4,iptable_nat
nf_conntrack           60071  5 nf_nat,nf_nat_ipv4,xt_connmark,iptable_nat,nf_conntrack_ipv4
iptable_mangle          1339  1 
iptable_filter          1302  0 
ip_tables               9646  3 iptable_filter,iptable_mangle,iptable_nat
x_tables               13518  4 ip_tables,iptable_filter,xt_connmark,iptable_mangle
nfnetlink               4137  1 
r8169                  53427  0 
uvesafb                23049  0 

sh-4.2# modprobe brcmfmac

sh-4.2# lsmod
Module                  Size  Used by
brcmfmac              112297  0 
brcmutil                5500  1 brcmfmac
cfg80211              368682  1 brcmfmac
xt_connmark             1511  2 
iptable_nat             2294  0 
nf_conntrack_ipv4      11367  3 
nf_defrag_ipv4          1069  1 nf_conntrack_ipv4
nf_nat_ipv4             3175  1 iptable_nat
nf_nat                 13395  2 nf_nat_ipv4,iptable_nat
nf_conntrack           60071  5 nf_nat,nf_nat_ipv4,xt_connmark,iptable_nat,nf_conntrack_ipv4
iptable_mangle          1339  1 
iptable_filter          1302  0 
ip_tables               9646  3 iptable_filter,iptable_mangle,iptable_nat
x_tables               13518  4 ip_tables,iptable_filter,xt_connmark,iptable_mangle
nfnetlink               4137  1 
r8169                  53427  0 
uvesafb                23049  0 

sh-4.2# iwconfig
sit0      no wireless extensions.

lo        no wireless extensions.

eth0      no wireless extensions.

sh-4.2# iwconfig wlan0
wlan0     No such device
Comment 8 Nitin Kamble 2013-10-04 19:02:16 UTC
check dmesg. 
try loading brcmutil.ko also
If this does not work, then we do not have a working kernel driver for the wifi chip in the kernel tree.
Comment 9 Razvan Ionescu 2013-10-07 12:32:46 UTC
Nothing relevant in dmesg. I have loaded the suggested module, but the result is the same.
I tried also to connect to wifi using a USB WiFi Modem, but w/o success.
Comment 10 Nitin Kamble 2013-10-07 19:37:15 UTC
can this bug assigned to a developer who has access to the h/w ?
Comment 11 Saul Wold 2013-10-18 16:36:46 UTC
Work with Darren on this if needed
Comment 12 Laurentiu Palcu 2013-10-21 13:26:30 UTC
Created attachment 1572 [details]
linux-yocto: meta patch
Comment 13 Laurentiu Palcu 2013-10-21 13:29:01 UTC
Apparently, Broadcom IEEE802.11n PCIe SoftMAC WLAN driver (BRCMSMAC) depends on Broadcom AMBA bus driver too (BCMA) which is not built in the current kernel. With the following kernel config fragment I was able to make WLAN work on lenovo s10-3:

CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_CFG80211_WEXT=y
CONFIG_BRCMSMAC=m
CONFIG_BCMA=m
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
CONFIG_BCMA_HOST_PCI=y
CONFIG_BCMA_DRIVER_GMAC_CMN=y
CONFIG_CRC8=m
CONFIG_CORDIC=m

These should be added to meta/cfg/kernel-cache/bsp/common-pc/common-pc-wifi.cfg in linux-yocto repo. I attached the patch to this bug:

https://bugzilla.yoctoproject.org/attachment.cgi?id=1572
Comment 14 Laurentiu Palcu 2013-10-30 14:00:18 UTC
Patch sent on linux-yocto ML.