• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[SOLVED] Wi-Fi failure with custom kernel

Search This thread

sjevtic

Member
Dec 8, 2007
39
15
Chicago, IL
I built a minimally modified BTI (Android 10) kernel for my Exynos S20+ (G986B) from the Samsung-released source and used Android Image Kitchen by @osm0sis to extract the boot.img from my device and repack it with the kernel image I built. I subsequently installed the new boot.img with dd, and the phone boots normally, including showing the expected uname output.

The only issue I've seen so far is that Wi-Fi doesn't work. I observed the following:
  1. Immediately after installing the kernel, Wi-Fi simply refuses to turn on, with the button turning back to gray a few seconds later. dmesg output includes complaints about failure powering up Wi-Fi chip and downloading firmware to it.
  2. After reformatting /data, Wi-Fi turns on and wlan0 is even visible in ifconfig output, but no networks are discovered and it is impossible to connect to any network. dmesg output contains numerous WIFI_SEC errors including references to files that do not exist in /data/misc/conn
  3. After reinstalling a boot.img containing the stock kernel, normal Wi-Fi functionality is immediately restored on next boot, even without reformatting /data.
A search of XDA and the greater web turned up lots of complaints about this issue spanning many years and generations of Galaxy devices. The solutions I found fell into three categories:
  • Replacing libsecure_storage components with a patched version. The version I found was quite old.
  • Setting ro.securestorage.support to false in build.prop. There are also comments that indicate this doesn't work.
  • Placing some provided files in /data/misc/conn. This seems somewhat unlikely to be applicable for this device/build since there are no files here even when Wi-Fi is working correctly with the stock kernel.
Can someone (maybe one of the prolific kernel devs like @freeza ) explain to me what is going on here and suggest a good way to address it? I'd definitely prefer an approach that doesn't involve inserting prepared binaries.

Thanks.
 

sjevtic

Member
Dec 8, 2007
39
15
Chicago, IL
The problem here is the way the Wi-Fi driver (drivers/net/wireless/broadcom/bcmdhd_101_12) is built in my custom Kernel:
  1. Makefile uses the ANDROID_VERSION or PLATFORM_VERSION environment variables to define the ANDROID_PLATFORM_VERSION macro, but does not do so if ANDROID_VERSION or PLATFORM_VERSION are not set.
  2. dhd.h uses the lack of ANDROID_PLATFORM_VERSION to:
    • Set the VENDOR_PATH macro to "" resulting in firmware being sought in /etc/wifi instead of /vendor/etc/wifi as expected for Android 10.
    • Set the PLATFORM_PATH macro to "/data/misc/conn/" resulting in configuration being sought in /data/misc/conn instead of /data/vendor/conn as expected in Android 10.
So, the solution was much simpler than any of possible methods I found earlier. All I had to do to resolve this problem was run this before building my Kernel:

Bash:
export PLATFORM_VERSION=10.0

It seems that this is an omission in Samsung's build instructions. Upon installing my kernel built this way, Wi-Fi works as expected. This is very similar to what is described in post 79 of this thread.
 
Last edited:

Magendanz

Senior Member
Mar 25, 2008
831
795
Issaquah, WA
www.Vote4Chad.com
Sadly, this didn't work for the Galaxy Tab 8.0 (SM-T290) which suffers identical symptoms when I build from kernel source. There's no reference to ANDROID_VERSION, PLATFORM_VERSION, ANDROID_PLATFORM_VERSION or even VENDOR_PATH in any kernel source file.
 
Last edited: