Getting TI MCP drivers working on Android

From OMAPpedia

Revision as of 16:36, 15 April 2011 by ElizaK (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

[edit] MCP 2.5.1 Wilink: Description

MCP WLAN source code was tested as a component standalone driver on OMAP4 Blaze ES 2.2 platform with 1283 PG2.21 Connectivity hardware

[edit] Highlights:

The features are supported in MCP 2.5.1

Following are improved in SoftAP 2.09

[edit] Procedure to build WLAN and test on Android FS

This section explains the build procedure for including WLAN 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:

[edit] To enable WLAN on the Blaze Board Linux Kernel

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 3 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
Build the Kernel:
#make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- android_4430_defconfig
#make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage

[edit] WLAN Build Procedures

WLAN Driver location: hardware/ti/wlan/wl1283

Go to the build path:
#cd platform/os/linux
Update following environment variables:
export PATH=<Location of your compiler>:$PATH
export CROSS_COMPILE=arm-none-linux-gnueabiexport
ARCH=arm
export 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 	tiwlan_drv.ko 	platform/os/linux/
INI File 	tiwlan.ini 		config/
FIRMWARE 	firmware.bin 	Obtained from ClearCase or CDP (proprietary)

[edit] SOFTAP Build Procedure

WLAN Driver location: hardware/ti/wlan/wl1283_softAP/

Go to the build path:
#cd platforms/os/linux
Update the following environment variables:
export PATH=<Location of your compiler>:$PATH
export CROSS_COMPILE=arm-none-linux-gnueabiexport
ARCH=arm
export 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 Obtained from ClearCase or CDP (proprietary)

[edit] ANDROID File system build

Build ANDROID file system so that all configuration file required for WLAN are placed in appropriate location. Also wlan_loader and wlan_cu are built as part of Android file system.

Make sure device/ti/blaze/BoardConfig.mk has all wifi related definitions:
BOARD_WPA_SUPPLICANT_DRIVER := CUSTOM
BOARD_WLAN_DEVICE := wl1283
BOARD_SOFTAP_DEVICE := wl1283
WPA_SUPPLICANT_VERSION := VER_0_6_X
WIFI_DRIVER_MODULE_PATH := "/system/etc/wifi/tiwlan_drv.ko"
WIFI_DRIVER_MODULE_NAME := "tiwlan_drv"
WIFI_FIRMWARE_LOADER := "wlan_loader"
Make sure the system property file:
device/ti/blaze/system.prop 
has definition for wifi interface:
wifi.interface=tiwlan0

[edit] Testing WLAN

[edit] Set up testing

[edit] Android GUI

Once you have the kernel, WLAN driver and file system built and setup follow the procedure below to setup and test WLAN on Android.

Menu --> Settings --> Wireless & Networks --> WiFi Settings

[edit] Using WLAN TI CLI interface (non GUI)

NOTE:

placed in appropriate place by the framework.

Place the files:
tiwlan_drv.ko 

and

firmware.bin 
in folder:
/system/etc/wifi 

of your filesystem

Make sure:
/system/etc/wifi 

folder also has

tiwlan.ini and wpa_supplicant.conf  

These are placed in the location when file system is built

Insert WLAN driver kernel module:
#insmod tiwlan_drv.ko
Load the firmware and bring the interface up by issuing commands below. Use appropriate IP address:
#start wlan_loader
#ifconfig tiwlan0 192.168.0.101 netmask 255.255.255.0
Start wpa_supplicant by this command:
#start wpa_supplicant
Launch the WLAN TI CLI with supplicant and start executing wlan commands:
#wlan_cu –itiwlan0 // Connect with supplicant and start executing wlan commands
OR
#wlan_cu –b // Bypass supplicant and for calibration

[edit] TxBip Calibration Procedure

Follow the above mentioned test setup Using WLAN TI CLI interface (non GUI):

wlan_cu –b
Run the following commands:
―/ w p 1 l 2 f 2‖
―/ t b v 21‖
―/ t b t 1 1 1 1 1 1 1 1 ‖
Now you have a NVS File in your setup:
Make sure your MAC address is updated and unique. Turn off and turn on Wifi to have the NVS file to take effect

Note:

[edit] Scan & Connect

On the Android UI go to:
Menu --> Settings --> Wireless & Networks --> WiFi Settings
Click on:
Turn on WiFi

You should see that wifi is turned on and list of available Access Points (AP) are shown

Click on any AP you wish to connect and click on:
Connect

You should see that it acquires IP address from that AP and gets connected

If it fails turn off wifi and turn on again:

[edit] Web Browsing

[edit] WLAN Security

WLAN driver supports WEP (40 bit), WEP (128bit), WPA-PSK (TKIP) and WPA2-PSK (AES)

  1. Configure the AP to one of the security type above with appropriate passkey
  2. Follow the procedure in section Scan & Connect to scan for networks
  3. Click on the AP SSID that you configured for security, enter the passkey and click connect
  4. You should be now connected to AP with security

[edit] Ad-hoc (CLI)

Ad-hoc (IBSS) or peer to peer connection can be tested only with WLAN TI CLI. Joining existing Ad-Hoc network

  1. When creating the ad-hoc network choose Network Authentication as open and Data Encryption as disabled:
  2. Disable all other interfaces on that Laptop:
  3. Configure a static IP address for the wifi interface on laptop:
  1. Set management mode to Ad-hoc (/ m m 0):
  2. Perform a scan (/ a s):
  3. View the list of networks (/ c b):
  4. Connect to the Ad-Hoc network you created on laptop (/ c c name):

[edit] Roaming (CLI)

  1. Have 2 AP configured with same SSID.
  2. On OMAP4 follow the procedure in section 3.1 to launch the WLAN TI CLI
  3. After launching the CLI do the following to enable roaming

# Enable roaming (/ g e) # Store the scan policy in scan menu (/ a p s) # Start a scan (/ a s) # Connect to the AP name that you configured (/ c c SSID)

[edit] SOFT AP Setup

  1. Once you have the kernel, SOFT AP driver and file system built follow the procedure below to setup and test SOFT AP on Android. Place the files tiap_drv.ko and firmware_ap.bin in the folder of /system/etc/wifi/softap
  2. 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.
  3. Make sure you use the same kernel that you built in step1 with the drivers generated in step2

[edit] SOFT AP Testing

Note: Before making OMAP4 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:

[edit] SOFT AP Testing TI CLI(non GUI)

Please follow section SOFT AP Setup:
cd:
/system/etc/wifi/softap
Insert 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 your file system:
#start hostapd
Launch the WLAN SOFT API CLI with supplicant and start executing tiap commands:
#tiap_cu -b

[edit] Iperf (Throughput Measurement)

Iperf instructions are in separate document. Follow the procedure mentioned in WCG_WLAN_Android_Iperf_Instruction.doc to measure WLAN throughput using iperf

[edit] EAP PEAP and TLS

Please ensure that following lines are present in the:
init.rc 
file which are required for storing certification
files (credentials) in Android system:
mkdir /data/misc/keystore 0777 keystore keystore
service keystore /system/bin/keystore /data/misc/keystore
user keystore
group keystore
socket keystore stream 666
Ensure that the Android system date and time are set appropriately, as the certificate validation is dependent on these parameters.
Ensure that a valid certificate is provided to you from the administrator in pkcs12 format.
Rename the certificate from <any name>.pfx to <any name>.p12 and place it in root of SD card(1st partition)
  1. Goto Settings -> Location & Security -> Use secure credentials. Type credential storage password minimum 8 characters.
  2. Goto Settings -> Location & Security -> Install from SD card
  3. Click on <any name>.p12 and give the following credentials
 # Enter the password to extract the certificates when prompted(password must be same that you specified while exporting the certificate)
 # Enter <any name> for Name the certificate
 # Enter credential storage password that you have set in step (a) You should see that certificate installed message is displayed:
  1. Goto Settings --> Wireless & Networks --> WiFi Settings

You must see Access Point (AP) that you have configured in Enterprise security mode. Click on AP that is secured with 802.1x EAP and give the following credentials  Select PEAP or TLS EAP method  Phase 2 authentication None  CA certificate Name that you have installed  Client certificate Name that you have installed  Identity the User Identity  Anonymous Identity blank  Wireless password Click on Connect.

You should see that it acquires IP address from that AP and gets connected

[edit] 802.11a (CLI)

802.11 a mode can also be tested only through WLAN TI CLI. (copy tiwlan_dual.ini from the clearcase and rename to tiwlan.ini into folder system/etc/wifi)

  1. Enable (a) mode and select the channel (40) in the AP
  2. On OMAP4 follow the procedure in section 3.1 to launch the WLAN TI CLI
  3. After launching the CLI do the following
Register ScanComplete event (/ v r 5)
- / a a
- g <empty> 1 1 3 32 0 12
- c 0 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 36
- c 1 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 40
- c 2 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 44
- c 3 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 48
- c 4 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 52
- c 5 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 56
- c 6 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 60
- c 7 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 64
- c 8 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 149
- c 9 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 153
- c 10 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 157
- c 11 ff:ff:ff:ff:ff:ff 60000 30000 0 0 250 161
- d
- ..
- s
- / c b
- / c c ssid
Wait for IpcEvent_PrintEvent - received IPC_EVENT_SCAN_COMPLETE message
View the list of networks (/ c b)

You should be able to see the AP that is configured for (1) band and verify the channel it is operating in is 40

Connect to the network (/ c c name)
Now you should be connected to network

[edit] Summary

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox