wifi binding on imx6sl evk based board

来源:互联网 发布:网络d是什么意思 编辑:程序博客网 时间:2024/05/22 06:14

We are having problem with board that is based on imx6sl evk and rtl8192cu (chip on wifi module is RTL8188CTV). The wifi module is on USB interface.
We integrated rtl8192cu driver from another package, we used manual supplied by realtek to integrate there driver into android (from zip file
RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip pdf file \android_ref_codes_JB_4.2\Realtek_Wi-Fi_SDK_for_Android_JB_4_2.pdf).


The driver is build as part of the kernel, not module. We used there's wpa_supplicant, that came with realteks package (wpa_supplicant_8_jb_4.2_rtw_r8680.20130821.tar.gz).


Package is from this site: http://www.realtek.com/downloads/downloadsView.aspx?Langid=2&PFid=48&Level=5&Conn=4&ProdID=277&DownTypeID=3&GetDown=false&Downloads=true

RTL8192CU for Linux/Android

Firmware is from this link: rtl819x - Linux Wireless


Using serial interface terminal, we tested the wlan0 interface,  we can bring it up, and get ip number:


root@evk_6sl:/ # cat /sys/kernel/debug/usb/devices


T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=0bda ProdID=8176 Rev= 2.00

S:  Manufacturer=Realtek

S:  Product=802.11n WLAN Adapter

S:  SerialNumber=00e04c000001

C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA

I:* If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=ff Prot=ff Driver=rtl8192cu

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=125us


root@evk_6sl:/ # dhcpcd wlan0

dhcpcd[2859]: version 5.5.6 start+871x_drv - drv_open, bup=0

===> FirmwareDownload91C() fw:Rtl819XFwImageArray_UMC_B

FirmwareDownload92C accquire FW from embedded image

fw_ver=v80, fw_subver=0, sig=0x88c0

fw download ok!

Set RF Chip ID to RF_6052 and RF type to 1T1R.

IQK:Start!!!

Path A IQK Success!!

Path A IQK Success!!

IQK: final_candidate is 0

IQK: RegE94=103 RegE9C=f RegEA4=fb RegEAC=5 RegEB4=0 RegEBC=0 RegEC4=0 RegECC=0

Path A IQ Calibration Success !

pdmpriv->TxPowerTrackControl = 1

MAC Address from REG_MACID = 44:33:4c:8b:f2:10

rtl8192cu_hal_init in 610ms

MAC Address = 44:33:4c:8b:f2:10

-871x_drv - drv_open, bup=1

ADDRCONF(NETDEV_UP): wlan0: link is not ready

dhcpcd[2859]: wlan0: checking for 169.254.169.141

dhcpcd[2859]: wlan0: using IPv4LL address 169.254.169.141

dhcpcd[2859]: forked to background, child pid 2885



root@evk_6sl:/ # ifconfig wlan0

wlan0: ip 169.254.169.141 mask 255.255.0.0 flags [up broadcast running multicast]


root@evk_6sl:/ # netcfg

lo       UP                                   127.0.0.1/8   0x00000049 00:00:00:00:00:00

eth0     UP                               192.168.0.152/24  0x00001043 24:80:00:00:00:00

tunl0    DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00

sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00

ip6tnl0  DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00

wlan0    UP                             169.254.169.141/16  0x00001043 44:33:4c:8b:f2:10


We need to use dhcpcd wlan0 command, the suggested init.rs service doesn't work, but thats not the problem.


Our problem is that binding from android ui and kernel isnt working.

When we tried to turn on wifi, from Settings>Wifi in Android UI, the slider button can move and change to On state, but the message on display "To see available networks, turn WiFi on" is still there.

in logcat we get:

D/WifiService( 2363): setWifiEnabled: true pid=2363, uid=1000

After that we can't move slider back.

When we exit that menu and return, the slider is back in Off state.



Using wifi from shell, we can get all the other wifi networks:


root@evk_6sl:/data # ./xbin/iwlist wlan0 scanning

survey done event(18)

wlan0     Scan completed :

         Cell 01 - Address: BC:AE:C5:C4:3B:F7

                   ESSID:"Automatic"

                   Protocol:IEEE 802.11bg

                   Mode:Master

                   Frequency:2.412 GHz (Channel 1)

                   Encryption key:on

                   Bit Rates:54 Mb/s

                   Quality=59/100  Signal level=-95 dBm

         Cell 02 - Address: 68:7F:74:01:C6:BE

                   ESSID:""

                   Protocol:IEEE 802.11bg

                   Mode:Master

                   Frequency:2.432 GHz (Channel 5)

                   Encryption key:off

                   Bit Rates:54 Mb/s

                   Quality=100/100  Signal level=-55 dBm

         Cell 03 - Address: 20:AA:4B:1B:A1:7C

                   ESSID:"TEST"

                   Protocol:IEEE 802.11bgn

                   Mode:Master

                   Frequency:2.437 GHz (Channel 6)

                   Encryption key:off

                   Bit Rates:144 Mb/s

                   IE: Unknown: DD750050F204104A0001101044000102103B0001031047001020AA4B1BA17A20AA4B1BA17A022AC107102100104C696E6B73797320627920436973636F102300085752543136304E4C1024000776312E302E303210420001351054000800060050F2040001101100085752543136304E4C100800020084

                   Quality=100/100  Signal level=-71 dBm

         Cell 04 - Address: 00:1D:7E:BD:10:05

                   ESSID:"alt02"

                   Protocol:IEEE 802.11bg

                   Mode:Master

                   Frequency:2.457 GHz (Channel 10)

                   Encryption key:on

                   Bit Rates:54 Mb/s

                   Extra:wpa_ie=dd180050f20101000050f20201000050f20201000050f2020c00

                   IE: WPA Version 1

                       Group Cipher : TKIP

                       Pairwise Ciphers (1) : TKIP

                       Authentication Suites (1) : PSK

                   Quality=100/100  Signal level=-74 dBm

         Cell 05 - Address: 00:18:F8:3B:F1:0A

                   ESSID:"alt1"

                   Protocol:IEEE 802.11bg

                   Mode:Master

                   Frequency:2.462 GHz (Channel 11)

                   Encryption key:on

                   Bit Rates:54 Mb/s

                   Quality=101/100  Signal level=-95 dBm



We also added permissions for wifi in android ..


Please, ask me if you need more details, I kept track of all the changed done in the android and kernel.

Logcat with DBG for classes in wifi is also available.


Does anyone have any idea about this problem? Could you help us, please? We wasted a lot of time on this.


Zoran Lukic
正确答案作者: Zoran Lukic 开启 2014-5-28 上午6:52

Yes, we manage to get wifi working. Here are info's in more detail, so if anybody else has problem ...


We build driver as part of the kernel:

vim kernel_imx/arch/arm/configs/imx6s_{yourdevice}_android_defconfig

CONFIG_CFG80211=y


CONFIG_MAC80211_MESH=y

CONFIG_MAC80211=y


CONFIG_HOSTAP=y

CONFIG_RTL8192CU=y

CONFIG_RTLWIFI=y

CONFIG_RTL8192C_COMMON=y

#CONFIG_RTL8723AS=m

CONFIG_USB_USBNET=y

CONFIG_NET_RADIO=y


vim device/fsl/{yourdevice}/BoardConfig.mk


BOARD_WIFI_VENDOR := realtek


WPA_SUPPLICANT_VERSION := VER_0_8_X


CONFIG_DRIVER_NL80211 := true


BOARD_WPA_SUPPLICANT_DRIVER := NL80211

BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_rtl

BOARD_HOSTAPD_DRIVER := NL80211

BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_rtl


BOARD_WLAN_DEVICE := rtl8192cu


WIFI_DRIVER_MODULE_NAME := "wlan0"

WIFI_DRIVER_MODULE_PATH := ""

WIFI_DRIVER_MODULE_ARG := ""


WIFI_FIRMWARE_LOADER := ""

WIFI_DRIVER_FW_PATH_STA := ""

WIFI_DRIVER_FW_PATH_AP := ""

WIFI_DRIVER_FW_PATH_P2P := ""

WIFI_DRIVER_FW_PATH_PARAM := ""




We disabled p2p, since we dont need it:

vim device/fsl/imx6/{yourboard}.mk

PRODUCT_COPY_FILES += \

#frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml


or

rm out/target/product/{yourboard}/system/etc/permissions/android.hardware.wifi.direct.xml


or just remount system partition:

root@{yourboard}:/ # mount -o remount, rw /system;

and remove xml:

root@{yourboard}:/ # rm /system/etc/permissions/android.hardware.wifi.direct.xml



edit:

root@{yourboard}:/ # busybox vi system/etc/permissions/required_hardware.xml

or

vim device/fsl/{yourboard}/required_hardware.xml

or

vim out/target/product/{yourboard}/system/etc/permissions/required_hardware.xml

<!--

    <feature name="android.hardware.wifi.direct" />

-->


If you use it as module, you will need to add it also in PRODUCT_COPY_FILES


You need to correct init scripts, leave just this lines:

(this is from: http://blog.linuxconsulting.ro/2010/04/porting-wifi-drivers-to-android.html )


You can do it directly to out folder:

vim out/target/product/{yourboard}/root/init.rc

or/and (rebuild the whole system):

vim device/fsl/imx6/imx6.mk


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

#wpa_supplicant control socket for android wifi.c (android private socket)

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


    setprop wifi.interface wlan0

    setprop wlan.driver.status "ok"

   #setprop wifi.ap.interface wlan0


#and also remove this lines:

#    mkdir /data/system/wpa_supplicant 0771 wifi wifi

#    chmod 0771 /data/system/wpa_supplicant

#    symlink /data/misc/wifi/wpa_supplicant /data/system/wpa_supplicant


you can read it in that blog link, about unix/android standard socket setup.



vim out/target/product/{yourboard}/root/init.freescale.rc

or/and

vim device/fsl/{yourboard}/init.rc


#this is the only supplicant service and dhcpcd service for wifi that we use:

service rtw_suppl /system/bin/wpa_supplicant -dd -iwlan0 -Dnl80211 \

    -c/data/misc/wifi/wpa_supplicant.conf

    socket wpa_wlan0 dgram 660 wifi wifi

    class main

    disabled

    oneshot



service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL

    class main

    disabled

    oneshot


service iprenew_wlan0 /system/bin/dhcpcd -n

    class main

    disabled

    oneshot



To keep it clean (it doesnt effect wifi):

vim device/fsl/imx6/imx6.mk


PRODUCT_PACKAGES += \

       rtw_suppl               \



We needed to make a little change in wifi_realtek.c since our jb is 4.3:


vim hardware/realtek/wlan/libhardware_legacy/wifi/wifi_realtek.c

int wifi_start_supplicant(int p2p_supported)

..

    wifi_stop_supplicant(p2p_supported);

….


int wifi_stop_supplicant(int p2p_supported){

    char supp_status[PROPERTY_VALUE_MAX] = {'\0'};

    int count = 50; /* wait at most 5 seconds for completion */


    if (p2p_supported) {

        property_get("wifi.supplicant", supplicant_name, P2P_SUPPLICANT_NAME);

        snprintf(supplicant_prop_name, PROPERTY_KEY_MAX, P2P_PROP_NAME, supplicant_name);

    } else {

        property_get("wifi.supplicant", supplicant_name, SUPPLICANT_NAME);

        snprintf(supplicant_prop_name, PROPERTY_KEY_MAX, SUPP_PROP_NAME, supplicant_name);

    }



Our problem was wrong supplicant name in prop setup. And, when wifi starts it first stops supplicant, and it wasn’t able to transfer that info through system. It was quite fun tracking this problem.


vim ./frameworks/base/wifi/java/android/net/wifi/WifiStateMachine.java

mWifiNative.killSupplicant(mP2pSupported);

if(mWifiNative.startSupplicant(mP2pSupported)) {

                            setWifiState(WIFI_STATE_ENABLING);

                            if (DBG) log("Supplicant start successful");

                            mWifiMonitor.startMonitoring();

                            transitionTo(mSupplicantStartingState);

                        } else {

                            loge("Failed to start supplicant!!");

                        }



Here are more info:


root@{yourdevice}:/ # cat /data/misc/wifi/wpa_supplicant.conf

ctrl_interface=wlan0

update_config=1

device_name={yourdevice}

manufacturer=Freescale

model_name={YOURDEVICE}

model_number={YOURDEVICE}

serial_number=

device_type=10-0050F204-5

config_methods=physical_display virtual_push_button


network={

        ssid="XXXXX"

        key_mgmt=NONE

        priority=1

}



and it started with:

root@{yourdevice}:/ # cat system/etc/wifi/wpa_supplicant.conf

update_config=1

ctrl_interface=wlan0

eapol_version=1

ap_scan=1

fast_reauth=1



permissions:

root@{yourdevice}:/ # ls -l /data/misc/wifi

-rw-rw---- system   wifi           21 2014-05-27 12:39 entropy.bin

drwxrwx--- wifi     wifi              2014-05-27 12:39 sockets

-rw------- system   system         33 2014-05-27 12:39 softap.conf

-rw-rw---- wifi     wifi          272 2014-05-27 12:39 wpa_supplicant.conf


root@{yourboard}:/ # ls -l /data/misc/

drwxr-s--- system   shell             2014-05-27 12:39 adb

drwxrwx--- bluetooth net_bt_stack          2014-05-27 12:39 bluedroid

drwxrwx--- system   system            2014-05-27 12:39 bluetooth

drwxrwx--- dhcp     dhcp              2014-05-27 12:39 dhcp

drwxrwx--x system   system            2014-05-27 12:39 keychain

drwx------ keystore keystore          2014-05-27 12:39 keystore

drwx------ media    media             2014-05-27 12:39 media

drwxrwx--- system   radio             2014-05-27 12:39 radio

drwxrwx--- system   radio             2014-05-27 12:39 sms

drwx------ system   system            2014-05-27 12:39 systemkeys

drwxrwx--- system   vpn               2014-05-27 12:39 vpn

drwxrwx--- wifi     wifi              2014-05-27 12:39 wifi

drwxrwxr-x system   system            2014-05-27 12:39 zoneinfo


root@{yourboard}:/ # ls -l /system/etc/wifi

-rw-rw---- wifi     wifi           77 2014-05-27 12:39 wpa_supplicant.conf



root@{yourboard}:/ # ps | grep wpa

wifi      2555  1     3104   1876  c0103edc 401a4448 S /system/bin/wpa_supplicant



root@{yourboard}:/ # cat system/etc/permissions/platform.xml | grep -i wifi

    <permission name="android.permission.ACCESS_WIFI_STATE" >

        <group gid="wifi" />

    <permission name="android.permission.CHANGE_WIFI_STATE" >

        <group gid="wifi" />

    <permission name="android.permission.WIFI" >

        <group gid="wifi" />




root@{yourboard}:/ # cat system/etc/permissions/required_hardware.xml | grep wifi

    <feature name="android.hardware.wifi" />




root@{yourboard}:/ # getprop | grep  wifi

[net.tcp.buffersize.wifi]: [524288,1048576,2097152,262144,524288,1048576]

[ro.wifi.channels]: []

[wifi.interface]: [wlan0]


root@{yourboard}:/ # getprop | grep  wlan

[dhcp.wlan0.dns1]: [192.168.1.1]

[dhcp.wlan0.dns2]: []

[dhcp.wlan0.dns3]: []

[dhcp.wlan0.dns4]: []

[dhcp.wlan0.domain]: []

[dhcp.wlan0.gateway]: [192.168.1.1]

[dhcp.wlan0.ipaddress]: [192.168.1.118]

[dhcp.wlan0.leasetime]: [86400]

[dhcp.wlan0.mask]: [255.255.255.0]

[dhcp.wlan0.pid]: [2689]

[dhcp.wlan0.reason]: [REBOOT]

[dhcp.wlan0.result]: [ok]

[dhcp.wlan0.server]: [192.168.1.1]

[dhcp.wlan0.vendorInfo]: []

[init.svc.dhcpcd_wlan0]: [running]

[wifi.interface]: [wlan0]

[wlan.driver.status]: [ok]

[wlan.interface]: [wlan0]



root@{yourboard}:/ # getprop | grep  suppl

[init.svc.rtw_suppl]: [running]



root@{yourboard}:/ # cat /sys/kernel/debug/usb/devices

 

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=0bda ProdID=8176 Rev= 2.00

S:  Manufacturer=Realtek

S:  Product=802.11n WLAN Adapter

S:  SerialNumber=00e04c000001

C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA

I:* If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=ff Prot=ff Driver=rtl8192cu

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=125us

 


root@{yourboard}:/ # cat /sys/bus/usb/devices/2-1/product

802.11n WLAN Adapter



Useful commands:


disable wifi:

root@{yourboard}:/ # svc wifi disable

enable wifi:

root@{yourboard}:/ # svc wifi enable



open wifi settings panel:

root@{yourboard}:/ # am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings


manually starting supplicant with debug:

root@{yourboard}:/ # wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd -B


root@{yourboard}:/ # netcfg wlan0 up/down/dhcp


root@{yourboard}:/ # wpa_cli

status

bssid=20:aa:4b:1b:a1:7c

ssid=ECTEST

id=0

mode=station

pairwise_cipher=NONE

group_cipher=NONE

key_mgmt=NONE

wpa_state=COMPLETED

ip_address=192.168.1.118

p2p_device_address=44:34:4c:8b:f2:10

address=44:34:4c:8b:f2:10

<3>CTRL-EVENT-STATE-CHANGE id=0 state=9 BSSID=20:aa:4b:1b:a1:7c SSID=ECTEST

<3>CTRL-EVENT-CONNECTED - connection to 20:aa:4b:1b:a1:7c completed (reauth) [id=0 id_str=]

scan

cfg80211_rtw_scan(wlan0)

OK

> no packet in tx packet buffer (0)

survey done event(14) band:0 for wlan0

<3>CTRL-EVENT-SCAN-RESULTS

scan_results

bssid / frequency / signal level / flags / ssid

20:aa:1b:1b:a1:7c       2437    -74     [WPS][ESS]      ECTEST

00:1d:3e:bd:10:05       2457    -85     [WPA-PSK-TKIP][ESS]     net02

68:7f:74:03:c6:be       2432    -59     [ESS]   \x00\x00\x00\x00

c8:23:73:3f:05:71       2462    -66     [ESS]   Nick's router. Hands off.



root@{yourboard}:/ # ifconfig wlan0

wlan0: ip 192.168.1.118 mask 255.255.255.0 flags [up broadcast running multicast]



root@{yourboard}:/ # dhcpcd wlan0

dhcpcd[3373]: version 5.5.6 starting

dhcpcd[3373]: wlan0: rebinding lease of 192.168.1.118

dhcpcd[3373]: wlan0: acknowledged 192.168.1.118 from 192.168.1.1

dhcpcd[3373]: wlan0: leased 192.168.1.118 for 86400 seconds

dhcpcd[3373]: forked to background, child pid 3405

 

root@{yourboard}:/ # netcfg

lo       UP                                   127.0.0.1/8   0x00000049 00:00:00:00:00:00

eth0     UP                               192.168.0.152/24  0x00001043 24:80:00:00:00:00

tunl0    DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00

sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00

ip6tnl0  DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00

wlan0    UP                               192.168.1.118/24  0x00001043 44:34:4c:8b:f2:10

wlan1    DOWN                                   0.0.0.0/0   0x00001002 46:34:4c:8b:f2:10

 

 

Good luck with it and please let me know if you need more info.




problem/solution:



if you get this problem:

E/wpa_supplicant( 3159): Could not set interface wlan0 flags (UP): Unknown error 132


solution:

missing rfkill, error 132 means "operation not possible due to RFkill"

vim kernel_imx/arch/arm/mach-mx6/board-mx6sl_{yourboard}.c

static int mx6sl_shd_bt_power_change(int status){return 0;}

static struct platform_device mxc_bt_rfkill = {

  .name = "mxc_bt_rfkill",

};

static struct imx_bt_rfkill_platform_data mxc_bt_rfkill_data = {

  .power_change = mx6sl_shd_bt_power_change,

};


/* init function  */

static void __init {yourboard}_init(void){

     ...

     mxc_register_device(&mxc_bt_rfkill, &mxc_bt_rfkill_data);

}


problem:

E/WifiHW ( 2488): Unable to open connection to supplicant on "/data/system/wpa_supplicant/wlan0": No such file or directory

solution:

setup correctly in init.rc and init.freescale.rc scripts wifi and wpa_supplicant permissions and services.



查看上下文中的回答
平均用户评级
(0 评级)
  • Re: wifi binding on imx6sl evk based board
    igorpadykovEmployee

    Hi, Zoran

    what Android was used, is it Freescale Android (link below) ?

     

    IMX6_JB43_110_ANDROID_SOURCE_BSP  : i.MX 6Quad, i.MX 6Dual, i.MX 6DualLite,

    i.MX 6Solo and i.MX 6Sololite Android jb4.3_1.1.0 0 BSP, Documentation and Source Code

     

    i.MX 6SoloLite Evaluation Kit

     

    Also very often WiFi modules have different firmware, so different drivers are needed, though module

    name may the same. Have you contacted Realtek for updated version of driver for this specific module ?

    • Re: Re: wifi binding on imx6sl evk based board
      Zoran LukicLevel 1

      Hello,

       

      Thank you for answering,

       

      Yeah, I wanted to add that info. It was JB4.3 and the Realtek porting for rtl8192cu driver is for JB4.2.

      Some more porting work was needed to be done that wasnt in the manual.

       

       

      Also we are currently working on nfs, there shouldnt be some permissions problem.

       

      We put every all firmware files in the root fs (nfs) just in case.

      ls /system/etc/firmware/rtlwifi/ -l                                        

      -rw------- root    root        11216 2014-04-23 13:10 rtl8188efw.bin

      -rw------- root    root        13904 2014-04-23 13:10 rtl8188eufw.bin

      -rw------- root    root        13540 2014-04-23 13:10 rtl8192cfw.bin

      -rw------- root    root        14818 2014-04-23 13:10 rtl8192cfwU.bin

      -rw------- root    root        14800 2014-04-23 13:10 rtl8192cfwU_B.bin

      -rw------- root    root        16014 2014-04-23 13:10 rtl8192cufw.bin

      -rw------- root    root        16116 2014-04-23 13:10 rtl8192cufw_A.bin

      -rw------- root    root        16096 2014-04-23 13:10 rtl8192cufw_B.bin

      -rw------- root    root        16116 2014-04-23 13:10 rtl8192cufw_TMSC.bin

      -rw------- root    root        22978 2014-04-23 13:10 rtl8192defw.bin

      -rw------- root    root        32754 2014-04-23 13:10 rtl8192eefw.bin

      -rw------- root    root        80208 2014-04-23 13:10 rtl8192sefw.bin

      -rw------- root    root      122328 2014-04-23 13:10 rtl8712u.bin

      -rw------- root    root        22172 2014-04-23 13:10 rtl8723aufw_A.bin

      -rw------- root    root        24118 2014-04-23 13:10 rtl8723aufw_B.bin

      -rw------- root    root        19200 2014-04-23 13:10 rtl8723aufw_B_NoBT.bin

      -rw------- root    root        11662 2014-04-23 13:10 rtl8723fw.bin

      -rw------- root    root        22996 2014-04-23 13:10 rtl8723fw_B.bin

      -rw------- root    root        29198 2014-04-23 13:10 rtl8821aefw.bin

       

       

      but driver source it askes for:

      (kernel_imx/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c file)

      MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin");

       

       

      also, driver is build in the kernel, from boot:

      rtl8192cu driver version=v4.0.2_9000.20130911

      build time: Apr 24 2014 13:14:21

      usbcore: registered new interface driver rtl8192cu

      ..

      USB_SPEED_HIGH

      CHIP TYPE: RTL8188C_8192C

      register rtw_netdev_ops to netdev_ops

      android_work: sent uevent USB_STATE=CONNECTED

      Netfilter messages via NETLINK v0.30.

      android_work: sent uevent USB_STATE=DISCONNECTED

      Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_B_CUT.

      nf_conntrack version 0.5.0 (7141 buckets, 28564 max)

      RF_Type is 3!!

      ctnetlink v0.93: registering with nfnetlink.

      NF_TPROXY: Transparent proxy support initialized, version 4.1.0

      ...

      readAdapterInfo_8192CU(): REPLACEMENT = 0

      <==== ReadAdapterInfo8192C in 570 ms

      rtw_register_early_suspend

      rtw_macaddr_cfg MAC Address  = 44:33:4c:8b:f2:10

      bDriverStopped:1, bSurpriseRemoved:0, bup:0, hw_init_completed:0

       

       

      This shouldn't be a problem:

      -rw------- root    root

      because system handles driver. But I will check out this, more.

       

      Other thing is that wpa_supplicant isnt  not called from init script, there is no trace of it in logcat.

      in init.freescale.rs file:

      service wpa_supplicant /system/bin/wpa_supplicant -iwlan0 -Dnl80211 \

          -c/data/misc/wifi/wpa_supplicant.conf

          socket wpa_wlan0 dgram 660 wifi wifi

          class late_start

          disabled

          oneshot

       

      service p2p_supplicant /system/bin/wpa_supplicant \

          -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf -N \

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

          class late_start

          disabled

          oneshot

       

      service rtw_suppl_con /system/bin/rtl_wpa_supplicant \

          -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf -e/data/misc/wifi/entropy.bin -N \

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

          class late_start

          socket wpa_wlan0 dgram 660 wifi wifi

          disabled

          oneshot

       

      service rtw_suppl /system/bin/wpa_supplicant -iwlan0 -Dnl80211a \

          -c/data/misc/wifi/wpa_supplicant.conf

          socket wpa_wlan0 dgram 660 wifi wifi

          class main

          disabled

          oneshot

       

      service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL

          class main

          disabled

          oneshot

       

      service dhcpcd_p2p /system/bin/dhcpcd -aABKL

          class main

          disabled

          oneshot

       

      service iprenew_wlan0 /system/bin/dhcpcd -n

          class main

          disabled

          oneshot

       

      service iprenew_p2p /system/bin/dhcpcd -n

          class main

          disabled

          oneshot

       

       

      in init.rs file:

       

          # give system access to wpa_supplicant.conf for backup and restore

          mkdir /data/misc/wifi 0770 wifi wifi

          chmod 0770 /data/misc/wifi

       

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

          mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi

          mkdir /data/misc/wifi/p2p_supplicant 0770 wifi wifi

          mkdir /data/misc/dhcp 0770 dhcp dhcp

          chown dhcp dhcp /data/misc/dhcp

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

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

          chmod 0775 /system/etc/dhcpcd/dhcpcd-run-hooks

       

      ######for nfs maybe some permissions problems (didn't work)

      #    chown system wifi /data/misc/wifi

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

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

       

       

      If we manual start dhcp for wlan0, we can get wifi ip address (in my previous post).

      When we manually call wpa_supplicant:

       

      wpa_supplicant -iwlan0 -c/system/etc/wifi/wpa_supplicant.conf -B

      we get this in logcat:

       

      --------- beginning of /dev/log/main

      I/wpa_supplicant( 2938): Successfully initialized wpa_supplicant

      E/wpa_supplicant( 2938): nl80211: Could not add multicast membership for scan events: -2 (No such file or directory)

      E/wpa_supplicant( 2938): Failed to initialize driver 'nl80211'

       

       

       

      In board config file:

      (./device/fsl/evk_6sl/BoardConfig.mk file)

       

      BOARD_WPA_SUPPLICANT_DRIVER  := NL80211

      BOARD_HOSTAPD_DRIVER        := NL80211

       

      in both

      ./external/wpa_supplicant_8/wpa_supplicant/android.config

      and

      ./external/wpa_supplicant_8/hostapd/android.config

      CONFIG_DRIVER_NL80211=y




      We didn't contacted Realtek yet, we believe that we have some binding problems with driver and android ui.


      Also, slider button for wifi in the Settings menu in the Android ui seamed not to be connected to Settings>Wifi button.

      I can move button in Settings menu, to On state. And the enter the Settings>Wi-Fi and the button is in Off state.

      Exiting Settings>Wi-Fi menu and entering it again, it shows that button is back in Off state.

      Toggling wifi button to Off state isn't possible, after it was set to On state by us.


      After moving the wifi button slider to Off state we get this in logcat:

      D/WifiService( 2401): setWifiEnabled: true pid=2561, uid=1000

      E/WifiService( 2401): Invoking mWifiStateMachine.setWifiEnabled

       

       

      in system/core/include/private/android_filesystem_config.h file we can see uid's

       

      #define AID_SYSTEM        1000  /* system server */

      #define AID_WIFI          1010  /* wifi subsystem */

       

       

      Do we need to register platform driver callbacks, but this is usb module, it shouldn't need that?

      Is it some nfs permission related issue with wifi?

       

      So, what do you think?

      • Re: Re: wifi binding on imx6sl evk based board
        Zoran LukicLevel 1

        building the driver as module also doesn't work ..

        we are pretty sure that it is to android binding with driver.

        we tried three different drivers for rtl8192cu.

         

        root@evk_6sl:/ # insmod /system/lib/modules/cfg80211_realtek.ko

        cfg80211: Calling CRDA to update world regulatory domain

        root@evk_6sl:/ # insmod /system/lib/modules/8192cu.ko

        rtl8192cu driver version=v4.0.2_9000.20130911

        build time: Apr 25 2014 15:18:54


        usb_endpoint_descriptor(0):

        bLength=7

        bDescriptorType=5

        bEndpointAddress=81

        wMaxPacketSize=200

        bInterval=0

        RT_usb_endpoint_is_bulk_in = 1


        usb_endpoint_descriptor(1):

        bLength=7

        bDescriptorType=5

        bEndpointAddress=2

        wMaxPacketSize=200

        bInterval=0

        RT_usb_endpoint_is_bulk_out = 2


        usb_endpoint_descriptor(2):

        bLength=7

        bDescriptorType=5

        bEndpointAddress=3

        wMaxPacketSize=200

        bInterval=0

        RT_usb_endpoint_is_bulk_out = 3


        usb_endpoint_descriptor(3):

        bLength=7

        bDescriptorType=5

        bEndpointAddress=84

        wMaxPacketSize=40

        bInterval=1

        RT_usb_endpoint_is_int_in = 4, Interval = 1

        nr_endpoint=4, in_num=2, out_num=2


        USB_SPEED_HIGH

        CHIP TYPE: RTL8188C_8192C

        register rtw_netdev_ops to netdev_ops

        Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_B_CUT.

        RF_Type is 3!!

        EEPROM type is E-FUSE

        ====> ReadAdapterInfo8192C

        Boot from EFUSE, Autoload OK !

        EEPROMVID = 0x0bda

        EEPROMPID = 0x8176

        EEPROMCustomerID : 0x00

        EEPROMSubCustomerID: 0x00

        RT_CustomerID: 0x00

        _ReadMACAddress MAC Address from EFUSE = 44:33:4c:8b:f2:10

        EEPROMRegulatory = 0x0

        _ReadBoardType(0)

        BT Coexistance = disable

        mlmepriv.ChannelPlan = 0x08

        _ReadPSSetting...bHWPwrPindetect(0)-bHWPowerdown(10) ,bSupportRemoteWakeup(0)

        ### PS params=>  power_mgnt(0),usbss_enable(0) ###

        ### AntDivCfg(0)

        readAdapterInfo_8192CU(): REPLACEMENT = 0

        <==== ReadAdapterInfo8192C in 180 ms

        rtw_wdev_alloc(padapter=da5f7000)

        rtw_register_early_suspend

        rtw_macaddr_cfg MAC Address  = 44:33:4c:8b:f2:10

        bDriverStopped:1, bSurpriseRemoved:0, bup:0, hw_init_completed:0

        register rtw_netdev_ops to netdev_ops

        register rtw_netdev_if2_ops to netdev_ops

        rtw_wdev_alloc(padapter=db8e7000)

        Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_B_CUT.

        RF_Type is 3!!

        _rtw_drv_register_netdev, MAC Address (if1) = 44:33:4c:8b:f2:10

        _rtw_drv_register_netdev, MAC Address (if2) = 46:33:4c:8b:f2:10

        usbcore: registered new interface driver rtl8192cu




        here is this kernel build config file:


        CONFIG_WLAN=y

        CONFIG_WIFI_CONTROL_FUNC=y

        CONFIG_HOSTAP=y

         

        CONFIG_CFG80211=m

        CONFIG_NL80211_TESTMODE=y

        CONFIG_CFG80211_REG_DEBUG=y

        CONFIG_CFG80211_DEFAULT_PS=y

        CONFIG_CFG80211_DEBUGFS=y

        CONFIG_CFG80211_WEXT=y

        CONFIG_LIB80211=y

        CONFIG_LIB80211_CRYPT_WEP=y

        CONFIG_LIB80211_CRYPT_CCMP=y

        CONFIG_LIB80211_CRYPT_TKIP=y

        CONFIG_CFG80211_ALLOW_RECONNECT=y

        CONFIG_MAC80211=m

        CONFIG_MAC80211_HAS_RC=y

        CONFIG_MAC80211_RC_MINSTREL=y

        CONFIG_MAC80211_RC_MINSTREL_HT=y

        CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y

        CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"

        CONFIG_MAC80211_MESH=y

        CONFIG_RTL8192CU=m

         

         

        root@evk_6sl:/ # lsmod

        8192cu 674910 0 - Live 0x00000000

        cfg80211 155527 1 8192cu, Live 0x00000000

         

        before that driver was build as part of kernel:

        CONFIG_RTL8192CU=y

        • Re: wifi binding on imx6sl evk based board
          igorpadykovEmployee

          Hi Zoran, I got advice from our expert:

           

          I had been reading about this issue and also i read the description from the client and seem

          there's some missing configuration which the client could try.

          First of all try to set BOARD_WPA_SUPPLICANT_DRIVER to WEXT in the Android BSP.

          Also you need to provide a proper wpa configuration file for your device.

           

          For more details check this reference:

          PaNiC Random Rant (or how we used to call it: .plan): Porting WiFi drivers to Android

           

          Hope this helps

          • Re: wifi binding on imx6sl evk based board
            Zoran LukicLevel 1

            Yep, I tried this link.

             

            In manual provided with rtl wifi driver, it states to use new nl80211 interface.

             

            BoardConfig.mk

            BOARD_WPA_SUPPLICANT_DRIVER=NL80211




            Problem is that Wifi slider switch cant be moved, but nothing happens, so some binding or some permissions are problem. This is done in nfs.

            When slider is moved to On position in logcat we get this:

            D/WifiService( 2401): setWifiEnabled: true pid=2561, uid=1000

            E/WifiService( 2401): Invoking mWifiStateMachine.setWifiEnabled

             

            there should be more data or some error or permission staff for wifi, after this.

             

             

            wpa_supplicant doesnt start automatically, but it is in init.freescale.rc script. It can start manually with nl80211 driver.

             

             

            WEXT, I will try this again, thank you. I am not sure it will work, i dont think the driver is problem. I can scan and get all networks in area, using shell.

            • Re: wifi binding on imx6sl evk based board
              Robert McLeanLevel 1

              We have a similar setup and are having the same problems.  Right down to the same bogus IP address reported by netconfig after dhcpcd seems to believe it got an address from the DHCP server on my Access Point.

               

              Has there been any activity on this?

              • 正确答案Re: wifi binding on imx6sl evk based board
                Zoran LukicLevel 1

                Yes, we manage to get wifi working. Here are info's in more detail, so if anybody else has problem ...


                We build driver as part of the kernel:

                vim kernel_imx/arch/arm/configs/imx6s_{yourdevice}_android_defconfig

                CONFIG_CFG80211=y


                CONFIG_MAC80211_MESH=y

                CONFIG_MAC80211=y


                CONFIG_HOSTAP=y

                CONFIG_RTL8192CU=y

                CONFIG_RTLWIFI=y

                CONFIG_RTL8192C_COMMON=y

                #CONFIG_RTL8723AS=m

                CONFIG_USB_USBNET=y

                CONFIG_NET_RADIO=y


                vim device/fsl/{yourdevice}/BoardConfig.mk


                BOARD_WIFI_VENDOR := realtek


                WPA_SUPPLICANT_VERSION := VER_0_8_X


                CONFIG_DRIVER_NL80211 := true


                BOARD_WPA_SUPPLICANT_DRIVER := NL80211

                BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_rtl

                BOARD_HOSTAPD_DRIVER := NL80211

                BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_rtl


                BOARD_WLAN_DEVICE := rtl8192cu


                WIFI_DRIVER_MODULE_NAME := "wlan0"

                WIFI_DRIVER_MODULE_PATH := ""

                WIFI_DRIVER_MODULE_ARG := ""


                WIFI_FIRMWARE_LOADER := ""

                WIFI_DRIVER_FW_PATH_STA := ""

                WIFI_DRIVER_FW_PATH_AP := ""

                WIFI_DRIVER_FW_PATH_P2P := ""

                WIFI_DRIVER_FW_PATH_PARAM := ""




                We disabled p2p, since we dont need it:

                vim device/fsl/imx6/{yourboard}.mk

                PRODUCT_COPY_FILES += \

                #frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml


                or

                rm out/target/product/{yourboard}/system/etc/permissions/android.hardware.wifi.direct.xml


                or just remount system partition:

                root@{yourboard}:/ # mount -o remount, rw /system;

                and remove xml:

                root@{yourboard}:/ # rm /system/etc/permissions/android.hardware.wifi.direct.xml



                edit:

                root@{yourboard}:/ # busybox vi system/etc/permissions/required_hardware.xml

                or

                vim device/fsl/{yourboard}/required_hardware.xml

                or

                vim out/target/product/{yourboard}/system/etc/permissions/required_hardware.xml

                <!--

                    <feature name="android.hardware.wifi.direct" />

                -->


                If you use it as module, you will need to add it also in PRODUCT_COPY_FILES


                You need to correct init scripts, leave just this lines:

                (this is from: http://blog.linuxconsulting.ro/2010/04/porting-wifi-drivers-to-android.html )


                You can do it directly to out folder:

                vim out/target/product/{yourboard}/root/init.rc

                or/and (rebuild the whole system):

                vim device/fsl/imx6/imx6.mk


                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

                #wpa_supplicant control socket for android wifi.c (android private socket)

                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


                    setprop wifi.interface wlan0

                    setprop wlan.driver.status "ok"

                   #setprop wifi.ap.interface wlan0


                #and also remove this lines:

                #    mkdir /data/system/wpa_supplicant 0771 wifi wifi

                #    chmod 0771 /data/system/wpa_supplicant

                #    symlink /data/misc/wifi/wpa_supplicant /data/system/wpa_supplicant


                you can read it in that blog link, about unix/android standard socket setup.



                vim out/target/product/{yourboard}/root/init.freescale.rc

                or/and

                vim device/fsl/{yourboard}/init.rc


                #this is the only supplicant service and dhcpcd service for wifi that we use:

                service rtw_suppl /system/bin/wpa_supplicant -dd -iwlan0 -Dnl80211 \

                    -c/data/misc/wifi/wpa_supplicant.conf

                    socket wpa_wlan0 dgram 660 wifi wifi

                    class main

                    disabled

                    oneshot



                service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL

                    class main

                    disabled

                    oneshot


                service iprenew_wlan0 /system/bin/dhcpcd -n

                    class main

                    disabled

                    oneshot



                To keep it clean (it doesnt effect wifi):

                vim device/fsl/imx6/imx6.mk


                PRODUCT_PACKAGES += \

                       rtw_suppl               \



                We needed to make a little change in wifi_realtek.c since our jb is 4.3:


                vim hardware/realtek/wlan/libhardware_legacy/wifi/wifi_realtek.c

                int wifi_start_supplicant(int p2p_supported)

                ..

                    wifi_stop_supplicant(p2p_supported);

                ….


                int wifi_stop_supplicant(int p2p_supported){

                    char supp_status[PROPERTY_VALUE_MAX] = {'\0'};

                    int count = 50; /* wait at most 5 seconds for completion */


                    if (p2p_supported) {

                        property_get("wifi.supplicant", supplicant_name, P2P_SUPPLICANT_NAME);

                        snprintf(supplicant_prop_name, PROPERTY_KEY_MAX, P2P_PROP_NAME, supplicant_name);

                    } else {

                        property_get("wifi.supplicant", supplicant_name, SUPPLICANT_NAME);

                        snprintf(supplicant_prop_name, PROPERTY_KEY_MAX, SUPP_PROP_NAME, supplicant_name);

                    }



                Our problem was wrong supplicant name in prop setup. And, when wifi starts it first stops supplicant, and it wasn’t able to transfer that info through system. It was quite fun tracking this problem.


                vim ./frameworks/base/wifi/java/android/net/wifi/WifiStateMachine.java

                mWifiNative.killSupplicant(mP2pSupported);

                if(mWifiNative.startSupplicant(mP2pSupported)) {

                                            setWifiState(WIFI_STATE_ENABLING);

                                            if (DBG) log("Supplicant start successful");

                                            mWifiMonitor.startMonitoring();

                                            transitionTo(mSupplicantStartingState);

                                        } else {

                                            loge("Failed to start supplicant!!");

                                        }



                Here are more info:


                root@{yourdevice}:/ # cat /data/misc/wifi/wpa_supplicant.conf

                ctrl_interface=wlan0

                update_config=1

                device_name={yourdevice}

                manufacturer=Freescale

                model_name={YOURDEVICE}

                model_number={YOURDEVICE}

                serial_number=

                device_type=10-0050F204-5

                config_methods=physical_display virtual_push_button


                network={

                        ssid="XXXXX"

                        key_mgmt=NONE

                        priority=1

                }



                and it started with:

                root@{yourdevice}:/ # cat system/etc/wifi/wpa_supplicant.conf

                update_config=1

                ctrl_interface=wlan0

                eapol_version=1

                ap_scan=1

                fast_reauth=1



                permissions:

                root@{yourdevice}:/ # ls -l /data/misc/wifi

                -rw-rw---- system   wifi           21 2014-05-27 12:39 entropy.bin

                drwxrwx--- wifi     wifi              2014-05-27 12:39 sockets

                -rw------- system   system         33 2014-05-27 12:39 softap.conf

                -rw-rw---- wifi     wifi          272 2014-05-27 12:39 wpa_supplicant.conf


                root@{yourboard}:/ # ls -l /data/misc/

                drwxr-s--- system   shell             2014-05-27 12:39 adb

                drwxrwx--- bluetooth net_bt_stack          2014-05-27 12:39 bluedroid

                drwxrwx--- system   system            2014-05-27 12:39 bluetooth

                drwxrwx--- dhcp     dhcp              2014-05-27 12:39 dhcp

                drwxrwx--x system   system            2014-05-27 12:39 keychain

                drwx------ keystore keystore          2014-05-27 12:39 keystore

                drwx------ media    media             2014-05-27 12:39 media

                drwxrwx--- system   radio             2014-05-27 12:39 radio

                drwxrwx--- system   radio             2014-05-27 12:39 sms

                drwx------ system   system            2014-05-27 12:39 systemkeys

                drwxrwx--- system   vpn               2014-05-27 12:39 vpn

                drwxrwx--- wifi     wifi              2014-05-27 12:39 wifi

                drwxrwxr-x system   system            2014-05-27 12:39 zoneinfo


                root@{yourboard}:/ # ls -l /system/etc/wifi

                -rw-rw---- wifi     wifi           77 2014-05-27 12:39 wpa_supplicant.conf



                root@{yourboard}:/ # ps | grep wpa

                wifi      2555  1     3104   1876  c0103edc 401a4448 S /system/bin/wpa_supplicant



                root@{yourboard}:/ # cat system/etc/permissions/platform.xml | grep -i wifi

                    <permission name="android.permission.ACCESS_WIFI_STATE" >

                        <group gid="wifi" />

                    <permission name="android.permission.CHANGE_WIFI_STATE" >

                        <group gid="wifi" />

                    <permission name="android.permission.WIFI" >

                        <group gid="wifi" />




                root@{yourboard}:/ # cat system/etc/permissions/required_hardware.xml | grep wifi

                    <feature name="android.hardware.wifi" />




                root@{yourboard}:/ # getprop | grep  wifi

                [net.tcp.buffersize.wifi]: [524288,1048576,2097152,262144,524288,1048576]

                [ro.wifi.channels]: []

                [wifi.interface]: [wlan0]


                root@{yourboard}:/ # getprop | grep  wlan

                [dhcp.wlan0.dns1]: [192.168.1.1]

                [dhcp.wlan0.dns2]: []

                [dhcp.wlan0.dns3]: []

                [dhcp.wlan0.dns4]: []

                [dhcp.wlan0.domain]: []

                [dhcp.wlan0.gateway]: [192.168.1.1]

                [dhcp.wlan0.ipaddress]: [192.168.1.118]

                [dhcp.wlan0.leasetime]: [86400]

                [dhcp.wlan0.mask]: [255.255.255.0]

                [dhcp.wlan0.pid]: [2689]

                [dhcp.wlan0.reason]: [REBOOT]

                [dhcp.wlan0.result]: [ok]

                [dhcp.wlan0.server]: [192.168.1.1]

                [dhcp.wlan0.vendorInfo]: []

                [init.svc.dhcpcd_wlan0]: [running]

                [wifi.interface]: [wlan0]

                [wlan.driver.status]: [ok]

                [wlan.interface]: [wlan0]



                root@{yourboard}:/ # getprop | grep  suppl

                [init.svc.rtw_suppl]: [running]



                root@{yourboard}:/ # cat /sys/kernel/debug/usb/devices

                 

                T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0

                D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

                P:  Vendor=0bda ProdID=8176 Rev= 2.00

                S:  Manufacturer=Realtek

                S:  Product=802.11n WLAN Adapter

                S:  SerialNumber=00e04c000001

                C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA

                I:* If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=ff Prot=ff Driver=rtl8192cu

                E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

                E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

                E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

                E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=125us

                 


                root@{yourboard}:/ # cat /sys/bus/usb/devices/2-1/product

                802.11n WLAN Adapter



                Useful commands:


                disable wifi:

                root@{yourboard}:/ # svc wifi disable

                enable wifi:

                root@{yourboard}:/ # svc wifi enable



                open wifi settings panel:

                root@{yourboard}:/ # am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings


                manually starting supplicant with debug:

                root@{yourboard}:/ # wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd -B


                root@{yourboard}:/ # netcfg wlan0 up/down/dhcp


                root@{yourboard}:/ # wpa_cli

                status

                bssid=20:aa:4b:1b:a1:7c

                ssid=ECTEST

                id=0

                mode=station

                pairwise_cipher=NONE

                group_cipher=NONE

                key_mgmt=NONE

                wpa_state=COMPLETED

                ip_address=192.168.1.118

                p2p_device_address=44:34:4c:8b:f2:10

                address=44:34:4c:8b:f2:10

                <3>CTRL-EVENT-STATE-CHANGE id=0 state=9 BSSID=20:aa:4b:1b:a1:7c SSID=ECTEST

                <3>CTRL-EVENT-CONNECTED - connection to 20:aa:4b:1b:a1:7c completed (reauth) [id=0 id_str=]

                scan

                cfg80211_rtw_scan(wlan0)

                OK

                > no packet in tx packet buffer (0)

                survey done event(14) band:0 for wlan0

                <3>CTRL-EVENT-SCAN-RESULTS

                scan_results

                bssid / frequency / signal level / flags / ssid

                20:aa:1b:1b:a1:7c       2437    -74     [WPS][ESS]      ECTEST

                00:1d:3e:bd:10:05       2457    -85     [WPA-PSK-TKIP][ESS]     net02

                68:7f:74:03:c6:be       2432    -59     [ESS]   \x00\x00\x00\x00

                c8:23:73:3f:05:71       2462    -66     [ESS]   Nick's router. Hands off.



                root@{yourboard}:/ # ifconfig wlan0

                wlan0: ip 192.168.1.118 mask 255.255.255.0 flags [up broadcast running multicast]



                root@{yourboard}:/ # dhcpcd wlan0

                dhcpcd[3373]: version 5.5.6 starting

                dhcpcd[3373]: wlan0: rebinding lease of 192.168.1.118

                dhcpcd[3373]: wlan0: acknowledged 192.168.1.118 from 192.168.1.1

                dhcpcd[3373]: wlan0: leased 192.168.1.118 for 86400 seconds

                dhcpcd[3373]: forked to background, child pid 3405

                 

                root@{yourboard}:/ # netcfg

                lo       UP                                   127.0.0.1/8   0x00000049 00:00:00:00:00:00

                eth0     UP                               192.168.0.152/24  0x00001043 24:80:00:00:00:00

                tunl0    DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00

                sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00

                ip6tnl0  DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00

                wlan0    UP                               192.168.1.118/24  0x00001043 44:34:4c:8b:f2:10

                wlan1    DOWN                                   0.0.0.0/0   0x00001002 46:34:4c:8b:f2:10

                 

                 

                Good luck with it and please let me know if you need more info.




                problem/solution:



                if you get this problem:

                E/wpa_supplicant( 3159): Could not set interface wlan0 flags (UP): Unknown error 132


                solution:

                missing rfkill, error 132 means "operation not possible due to RFkill"

                vim kernel_imx/arch/arm/mach-mx6/board-mx6sl_{yourboard}.c

                static int mx6sl_shd_bt_power_change(int status){return 0;}

                static struct platform_device mxc_bt_rfkill = {

                  .name = "mxc_bt_rfkill",

                };

                static struct imx_bt_rfkill_platform_data mxc_bt_rfkill_data = {

                  .power_change = mx6sl_shd_bt_power_change,

                };


                /* init function  */

                static void __init {yourboard}_init(void){

                     ...

                     mxc_register_device(&mxc_bt_rfkill, &mxc_bt_rfkill_data);

                }


                problem:

                E/WifiHW ( 2488): Unable to open connection to supplicant on "/data/system/wpa_supplicant/wlan0": No such file or directory

                solution:

                setup correctly in init.rc and init.freescale.rc scripts wifi and wpa_supplicant permissions and services.



                • Re: wifi binding on imx6sl evk based board
                  Ranganath tmLevel 1

                  Hi All,

                   

                  I am working to bring up RealTeck USB wifi dongel on android 4.3 and kernel 3.0.35  below are steps I followed :

                   

                  1) I am building  drivers as modules, copying them to  /system/lib/modules/ and after that I added below lines in init.rc before wpa_supplicant service start.

                      insmod /system/lib/modules/cfg80211.ko

                      insmod /system/lib/modules/mac80211.ko

                      insmod /system/lib/modules/rtlwifi.ko

                      insmod /system/lib/modules/rtl8192c-common.ko

                      insmod /system/lib/modules/rtl8192cu.ko

                   

                  2)wlan0 interface is creating successfully in /sys/class/net/wlan0.

                   

                  3) After that I try to run below commands :


                  root@sabresd_6dq:wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd -B ---> success


                  root@sabresd_6dq: wpa_cli ----> Able to scan the devices form command line .


                  But if I try to do from application I am getting below errors:


                  E/WifiHW  ( 2514): Unable to open connection to supplicant on "/data/system/wpa_supplicant/wlan0": Connection refused

                  D/BluetoothAdapter( 2755): 1101306992: getState() :  mService = null. Returning STATE_OFF

                  I/wpa_supplicant( 3163): Successfully initialized wpa_supplicant

                  I/wpa_supplicant( 3163): rfkill: Cannot open RFKILL control device

                  E/wpa_supplicant( 3163): nl80211: Could not configure driver to use managed mode

                  E/wpa_supplicant( 3163): Could not read interface p2p0 flags: No such device

                  E/wpa_supplicant( 3163): p2p0: Failed to initialize driver interface

                   

                  kindly help me to solve issues.

                   

                  Thanks In Advance,

                  Ranganath TM

                   




                  • Re: wifi binding on imx6sl evk based board
                    Zoran LukicLevel 1

                    Hello Ranganath,


                    You need to run wpa_supplicant as service (in init.rc or init.xxxxx.rc script).


                    Do you need rf kill ?

                    We removed it completely from our android system.



                    BR,

                    Zoran



                    • Re: wifi binding on imx6sl evk based board
                      Ranganath tmLevel 1

                      Hi Zoran,

                       

                      Thanks for reply,

                       

                      I am running wpa_supplicant in init.freescale.rc and at boot time I am getting below error :

                       

                      D/NetworkManagementService( 2501): enabling bandwidth control

                      I/wpa_supplicant( 2591): Successfully initialized wpa_supplicant

                      I/wpa_supplicant( 2591): rfkill: Cannot open RFKILL control device

                      E/wpa_supplicant( 2591): nl80211: Could not configure driver to use managed mode

                      E/wpa_supplicant( 2591): Could not read interface p2p0 flags: No such device

                      E/wpa_supplicant( 2591): p2p0: Failed to initialize driver interface

                      E/WifiStateMachine( 2501): Failed to start supplicant!

                      D/WifiStateMachine( 2501): handleMessage: X

                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131144

                      D/WifiStateMachine( 2501): processMsg: InitialState

                      D/WifiStateMachine( 2501): processMsg: DefaultState

                      D/WifiStateMachine( 2501): handleMessage: X

                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131085

                      D/WifiStateMachine( 2501): processMsg: InitialState

                      D/WifiStateMachine( 2501): processMsg: DefaultState

                      D/WifiStateMachine( 2501): handleMessage: X

                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131149

                      D/WifiStateMachine( 2501): processMsg: InitialState

                      D/WifiStateMachine( 2501): processMsg: DefaultState

                      D/WifiStateMachine( 2501): setSuspendOptimizations: 2 true

                      D/WifiStateMachine( 2501): mSuspendOptNeedsDisabled 0

                      D/WifiStateMachine( 2501): handleMessage: X

                       

                      Note : When I run ps | grep wpa : result is nothing and wpa_supplicant is not running.

                      But it works fine for me from command line

                       

                      Thanks And Regards,

                      Ranganath TM

                      • Re: wifi binding on imx6sl evk based board
                        Zoran LukicLevel 1

                        Are the service name and the name in the interface file same?

                         

                        vim hardware/realtek/wlan/libhardware_legacy/wifi/wifi_realtek.c

                        static const char SUPPLICANT_NAME[]     = "rtw_suppl"; /* without p2p concurrent */

                         

                        and

                         

                        in init.rc or init.xxxxx.rc script

                        service rtw_suppl /system/bin/wpa_supplicant -dd -iwlan0 -Dnl80211 \

                            -c/data/misc/wifi/wpa_supplicant.conf

                            socket wpa_wlan0 dgram 660 wifi wifi

                            class main

                            disabled

                            oneshot

                         

                        You could add ALOGE to wifi_start_supplicant function, to get more debug data.

                         

                        p2p is another service and interface.

                         

                        Are the modules loaded ok, after booting?

                        Is the insert mod in the right place (you have on early-init, on boot, on fs), so maybe to make it as part of kernel, not modules, for start, to eliminate that.

                         

                        BR,

                        Zoran

                        • Re: wifi binding on imx6sl evk based board
                          Ranganath tmLevel 1

                          Hi Zoran,

                           

                          Thanks for reply,

                           

                          1) Yes services names are same inside init.freescale.rc and wifi_realtek.c, kindly find below :

                           

                          static const char P2P_SUPPLICANT_NAME_REALTEK[] = "rtw_suppl_con"; /* p2p concurrent */

                           

                          service rtw_suppl_con /system/bin/rtl_wpa_supplicant \

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

                              class late_start

                              socket wpa_wlan0 dgram 660 wifi wifi

                              disabled

                              oneshot

                           

                          2) I added logs inside function wifi_start_supplicant function and it pass below condition which give confidence supplicant is running,

                           

                          if (pi != NULL) {

                                      __system_property_read(pi, NULL, supp_status);

                                      if (strcmp(supp_status, "running") == 0) {

                                          ALOGE("TMR supplicant running success");

                                          return 0;

                                      }

                           

                          3) Yes the modules are loading after boot in init.rc. Below is the result of lsmod,

                           

                          rtl8192cu 91079 0 - Live 0x00000000

                          rtl8192c_common 54246 1 rtl8192cu, Live 0x00000000

                          rtlwifi 88904 1 rtl8192cu, Live 0x00000000

                          mac80211 164669 3 rtl8192cu,rtl8192c_common,rtlwifi, Live 0x00000000

                          cfg80211 149736 2 rtlwifi,mac80211, Live 0x00000000

                           

                          4)But it fails in wifi_connect_on_socket_path function inside condition

                           

                          ctrl_conn[index] = wpa_ctrl_open(path1);

                              if (ctrl_conn[index] == NULL) {

                                  ALOGE("TMR wifi_connect_on_socket_path inside if");

                                  ALOGE("Unable to open connection to supplicant on \"%s\": %s",

                                          path, strerror(errno));

                                  return -1;

                              }    

                           

                          By throwing error E/WifiHW  ( 2514): Unable to open connection to supplicant on "/data/system/wpa_supplicant/wlan0": Connection refused.

                          please help me to resolve issue.

                           

                          Thanks In Advance,

                          Ranganath TM

                          • Re: wifi binding on imx6sl evk based board
                            Zoran LukicLevel 1

                            This is P2P supplicant.

                            static const char P2P_SUPPLICANT_NAME_REALTEK[] = "rtw_suppl_con"; /* p2p concurrent */

                            or

                            static const char SUPPLICANT_NAME[] = "rtw_suppl"; /* without p2p concurrent */

                             

                            Do you have rtw_suppl running on system?

                             

                            I only have primary interface, not p2p (we dont need it)

                            root@shd_6sl:/ # ps | grep supp

                            wifi      2915  1     3108   1856  c00fdb8c 40191448 S /system/bin/wpa_supplicant

                            root@shd_6sl:/ # getprop |grep suppl

                            [init.svc.rtw_suppl]: [running]

                             

                            Do you have this file in android fs:

                            /data/system/wpa_supplicant/wlan0 ?

                            I dont think this is correct path.

                             

                            What is your wpa conf file, after you start wifi?

                            Mine is:

                            root@shd_6sl:/ # cat /data/misc/wifi/wpa_supplicant.conf

                            update_config=1

                            ctrl_interface=wlan0

                            eapol_version=1

                            ap_scan=1

                            fast_reauth=1

                             

                             

                            /* PRIMARY refers to the connection on the primary interface                             

                            * SECONDARY refers to an optional connection on a p2p interface */

                             

                             

                            Did you made modification so that jni (android_net_wifi_Wifi.cpp)  can interface this driver?

                            vim frameworks/base/core/jni/android_net_wifi_Wifi.cpp

                            static jboolean android_net_wifi_killSupplicant(JNIEnv* env, jobject, jboolean p2pSupported)

                            {                        

                              return (jboolean)(::wifi_stop_supplicant(p2pSupported) == 0);

                            }

                             

                            In 4.3 wifi_stop_supplicant function has argument:

                            int wifi_stop_supplicant(int p2p_supported);

                             

                            also we have to add this (and some debug log):

                            vim hardware/realtek/wlan/libhardware_legacy/wifi/wifi_realtek.c

                            int wifi_stop_supplicant(int p2p_supported) {

                            .......

                                if (p2p_supported) {

                                    property_get("wifi.supplicant", supplicant_name, P2P_SUPPLICANT_NAME);

                                    snprintf(supplicant_prop_name, PROPERTY_KEY_MAX, P2P_PROP_NAME, supplicant_name);

                                      ALOGE("p2p_supported wifi.supplicant=%s\n",supplicant_name);

                                } else {

                                    property_get("wifi.supplicant", supplicant_name, SUPPLICANT_NAME);

                                    snprintf(supplicant_prop_name, PROPERTY_KEY_MAX, SUPP_PROP_NAME, supplicant_name);

                                      ALOGE("wifi.supplicant=%s\n",supplicant_name);

                                }

                             

                             

                            If you do not use modules for rtl wifi, remember to add return 0; in wifi_realtek.c functions:

                            insmod,rmmod,load_driver,wifi_load_driver,unload_driver,wifi_unload_driver.

                             

                             

                            BR,

                            Zoran

                            • Re: wifi binding on imx6sl evk based board
                              Ranganath tmLevel 1

                              Hi Zoran,

                               

                              sorry for late reply,

                               

                              when I run below command I am getting Permission denied issue where to change permission,

                               

                              root@sabresd_6dq:/data/system # wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd -B

                              rtl8192cu: MAC auto ON okay!

                              rtl8192cu: Tx queue select: 0x05

                              rtl8192c: Loading firmware file rtlwifi/rtl8192cufw.bin

                              ADDRCONF(NETDEV_UP): wlan0: link is not ready

                              mkdir[ctrl_interface]: Permission denied


                              I tried my mounting /system and /data partition as rw in fstab.freescale

                               

                              Thanks And Regards,

                              Ranganath TM

                              • Re: wifi binding on imx6sl evk based board
                                Zoran LukicLevel 1

                                Hi Ranganath,

                                 

                                In init.rc file, you have to setup correct permission, group and owner:

                                 

                                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

                                #wpa_supplicant control socket for android wifi.c (android private socket)

                                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

                                 

                                 

                                Check this two folders and files in them:

                                /system/etc/wifi

                                and

                                /data/misc/wifi

                                 

                                BR,

                                Zoran

                                • Re: wifi binding on imx6sl evk based board
                                  Ranganath tmLevel 1

                                  Hi Zoran,

                                   

                                  I executed the permissions give by you in command line, and below are the permissions of

                                   

                                  ls -l /system/etc/wifi/                   

                                  -rw-rw---- wifi     wifi          132 2014-11-19 09:19 wpa_supplicant.conf

                                   

                                  ls -l /data/misc/wifi/                                                         <

                                  drwxrwx--- wifi     wifi              1970-01-01 00:00 sockets

                                  -rw------- system   system         33 1970-01-02 00:00 softap.conf

                                  drwxrwx--- wifi     wifi              1970-01-01 00:00 wpa_supplicant

                                  -rw-rw---- wifi     wifi          132 1970-01-02 00:01 wpa_supplicant.conf

                                   

                                   

                                  Thanks And Regards,

                                  Ranganath TM

                                • Re: wifi binding on imx6sl evk based board
                                  Ranganath tmLevel 1

                                  Hi Zoran,

                                   

                                  I am able to solve permission issue now wpa_supplicant is running in command line, but I fails when I try from settings app  below are logs:


                                  root@sabresd_6dq:/data/system/wpa_supplicant # logcat                         

                                  --------- beginning of /dev/log/system

                                  D/WifiService( 2515): setWifiEnabled: true pid=2835, uid=1000

                                  --------- beginning of /dev/log/main

                                  D/WifiStateMachine( 2515): handleMessage: E msg.what=131083

                                  D/WifiStateMachine( 2515): processMsg: InitialState

                                  E/WifiHW  ( 2515): the ret value form is_wifi_driver_loaded = 1

                                  E/WifiHW  ( 2515): the check condition inside wifi.c wifi_load_driver

                                  E/WifiStateMachine( 2515): trying to start supplicant

                                  D/SoftapController( 2184): Softap fwReload - Ok

                                  D/CommandListener( 2184): Setting iface cfg

                                  D/CommandListener( 2184): Trying to bring down wlan0

                                  E/WifiHW  ( 2515): inside wifi_stop_supplicant = init.svc.wpa_supplicant

                                  D/dalvikvm( 2515): GC_CONCURRENT freed 315K, 44% free 5272K/9408K, paused 3ms+3ms, total 42ms

                                  E/WifiHW  ( 2515): wifi_start_supplicant p2p=0

                                  E/WifiHW  ( 2515): Wi-Fi will ensure config file exist

                                  D/WifiHW  ( 2515): start supplicant cmd=wpa_supplicant

                                  E/WifiHW  ( 2515): TMR after start supplicant checking its status

                                  E/WifiHW  ( 2515): TMR supplicant name = init.svc.wpa_supplicant

                                  I/wpa_supplicant( 3297): Successfully initialized wpa_supplicant

                                  E/WifiHW  ( 2515): TMR after start supplicant checking its status

                                  E/WifiHW  ( 2515): TMR supplicant name = init.svc.wpa_supplicant

                                  E/WifiHW  ( 2515): TMR: supplicant stopped

                                  E/WifiStateMachine( 2515): Failed to start supplicant!

                                  D/WifiStateMachine( 2515): handleMessage: X

                                  D/WifiStateMachine( 2515): handleMessage: E msg.what=131144

                                  D/WifiStateMachine( 2515): processMsg: InitialState

                                  D/WifiStateMachine( 2515): processMsg: DefaultState

                                  D/WifiStateMachine( 2515): handleMessage: X

                                  D/WifiStateMachine( 2515): handleMessage: E msg.what=131085

                                  D/WifiStateMachine( 2515): processMsg: InitialState

                                  D/WifiStateMachine( 2515): processMsg: DefaultState

                                  D/WifiStateMachine( 2515): handleMessage: X

                                  D/WifiStateMachine( 2515): handleMessage: E msg.what=131149

                                  D/WifiStateMachine( 2515): processMsg: InitialState

                                  D/WifiStateMachine( 2515): processMsg: DefaultState

                                  D/WifiStateMachine( 2515): setSuspendOptimizations: 2 true

                                  D/WifiStateMachine( 2515): mSuspendOptNeedsDisabled 0

                                  D/WifiStateMachine( 2515): handleMessage: X

                                   

                                  Thanks And Regrads,

                                  Ranganath TM

                                   

                                  • Re: wifi binding on imx6sl evk based board
                                    Zoran LukicLevel 1

                                    Did you restart device, always try to turn wifi on from Settings after reboot.

                                     

                                    Could you cat wpa_supplicant.conf file in /system/etc/wifi/ and also in /data/misc/wifi, they seamed to be same size, but a little too big :-) ?

                                    Here are mine:

                                    root@shd_6sl:/ # cat /data/misc/wifi/wpa_supplicant.conf

                                    update_config=1

                                    ctrl_interface=wlan0

                                    eapol_version=1

                                    ap_scan=1

                                    fast_reauth=1

                                     

                                    same as in

                                    root@shd_6sl:/ # cat /system/etc/wifi/wpa_supplicant.conf

                                     

                                     

                                     

                                    BR,

                                    Zoran

                                    • Re: wifi binding on imx6sl evk based board
                                      Ranganath tmLevel 1

                                      Hi Zoran,

                                       

                                      I did following experiment first I turned on wpa_supplicant in command line and after the I typed svc_wifi_enable, by below experiment I am able to see wifi device list in settings app,


                                      cat system/etc/permissions/platform.xml | grep -i wifi  ---------> I am not able find any thing in my system

                                       

                                      Below are my config files:

                                      cat  /data/misc/wifi/wpa_supplicant.conf             

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

                                      update_config=1

                                      device_name=sabresd_6dq

                                      manufacturer=Freescale

                                      model_name=SABRESD-MX6DQ

                                      model_number=SABRESD-MX6DQ

                                      serial_number=

                                      device_type=10-0050F204-5

                                      config_methods=physical_display virtual_push_button

                                      p2p_listen_reg_class=81

                                      p2p_listen_channel=11

                                      persistent_reconnect=1

                                       

                                       

                                      network={

                                              ssid="XT1068 2883"

                                              key_mgmt=NONE

                                              priority=5

                                      }

                                       

                                       

                                      network={

                                              ssid="HemanthAP"

                                              psk="medconnect"

                                              key_mgmt=WPA-PSK

                                              priority=6

                                              disabled=1

                                      }

                                       

                                      cat /system/etc/wifi/wpa_supplicant.conf                                                  <

                                      ##### wpa_supplicant configuration file template #####

                                      update_config=1

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

                                      eapol_version=1

                                      ap_scan=1

                                      fast_reauth=1

                                      config_methods=virtual_push_button physical_display keypad

                                      p2p_listen_channel=11

                                      p2p_listen_reg_class=81

                                      persistent_reconnect=1

                                      root@sabresd_6dq:/ #

                                       

                                      Thanks And Regrads,

                                      Ranganath TM

                                      • Re: wifi binding on imx6sl evk based board
                                        Zoran LukicLevel 1

                                        Hi Ranganath,

                                         

                                        So, it works now?

                                         

                                         

                                        BR,

                                        Zoran

                                        • Re: wifi binding on imx6sl evk based board
                                          Ranganath tmLevel 1

                                          Hi Zoran,

                                           

                                          If I start wpa_supplicant and run svc wifi enable form command line its working, but it's not working form setting app.

                                           

                                          And I am not able to find any thing in  command line by typing below command,

                                           

                                          cat system/etc/permissions/platform.xml | grep -i wifi 


                                          Thanks And Regards,

                                          Ranganath TM

                                          • Re: wifi binding on imx6sl evk based board
                                            Zoran LukicLevel 1

                                            So, there is a problem with jni or some permissions.

                                             

                                            What is in the logcat?

                                             

                                            Do you have this:

                                            cat system/etc/permissions/required_hardware.xml | grep wifi

                                                <feature name="android.hardware.wifi" />

                                             

                                            there should be also android.hardware,wifi.direct or something like that. You could try it for now, without wifi.direct.

                                             

                                            Edit file

                                            vim ./frameworks/base/data/etc/platform.xml

                                            or directly in android /system/etc/permissions/platform.xml and add those lines

                                             

                                             

                                             

                                            BR,

                                            Zoran

                                            • Re: wifi binding on imx6sl evk based board
                                              Ranganath tmLevel 1

                                              Hi Zoran,

                                               

                                              I have android.hardware.wifi.xml which as the <feature name="android.hardware.wifi" /> and I tried by removing android.hardware.wifi.direct.xml, but the result is same the wpa_supplicant is not running. Below are errors:


                                              E/WifiHW  ( 2511): the ret value form is_wifi_driver_loaded = 1

                                              E/WifiStateMachine( 2511): trying to start supplicant

                                              D/SoftapController( 2195): Softap fwReload - Ok

                                              D/CommandListener( 2195): Setting iface cfg

                                              D/CommandListener( 2195): Trying to bring down wlan0

                                              E/WifiHW  ( 2511): wifi_start_supplicant p2p=0

                                              E/WifiHW  ( 2511): Wi-Fi will ensure config file exist

                                              D/WifiHW  ( 2511): start supplicant cmd=wpa_supplicant

                                              E/WifiHW  ( 2511): TMR:supplicant running success, sup_name=wpa_supplicant

                                              D/WifiStateMachine( 2511): setWifiState: enabling

                                              D/WifiStateMachine( 2511): Supplicant start successful

                                              E/WifiHW  ( 2511): TMR:wifi_connect_to_supplicant wlan0

                                              E/WifiHW  ( 2511): Unable to open connection to supplicant on "/data/system/wpa_supplicant/wlan0": No such file or directory

                                               

                                              Thanks And Regards,

                                              Ranganath TM

                                              • Re: wifi binding on imx6sl evk based board
                                                Zoran LukicLevel 1

                                                This means that android is working correctly:-).

                                                 

                                                As I said, couple messages before, wlan0 isnt in

                                                /data/system/wpa_supplicant

                                                 

                                                I am not sure that there is even that directory.

                                                 

                                                In your wpa_supplicant.conf file, you set path to interface directory, but that path doesnt exist, and of course wlan0 file isnt there.

                                                 

                                                Please try with wpa_supplicant.conf that I've sent you before.

                                                 

                                                 

                                                BR,

                                                Zoran

                                                • Re: wifi binding on imx6sl evk based board
                                                  Ranganath tmLevel 1

                                                  Hi Zoran,

                                                   

                                                  When I execute by copying content of wpa_supplicant.conf as specified by you, I am not able to lunch wpa_supplicant below are errors,

                                                   

                                                  rtl8192cu: MAC auto ON okay!

                                                  rtl8192cu: Tx queue select: 0x05

                                                  rtl8192c: Loading firmware file rtlwifi/rtl8192cufw.bin

                                                  ADDRCONF(NETDEV_UP): wlan0: link is not ready

                                                  mkdir[ctrl_interface]: Read-only file system

                                                   

                                                   

                                                  But if lunch wpa_supplicant in command, after that if I turn on my wiifi from settings app its working for me.

                                                   

                                                  Zoran Kindly let me know where all the wpa-supplicant will stopped in HAL layer and who will the status of update init.svc.wpa_supplicant.

                                                   

                                                  Thanks And Regards,

                                                  Ranganath TM 

                                                  • Re: wifi binding on imx6sl evk based board
                                                    Zoran LukicLevel 1

                                                    This is the problem:

                                                    mkdir[ctrl_interface]: Read-only file system

                                                     

                                                     

                                                    Could you pack this files/folders and send them to me. I will send you my email address in pm.

                                                     

                                                    out/target/product/{yourdevice}/system/etc/wifi/wpa_supplicant.conf

                                                    out/target/product/{yourdevice}/root//init.rc

                                                    out/target/product/{yourdevice}/root/init.{yourdevice}.rc

                                                    out/target/product/{yourboard}/system/etc/permissions

                                                    hardware/realtek

                                                    hardware/libhardware_legacy

                                                    external/wpa_supplicant_8

                                                    kernel_imx/arch/arm/configs/imx6s_{yourdevice}_android_defconfig

                                                    device/fsl/{yourdevice}/BoardConfig.mk

                                                    frameworks/base/wifi/java/android/net/wifi

                                                     

                                                    Please list all relevant folders/files to recheck permissions!

                                                     

                                                    It is irrelevant, it just reports if process is running. Its a way to get info between layers in android.

                                                     

                                                    BR,

                                                    Zoran

                                                    • Re: wifi binding on imx6sl evk based board
                                                      Ranganath tmLevel 1

                                                      Hi Zoran,

                                                      Thanks For reply,

                                                       

                                                      Now I am able scan all wifi node from setting app and wpa_supplicant is starting successfully, but it fails to connect.

                                                       

                                                      Below are the logs,

                                                       

                                                      E/WifiConfigStore( 2511): Error parsing configurationjava.io.FileNotFoundException: /data/misc/wifi/ipconfig.txt: open failed: ENOENT (No such

                                                      file or directory

                                                       

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131131

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=151553

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      W/audio_hw_primary( 2178): card 0, port 0 device 0x400

                                                      W/audio_hw_primary( 2178): rate 44100, channel 2 period_size 0x300

                                                      I/wpa_supplicant( 3054): wlan0: SME: Trying to authenticate with 80:6c:1b:de:9b:67 (SSID='XT1068 2883' freq=2437 MHz)

                                                      D/WifiStateMachine( 2501): transitionTo: destState=DisconnectingState

                                                      D/WifiStateMachine( 2501): handleMessage: new destination call exit/enter

                                                      D/WifiStateMachine( 2501): setupTempStateStackWithStatesToEnter: X mTempStateStackCount=1,curStateInfo: state=ConnectModeState,active=true,pare

                                                      nt=DriverStartedState

                                                      D/WifiStateMachine( 2501): invokeExitMethods: DisconnectedState

                                                      D/WifiStateMachine( 2501): moveTempStackToStateStack: i=0,j=4

                                                      D/WifiStateMachine( 2501): moveTempStackToStateStack: X mStateStackTop=4,startingIndex=4,Top=DisconnectingState

                                                      D/WifiStateMachine( 2501): invokeEnterMethods: DisconnectingState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147462

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectingState

                                                      D/WifiStateMachine( 2501): deferMessage: msg=147462

                                                      D/WifiStateMachine( 2501): Stopping DHCP and clearing IP

                                                      D/CommandListener( 2173): Clearing all IP addresses on wlan0

                                                      D/WifiStateMachine( 2501): setDetailed state, old =IDLE and new state=DISCONNECTED

                                                      D/WifiStateMachine( 2501): transitionTo: destState=DisconnectedState

                                                      D/WifiStateMachine( 2501): handleMessage: new destination call exit/enter

                                                      D/WifiStateMachine( 2501): setupTempStateStackWithStatesToEnter: X mTempStateStackCount=1,curStateInfo: state=ConnectModeState,active=true,pare

                                                      nt=DriverStartedState

                                                      D/WifiStateMachine( 2501): invokeExitMethods: DisconnectingState

                                                      D/WifiStateMachine( 2501): moveTempStackToStateStack: i=0,j=4

                                                      D/WifiStateMachine( 2501): moveTempStackToStateStack: X mStateStackTop=4,startingIndex=4,Top=DisconnectedState

                                                      D/WifiStateMachine( 2501): invokeEnterMethods: DisconnectedState

                                                      D/WifiStateMachine( 2501): moveDeferredMessageAtFrontOfQueue; what=147462

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147462

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedState

                                                      D/WifiStateMachine( 2501): setDetailed state, old =DISCONNECTED and new state=SCANNING

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131131

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147462

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedState

                                                      D/WifiStateMachine( 2501): setDetailed state, old =SCANNING and new state=CONNECTING

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/ConnectivityService( 2501): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED

                                                      D/ConnectivityService( 2501): Attempting to switch to mobile

                                                      D/ConnectivityService( 2501): Attempting to switch to BLUETOOTH_TETHER

                                                      D/ConnectivityService( 2501): Attempting to switch to ETHERNET

                                                      D/Nat464Xlat( 2501): requiresClat: netType=1, hasIPv4Address=false

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131131

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147461

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): processMsg: DriverStartedState

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStartedState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131131

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501):wlan0: authenticate with 80:6c:1b:de:9b:67 (try 1)

                                                      handleMessage: X

                                                      wlan0: authenticated

                                                      wlan0: associate with 80:6c:1b:de:9b:67 (try 1)

                                                      I/wpa_supplicant( 3054): wlan0: Trying to associate with 80:6c:1b:de:9b:67 (SSID='XT1068 2883' freq=2437 MHz)

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147462

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedStwlan0: RX AssocResp from 80:6c:1b:de:9b:67 (capab=0x8421 status=0 aid=3)

                                                      ate

                                                      D/WifiStateMachine( 2501): swlan0: associated

                                                      etDetailed state, old =CONNECTING and new state=CONNECTING

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/dalvikvm( 2754): GC_CONCURRENT freed 329K, 10% free 3663K/4044K, paused 3ms+5ms, total 26ms

                                                      ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

                                                      I/wpa_supplicant( 3054): wlan0: Associated with 80:6c:1b:de:9b:67

                                                      I/wpa_supplicant( 3054): wlan0: CTRL-EVENT-CONNECTED - Connection to 80:6c:1b:de:9b:67 completed (auth) [id=0 id_str=]

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147462

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedState

                                                      D/WifiStateMachine( 2501): setDetailed state, old =CONNECTING and new state=CONNECTING

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147459

                                                      D/WifiStateMachine( 2501): processMsg: DisconnectedSwlan0: deauthenticating from 80:6c:1b:de:9b:67 by local choice (reason=3)

                                                      tate

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): Network connection established

                                                      D/WifiStateMachine( 2501): setDetailed state, old =CONNECTING and new state=OBTAINING_IPADDR

                                                      D/WifiStateMachine( 2501): transitionTo: destState=ObtainingIpState

                                                      D/WifiStateMachine( 2501): handleMessage: new destination call exit/enter

                                                      D/WifiStateMachine( 2501): setupTempStateStackWithStatesToEnter: X mTempStateStackCount=2,curStateInfo: state=ConnectModeState,active=true,pare

                                                      nt=DriverStartedState

                                                      D/WifiStateMachine( 2501): invokeExitMethods: DisconnectedState

                                                      D/WifiStateMachine( 2501): moveTempStackToStateStack: i=1,j=4

                                                      D/WifiStateMachine( 2501): moveTempStackToStateStack: i=0,j=5

                                                      D/WifiStateMachine( 2501): moveTempStackToStateStack: X mStateStackTop=5,startingIndex=4,Top=ObtainingIpState

                                                      D/WifiStateMachine( 2501): invokeEnterMethods: L2ConnectedState

                                                      D/WifiStateMachine( 2501): invokeEnterMethods: ObtainingIpState

                                                      D/Tethering( 2501): sendTetherStateChangedBroadcast 1, 0, 0

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147462

                                                      D/WifiStateMachine( 2501): processMsg: ObtainingIpState

                                                      D/Wcfg80211: Calling CRDA for country: US

                                                      ifiStateMachine( 2501): ObtainingIpState{ what=147462 when=-8ms obj=android.net.wifi.StateChangeResult@42090f98 }

                                                      D/WifiStateMachine( 2501): processMsg: L2ConnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131155

                                                      D/WifiStateMachine( 2501): processMsg: ObtainingIpState

                                                      D/WifiStateMachine( 2501): ObtainingIpState{ what=131155 when=-6ms arg1=1 }

                                                      D/WifiStateMachine( 2501): processMsg: L2ConnectedState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131101

                                                      D/WifiStateMachine( 2501): processMsg: ObtainingIpState

                                                      D/WifiStateMachine( 2501): ObtainingIpState{ what=131101 when=-7ms obj=android.net.wifi.WifiStateMachine$TetherStateChange@42096700 }

                                                      D/WifiStateMachine( 2501): processMsg: L2ConnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): processMsg: DriverStartedState

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStartedState

                                                      D/WifiStateMachine( 2501): processMsg: DefaultState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=196612

                                                      D/WifiStateMachine( 2501): processMsg: ObtainingIpState

                                                      D/WifiStateMachine( 2501): ObtainingIpState{ what=196612 when=-7ms }

                                                      D/WifiStateMachine( 2501): processMsg: L2ConnectedState

                                                      E/wpa_supplicant( 3054): wpa_driver_nl80211_driver_cmd: failed to issue private commands

                                                      I/wpa_supplicant( 3054): wlan0: CTRL-EVENT-DRIVER-STATE HANGED

                                                      D/WifiStateMachine( 2501): setSuspendOptimizationsNative: 1 false

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131131

                                                      D/WifiStateMachine( 2501): processMsg: ObtainingIpState

                                                      D/WifiStateMachine( 2501): ObtainingIpState{ what=131131 when=-5ms }

                                                      D/WifiStateMachine( 2501): processMsg: L2ConnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147468

                                                      D/WifiStateMachine( 2501): processMsg: ObtainingIpState

                                                      D/WifiStateMachine( 2501): ObtainingIpState{ what=147468 when=-4ms }

                                                      D/WifiStateMachine( 2501): processMsg: L2ConnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): processMsg: DriverStartedState

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStartedState

                                                      D/WifiStateMachine( 2501): processMsg: DefaultState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131084

                                                      D/WifiStateMachine( 2501): processMsg: ObtainingIpState

                                                      D/WifiStateMachine( 2501): ObtainingIpState{ what=131084 when=0 }

                                                      D/WifiStateMachine( 2501): processMsg: L2ConnectedState

                                                      D/WifiStateMachine( 2501): processMsg: ConnectModeState

                                                      D/WifiStateMachine( 2501): processMsg: DriverStartedState

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStartedState

                                                      D/WifiStateMachine( 2501): transitionTo: destState=SupplicantStoppingState

                                                      D/WifiStateMachine( 2501): handleMessage: new destination call exit/enter

                                                      D/WifiStateMachine( 2501): setupTempStateStackWithStatesToEnter: X mTempStateStackCount=1,curStateInfo: state=DefaultState,active=true,parent=n

                                                      ull

                                                      D/WifiStateMachine( 2501): invokeExitMethods: ObtainingIpState

                                                      D/WifiStateMachine( 2501): invokeExitMethods: L2ConnectedState

                                                      D/WifiStateMachine( 2501): invokeExitMethods: ConnectModeState

                                                      D/WifiStateMachine( 2501): invokeExitMethods: DriverStartedState

                                                      D/WifiStateMachine( 2501): invokeExitMethods: SupplicantStartedState

                                                      D/WifiStateMachine( 2501): moveTempStackToStateStack: i=0,j=1

                                                      D/WifiStateMachine( 2501): moveTempStackToStateStack: X mStateStackTop=1,startingIndex=1,Top=SupplicantStoppingState

                                                      D/WifiStateMachine( 2501): invokeEnterMethods: SupplicantStoppingState

                                                      D/WifiStateMachine( 2501): Stopping DHCP and clearing IP

                                                      D/WifiStateMachine( 2501): setSuspendOptimizationsNative: 1 true

                                                      E/wpa_supplicant( 3054): wpa_driver_nl80211_driver_cmd: failed to issue private commands

                                                      D/CommandListener( 2173): Clearing all IP addresses on wlan0

                                                      D/WifiStateMachine( 2501): setDetailed state, old =OBTAINING_IPADDR and new state=DISCONNECTED

                                                      D/WifiStateMachine( 2501): stopping supplicant

                                                      D/WifiStateMachine( 2501): setWifiState: disabling

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131083

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStoppingState

                                                      D/WifiStateMachine( 2501): deferMessage: msg=131083

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/ConnectivityService( 2501): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED

                                                      D/ConnectivityService( 2501): Attempting to switch to mobile

                                                      D/ConnectivityService( 2501): Attempting to switch to BLUETOOTH_TETHER

                                                      D/ConnectivityService( 2501): Attempting to switch to ETHERNET

                                                      D/Nat464Xlat( 2501): requiresClat: netType=1, hasIPv4Address=false

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131143

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStoppingState

                                                      D/WifiStateMachine( 2501): processMsg: DefaultState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/BluetoothAdapter( 2754): 1105219112: getState() :  mService = null. Returning STATE_OFF

                                                      I/wpa_supplicant( 3054): wlan0: CTRL-EVENT-DISCONNECTED bssid=80:6c:1b:de:9b:67 reason=3 locally_generated=1

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147460

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStoppingState

                                                      D/WifiStateMachine( 2501): processMsg: DefaultState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147462

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStoppingState

                                                      D/WifiStateMachine( 2501): processMsg: DefaultState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      D/Tethering( 2501): InitialState.processMessage what=4

                                                      D/Tethering( 2501): sendTetherStateChangedBroadcast 0, 0, 0

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=131101

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStoppingState

                                                      D/WifiStateMachine( 2501): processMsg: DefaultState

                                                      D/WifiStateMachine( 2501): handleMessage: X

                                                      I/wpa_supplicant( 3054): wlan0: CTRL-EVENT-TERMINATING

                                                      D/WifiStateMachine( 2501): handleMessage: E msg.what=147458

                                                      D/WifiStateMachine( 2501): processMsg: SupplicantStoppingState

                                                      D/WifiStateMachine( 2501): Supplicant connection lost

                                                      D/WifiStateMachine( 2501): setWifiState: disabled

                                                      D/WifiStateMachine( 2501): transitionTo: destState=InitialState

                                                      D/WifiStateMachine( 2501): handleMessage: new destination call exit/enter

                                                      D/WifiStateMachine( 2501): setupTempStateStackWithStatesToEnter: X mTempStateStackCount=1,curStateInfo: state=DefaultState,active=true,parent=n

                                                      ull

                                                       

                                                      Thanks And Regards,

                                                      Ranganath TM

                                                      • Re: wifi binding on imx6sl evk based board
                                                        Zoran LukicLevel 1

                                                        Hi Ranganath,

                                                         

                                                        Do you have ethernet cable connected to the device?

                                                         

                                                        Do you supply enough current to the device?

                                                         

                                                        BR,

                                                        Zoran

                                                        • Re: wifi binding on imx6sl evk based board
                                                          Ranganath tmLevel 1

                                                          Hi Zoran,

                                                           

                                                          No I don't have ethernet cable connected to device, but the wifi is connected via usb hub for my device.


                                                          Thanks And Regards,

                                                          Ranganath TM

                                                          • Re: wifi binding on imx6sl evk based board
                                                            Zoran LukicLevel 1

                                                            Hi Ranganath,

                                                             

                                                            Could you try without hub?

                                                             

                                                            Have you build driver as modules?  (remember return 0; for insmod in driver)

                                                             

                                                            Could you add LOG to see what is the command?

                                                             

                                                             

                                                            BR,

                                                            Zoran

                                                            • Re: wifi binding on imx6sl evk based board
                                                              Ranganath tmLevel 1

                                                              Hi Zoran,

                                                               

                                                              I cannot try without hub, because I have issues with usb wifi dongle,

                                                               

                                                              Yes I build driver as module and I am returning 0 form that.

                                                               

                                                              Thanks And Regards,

                                                              Ranganath TM

                                                              • Re: wifi binding on imx6sl evk based board
                                                                Zoran LukicLevel 1

                                                                Hi Ranganath,

                                                                 

                                                                Please read more carefully what I write to you, we are going in circle.

                                                                 

                                                                "If you do not use modules for rtl wifi, remember to add return 0; in wifi_realtek.c functions:

                                                                insmod,rmmod,load_driver,wifi_load_driver,unload_driver,wifi_unload_driver."

                                                                 

                                                                and

                                                                 

                                                                "PaNiC Random Rant (or how we used to call it: .plan): Porting WiFi drivers to Android"

                                                                 

                                                                 

                                                                BR,

                                                                Zoran

                                                              • Re: wifi binding on imx6sl evk based board
                                                                Ranganath tmLevel 1

                                                                Hi Zoran,

                                                                 

                                                                When I run the below command I am not getting anu dhcpd results:

                                                                 

                                                                root@sabresd_6dq:/ # getprop | grep  wlan                                     

                                                                [wifi.interface]: [wlan0]

                                                                [wlan.driver.status]: [ok]

                                                                 

                                                                Thanks And Regards,

                                                                Ranganath TM

                                                                • Re: wifi binding on imx6sl evk based board
                                                                  Zoran LukicLevel 1

                                                                  Hello Ranganath,

                                                                   

                                                                  dhcp is run as service ini init script. Make sure the setup is correct and permissions are ok.

                                                                   

                                                                  root@shd_6sl:/ # getprop | grep wlan

                                                                  [wifi.ap.interface]: [wlan0]

                                                                  [wifi.interface]: [wlan0]

                                                                  [wlan.driver.status]: [ok]

                                                                  [wlan.interface]: [wlan0]

                                                                   

                                                                  root@shd_6sl:/ # getprop | grep dhcp

                                                                  [dhcp.eth0.dns1]: [xxx.xxx.1.1]

                                                                  [dhcp.eth0.dns2]: []

                                                                  [dhcp.eth0.dns3]: []

                                                                  [dhcp.eth0.dns4]: []

                                                                  [dhcp.eth0.domain]: [lan]

                                                                  [dhcp.eth0.gateway]: [192.168.2.1]

                                                                  [dhcp.eth0.ipaddress]: [192.168.2.113]

                                                                  [dhcp.eth0.leasetime]: [86400]

                                                                  [dhcp.eth0.mask]: [255.255.255.0]

                                                                  [dhcp.eth0.pid]: [2644]

                                                                  [dhcp.eth0.reason]: [RENEW]

                                                                  [dhcp.eth0.result]: [ok]

                                                                  [dhcp.eth0.server]: [192.168.2.1]

                                                                  [dhcp.eth0.vendorInfo]: []

                                                                  [init.svc.dhcpcd_eth0]: [running]

                                                                   

                                                                   

                                                                  BR,

                                                                  Zoran

                                                                  • Re: wifi binding on imx6sl evk based board
                                                                    Ranganath tmLevel 1

                                                                    Hi Zoran,

                                                                     

                                                                    Thanks for your help,

                                                                     

                                                                    Wifi is working now, but it only connect for non-secured network without password, it obtains IPaddress for secured network but it fails to connect(WPA/WPA2 PSK).

                                                                     

                                                                    Thanks And Regards,

                                                                    Ranganath TM

0 0