This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

wl18xx integration for Android 4.4.4 with Kernel-3.2

Other Parts Discussed in Thread: WL1835, WL1271

Hi all, 

Greetings !!!

I am using WL183x with AM335x for Android KitKat 4.4.

Kernel Version - 3.2 

I have done all compilation setup by using the below link. SDcard image is working perfectly.

https://github.com/csimmonds/bbb-android-device-files/tree/kk4.4-sdcard

But Now, I have to integrate WL183X with the Android.

I found the below link. and Done required changes and compiled the drivers for WL138x.

http://processors.wiki.ti.com/index.php/WL18xx_First_Time_Getting_Started_Guide_(IMX6)#Building_the_wl18xx_related_module_with_the_updated_kernel

when i give make only comapt and cfg80211  drivers compiling, but I am unable to compile the wlcore and wlcore_sdio dirvers ..

Building modules, stage 2.
MODPOST 2 modules
CC hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat.mod.o
LD [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat.ko
CC hardware/ti/wlan/mac80211/compat_wl18xx/net/wireless/cfg80211.mod.o
LD [M] hardware/ti/wlan/mac80211/compat_wl18xx/net/wireless/cfg80211.ko

What could be the reason ? why it is not compiling the wlcore drivers ?

Is there any other Links or Docs for Wl1835 with Kernel-3.2 ?

Thanks in advance for your help.

Best Regards,
Bhaskar 

  • Hi,
    Can you check your kernel .config and verify that CONFIG_CRYPTO_GCM is selected? (=y)
    In case it is not, it could explain why only part of the modules were built.
    BR,
    Eyal
  • Hi Eyal,

    Thank you for the quick reply.

    In my .config it was not enabled, now i enabled it, then the wlcore driver Makefile including and compiling.

    But I am facing errors while compiling the wlcore driver. I hope it is because of the driver is compatible for higher version than 3.2.

    Which tag should i checkout for 3.2 kernel ?

    my present git tag is :  android-cts-4.4_r4-13-g9540069

    My git HEAD is 

    commit 95400695306cba64700d97bb7e446b3b5e871a37
    Author: Vishal Mahaveer <vishalm@ti.com>
    Date: Tue Jul 28 11:43:17 2015 -0500

    wlan: wpa_supplicant_lib: fix libnl build

    Fix build issue for libnl

    Change-Id: Ia18add657f02758e1c2209b77cb7f8d1c61be5b9
    Signed-off-by: Vishal Mahaveer <vishalm@ti.com>

    Error Log : 
    ~~~~~~~~~

    $ make
    make[5]: `conf' is up to date.
    boolean symbol HWMON tested for 'm'? test forced to 'n'
    boolean symbol HWMON tested for 'm'? test forced to 'n'
    #
    # configuration written to .config
    #
    Building backport-include/backport/autoconf.h ... done.
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/main.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat-3.3.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat-3.4.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat-3.5.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/user_namespace.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat-3.6.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat-3.7.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat-3.8.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat-3.9.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/backport-3.10.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/backport-3.12.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/backport-3.13.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/backport-3.14.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/backport-3.15.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/backport-3.17.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/backport-3.18.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/backport-3.19.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/backport-4.1.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/dma-shared-helpers.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/lib-rhashtable.o
    LD [M] hardware/ti/wlan/mac80211/compat_wl18xx/compat/compat.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/main.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/cmd.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/acx.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/debugfs.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/scan.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/event.o
    LD [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/wl12xx.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/main.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/acx.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/tx.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/io.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/debugfs.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/scan.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/cmd.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/event.o
    LD [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/wl18xx.o
    CC [M] hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/main.o
    hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/main.c: In function 'wlcore_time_sync_hrtimer_cb':
    hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/main.c:6176:2: error: implicit declaration of function 'ktime_compare' [-Werror=implicit-function-declaration]
    cc1: some warnings being treated as errors
    make[8]: *** [hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/main.o] Error 1
    make[7]: *** [hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore] Error 2
    make[6]: *** [hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless/ti] Error 2
    make[5]: *** [hardware/ti/wlan/mac80211/compat_wl18xx/drivers/net/wireless] Error 2
    make[4]: *** [_module_hardware/ti/wlan/mac80211/compat_wl18xx] Error 2
    make[3]: *** [modules] Error 2
    make[2]: *** [modules] Error 2
    make[1]: *** [modules] Error 2
    make: *** [default] Error 2

    Thanks in advance..

    regards,
    Bhaskar

  • Hi,

    You can actually apply this commit on your compat_wl18xx driver directory:
    git.ti.com/.../

    There was a time sync demo feature that was later removed which used this API that is probably not present in the 3.2 kernel.
    this commit removed this code.
    It is best to just remove it and it should allow you to continue your build. You don't use it anyway.

    BR,
    Eyal
  • Hi Eyal,

    I added this ktime_compare API in include/linux/ktime.h, Now driver got compiled without any error.
    But when i insert the drivers, I am facing the below issue.

    Log File : 
    ~~~~~~~

    # dmesg | grep mmc1
    [ 2.475091] mmc1: card claims to support voltages below the defined range. These will be ignored.
    [ 2.527535] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
    [ 2.534543] mmc1: new high speed SDIO card at address 0001

    # lsmod
    Module Size Used by
    wl18xx 76061 0
    wlcore 170180 1 wl18xx
    mac80211 523730 2 wl18xx,wlcore
    cfg80211 411066 3 wl18xx,wlcore,mac80211
    compat 23218 4 wl18xx,wlcore,mac80211,cfg80211
    #
    # insmod wlcore_sdio.ko

    [ 133.605120] wl1271_sdio: probe of mmc1:0001:2 failed with error -12

    The module is working with same platfrom data without Android (only Linux with yocto rootfs).

    could you please tell me, what might be the issue ? 

    Thanks in advance..

    Best regards,
    Bhaskar

  • Hi,

    Are you using the same .dts file between the linux build that works and the android one?
    I believe the issue is that the drivers fail to locate the "wlcore" subnode inside the mmc1 node in the android .dts file.

    BR,
    Eyal
  • HI Eyal,

    I am not using DTS in both the Linux and Android.
    My kernel version is 3.2 So I am using platform data in board file.
    My both kernel board files are same for Linux and Android.

    what i observed is, the problem in driver file, it is looking for oftree node structure in Android driver code.
    So i want to know is, which git tag i should use for Linux-3.2. So that i can compile the drivers with that driver.

    For Linux i am using,
    wlcore: driver version: ol_r8.a8.04_32-dirty (it is working good)
    For Android i am using,
    Backport generated by backports.git R8.6-0-g4677dc3 (driver not loading)

    So, i want to know the perfect tag for 3.2 kernel for Android-4.4.4.

    Could you please tell me the git tag for Linux-3.2 ?

    Thanks & Regards,
    Bhaskar
  • Hi Bhaskar,

    In general, I always recommend using the latest drivers which are currently R8.7_SP1
    What you are using for android is fairly new (R8.6)
    Your issue may be related to the fact that starting from R8.6 a due to change in mainline the "wlcore" node parameters are now a sub-node inside the mmc node. So this may be where your board file is failing.
    As we don't work with board files for a long time already, I can't be more specific but I suggest you put some debug prints inside:

    git.ti.com/.../sdio.c

    and check the wl1271_probe() function to see where it fails.

    BR,
    Eyal
  • Hi Eyal,

    I found wl18xx back-port drivers for 3.2 kernel. Now all the drivers loaded and also interface is up by using adb shell.

    # lsmod
    wlcore_sdio 3482 0 - Live 0x00000000 (O)
    wl18xx 56963 0 - Live 0x00000000 (O)
    wlcore 161315 1 wl18xx, Live 0x00000000 (O)
    omaplfb 12412 0 - Live 0x00000000 (O)
    mac80211 410223 2 wl18xx,wlcore, Live 0x00000000 (O)
    pvrsrvkm 180836 43 omaplfb, Live 0x00000000 (O)
    cfg80211 187321 3 wl18xx,wlcore,mac80211, Live 0x00000000 (O)
    compat 1867 4 wlcore_sdio,wl18xx,mac80211,cfg80211, Live 0x00000000 (O)

    # netcfg
    lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00
    sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
    wlan0 DOWN 0.0.0.0/0 0x00001002 5c:31:3e:e3:38:9c

    # netcfg wlan0 up
    [ 56.120841] wlcore: PHY firmware version: Rev 8.2.0.0.168
    [ 56.213976] wlcore: firmware booted (Rev 8.6.0.0.5)
    [ 56.234364] ADDRCONF(NETDEV_UP): wlan0: link is not ready

    # netcfg
    lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00
    sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
    wlan0 UP 0.0.0.0/0 0x00001003 5c:31:3e:e3:38:9c

    But when i turn on the wifi through settings, it is showing only "Turning Wi-Fi on....."
    Below is logcat what i am getting..

    # logcat | grep wpa
    E/WifiHW ( 391): Unable to open connection to supplicant on "@android:wpa_wlan0": No such file or directory
    I/wpa_supplicant( 447): Successfully initialized wpa_supplicant
    I/wpa_supplicant( 812): Successfully initialized wpa_supplicant

    where the supplicant searching this @android:wpa_wlan0 ?

    could you please help me in this ?

    Thanks & Regars,
    Bhaskar
  • Please check the following patch used with a different platform:

    git.ti.com/.../0001-sabresd_6dq-add-wilink8-platform-support.patch

    notice the following init.rc change:

    service p2p_supplicant /system/bin/wpa_supplicant \
    - -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
    - -I/system/etc/wifi/p2p_supplicant_advance_overlay.conf -N \
    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
    -I/system/etc/wifi/wpa_supplicant_overlay.conf \
    - -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 \
    + -O/data/misc/wifi/sockets -pp2p_device=1\
    -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
    ...
    ...

    Perhaps you are missing something similar?

    BR,
    Eyal
  • Hi Eyal,

    Thank you for your valuable support.
    above patch helped me.

    Best Regards,
    Bhaskar