[Sony Xperia P, U, Sola, Go] 95A31:
Daily report:

After spend some day on CM11 Wi-Fi I want share with the community my progress in order to avoid of test 2 (or more) times the same configurations/drivers:

For make it (very) simple, Wi-Fi envirorment in CM11 is structured in driver (make hardware exploitable) + CyanogenMod system + wpa_supplicant (used by Android for communicate with driver). All drivers usen by me, [MENTION=4120742]munjeni[/MENTION] and the others develoeprs are working in the sense that make the hardware exploitable. CM is working for assumption so the problem is wpa_supplicant.

In order to configure drivers is necessary modify BoardConfig.mk. It set the drivers and some related flag userfull for build CM system and wpa_supplicant. WARNING: Usually is not necessay specify any flags because wpa_supplicant's Android.mk load all the correct configurations from android.config. (Currently my device repository is no correct in this sense, I will remove all flags for the future tests).

Before explain how to configure wpa_supplicant is needed introduce some concepts. For communicate wpa_supplicant and CM use sockets (is not importat that you know precisly what they are, you can image them as files). There are 2 kind of sockets in Andoid: Unix socket and Android private socket. At function level they are equivalent but your configuration must be coerent and use only one type.

In order to configure wpa_supplicant is necessary modify 2 files:

- init.st-ericsson.rc: this file create the directory needed by wpa_supplicant and lunch it.

#Common socket dirs

mkdir /system/etc/wifi 0770 wifi wifi

chmod 0770 /system/etc/wifi

chmod 0660 /system/etc/wifi/wpa_supplicant.conf

chown wifi wifi /system/etc/wifi/wpa_supplicant.conf

#Android socket dirs

mkdir /data/misc/wifi 0770 wifi wifi

mkdir /data/misc/wifi/sockets 0770 wifi wifi

chmod 0770 /data/misc/wifi

chmod 0660 /data/misc/wifi/wpa_supplicant.conf

chown wifi wifi /data/misc/wifi

chown wifi wifi /data/misc/wifi/wpa_supplicant.conf

#Unix socket dirs

mkdir /data/system/wpa_supplicant 0771 wifi wifi

chmod 0771 /data/system/wpa_supplicant

chown wifi wifi /data/system/wpa_supplicant
​

And then wpa_supplicant must be lunched like this:

#Android socket

service wpa_supplicant /system/bin/wpa_supplicant \

-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \

-e/data/misc/wifi/entropy.bin -ddd

class main

socket wpa_wlan0 dgram 660 wifi wifi #<- With this line you specify that is an Android socket, note the keyword "socket"

disabled

oneshot

#Unix socket

service wpa_supplicant /system/bin/wpa_supplicant \

-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \

disabled

oneshot
​

- wpa_supplicant.conf: this file give to wpa_supplicant the correct settings for run.

#(Minimum) Configuration for Android socket

ctrl_interface=wlan0 #<- With this line you specify that is an Android socket, note the relative path

update_config=1

#(Minimum) Configuration for Unix socket

ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi

update_config=1​

Reference:

- http://blog.linuxconsulting.ro/2010/04/porting-wifi-drivers-to-android.html

- http://processors.wiki.ti.com/index.php/TI-Android-JB-PortingGuide