Realtek Wi-Fi SDK for Android M 6.xver. 1.0.0
Contents
Release History 2
Introduction 3
1. Copy Necessary Files into SDK 4
2. Platform Related Files 4
2.1. BoardConfig.mk 4
2.2. init.xxx.rc 6
2.3. Others 8
3. System Resource Configurations 9
4. wpa_supplicant_8 11
5. Driver Configurations for Android 6.x 11
6. FAQ 13
6.1. Wi-Fi (STA mode) 13
6.1.1. Why Wi-Fi can’t enable? 13
6.2. Portable Wi-Fi hotspot (AP mode) 14
6.2.1. Why Portable Wi-Fi hotspot can’t enable? 14
6.3. Wi-Fi Direct (P2P mode) 14
6.3.1. There is no Wi-Fi Direct UI shown? 14
6.3.2. Wi-Fi Direct can’t scan any peer? 14
Release History
1.0.0
2015/11/17
1. First formal release
SDK packages
l hardware/realtek/*
Folder to store config files, private code from Realtek.
Introduction
This document provides a simple guide to help engineers to apply Realtek Wi-Fi solution onto their Android M 6.x system. For now, we have supported the following two scenarios:
l STA/AP – Switch between STA mode and AP mode
l (STA+P2P)/AP – Switch between STA+P2P(Wi-Fi Direct) concurrent mode and AP mode
To port Realtek Wi-Fi driver onto Android 6.x platform, you can go through the following guide with reference codes within our driver package's realtek_wifi_SDK_for_android_M_6.x_20151117.tgz.
Because Android's SDK may differ from platform to platform, our reference codes may not be applied on every platform without modifications. You should check if our reference code is suitable for you to use.
In this document, ANDROID_SDK is the path of top folder of the target Android SDK; this term is used in the following paragraphs.
1. Copy Necessary Files into SDK
After unzipping realtek_wifi_SDK_for_android_M_6.x_20151116.tgz, copy the following folder into ANDROID_SDK/hardware/ folder:
l hardware/realtek
2. Platform Related Files
2.1. BoardConfig.mk
To apply Realtek Wi-Fi solution onto your Android 6.x system, you need to define some compile-time variables in BoardConfig.mk of your platform. In general, the BoardConfig.mk file is located in:
ANDROID_SDK /device/<soc_vendor_name>/<board_name>/
Take TI panda board for example:
ANDROID_SDK /device/ ti/panda/ BoardConfig.mk
Please define the following compile-time variables below:
BOARD_WIFI_VENDOR := realtek
ifeq ($(BOARD_WIFI_VENDOR), realtek)
WPA_SUPPLICANT_VERSION := VER_0_8_X
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
#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 := "rtw_fwloader"
WIFI_DRIVER_FW_PATH_STA := "STA"
WIFI_DRIVER_FW_PATH_AP := "AP"
WIFI_DRIVER_FW_PATH_P2P := "P2P"
WIFI_DRIVER_FW_PATH_PARAM := "/dev/null"
endif
l BOARD_WIFI_VENDOR := realtek
To distinguish the platform Wi-Fi device from products of other vendors, we define variable BOARD_WIFI_VENDOR as realtek. This is for compile-time choices to be applied for Realtek Wi-Fi solutions.
l WPA_SUPPLICANT_VERSION := VER_0_8_X
For Android L, please set WPA_SUPPLICANT_VERSION as VER_0_8_X to use wpa_supplicant_8.
l BOARD_WPA_SUPPLICANT_DRIVER := NL80211
l BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_rtl
l BOARD_HOSTAPD_DRIVER := NL80211
l BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_rtl
We use NL80211 as the driver interface for wpa_supplicant and hostapd to communicate with driver and provide lib_driver_cmd_rtl as the private library.
l BOARD_WLAN_DEVICE
Realtek provide a variety of Wi-Fi solutions to choose. For now, BOARD_WLAN_DEVICE is not used for any purpose but we suggest setting this variable for your Wi-Fi solution you used.
l WIFI_DRIVER_MODULE_NAME
l WIFI_DRIVER_MODULE_PATH
l WIFI_DRIVER_MODULE_ARG
These three variables will be used in libhardware_legacy (wifi.c) to do insmod and rmmod. The value of WIFI_DRIVER_MODULE_NAME should match the value of MODULE_NAME specified in our driver’s Makefile at compile-time. Please refer to “Platform Setting Section in Detail” of:
document/Quick_Start_Guide_for_Driver_Compilation_and_Installation.pdf
l WIFI_FIRMWARE_LOADER :=”rtw_fwloader”
This variable will be used in libhardware_legacy (wifi.c) as the name of Wi-Fi firmware loader, which will be executed after driver’s insmod and before the executing of wpa_supplicant and hostapd. Setting it to “rtw_fwloader” for calling service rtw_fwloader which provided by Realtek.
l WIFI_DRIVER_FW_PATH_STA :=”STA”
l WIFI_DRIVER_FW_PATH_AP :=”AP”
l WIFI_DRIVER_FW_PATH_P2P :=”P2P”
l WIFI_DRIVER_FW_PATH_PARAM :=”/dev/null”
Realtek driver has FW embedded inside, and will automatically load FW at NIC initialization process. Setting these four variables is ...
hacyy