Port wifi module BCM43362 into IMX6 (Android 4.4.3)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Port wifi module BCM43362 into IMX6 (Android 4.4.3)

11,275 Views
ASTRIHK
Contributor III

After starting wpa_supplicant and running "wpa_cli", except typing "status", other commands return "UNKNOWN COMMAND", please kindly advise.

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

cfg80211: Calling CRDA to update world regulatory domain

ath=/system/etc/firmware/nvram.txt iface_name=wlan0"                          <

dhd_module_init: Enter

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

=========== WLAN placed in POWER ON ========

bcmsdh_register: Linux Kernel SDIO/MMC Driver

dhd_conf_set_hw_oob_intr: Enable HW OOB for 43362

F1 signature OK, socitype:0x1 chip:0xa962 rev:0x1 pkg:0x9

DHD: dongle ram size is set to 245760(orig 245760) at 0x0

dhdsdio_probe: Disable prop_txstatus

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

wl_create_event_handler(): thread:wl_event_handler:3a8 started

tsk Enter, tsk = 0x98401444

dhd_attach(): thread:dhd_watchdog_thread:3a9 started

dhd_attach(): thread:dhd_dpc:3aa started

dhd_attach(): thread:dhd_sysioc:3ab started

Broadcom Dongle Host Driver: register interface [wlan0] MAC: 00:90:4c:11:22:33

Dongle Host Driver, version 1.88.45.4 (r420671)

Compiled in drivers/net/wireless/bcmdhd on Sep 11 2015 at 16:12:53

======== PULL WL_REG_ON LOW! (flag = 2) ========

=========== WLAN placed in RESET ========

dhd_module_init: Exit error=0

root@sabresd_6dq:/system/lib/modules # ifconfig wlan0 up

dhd_open: Enter bcbd6000

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

Dongle Host Driver, version 1.88.45.4 (r420671)

Compiled in drivers/net/wireless/bcmdhd on Sep 11 2015 at 16:12:53

wl_android_wifi_on in 1

wl_android_wifi_on in 2: g_wifi_on=0

======== PULL WL_REG_ON HIGH! (flag = 2) ========

=========== WLAN going back to live  ========

sdio_reset_comm():

sdio_read_cis: 2 callbacks suppressed

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

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

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

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

dhd_bus_devreset: == WLAN ON ==

dhd_bus_devreset called when dongle is not in reset

Will call dhd_bus_start instead

dhd_conf_set_hw_oob_intr: Enable HW OOB for 43362

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

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

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

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

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

NVRAM version: AP6181_NVRAM_V1.1_01152013

dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.

dhd_bus_init: delay 100ms for BCM43362

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

bcmsdh_set_drvdata: Enter

bcmsdh_register_oob_intr: Enter

bcmsdh_register_oob_intr: IRQ=336 Type=414

dhd_conf_set_band: Set band 0

Firmware up: op_mode=0x0005, Broadcom Dongle Host Driver mac=98:3b:16:dd:aa:88

dhd_conf_set_country: Set country ALL, revision 0

Country code: ALL (ALL/0)

dhd_conf_set_roam: Set roam_off 1

dhd_preinit_ioctls buf_key_b4_m4 set failed -23

Firmware version = wl0: Dec 10 2012 15:10:32 version 5.90.195.89.1_edon/off_0xb8bf FWID 01-ff

  Driver: 1.88.45.4 (r420671)

  Firmware: wl0: Dec 10 2012 15:10:32 version 5.90.195.89.1_edon/off_0xb8bf FWID 01-ff

wl_android_wifi_on: Success

dhd_open: Exit ret=0

root@sabresd_6dq:/system/lib/modules # start wpa_supplicant

root@sabresd_6dq:/system/lib/modules # Connectting with 00:19:be:30:4b:a7 channel (6) ssid "asguest", len (7)

wl_bss_connect_done succeeded with 00:19:be:30:4b:a7

wl_notify_connect_status nothing

wl_bss_connect_done succeeded with 00:19:be:30:4b:a7

nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.

root@sabresd_6dq:/system/lib/modules # wpa_cli

wpa_cli v2.1-devel-4.4.3

Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.

See README for more details.

Using interface 'wlan0'

Interactive mode

> status

p2p_device_address=98:3b:16:dd:aa:88

p2p_state=IDLE

wifi_display=1

ifname=wlan0

address=98:3b:16:dd:aa:88

> scan

UNKNOWN COMMAND

> ifname

UNKNOWN COMMAND

>

Labels (1)
0 Kudos
5 Replies

1,827 Views
zhanxiaozhang
Contributor III

what did u dhd_wlan_set_carddetect look like?

0 Kudos

1,827 Views
zhanxiaozhang
Contributor III

what does u dts file for sdio wifi look like?

0 Kudos

1,827 Views
Rita_Wang
NXP TechSupport
NXP TechSupport

Hi Jackie Chau,

About the wifi BCM43362 porting you can refer to the follow document:

Porting BCM4330/BCM43362 WIFI to Android4.2.2

Hope this can help you.

Have a nice day

Best Regards

Dan

0 Kudos

1,827 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Jackie,

     Give you some suggestions, see messages below :

(1) check your wpa_supplicant.conf file.

ctrl_interface=wlan0( or for unix mode: =DIR/data/misc/wifi/wpa_supplicant GROUPU=WIFI)

ap_scan=1

update_config=1

(2)wpa_cli command like this:

#wpa_cli -i wlan0

>scan

>ok

Except above,  the following is my additional advice, you can also try, if you still have question, you can search "wireless-tools" on internet to get more information about debugging wireless net :

(1) Pay attention to checking the settings of router

(2)Using iwconfig to configure router

such as:

#iwconfig wlan0 mode Managed

#iwconfig wlan0 key 1234567890 (note: should be the password of your router)

#iwconfig wlan0 key open

#iwconfig wlan0 essid TP-LINK_432F1 ( note: router's name)

(3)Getting dynamic IP

# /system/bin/dhcpcd wlan0

(4)Searching AP

you can also use iwlist command to search AP, like this:

# iwlist wlan0 scan

Regards,

Weidong

1,827 Views
ASTRIHK
Contributor III

Hi Weidong,

Thanks for your reply. It seems wifi module can get a dynamic IP by command line. Please take a look on the debug message. However when I move the slide switch from off to on in GUI wifi setting of Android, I can't see any debug message related to insmod *.ko or start wpa_supplicant, in logcat I just see "D/WifiService(  450): setWifiEnabled: true pid=705, uid=1000". I have followed vendor's suggestion to modify *.mk as below. Please kindly advise.

Debug message to open wifi by command line

root@sabresd_6dq:/ #

insmod /system/lib/modules/bcmdhd.ko "firmware_path=/system/etc/firmware/fw_bcm40181a2.bin nvram_path=/system/etc/firmware/nvram.txt iface_name=wlan0"

dhd_module_init: Enter

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

=========== WLAN placed in POWER ON ========

bcmsdh_register: Linux Kernel SDIO/MMC Driver

dhd_conf_set_hw_oob_intr: Enable HW OOB for 43362

F1 signature OK, socitype:0x1 chip:0xa962 rev:0x1 pkg:0x9

DHD: dongle ram size is set to 245760(orig 245760) at 0x0

dhdsdio_probe: Disable prop_txstatus

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

wl_create_event_handler(): thread:wl_event_handler:3a1 started

tsk Enter, tsk = 0x98381444

dhd_attach(): thread:dhd_watchdog_thread:3a2 started

dhd_attach(): thread:dhd_dpc:3a3 started

dhd_attach(): thread:dhd_sysioc:3a4 started

Broadcom Dongle Host Driver: register interface [wlan0] MAC: 00:90:4c:11:22:33

Dongle Host Driver, version 1.88.45.4 (r420671)

Compiled in drivers/net/wireless/bcmdhd on Sep 14 2015 at 10:23:19

======== PULL WL_REG_ON LOW! (flag = 2) ========

=========== WLAN placed in RESET ========

dhd_module_init: Exit error=0

root@sabresd_6dq:/ # ifconfig wlan0 up

dhd_open: Enter bc946800

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

Dongle Host Driver, version 1.88.45.4 (r420671)

Compiled in drivers/net/wireless/bcmdhd on Sep 14 2015 at 10:23:19

wl_android_wifi_on in 1

wl_android_wifi_on in 2: g_wifi_on=0

======== PULL WL_REG_ON HIGH! (flag = 2) ========

=========== WLAN going back to live  ========

sdio_reset_comm():

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

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

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

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

dhd_bus_devreset: == WLAN ON ==

dhd_bus_devreset called when dongle is not in reset

Will call dhd_bus_start instead

dhd_conf_set_hw_oob_intr: Enable HW OOB for 43362

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

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

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

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

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

NVRAM version: AP6181_NVRAM_V1.1_01152013

dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.

dhd_bus_init: delay 100ms for BCM43362

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

bcmsdh_set_drvdata: Enter

bcmsdh_register_oob_intr: Enter

bcmsdh_register_oob_intr: IRQ=336 Type=414

dhd_conf_set_band: Set band 0

Firmware up: op_mode=0x0005, Broadcom Dongle Host Driver mac=98:3b:16:dd:aa:88

dhd_conf_set_country: Set country ALL, revision 0

Country code: ALL (ALL/0)

dhd_conf_set_roam: Set roam_off 1

dhd_preinit_ioctls buf_key_b4_m4 set failed -23

Firmware version = wl0: Dec 10 2012 15:10:32 version 5.90.195.89.1_edon/off_0xb8bf FWID 01-943eb0bc

  Driver: 1.88.45.4 (r420671)

  Firmware: wl0: Dec 10 2012 15:10:32 version 5.90.195.89.1_edon/off_0xb8bf FWID 01-943eb0bc

wl_android_wifi_on: Success

dhd_open: Exit ret=0

root@sabresd_6dq:/ # start wpa_supplicant

root@sabresd_6dq:/ # Connectting with 00:19:be:30:4b:a7 channel (6) ssid "asguest", len (7)

wl_bss_connect_done succeeded with 00:19:be:30:4b:a7

wl_notify_connect_status nothing

wl_bss_connect_done succeeded with 00:19:be:30:4b:a7

nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.

root@sabresd_6dq:/ # dhcpcd wlan0

dhcpcd[960]: version 5.5.6 starting

dhcpcd[960]: wlan0: checking for 169.254.251.58

dhcpcd[960]: wlan0: using IPv4LL address 169.254.251.58

dhcpcd[960]: forked to background, child pid 985

logcat to open wifi via GUI

W/AudioTrack(  444): AUDIO_OUTPUT_FLAG_FAST denied by client due to mismatching sample rate (48000 vs 44100)

I/ActivityManager(  444): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)} from pid 695

D/SubSettings(  695): Launching fragment com.android.settings.wifi.WifiSettings

E/BufferQueue(  143): [com.android.settings/com.android.settings.SubSettings] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count

I/ActivityManager(  444): Displayed com.android.settings/.SubSettings: +204ms

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

W/SocketClient(  141): write error (Broken pipe)

D/ConnectivityService(  444): Sampling interval elapsed, updating statistics ..

D/ConnectivityService(  444): Done.

D/ConnectivityService(  444): Setting timer for 720seconds

I/MediaFocusControl(  444):  AudioFocus  abandonAudioFocus() from android.media.AudioManager@2c891d18com.android.music.MediaPlaybackService$3@2c890b98

I/ActivityManager(  444): Start proc com.android.musicfx for broadcast com.android.musicfx/.ControlPanelReceiver: pid=962 uid=10010 gids={50010, 3003, 3002}

V/MusicFXControlPanelReceiver(  962): onReceive

V/MusicFXControlPanelReceiver(  962): Action: android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION

V/MusicFXControlPanelReceiver(  962): Package name: com.android.music

V/MusicFXControlPanelReceiver(  962): Audio session: 7

V/MusicFXControlPanelEffect(  962): closeSession(android.app.ReceiverRestrictedContext@2c88d000, com.android.music, 7)

In BoardConfig.mk,

BOARD_WPA_SUPPLICANT_DRIVER := NL80211

WPA_SUPPLICANT_VERSION       := VER_0_8_X

BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd

BOARD_HOSTAPD_DRIVER       := NL80211

BOARD_HOSTAPD_PRIVATE_LIB    := lib_driver_cmd_bcmdhd

BOARD_WLAN_DEVICE            := bcmdhd

WIFI_DRIVER_FW_PATH_PARAM := "/sys/module/bcmdhd/parameters/firmware_path"

WIFI_DRIVER_FW_PATH_STA      := "/system/etc/firmware/fw_bcm40181a2.bin"

WIFI_DRIVER_FW_PATH_P2P      := "/system/etc/firmware/fw_bcmbcm40181a2_p2p.bin"

WIFI_DRIVER_FW_PATH_AP       := "/system/etc/firmware/fw_bcmbcm40181a2_apsta.bin"

WIFI_DRIVER_MODULE_NAME      := "bcmdhd"

#WIFI_DRIVER_MODULE_PATH      := "/system/lib/modules/bcmdhd.ko"

WIFI_DRIVER_MODULE_ARG       := "iface_name=wlan0 firmware_path=/system/etc/firmware/fw_bcmbcm40181a2.bin nvram_path=/system/etc/firmware/nvram.txt"

In android/external/wpa_supplicant_8/wpa_supplicant/wpa_supplicant.conf

update_config=1

ctrl_interface=wlan0

eapol_version=1

ap_scan=1

fast_reauth=1

In init.rc

on post-fs-data

mkdir /data/misc/wifi 0770 wifi wifi

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

mkdir /data/misc/dhcp 0770 dhcp dhcp

on boot

service wpa_supplicant /system/bin/wpa_supplicant \

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

-I/system/etc/wifi/wpa_supplicant_overlay.conf \

-O/data/misc/wifi/sockets \

-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0

class main

socket wpa_wlan0 dgram 660 wifi wifi

disabled

oneshot

service p2p_supplicant /system/bin/wpa_supplicant \

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

-I/system/etc/wifi/p2p_supplicant_overlay.conf -N \

-O/data/misc/wifi/sockets \

-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 \

-puse_p2p_group_interface=1p2p_device=1

class main

socket wpa_wlan0 dgram 660 wifi wifi

disabled

oneshot

service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL

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

0 Kudos