Porting WLAN SoftAP to Android

From OMAPpedia

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
=MCP 2.5.1 WiLink Driver: Description=
=MCP 2.5.1 WiLink Driver: Description=
-
MCP WiLink 2.5.1 source code was tested as a standalone component on OMAP4 Blaze / OMAP4 BlazeTablet platforms with WiLink 1283 PG2.21 connectivity hardware.
+
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.
== WLAN features are supported ==
== WLAN features are supported ==
Line 16: Line 16:
* SoftAP WPS(supported via TIAP CLI)
* SoftAP WPS(supported via TIAP CLI)
* EAP PEAP and TLS
* EAP PEAP and TLS
-
* 802.11a
+
* 802.11a/b/g/n
* Ad-hoc(WLAN TI CLI)
* Ad-hoc(WLAN TI CLI)
Line 27: Line 27:
* Support High Speed SDIO
* Support High Speed SDIO
-
= Procedures to port SoftAP driver on Android File System (AFS) =
+
= Procedures to port WLAN driver on Android File System (AFS) =
This section explains the build procedure of porting WLAN driver in Android on OMAP4 platform.
This section explains the build procedure of porting WLAN driver in Android on OMAP4 platform.
Line 33: Line 33:
ready, follow the steps below.
ready, follow the steps below.
-
*Step1: Build the kernel with WiFi specific configurations
+
*Step1: Build the kernel with WLAN specific configurations
-
*Step2: Build the SoftAP driver
+
*Step2: Build the WLAN driver
-
*Step3: Builds Android File System which includes wlan_loader, wlan_cu. Also places tiwlan.ini and other wifi related files under the path of /system/etc/wifi.
+
*Step3: Build Android File System including firmware loader, <b style="color:brown"> wlan_loader </b>, and configuration tool, <b style="color:brown"> wlan_cu </b>, and  place <b style="color:brown"> tiwlan.ini </b> and other WiFi related files under the path of /system/etc/wifi on target platform.
Note:
Note:
-
* Step1 and step2 needs to be done in order and use the same kernel.  
+
* Step1 and step2 need to be done in order and use the same kernel.  
 +
 
== To Enable WLAN on Linux Kernel ==
== To Enable WLAN on Linux Kernel ==
Line 100: Line 101:
== Porting SoftAP Driver To ANDROID File system (AFS) ==
== Porting SoftAP Driver To ANDROID File system (AFS) ==
-
* How to build up Android File System with TI WLAN Driver
+
* How to build up Android File System with TI WLAN SoftAP Driver
-
This section we showed how to build ANDROID file system with all configuration files required for WLAN are placed in appropriate locations. And also wlan_loader and wlan_cu are built as part of Android file system. The functionality of wlan loader is used to download the WLAN firmware. The configuration utility (wlan_cu) provided by TI is used to configure WLAN driver and firmware, and to perform most WLAN operations, such as scanning, connecting, TX, RX, and calibration procedures.
+
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 <b style="color:brown"> wlan_ap_loader </b> and <b style="color:brown"> wlan_cu </b> are built as part of Android file system.  
-
Android uses a modified wpa_supplicant daemon for wifi support which is controlled through a socket by WiFiHW that gets controlled from Android UI through android.net.wifi package.  
+
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 scanning, connecting, TX, RX, and calibration procedures. Android uses a modified wpa_supplicant daemon for WiFi support which is controlled through a socket by WiFi HW that gets controlled from Android UI through android.net.wifi package.  
: Location and versions:
: Location and versions:
  wpa_supplicant ver 0.5.x --> ${YOUR_PATH}/external/wpa_supplicant
  wpa_supplicant ver 0.5.x --> ${YOUR_PATH}/external/wpa_supplicant
Line 125: Line 126:
  WIFI_DRIVER_MODULE_PATH := "/system/etc/wifi/tiwlan_drv.ko"
  WIFI_DRIVER_MODULE_PATH := "/system/etc/wifi/tiwlan_drv.ko"
  WIFI_DRIVER_MODULE_NAME := "tiwlan_drv"
  WIFI_DRIVER_MODULE_NAME := "tiwlan_drv"
-
  WIFI_FIRMWARE_LOADER := "wlan_loader"
+
  WIFI_FIRMWARE_LOADER := "wlan_ap_loader"
-
:By the way, make sure the system property file (device/ti/blaze/system.prop)has definition for wifi interface:
+
:By the way, make sure the system property file (device/ti/blaze/system.prop) has definition for WiFi interface:
  wifi.interface=tiwlan0
  wifi.interface=tiwlan0
Line 136: Line 137:
  SoftAP Driver module --> /system/etc/wifi/tiap_drv.ko
  SoftAP Driver module --> /system/etc/wifi/tiap_drv.ko
  SoftAP firmware file --> /system/etc/wifi/softap/firmware_ap.bin
  SoftAP firmware file --> /system/etc/wifi/softap/firmware_ap.bin
 +
 +
= Testing SoftAP on Blaze Platform with GingerBread =
= Testing SoftAP on Blaze Platform with GingerBread =
Line 141: Line 144:
===SOFT AP Setup and Testing===
===SOFT AP Setup and Testing===
-
# Once you have the kernel, SoftAP driver and file system built, follow the procedure below to setup and test SoftAP on Android.  
+
# Once you have the kernel, SoftAP driver and file system built, follow the procedure below to set up and test SoftAP on Blaze.  
# Place the files <b style="color:brown"> tiap_drv.ko </b> and <b style="color:brown"> firmware_ap.bin </b> in the folder of /system/etc/wifi/softap
# Place the files <b style="color:brown"> tiap_drv.ko </b> and <b style="color:brown"> firmware_ap.bin </b> in the folder of /system/etc/wifi/softap
# Make sure /system/etc/wifi/softap folder also has <b style="color:brown"> tiwlan_ap.ini </b> and <b style="color:brown"> hostapd.conf </b>. These are placed in the location when file system is built.
# Make sure /system/etc/wifi/softap folder also has <b style="color:brown"> tiwlan_ap.ini </b> and <b style="color:brown"> hostapd.conf </b>. These are placed in the location when file system is built.

Revision as of 19:21, 20 April 2011

Contents

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.

WLAN features are supported

Improvements in SoftAP 2.09

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

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

Note:


To Enable WLAN on Linux Kernel

 # make menuconfig
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.[1]

 # 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

Go to WLAN Driver location:
# cd hardware/ti/wlan/wl1283_softAP/
Go to the build path:
# cd platforms/os/linux
Make sure the following environment variables:
# echo $PATH            //<Location of your compiler>:$PATH
# echo $CROSS_COMPILE   //arm-none-linux-gnueabiexport
# echo $ARCH            //arm
# echo $KERNEL_DIR      //<path to the kernel folder where you performed step1>
Start the build:
# 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 wlan_cu are built as part of Android file system.

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 scanning, connecting, TX, RX, and calibration procedures. Android uses a modified wpa_supplicant daemon for WiFi support which is controlled through a socket by WiFi HW that gets controlled from Android UI through android.net.wifi package.

Location and versions:
wpa_supplicant ver 0.5.x --> ${YOUR_PATH}/external/wpa_supplicant
wpa_supplicant ver 0.6.x --> ${YOUR_PATH}/external/wpa_supplicant_6
wpa_supplicant library --> ${YOUR_PATH}/hardware/ti/wlan/wl1283/wpa_supplicant_lib/
To tell the Android build system to build supplicant with custom wpa_supplicant_library we add below lines to BoardConfig.mk file
BOARD_WPA_SUPPLICANT_DRIVER := CUSTOM
choose the supplicant version for GingerBread:
WPA_SUPPLICANT_VERSION := VER_0_6_X
The way WiFi driver in Gingerbread is selected by the variable of BOARD_WLAN_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_WLAN_DEVICE := wl1283
In our case, Android builds the following components
So We specify the folder and name of the driver module and SoftAP in BoardConfig.mk:
BOARD_SOFTAP_DEVICE := wl1283
WIFI_DRIVER_MODULE_PATH := "/system/etc/wifi/tiwlan_drv.ko"
WIFI_DRIVER_MODULE_NAME := "tiwlan_drv"
WIFI_FIRMWARE_LOADER := "wlan_ap_loader"
By the way, make sure the system property file (device/ti/blaze/system.prop) has definition for WiFi interface:
wifi.interface=tiwlan0
Finally, these files need to be placed in properly locations on target platform before testing:
Kernel image         --> /root/uImage
Driver module        --> /system/etc/wifi/tiwlan_drv.ko
WLAN Firmware file   --> /system/etc/wifi/firmware.bin
SoftAP Driver module --> /system/etc/wifi/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

  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 in the folder of /system/etc/wifi/softap
  3. Make sure /system/etc/wifi/softap folder also has tiwlan_ap.ini and hostapd.conf . These are placed in the location when file system is built.

Note: Make sure you use the same kernel that you built the kernel image as the SoftAP drivers.


SOFT AP Testing by 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 AP mode.

  1. SoftAP can now be tested through HotSpot option in Android UI.
  2. Click
Settings --> Wireless & Networks --> Tethering & HotSpot 
to configure and start using:

SOFT AP Testing TI CLI(non GUI)

Please follow section SOFT AP Setup:
Go the path of SOFT AP
# cd /system/etc/wifi/softap
Insert soft ap kernel modules:
# insmod tiap_drv.ko
Load the firmware and bring the interface up by issuing commands below. Use appropriate IP address.
# start wlan_ap_loader
# ifconfig tiap0 up
Start hostapd by this command. Before starting hostapd make sure you have hostapd.conf file placed in /data/misc/wifi of target file system:
# start hostapd
Launch the WLAN SOFT API CLI with supplicant and start executing tiap commands:
# tiap_cu -b

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

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox