AnsweredAssumed Answered

Porting AP6335 WIFI to Android4.4.2

Question asked by li chen on Jun 15, 2016
Latest reply on Jun 16, 2016 by Wigros Sun

NXP社区的工程师

 

您好,

 

我们这边用到一款i.MX6Q SABRE的开发板为参考板,制作定制了自己的产品板子,Android版本为4.4.2,只有wifi有改动,我们wifi用的是AMPAK 的AP6335芯片,移植的时候参考NXP社区分享的文档Porting BCM4330/BCM43362 WIFI to Android4.2.2,现在在android界面层可以设置wifi网络热点,但是扫描不到网络,logcat错误如下:

 

dhd_bus_devreset: == WLAN ON ==

 

F1 signature read @0x18000000=0x16224335

 

F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2

 

DHD: dongle ram size is set to 786432(orig 786432) at 0x180000

 

dhd_conf_read_config: Ignore config file /system/etc/firmware/config.txt

 

dhd_conf_set_fw_name_by_chip: firmware_path=/system/etc/firmware/fw_bcm4339a0_ag.bin

 

Final fw_path=/system/etc/firmware/fw_bcm4339a0_ag.bin

 

Final nv_path=/system/etc/firmware/nvram.txt

 

Final conf_path=/system/etc/firmware/config.txt

 

NVRAM version: AP6335_NVRAM_V1.7_04102014

 

dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.

 

D/WifiHW ( 2650): -------------------------->wifi_start_supplicant: sleep 500ms, return 0

 

D/WifiMonitor( 2650): startMonitoring(wlan0) with mConnected = false

 

D/WifiHW ( 2650): -------------------------->enter wifi_connect_to_supplicant

 

D/WifiHW ( 2650): -------------------------->enter wifi_connect_on_socket_path

 

E/WifiHW ( 2650): ----------->/data/system/wpa_supplicant/wlan0: File not exists! error:No such file or directory

 

D/BluetoothAdapter( 2910): 1101234160: getState() : mService = null. Returning STATE_OFF

 

E/WifiHW ( 2650): ----------->/data/system/wpa_supplicant/wlan0: File not exists! try_cnt=49

 

dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)

 

bcmsdh_oob_intr_register: Enter

 

bcmsdh_oob_intr_register OOB irq=377 flags=4

 

bcmsdh_oob_intr_register: enable_irq_wake

 

add wake up source irq 105

 

dhd_conf_set_band: Set band 0

 

Firmware up: op_mode=0x0005, MAC=6c:fa:a7:26:2c:da

 

dhd_conf_set_country: Set country CN, revision 38

 

E/WifiHW ( 2650): ----------->/data/system/wpa_supplicant/wlan0: File not exists! try_cnt=48

 

Country code: CN (CN/38)

 

dhd_conf_set_roam: Set roam_off 1

 

dhd_conf_set_glom: set bus:txglom 8

 

dhd_conf_set_ampdu_ba_wsize: set ampdu_ba_wsize 40

 

Firmware version = wl0: Apr 3 2014 12:12:42 version 6.37.32.28.2_ip (r424058)

 

Driver: 1.201.34.2 (r491657)

 

Firmware: wl0: Apr 3 2014 12:12:42 version 6.37.32.28.2_ip (r424058)

 

dhd_txglom_enable: enable 0

 

dhd_wlfc_hostreorder_init(): successful bdcv2 tlv signaling, 64

 

wl_android_wifi_on: Success

 

p2p0: p2p_dev_addr=6e:fa:a7:26:2c:da

 

E/WifiHW ( 2650): ----------->/data/system/wpa_supplicant/wlan0: File not exists! try_cnt=47

 

dhd_open: Exit ret=0

 

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

 

E/WifiHW ( 2650): ----------->/data/system/wpa_supplicant/wlan0: File not exists! try_cnt=46

 

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

 

D/Tethering( 2650): sendTetherStateChangedBroadcast 2, 0, 0

 

E/WifiHW ( 2650): ----------->/data/system/wpa_supplicant/wlan0: File not exists! try_cnt=45

 

D/WifiConfigStore( 2650): Loading config and enabling all networks

 

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

 

E/WifiStateMachine( 2650): Failed to set device name sabresd_6dq

 

E/WifiStateMachine( 2650): Failed to set manufacturer Freescale

 

E/WifiStateMachine( 2650): Failed to set model name SABRESD-MX6DQ

 

E/WifiStateMachine( 2650): Failed to set model number SABRESD-MX6DQ

 

E/WifiStateMachine( 2650): Failed to set serial number 191411d4df64727f

 

E/WifiStateMachine( 2650): Failed to set WPS config methods

 

D/BluetoothAdapter( 2910): 1101234160: getState() : mService = null. Returning STATE_OFF

 

E/WifiStateMachine( 2650): Failed to set primary device type 10-0050F204-5

 

D/CommandListener( 2251): Setting iface cfg

 

D/CommandListener( 2251): Trying to bring up p2p0

 

D/WifiMonitor( 2650): startMonitoring(p2p0) with mConnected = true

 

E/WifiStateMachine( 2650): Failed to set frequency band 0

 

p2p0: no IPv6 routers presen

 

 

 

netcfg的信息如下:

255|root@sabresd_6dq:/ #

 

nsmod /system/lib/modules/cf <

 

cfg80211.ko cfg80211_realtek.ko

 

em/lib/modules/cfg80211.ko <

 

cfg80211: Calling CRDA to update world regulatory domain

 

root@sabresd_6dq:/ #

 

root@sabresd_6dq:/ #

 

root@sabresd_6dq:/ #

 

root@sabresd_6dq:/ # insmod /system/lib/modules/bcmdhd.ko

 

dhd_module_init: in

 

======== bcm_wlan_set_plat_data ========

 

GPIO(WL_HOST_WAKE) = GPIO_4_25

 

host_oob_irq: 377

 

host_oob_irq_flags=4

 

dhd_wifi_platform_load: Enter

 

Power-up adapter 'DHD generic adapter'

 

wifi_platform_set_power = 1

 

======== PULL WL_REG_ON HIGH! ========

 

wifi_platform_bus_enumerate device present 1

 

======== Card detection to detect SDIO card! ========

 

mmc2: queuing unknown CIS tuple 0x80 (2 bytes)

 

mmc2: queuing unknown CIS tuple 0x80 (3 bytes)

 

mmc2: queuing unknown CIS tuple 0x80 (3 bytes)

 

mmc2: queuing unknown CIS tuple 0x80 (7 bytes)

 

mmc2: queuing unknown CIS tuple 0x91 (3 bytes)

 

mmc2: new high speed SDIO card at address 0001

 

mmc2: queuing unknown CIS tuple 0x80 (2 bytes)

 

mmc2: queuing unknown CIS tuple 0x80 (3 bytes)

 

mmc2: queuing unknown CIS tuple 0x80 (3 bytes)

 

mmc2: queuing unknown CIS tuple 0x80 (7 bytes)

 

bcmsdh_register: register client driver

 

mmc2: queuing unknown CIS tuple 0x80 (2 bytes)

 

mmc2: queuing unknown CIS tuple 0x80 (3 bytes)

 

mmc2: queuing unknown CIS tuple 0x80 (3 bytes)

 

mmc2: queuing unknown CIS tuple 0x80 (7 bytes)

 

bcmsdh_sdmmc: bcmsdh_sdmmc_probe Enter

 

bcmsdh_sdmmc: bcmsdh_sdmmc_probe Enter

 

bus num (host idx)=2, slot num (rca)=1

 

found adapter info 'DHD generic adapter'

 

F1 signature read @0x18000000=0x16224335

 

F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2

 

DHD: dongle ram size is set to 786432(orig 786432) at 0x180000

 

wl_create_event_handler(): thread:wl_event_handler:cc5 started

 

tsk Enter, tsk = 0xca6e13f0

 

p2p0: P2P Interface Registered

 

dhd_attach(): thread:dhd_watchdog_thread:ccc started

 

dhd_attach(): thread:dhd_dpc:cce started

 

dhd_attach(): thread:dhd_rxf:ccf started

 

dhd_deferred_work_init: work queue initialized

 

Dongle Host Driver, version 1.201.34.2 (r491657)

 

Compiled in drivers/net/wireless/bcmdhd on May 27 2016 at 14:54:40

 

Register interface [wlan0] MAC: 6c:fa:a7:26:2d:b1

 

 

 

dhd_prot_ioctl : bus is down. we have nothing to do

 

bcmsdh_oob_intr_unregister: Enter

 

bcmsdh_oob_intr_unregister: irq is not registered

 

dhd_txglom_enable: enable 0

 

dhd_bus_devreset: WLAN OFF DONE

 

wifi_platform_set_power = 0

 

======== PULL WL_REG_ON LOW! ========

 

dhd_module_init: Exit err=0

 

root@sabresd_6dq:/ #

 

root@sabresd_6dq:/ #

 

root@sabresd_6dq:/ #

 

root@sabresd_6dq:/ #

 

root@sabresd_6dq:/ # netcfg

 

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

 

p2p0 DOWN 0.0.0.0/0 0x00001002 00:90:4c:33:22:11

 

wlan0 DOWN 0.0.0.0/0 0x00001002 6c:fa:a7:26:2d:b1

 

root@sabresd_6dq:/ #

 

 

 

 

 

这边在启动网卡时候firmware信息:

 

root@sabresd_6dq:/data/system/wpa_supplicant # ifconfig wlan0 up

dhd_open: Enter d6c92000

 

Dongle Host Driver, version 1.201.34.2 (r491657)

Compiled in drivers/net/wireless/bcmdhd on May 27 2016 at 14:54:40

wl_android_wifi_on in 1

wl_android_wifi_on in 2: g_wifi_on=0

wifi_platform_set_power = 1

======== PULL WL_REG_ON HIGH! ========

sdio_reset_comm():

 

 

dhd_bus_devreset: == WLAN ON ==

F1 signature read @0x18000000=0x16224335

F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2

DHD: dongle ram size is set to 786432(orig 786432) at 0x180000

dhd_conf_read_config: Ignore config file /system/etc/firmware/config.txt

dhd_conf_set_fw_name_by_chip: firmware_path=/system/etc/firmware/fw_bcm4339a0_ag.bin

Final fw_path=/system/etc/firmware/fw_bcm4339a0_ag.bin

Final nv_path=/system/etc/firmware/nvram.txt

Final conf_path=/system/etc/firmware/config.txt

NVRAM version: AP6335_NVRAM_V1.7_04102014

dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.

dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)

bcmsdh_oob_intr_register: Enter

bcmsdh_oob_intr_register OOB irq=377 flags=4

bcmsdh_oob_intr_register: enable_irq_wake

add wake up source irq 105

dhd_conf_set_band: Set band 0

Firmware up: op_mode=0x0005, MAC=6c:fa:a7:26:2d:b1

dhd_conf_set_country: Set country CN, revision 38

Country code: CN (CN/38)

dhd_conf_set_roam: Set roam_off 1

dhd_conf_set_glom: set bus:txglom 8

dhd_conf_set_ampdu_ba_wsize: set ampdu_ba_wsize 40

Firmware version = wl0: Apr 3 2014 12:12:42 version 6.37.32.28.2_ip (r424058)

Driver: 1.201.34.2 (r491657)

Firmware: wl0: Apr 3 2014 12:12:42 version 6.37.32.28.2_ip (r424058)

dhd_txglom_enable: enable 0

dhd_wlfc_hostreorder_init(): successful bdcv2 tlv signaling, 64

wl_android_wifi_on: Success

p2p0: p2p_dev_addr=6e:fa:a7:26:2d:b1

dhd_open: Exit ret=0

root@sabresd_6dq:/data/system/wpa_supplicant #

 

驱动可以起来,也可以配置ip,用wpa_cli也能扫描到网络,主要问题是在android界面层可以设置wifi网络热点,但是扫描不到网络

Outcomes