Development environment
Hardware: i.MX6Q SabreSD connecting rtl8188cus or rtl8192cus wifi dongle
Software: FSL JB 4.2.2-1.1.0-GA release
Advantage brought by JB4.2.2
As we may know that in JB4.0.x, Wifi-Direct is exclusive to normal Wifi access AP, so means that you have to turn off Wifi normal AP access, then turn on Wifi-Direct. But in JB4.2.x, it can support the following topologies in use scene as following:
So that means you can keep p2p connection meanwhile access internet throught AP.
Feature verified
1. Wifi connection support internet surf, and DLNA.
2. Wifi-Direct can support files transmission like Gallery sharing based on Wifi-Direct Demo.apk from FSL.
3. Particial support Wifi-Display, but due to unavailability of Wifi-Display sink module, so cannot be verified fully.
Usage:
untar the attached file, then "patch -p1 <" in corresponding subdirectories. It would be better to untar the file in an empty directory, so you can understand which subdirectories are newly created (ex. hardware/realtek is newly created), then within these newly created subdirectoies, you need to "git init" first, then do "patch -p1<" to adopt all newly added files and subdirectories.
Original Attachment has been moved to: WiFiDirectDemo.apk.zip
Original Attachment has been moved to: patch4rtl8188_8192_on_jb4_2_2-ga.tar.gz
Dear Xia Zhang
We are using your patch :
Support RTL8188 8192 wifi dongle in FSL JB4.2.2-G...
To use 8188 CUS, after make the patch.
And load the cfg80211.ko ,mac80211.ko and 8192cu.ko,
But still can not use the WiFi on JB4.2.2
Here is the error message:
ath6kl_sdio: Unknown symbol cfg80211_sched_scan_results (err -22)
ath6kl_sdio: Unknown symbol cfg80211_cqm_txe_notify (err 0)
ath6kl_sdio: disagrees about version of symbol cfg80211_scan_done
ath6kl_sdio: Unknown symbol cfg80211_scan_done (err -22)
ath6kl_sdio: disagrees about version of symbol cfg80211_sched_scan_stopped
ath6kl_sdio: Unknown symbol cfg80211_sched_scan_stopped (err -22)
ath6kl_sdio: disagrees about version of symbol cfg80211_remain_on_channel_expired
ath6kl_sdio: Unknown symbol cfg80211_remain_on_channel_expired (err -22)
ath6kl_sdio: disagrees about version of symbol regulatory_hint
ath6kl_sdio: Unknown symbol regulatory_hint (err -22)
ath6kl_sdio: Unknown symbol cfg80211_roamed_bss (err 0)
ath6kl_sdio: disagrees about version of symbol cfg80211_new_sta
ath6kl_sdio: Unknown symbol cfg80211_new_sta (err -22)
ath6kl_sdio: disagrees about version of symbol cfg80211_disconnected
ath6kl_sdio: Unknown symbol cfg80211_disconnected (err -22)
255|root@android:/ # cat /proc/net/wireless
Inter-| sta-| Quality | Discarded packets | Missed | WE
face | tus | link level noise | nwid crypt frag retry misc | beacon | 22
wlan0: 0000 0. -256. -256. 0 0 0 0 0 0
wlan1: 0000 0. -256. -256. 0 0 0 0 0 0
Can you give us some advice with this?
Thanks
Kind Regards
steven
Hi, Steven,
Your log messages show that you still use Atheros, not realtek. Pls check whehter you correctly merge the code in devices/fsl directory. I use sabresd_6dq-user. Do you use the same target board?
Regards,
Alan Zhang
Dear Xia Zhang
Thank you very much for your reply.
Just have found this too.
In device/fsl/sabresd_6dq/BoardConfig.mk is still the Atheros one
# Wifi
BOARD_WLAN_VENDOR := ATHEROS
# for atheros vendor
ifeq ($(BOARD_WLAN_VENDOR),ATHEROS)
BOARD_WLAN_DEVICE := ar6003
BOARD_HAS_ATH_WLAN := true
WPA_SUPPLICANT_VERSION := VER_0_8_ATHEROS
WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/ath6kl_sdio.ko"
WIFI_DRIVER_MODULE_NAME := "ath6kl_sdio"
WIFI_DRIVER_MODULE_ARG := "suspend_mode=3 wow_mode=2 ar6k_clock=26000000 ath6kl_p2p=1"
WIFI_DRIVER_P2P_MODULE_ARG := "suspend_mode=3 wow_mode=2 ar6k_clock=26000000 ath6kl_p2p=1 debug_mask=0x2413"
WIFI_SDIO_IF_DRIVER_MODULE_PATH := "/system/lib/modules/cfg80211.ko"
WIFI_SDIO_IF_DRIVER_MODULE_NAME := "cfg80211"
WIFI_SDIO_IF_DRIVER_MODULE_ARG := ""
WIFI_COMPAT_MODULE_PATH := "/system/lib/modules/compat.ko"
WIFI_COMPAT_MODULE_NAME := "compat"
WIFI_COMPAT_MODULE_ARG := ""
endif
This patch patch4rtl8188_8192_on_jb4_2_2-ga\device\fsl\0001-Adopt-rtl8188-rtl8192-usb-dongle-support.patch does not work.
excute like this
~myandroid/device/fsl$ patch -p1 < patch4rtl8188_8192_on_jb4_2_2-ga\device\fsl\0001-Adopt-rtl8188-rtl8192-usb-dongle-support.patch
But nothing changes. : (
Can you help me how to make this patch . : )
Thanks
Kind Regards
steven
Pls check your directory's attribute whether they are read-only! Also check "patch" command works or not. The patch file (devices/fsl/) contains all necessary modification inside, you can open it and check.
Regards,
Alan Zhang
Dear Xia Zhang
Thanks for your reply.
The directory's attribute all is ok: as you can see here.
drwxrwxr-x 4 liuy liuy 4096 2013-07-30 16:20 asus
drwxrwxr-x 5 liuy liuy 4096 2013-07-30 16:20 common
drwxrwxr-x 13 liuy liuy 4096 2013-08-05 16:58 fsl
drwxrwxr-x 14 liuy liuy 4096 2013-08-02 14:23 fsl-proprietary
drwxrwxr-x 8 liuy liuy 4096 2013-07-30 16:20 generic
drwxrwxr-x 3 liuy liuy 4096 2013-07-30 16:20 google
drwxrwxr-x 4 liuy liuy 4096 2013-07-30 16:20 lge
drwxrwxr-x 10 liuy liuy 4096 2013-07-30 16:20 sample
drwxrwxr-x 7 liuy liuy 4096 2013-07-30 16:20 samsung
drwxrwxr-x 3 liuy liuy 4096 2013-07-30 16:20 ti
drwxrwxr-x 3 liuy liuy 4096 2013-08-02 14:23 arm2_6dq
drwxrwxr-x 3 liuy liuy 4096 2013-08-02 14:23 arm2_6sl
drwxrwxr-x 7 liuy liuy 4096 2013-08-02 14:23 common
drwxrwxr-x 3 liuy liuy 4096 2013-08-02 14:23 evk_6sl
drwxrwxr-x 4 liuy liuy 4096 2013-08-02 14:23 hdmidongle_6dq
drwxrwxr-x 5 liuy liuy 4096 2013-08-02 14:23 imx53_smd
drwxrwxr-x 2 liuy liuy 4096 2013-08-02 14:23 imx5x
drwxrwxr-x 4 liuy liuy 4096 2013-08-05 17:10 imx6
drwxrwxr-x 4 liuy liuy 4096 2013-08-02 14:23 sabreauto_6q
drwxrwxr-x 5 liuy liuy 4096 2013-08-05 17:04 sabresd_6dq
I am sure that the patch file (devices/fsl/) does not work, the file in (device/fsl) folder still the older one.
Kind Regards
steven
Dear Xia Zhang
After manual patch devices/fsl/ folder ,all is ok now. : )
Thanks again for your help.
Kind Regards
steven
I have a boundary devices sabrelite board and applied your patches to the jb source code for this board. Eveything besides board-specific patches (i.e. in drivers/fsl) worked. I then manually patched the board specific files. When I try to build, I get the following error:
m 2>&1 | tee build_wifi.out
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
TARGET_PRODUCT=nitrogen6x
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-38-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=1.0.0-rc3
OUT_DIR=out
============================================
make: Entering directory `/home/xxxxxx/android_boundary_jb422'
external/wpa_supplicant_8_jb_4.2_rtw_r7482.20130515_beta/hostapd/Android.mk:239: external/wpa_supplicant_8_jb_4.2_rtw_r7482.20130515_beta/hostapd/src/drivers/drivers.mk: Not a directory
external/wpa_supplicant_8_jb_4.2_rtw_r7482.20130515_beta/wpa_supplicant/Android.mk:292: external/wpa_supplicant_8_jb_4.2_rtw_r7482.20130515_beta/wpa_supplicant/src/drivers/drivers.mk: Not a directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-client/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-server/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-client/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-server/src': No such file or directory
hardware/imx/alsa/Android.mk:33: board has SGTL5000
find: `src': No such file or directory
No private recovery resources for TARGET_DEVICE nitrogen6x
make: *** No rule to make target `external/wpa_supplicant_8_jb_4.2_rtw_r7482.20130515_beta/wpa_supplicant/src/drivers/drivers.mk'. Stop.
make: Leaving directory `/home/xxxxxx/android_boundary_jb422'
xxxxxx@xxxxxx1:~/android_boundary_jb422$ cd -
I was able to trace this error to something similar here:jni - Android NDK, No rule to make target - Stack Overflow and java - No rule to make target NDK - Stack Overflow and tried both approaches but didn't help. Could you please advise if you know of a solution? Thanks
I was able to hard code the path like this:
LOCAL_PATH := $(call my-dir)
include $(call all-subdir-makefiles)
LOCAL_PATH :=/home/xxxxxx/android_boundary_jb422/external/wpa_supplicant_8_jb_4.2_rtw_r7482.20130515_beta
and it builds for a long while until I get this error
Install: out/target/product/nitrogen6x/system/bin/asan/app_process
target Executable: bdt (out/target/product/nitrogen6x/obj/EXECUTABLES/bdt_intermediates/LINKED/bdt)
target Symbolic: bdt (out/target/product/nitrogen6x/symbols/system/bin/bdt)
target Strip: bdt (out/target/product/nitrogen6x/obj/EXECUTABLES/bdt_intermediates/bdt)
Install: out/target/product/nitrogen6x/system/bin/bdt
make: *** No rule to make target `/home/xxxxxx/android_boundary_jb422/external/wpa_supplicant_8_jb_4.2_rtw_r7482.20130515_beta/main.c', needed by `out/target/product/nitrogen6x/obj/EXECUTABLES/hostapd_intermediates/main.o'. Stop.
make: Leaving directory `/home/xxxxxx/android_boundary_jb422'
Hi AlanZhang
Thanks for your patch. I used it and it run ok. I can't not turn on wifi at the first boot. After restart my box, it can turn on and connect AP to access internet. but I can't turn on Portable wifi hostpot. Here is the log message:
D/ConnectivityService( 3043): sendStickyBroadcast: action=android.net.conn.INET_CONDITION_ACTION
I/hostapd ( 3876): 20/40 MHz operation not permitted on channel pri=6 sec=10 based on overlapping BSSes
E/hostapd ( 3876): Using interface wlan0 with hwaddr 00:11:7f:22:33:99 ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
and ssid "AndroidAP"
D/Tethering( 3043): interfaceLinkStateChanged wlan0, false
D/Tethering( 3043): interfaceStatusChanged wlan0, false
D/Tethering( 3043): interfaceLinkStateChanged wlan0, true
D/Tethering( 3043): interfaceStatusChanged wlan0, true
D/Tethering( 3043): sendTetherStateChangedBroadcast 1, 0, 0
D/BluetoothAdapter( 3408): 1852039040: getState() : mService = null. Returning STATE_OFF
D/CommandListener( 2097): Setting iface cfg
D/CommandListener( 2097): Trying to bring up wlan0
D/Tethering( 3043): Tethering wlan0
D/Tethering( 3043): InitialState.processMessage what=2
D/Tethering( 3043): sendTetherStateChangedBroadcast 0, 0, 0
D/BluetoothAdapter( 3408): 1852039040: getState() : mService = null. Returning STATE_OFF
D/Tethering( 3043): Tethered wlan0
D/BluetoothAdapter( 3408): 1852039040: getState() : mService = null. Returning STATE_OFF
D/Tethering( 3043): sendTetherStateChangedBroadcast 0, 1, 0
D/Tethering( 3043): MasterInitialState.processMessage what=1
D/Tethering( 3043): Tether Mode requested by wlan0 - TetheredState - Tethered - lastError =0
D/TetherController( 2097): Setting IP forward enable = 1
D/TetherController( 2097): Starting tethering services
D/TetherController( 2097): Tethering services running
D/TetherController( 2097): setDnsForwarders(0 = '8.8.8.8')
D/TetherController( 2097): setDnsForwarders(1 = '8.8.4.4')
D/TetherController( 2097): Sending update msg to dnsmasq [update_dns:8.8.8.8:8.8.4.4]
D/Tethering( 3043): chooseUpstreamType has upstream iface types:
D/Tethering( 3043): 0
D/Tethering( 3043): 1
D/Tethering( 3043): 5
D/Tethering( 3043): 7
D/Tethering( 3043): 9
D/Tethering( 3043): chooseUpstreamType(true), preferredApn =5, got type=9
D/TetherController( 2097): setDnsForwarders(0 = '172.24.104.6')
D/TetherController( 2097): setDnsForwarders(1 = '172.24.104.228')
D/TetherController( 2097): Sending update msg to dnsmasq [update_dns:172.24.104.6:172.24.104.228]
D/Tethering( 3043): notifying tethered with iface =eth0
D/Tethering( 3043): TetheredState.processMessage what=12
I/dnsmasq ( 3882): started, version 2.51 cachesize 150
I/dnsmasq ( 3882): compile time options: no-IPv6 GNU-getopt no-DBus no-I18N DHCP no-scripts no-TFTP
W/dnsmasq ( 3882): warning: no upstream servers configured
I/dnsmasq ( 3882): DHCP, IP range 192.168.48.2 -- 192.168.48.254, lease time 1h
I/dnsmasq ( 3882): DHCP, IP range 192.168.47.2 -- 192.168.47.254, lease time 1h
I/dnsmasq ( 3882): DHCP, IP range 192.168.46.2 -- 192.168.46.254, lease time 1h
I/dnsmasq ( 3882): DHCP, IP range 192.168.45.2 -- 192.168.45.254, lease time 1h
I/dnsmasq ( 3882): DHCP, IP range 192.168.44.2 -- 192.168.44.254, lease time 1h
I/dnsmasq ( 3882): DHCP, IP range 192.168.43.2 -- 192.168.43.254, lease time 1h
I/dnsmasq ( 3882): DHCP, IP range 192.168.42.2 -- 192.168.42.254, lease time 1h
I/dnsmasq ( 3882): read /etc/hosts - 1 addresses
I/dnsmasq ( 3882): using nameserver 8.8.4.4#53
I/dnsmasq ( 3882): using nameserver 8.8.8.8#53
I/dnsmasq ( 3882): using nameserver 172.24.104.228#53
I/dnsmasq ( 3882): using nameserver 172.24.104.6#53
E/NatController( 2097): Error setting forward rules
E/Tethering( 3043): Exception enabling Nat: java.lang.IllegalStateException: command '33 nat enable wlan0 eth0 2 fe80::/64 192.168.43.0/24' failed with '400 33 Nat operation failed (No such device)'
E/WifiStateMachine( 3043): Tethering reports wifi as untethered!, shut down soft Ap
D/Tethering( 3043): sendTetherStateChangedBroadcast 0, 0, 1
D/CommandListener( 2097): Setting iface cfg
D/CommandListener( 2097): Trying to bring up wlan0
D/Tethering( 3043): Untethering wlan0
E/Tethering( 3043): Tried to Untethered an errored iface :wlan0, ignoring
E/WifiStateMachine( 3043): Untether initiate failed!
D/BluetoothAdapter( 3408): 1852039040: getState() : mService = null. Returning STATE_OFF
I/dalvikvm( 3408): Jit: resizing JitTable from 512 to 1024
E/WifiStateMachine( 3043): Failed to get tether update, force stop access point
D/SoftapController( 2097): Stopping Softap service
D/Tethering( 3043): interfaceLinkStateChanged wlan0, false
D/Tethering( 3043): interfaceStatusChanged wlan0, false
D/Tethering( 3043): InitialState.processMessage what=4
D/Tethering( 3043): sendTetherStateChangedBroadcast 0, 0, 0
D/BluetoothAdapter( 3408): 1852039040: getState() : mService = null. Returning STATE_OFF
D/SoftapController( 2097): Softap service stopped
usbcore: deregistering interface driver rtl8192cu
E/NetdConnector( 3043): NDC Command {37 softap stopap} took too long (526ms)
D/SoftapController( 2097): Softap fwReload - Ok
W/Netd ( 2097): No subsystem found in netlink event
D/NetlinkEvent( 2097): Unexpected netlink message. type=0x11
D/Tethering( 3043): interfaceRemoved p2p0
E/Tethering( 3043): attempting to remove unknown iface (p2p0), ignoring
W/Netd ( 2097): No subsystem found in netlink event
D/NetlinkEvent( 2097): Unexpected netlink message. type=0x11
D/Tethering( 3043): interfaceRemoved wlan0
E/Tethering( 3043): attempting to remove unknown iface (wlan0), ignoring
Can you explain and give me some advice with this?
Thanks & brgs
Dear Xia Zhang,
We are using this patch for implementing "Wi-FI Direct" but we have a issue about p2p.
The operation for STA mode is Ok but the problem occur when target find other p2p device.
after debugging along with source code, I find that "p2p_find" function is not called in "wpas_p2p_find", "P2_supplicant.c" because "wpa_s->global->p2p" is null.
Could you give some advice for solving this problem? And then Where should I check any part of "wpa_supplicant" part?
Actually I am working with wifi-module firstly, so I have a less knowledge about this.
I am wating for your reply. let me know what you need if you need something for checking this issue.
Thank you. Best regards. from Cloud.
Hi I tried all the steps.
Patches worked fine. Made a fresh build. But I am getting the following error when I try to turn on the wifi after connecting the device.
D/WifiService( 2704): setWifiEnabled: true pid=2945, uid=1000
D/BluetoothAdapter( 2945): 1101450528: getState() : mService = null. Returning STATE_OFF
E/WifiStateMachine( 2704): Failed to load driver!
E/WifiStateMachine( 2704): DriverFailedState
D/BluetoothAdapter( 2945): 1101450528: getState() : mService = null. Returning STATE_OFF
D/dalvikvm( 2704): GC_CONCURRENT freed 505K, 42% free 5436K/9248K, paused 3ms+4ms, total 40ms
Any help ?
Update,
Reboot solved the problem
Xia Zhang
I gone through your patches and this patches works for ath6k series chips. i'm using ath9k series atheros chips, which uses PCIe interface. the respective driver creates wlan0 interface in driver level and i want use create p2p0 interface and want to UP both the interface and use concurrently, do you have any idea how i can do it.
I tried following steps to create p2p0 interface from user space but fail to assign MAC address to P2p0 interface.
https://community.freescale.com/message/388240#388240
Kind;y give me your inputs regarding this.
thanks in advance.
Sandesh D
Does this solution also work for FSL JB4.3 or KK4.4 release?
Hi, I add the patch to build driver in to my project. I cat get message when i insert dongle. But it deregistering in coming few seconds::
---------------------------------------------------------------------------------------------------------
usb 2-1.1: New USB device found, idVendor=0bda, idProduct=8179
usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1.1: Product: 802.11n NIC
usb 2-1.1: Manufacturer: Realtek
usb 2-1.1: SerialNumber: 8C18D916247D
usb 2-1.1: usb_probe_device
usb 2-1.1: configuration #1 chosen from 1 choice
usb 2-1.1: adding 2-1.1:1.0 (config #1, interface 0)
usbserial_generic 2-1.1:1.0: usb_probe_interface
usbserial_generic 2-1.1:1.0: usb_probe_interface - got id
drivers/usb/core/inode.c: creating file '003'
hub 2-1:1.0: port 2, status 0301, change 0000, 1.5 Mb/s
Freeing init memory: 224K
usb 2-1.2: link qh8-0601/cc09bd60 start 2 [1/2 us]
flexcan imx6q-flexcan.0: writing ctrl=0x03292005
usb 2-1.2: unlink qh8-0601/cc09bd60 start 2 [1/2 us]
fsl-ehci fsl-ehci.1: reused qh cc09bd60 schedule
usb 2-1.2: link qh8-0601/cc09bd60 start 2 [1/2 us]
usb 2-1.2: unlink qh8-0601/cc09bd60 start 2 [1/2 us]
fsl-ehci fsl-ehci.1: reused qh cc09bd60 schedule
usb 2-1.2: link qh8-0601/cc09bd60 start 2 [1/2 us]
usb 2-1.2: unlink qh8-0601/cc09bd60 start 2 [1/2 us]
warning: `zygote' uses 32-bit capabilities (legacy support in use)
fsl-ehci fsl-ehci.1: reused qh cc09bd60 schedule
usb 2-1.2: link qh8-0601/cc09bd60 start 2 [1/2 us]
usbcore: registered new interface driver rtl8192cu
acc_open
acc_release
usb usb1: usb auto-resume
ehci_fsl_bus_resume begins, DR
usb usb1: bus resume fail, err -108
sys_prop: permission denied uid:1003 name:service.bootanim.exit
usbcore: deregistering interface driver rtl8192cu
---------------------------------------------------------------------------------------------------------
What's problem ? Thanks!
BR.
David