Porting WLAN SoftAP to Android

=MCP 2.5.1 WiLink Driver: Description=

MCP WiLink Driver 2.5.1 source code was tested as a standalone component on OMAP4 Blaze / OMAP4 BlazeTablet platforms with WiLink 1283 PG2.21 connectivity hardware.

Improvements in SoftAP 2.09

 * Support up to 8 clients
 * Background scanning
 * AP with ACL and SCO
 * ERP protection
 * Support High Speed SDIO

= Procedures to port WLAN driver on Android File System (AFS) =

This section explains the build procedure of porting WLAN SoftAP driver in Android on OMAP4 platform, Blaze. Refer to www.omapzoom.org website for instructions on how to create a repo. Once you have the repo ready, follow the steps below.


 * Step1: Build the kernel with WLAN specific configurations
 * Step2: Build the WLAN SoftAP driver
 * Step3: Build Android File System including firmware loader,  wlan_ap_loader , and configuration tool,  tiap_cu , then place  tiwlan_ap.ini  and other SoftAP related files under the path of /system/etc/wifi/softap on target platform.

Note:
 * Step1 and step2 need to be done in order and use the same kernel.

To Enable WLAN on Linux Kernel
# make menuconfig
 * Make sure the Linux Configuration before Kernel Building:
 * Enable wireless extension in networking support (Default setting):

[*] Networking Support ---> [*] Wireless --->
 * Enable MMC5 support in OMAP:

Device Drivers ---> <*> MMC/SD/SDIO card Support ---> <*> TI OMAP High Speed Multimedia Card Interface support


 * Disable Module Versioning Support:

[*] Enable loadable module support ---> [ ] Module versioning support
 * Enable TI WLAN enhanced SDIO support and interface controller number to 5 in system type:

System Type ---> [*] Enable WiFi control function abstraction [*] TI WLAN Enhanced SDIO Controller support (5) MMC Controller number that TI WLAN chip is connected to
 * Update following environment variables and build the Kernel:

Please note Toolchain required is 2010q1-202.

# export YOUR_PATH=`pwd` # export PATH=${YOUR_PATH}/u-boot/tools:${PATH} //path of mkimage for uImage # export PATH=$PATH:${YOUR_PATH}/toolchain/arm-2010q1/bin //path of cross complier # cd ${YOUR_PATH}/kernel/android-2.6.35 # export CROSS_COMPILE=arm-none-linux-gnueabi- # export ARCH=arm # make android_4430_defconfig # make uImage

To Build SoftAP Driver Procedure

 * How to build SOftAP Driver:
 * Go to WLAN SoftAP Driver location:


 * 1) cd hardware/ti/wlan/wl1283_softAP/


 * Go to the build path:


 * 1) cd platforms/os/linux


 * Update the environment variable of kernel:


 * 1) export KERNEL_DIR = ${YOUR_PATH}/kernel/android-2.6.35


 * Make sure the following environment variables:


 * 1) echo $PATH            //:$PATH
 * 2) echo $CROSS_COMPILE   //arm-none-linux-gnueabiexport
 * 3) echo $ARCH            //arm
 * 4) echo $KERNEL_DIR      //


 * Start the build:


 * 1) make TNETW=1283


 * Place where the target files are placed after build:

Module 		File Name 	Location -- WLAN Driver 	tiap_drv.ko 	platform/os/linux/ INI File 	tiwlan_ap.ini 	config/ FIRMWARE 	firmware_ap.bin downloaded from https://gforge.ti.com/gf/project/wilink_drivers/

Porting SoftAP Driver To ANDROID File system (AFS)
This section we showed how to build ANDROID file system with all configuration files required for WLAN SoftAP are placed in appropriate locations. And also  wlan_ap_loader  and  tiap_cu  are built as part of Android file system.
 * How to build up Android File System with TI WLAN SoftAP Driver

The functionality of wlan_ap_loader is used to download the WLAN SoftAP firmware. The configuration utility (tiap_cu) provided by TI is used to configure WLAN SoftAP driver and firmware, and to perform most SoftAP operations, such as signal channel, SSID, and beacon rate. Besides, Android uses a  hostapd  daemon for Hotspot support.


 * Location and versions:

hostapd ver 0.6.x --> ${YOUR_PATH}/external/hostapd


 * choose the hostapd version for GingerBread:

HOSTAPD_VERSION            := VER_0_6_X


 * The way SoftAP driver in Gingerbread is selected by the variable of BOARD_SOFTAP_DEVICE in BoardConfig.mk file. We just specify the folder name of driver located in mydroid/hardware/ti/wlan folder as value of the variable:

BOARD_SOFTAP_DEVICE        := wl1283


 * In our case, Android builds the following components


 * wlan_ap_loader
 * tiap_cu
 * hostapd and automatically copies tiwlan_ap.ini and hostapd.conf configuration files to the appropriate location on target file system


 * We have related SoftAP variables in BoardConfig.mk:

HOSTAPD_VERSION    := VER_0_6_X BOARD_SOFTAP_DEVICE := wl1283


 * Ensure the interface defined in hostapd.conf (...system/etc/wifi/softap/)

interface=tiap0


 * Finally, these files need to be placed in properly locations on target platform before testing:

Kernel image        --> /root/uImage SoftAP Driver module --> /system/etc/wifi/softap/tiap_drv.ko SoftAP firmware file --> /system/etc/wifi/softap/firmware_ap.bin

= Testing SoftAP on Blaze Platform with GingerBread =

SOFT AP Setup and Testing
Note: Make sure you use the same kernel that you built the kernel image as the SoftAP drivers.
 * 1) Once you have the kernel, SoftAP driver and file system built, follow the procedure below to set up and test SoftAP on Blaze.
 * 2) Place the files  tiap_drv.ko  and  firmware_ap.bin </b> in the folder of /system/etc/wifi/softap
 * 3) Make sure /system/etc/wifi/softap folder also has  tiwlan_ap.ini </b> and  hostapd.conf </b>. These are placed in the location when file system is built.

SOFTAP Testing by Gingerbread GUI
Note: Before making OMAP4(Blaze) in AP mode, make sure normal WiFi is turned off and similarly if you want to use normal WiFi, turn off SoftAP.

Settings --> Wireless & network settings --> Tethering & portable hotspot --> Portable Wi-Fi hotspot
 * SoftAP can now be turned on through Tethering (HotSpot) option in Android UI:
 * to configure and start to configure the property...

Settings --> Wireless & network settings --> Tethering & portable hotspot --> Portable Wi-Fi hotspot settings --> Configure Wi-Fi hotspot
 * Followed by the procedure above, confige Wi-Fi hotspot SSID and security by:
 * define the "Network SSID" as ‘AndroidAP’ and choose "Security" option on the drop-down menu:

Open or WPA2 PSK //They are only secury options of portable hotspot supported by Gingerbread
 * 'Save' the configuration...


 * Now on other Blaze board or laptop
 * 1) Scan for ‘AndroidAP’ AP and click on 'Connect'. You should be now able to connect to it.
 * 2) Browse the PC, connecting to the Ethernet interface of SoftAP, by typing the PC IP address in browser.

Menu --> Settings --> Wireless & Networks --> Tethering & portable hotspot --> Portable Wi-Fi hotspot
 * Turn off Hotspot by clicking

SOFTAP Testing by TI WLAN SOFTAP CLI (non GUI)

 * Please follow the procedure to setup SOFTAP and launch SOFTAP CLI:
 * Go the path


 * 1) cd /system/etc/wifi/softap
 * Insert softap kernel modules:


 * 1) insmod tiap_drv.ko
 * Load the firmware and bring the interface up by issuing commands below.


 * 1) start wlan_ap_loader
 * 2) ifconfig tiap0 up
 * Ensure you have  hostapd.conf </b> file placed in /data/misc/wifi on target file system, then start  hostapd </b> by this command:


 * 1) start hostapd
 * Launch the WLAN SOFTAP CLI with supplicant and start executing tiap commands:


 * 1) tiap_cu -b


 * After Launching SOFTAP CLI, do the following configurations:


 * SoftAP with WEP security :
 * You can assign 10 digits WEP password (field highlighted).


 * 1) 	/ m e c 13  1234567890 </b>
 * 2) 	/ m e s
 * 3) 	/ m e r
 * 4) 	/ q


 * or with WPA1-PSK security :
 * 1) 	/ m e c 18 1
 * 2) 	/ m e c 20  psk12345 </b>                          //define wpa_passphrase
 * 3) 	/ m e c 21 WPA-PSK                             //define wpa_key_mgmt
 * 4) 	/ m e c 22 TKIP                                //define wpa_pairwise=TKIP
 * 5) 	/ m e c 23 TKIP                                //define rsn_pairwise=TKIP
 * 6) 	/ m e s                                        //save configuration
 * 7) 	/ m e r                                        //restart softap
 * 8) 	/ q


 * On other Blaze boards or laptops:
 * 1) Scan for the AP named as ‘AndroidAP’ and click on 'connect' and enter the WEP/WPA1-PSK password configured in previous steps. You should be now able to connect to portable hotspot.
 * 2) Browse the PC, connecting to Ethernet interface of SoftAP, by typing the PC IP address in browser.

=Summary= OS Kernel: Linux® 2.6.35 WLAN Driver Version: MCP-WiLink_Driver_2.5.3.0.18 WLAN Firmware Version: Rev 7.1.3.10.54 SOFT AP Driver Version: WiLink_Driver_AP_6.2.0.0.50 SOFT AP Firmware Version: Rev 7.2.0.0.48 Hardware: OMAP4 Blaze(ES 2.2) (with 1283 PG 2.21 Connectivity device)

GIT Project: git://git.omapzoom.org/platform/hardware/ti/wlan.git Commit Id: 263d8ce082a823185ea0e13d8ccd58491b13177a

Back to Connectivity Home Page