MY-IMX6 Android-4.4.2 WIFI and 3G Migration Development

来自明远智睿的wiki
跳转至: 导航搜索

Port WIFI(RTL8188EUS)


Step 1:
vim device/fsl/sabresd_6dq/BoardConfig.mk

# UNITE is a virtual device support both atheros and realtek wifi(ar6103 and rtl 8723as)
#BOARD_WLAN_DEVICE:            := UNITE
#WPA_SUPPLICANT_VERSION:         := VER_0_8_UNITE
#TARGET_KERNEL_MODULES:          := \  kernel_imx/drivers/net/wireless/rtl8723as/8723as.ko:system/lib/modules/8723as.ko \
   kernel_imx/net/wireless/cfg80211.ko:system/lib/modules/cfg80211_realtek.ko
#BOARD_WPA_SUPPLICANT_DRIVER:      := NL80211
#BOARD_HOSTAPD_DRIVER:           := NL80211

#BOARD_HOSTAPD_PRIVATE_LIB_QCOM:           := lib_driver_cmd_qcwcn
#BOARD_WPA_SUPPLICANT_PRIVATE_LIB_QCOM:      := lib_driver_cmd_qcwcn
#BOARD_HOSTAPD_PRIVATE_LIB_RTL:           := lib_driver_cmd_rtl
#BOARD_WPA_SUPPLICANT_PRIVATE_LIB_RTL

...
...
BOARD_WIFI_VENDOR := realtek

BOARD_WLAN_VENDOR := REALTEK

ifeq ($(BOARD_WIFI_VENDOR),realtek)

WPA_SUPPLICANT_VERSION :=VER_0_8_X

BOARD_WPA_SUPPLICANT_DRIVER :=NL80211
#CONFIG_DRIVER_WEXT :=y

CONFIG_DRIVER_NL80211 :=true

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

#BOARD_WLAN_DEVICE := rtl8192du

#BOARD_WLAN_DEVICE := rtl8192ce

#BOARD_WLAN_DEVICE := rtl8192de

#BOARD_WLAN_DEVICE := rtl8723as

#BOARD_WLAN_DEVICE := rtl8723au

#BOARD_WLAN_DEVICE := rtl8189es

#BOARD_WLAN_DEVICE := rtl8723bs

#BOARD_WLAN_DEVICE := rtl8723bu

WIFI_DRIVER_MODULE_NAME :="wlan"

WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/wlan.ko"

WIFI_DRIVER_MODULE_ARG :="ifname=wlan0 if2name=p2p0"

WIFI_FIRMWARE_LOADER :=""

WIFI_DRIVER_FW_PATH_STA :=""

WIFI_DRIVER_FW_PATH_AP :=""

WIFI_DRIVER_FW_PATH_P2P :=""

WIFI_DRIVER_FW_PATH_PARAM :=""

Endif

Step 2:

vim device/fsl/sabresd_6dq/init.rc

#service p2p_supplicant /system/bin/wpa_supplicant \
# -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
# -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \
# -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
# -I/system/etc/wifi/wpa_supplicant_overlay.conf \
# -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 \
# -e/data/misc/wifi/entropy.bin [email protected]:wpa_wlan0
# class late_start
# socket wpa_wlan0 dgram 660 wifi wifi
# disabled
# oneshot

#service rtw_suppl_con /system/bin/rtl_wpa_supplicant \
# -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
# -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \
# -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
# -I/system/etc/wifi/wpa_supplicant_overlay.conf \
# -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 \
# -e/data/misc/wifi/entropy.bin [email protected]:wpa_wlan0
# class late_start
# socket wpa_wlan0 dgram 660 wifi wifi
# disabled
# oneshot

service rtw_suppl_con /system/bin/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 \
  -O/data/misc/wifi/sockets \
  [email protected]:wpa_wlan0
  class main
  socket wpa_wlan0 dgram 660 wifi wifi
  disabled
  oneshot


service rtw_suppl /system/bin/wpa_supplicant \

  -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
  -O/data/misc/wifi/sockets \
  -e/data/misc/wifi/entropy.bin
  [email protected]:wpa_wlan0
  class main
  socket wpa_wlan0 dgram 660 wifi wifi
  disabled
  oneshot

Step 3:

Decompress "realtek_wifi_SDK_for_android_KK_4.4_20140117.tar.gz” ,then ANDROID_SDK/hardware/realtek in it will be covered to hardwar/realtek directory of android source code.

Step 4:

vim hardware/libhardware_legacy/wifi/Android.mk

#ifeq ($(BOARD_WLAN_DEVICE),UNITE)
# LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../external/wpa_supplicant_ath/wpa_supplicant/src/common
# LOCAL_SRC_FILES += wifi/wifi_unite.c
#else ifeq ($(BOARD_WLAN_VENDOR), INTEL)
# LOCAL_SRC_FILES += wifi/wifi_intel.c
# LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../external/wpa_supplicant_8/src/common
#else
# LOCAL_SRC_FILES += wifi/wifi.c
# LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../external/wpa_supplicant_8/src/common
#endif

ifeq ($(BOARD_WIFI_VENDOR),realtek)
LOCAL_SRC_FILES +=../realtek/wlan/libhardware_legacy/wifi/wifi_realtek.c
else
LOCAL_SRC_FILES += wifi/wifi.c
endif

Step 5:

Backup "wpa_supplicant_8" under "external/"of "android" souce code,then decompress "wpa_supplicant_8_kk_4.4_rtw_r10450.20140220.tar.gz" in the driving package and rename as "wpa_supplicant_8" and replaced to "external/" directory of "android" 。</span>

Step 6:

Modify "kernel_imx/arch/arm/configs/imx6_android_defconfig",(or modify ".config") configure the following items as "Y"
CONFIG_CFG80211=y

CONFIG_MAC80211_MESH=y

CONFIG_MAC80211=y

CONFIG_HOSTAP=y

CONFIG_USB_USBNET=y

Step 7:

vim device/fsl/imx6/etc/init.rc

 setprop wifi.interface wlan0
 setprop wlan.driver.status "ok"


Step 8:

Delete system folder in "out/target/product/sabresd_6dq" and folder of "wpa_supplicant_intermediates" in "out/target/product/sabresd_6d/obj/EXECUTABLES",re-compile "system.img" and" boot.img".

Step 9:

Compile "wlan.ko" and copy to directory of “system to /lib/modules/ ”

vim Makefile
CONFIG_PLATFORM_I386_PC = n

CONFIG_PLATFORM_NEW = y

ifeq ($(CONFIG_PLATFORM_NEW), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
ARCH := arm
CROSS_COMPILE :=/home/linyn/android/android-myzr/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- KSRC := /home/linyn/android/android-myzr/kernel_imx
MODULE_NAME := wlan
endif

vim include/autoconf.h

#define CONFIG_IOCTL_CFG80211
#ifdef CONFIG_IOCTL_CFG80211
#define RTW_USE_CFG80211_STA_EVENT

//#defineCONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER

//#define CONFIG_DEBUG_CFG80211 1
#endif
...
...
#define CONFIG_CONCURRENT_MODE

#define CONFIG_P2P_IPS
Finally compiled to wlan.ko and copy to directory of system/lib/modules/

Port 3G(MU609)


Step 1:
vim kernel_imx/drivers/usb/serial/option.c

#define HUAWEI_PRODUCT_E353:   0x1506
instead
#define HUAWEI_PRODUCT_E353:   0x1573

Step 2:
vim hardware/ril/rild/rild.c

#define REFERENCE_RIL_DEF_PATH "/system/lib/libreference-ril.so"
instead
#define REFERENCE_RIL_DEF_PATH "/system/lib/libhuawei-ril.so"

...
// switchUser();

Step 3:
Vim hardware/ril/runtime-ril-port/runtime_port.c

Add new structure in arrays
static struct modem_3g_device modem_3g_device_table[] = {

   {
  .name:  = "Huawei-MU609",
  .idVendor = "12d1",
  .idProduct = "1573",
  .deviceport = "/dev/ttyUSB2",
  .dataport = "/dev/ttyUSB0",
  .type:  = HUAWEI_MODEM,
   },


Step 4:
Copy ip-up,ip-down to directory of /system/etc/ppp,copy libhuawei-ril.so to directory of /system/lib.

Step 5:
vim device/fsl/imx6/etc/init.rc

Modify with following reference:
chmod 777 /dev/ttyUSB0
chmod 777 /dev/ttyUSB2
chmod 777 /etc/ppp/ip-up
chmod 777 /etc/ppp/ip-down
#service ril-daemon /system/bin/rild
service ril-daemon /system/bin/rild -l /system/lib/libhuawei-ril.so

Step 6:
Re-compile system.img and boot.img