How should I porting own wifi module on Android 8.0?


I’ve build my own kernel(disable TI wifi and enable CONFIG_MODULES).
Then I build own wifi ko (rtl8723bu).
I can insmod and bring up wlan0 but I got this error log.
01-01 00:07:10.550 1975 2049 E SupplicantStaIfaceHal: initSupplicantStaIface got null iface
01-01 00:07:10.550 1975 2049 E SupplicantStaIfaceHal: initalizing ISupplicantIfaces failed.

Is there any suggestion?
Thanks a lot


Did you get a Solution ?? I am also facing the same error …



Does loading the driver create a wlan0 interface ? Android is statically configured for a wlan0 network interface, cf wpa_supplicant service in device/linaro/hikey/init.common.rc.



I’ve enable my own wifi module on Android 8.0.
Here is some key point

  1. Hikey has default TI wifi builtin module, you have to build own kernel to disable TI wifi module and enable kernel module related function (insmod, rmmod)
  2. You should insmod your wifi module by init script(.rc). You should take care of selinux policy.
  3. There are two kind hidl related to wifi : IWifi & ISupplicant. I used ISupplicant only


In my case, wlan0 interface is existing and when i force run wpa_supplicant on command line using the below command, wpa_cli works and gets connected to network

./vendor/bin/hw/wpa_supplicant -B -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -O/data/misc/wifi/sockets

The above error (SupplicantStaIfaceHal: initSupplicantStaIface got null iface) is only seen while turning WIFI on from the android ui . The way android starts the wifi_supplicant service is like the below

service wpa_supplicant /vendor/bin/hw/wpa_supplicant -B
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf
-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
socket wpa_wlan0 dgram 660 wifi wifi
class main

Any idea about this ??


I suggest you to provide log related to wifi/wpa_supplicant. moreover adding some debug into in initSupplicantStaIface (frameworks/opt/net/wifi/service/java/com/android/server/wifi/ could help. It looks like iface is detected but no ‘STA’ iface.


Thanks . I debugged this issue and found p2p was taken the default iface . So went ahead and added the below line to wpa_supplicant.conf .


After that, I was able to add network manually with ssid and password . The autoscan is still failing though and i am not getting the list of available networks through ui .