Android Mac80211

From OMAPpedia

Revision as of 19:18, 26 October 2012 by Vishalm (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

[edit] Summary

This page contains information for bringing up MAC80211 based TI WLAN driver on Android.

Android Logov2.jpg
+
Wifi.gif


[edit] WLAN Driver build instruction

We use compat-wireless mechanism to build WLAN driver files.

[edit] OMAP5 sEVM + wl18xx (COM8)

Follow the procedure below to generated required kernel module files for OMAP5 sEVM platform

wl18xx is the default connectivity hardware in this platform.

cd $MYDROID/hardware/ti/wlan/mac80211/compat_wl18xx
export KLIB=/path/to/kernel
export KLIB_BUILD=/path/to/kernel
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabi-
make

The above step will produce compat.ko, cfg80211.ko, mac80211.ko, ,wlcore.ko, wl12xx.ko, wl18xx.ko, wlcore_sdio.ko which needs to be copied to target file system.


[edit] Blaze/Tablet + wl18xx (COM8)

Follow the procedure below to generated required kernel module files for OMAP5 sEVM platform

wl18xx is the default connectivity hardware in this platform.

cd $MYDROID/hardware/ti/wlan/mac80211/compat_wl18xx
export KLIB=/path/to/kernel
export KLIB_BUILD=/path/to/kernel
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabi-
make

The above step will produce compat.ko, cfg80211.ko, mac80211.ko, ,wlcore.ko, wl12xx.ko, wl18xx.ko, wlcore_sdio.ko which needs to be copied to target file system.


[edit] Blaze/Tablet + wl128x (COM7)

Follow the procedure below to generated required kernel module files for OMAP4 Blaze/Tablet platforms

wl128x is the default connectivity hardware in this platform.

cd $MYDROID/hardware/ti/wlan/mac80211/compat_wl12xx
export KLIB=/path/to/kernel
export KLIB_BUILD=/path/to/kernel
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabi-
make

The above step will produce compat.ko, cfg80211.ko, mac80211.ko, wl12xx.ko, wl12xx_sdio.ko which needs to be copied to target file system.


[edit] Target file system setup

We need to copy two explicit things to target file system for WLAN

[edit] WLAN Driver modules

Copy the driver files built from steps mentioned above along with the firmware files to target file system

The driver module files are expected in following location of target file system

/system/lib/modules


cd $OUT
mkdir system/lib/modules
cd $MYDROID/hardware/ti/wlan/mac80211/compat_wl12xx
cp ./compat/compat.ko $OUT/system/lib/modules/
cp ./net/wireless/cfg80211.ko $OUT/system/lib/modules/
cp ./net/mac80211/mac80211.ko $OUT/system/lib/modules/
cp ./drivers/net/wireless/wl12xx/wl12xx.ko $OUT/system/lib/modules/
cp ./drivers/net/wireless/wl12xx/wl12xx_sdio.ko $OUT/system/lib/modules/
cd $OUT
mkdir system/lib/modules
cd $MYDROID/hardware/ti/wlan/mac80211/compat_wl18xx
cp ./compat/compat.ko $OUT/system/lib/modules/
cp ./net/wireless/cfg80211.ko $OUT/system/lib/modules/
cp ./net/mac80211/mac80211.ko $OUT/system/lib/modules/
cp ./drivers/net/wireless/ti/wlcore/wlcore.ko $OUT/system/lib/modules/
cp ./drivers/net/wireless/ti/wl12xx/wl12xx.ko $OUT/system/lib/modules/
cp ./drivers/net/wireless/ti/wl12xx/wl18xx.ko $OUT/system/lib/modules/
cp ./drivers/net/wireless/ti/wl12xx/wlcore_sdio.ko  $OUT/system/lib/modules/

[edit] WLAN firmware

Firmware files go to following location on target file system.

/system/etc/firmware/ti-connectivity/

[edit] Blaze/Tablet

The corresponding firmware files are now part of repo and gets copied as part of Android File System Build.


[edit] OMAP5 sEVM (ICS)

The default connectivity chip in OMAP5 sEVM is wl18xx and ICS code base only supports PG1.1 version of this chip.

If you get following error on your sevm when enabling Wi-Fi on ICS image, it means you have newer version of wilink chip.

[  203.116271] wl12xx: WARNING unsupported chip id: 0x6030111

To resolve this, either move to JB builds or use PG1.1 wilink module on your board.


The corresponding firmware files is not part of repo at this point because of licensing restrictions.

But we have the firmware files as part of OMAP5 daily build artifacts.

Connectivity in Db.png


To get the firmware files do the following,

To enable connectivity do the following,

- Boot your board
- Make sure adb is set up
- Untar wilink_fw.tgz package and run Install_Connectivity.sh script file


[edit] OMAP5 sEVM (JB)

The default connectivity chip in omap5sevm is wl18xx and JB code base only supports PG2.0 version of this chip.

If you get following error on your sevm when enabling Wi-Fi on JB image, it means you have older version of wilink chip.

[  134.714080] wlcore: WARNING chip id 0x6030101 (185x PG10) is deprecated

To resolve this you will need PG2.0 wilink module on your board.


The corresponding firmware files are now part of repo and gets copied as part of Android File System Build.



[edit] WLAN Calibration Instruction

NOTE: For WL18xx or COM8 module we don't need Calibration

NOTE: For WL1283 chip, we have also placed a calibration script file now to calibrate in Android. Just run wifical.sh on your target

   shell@android:/ # cd /system/bin
   shell@android:/ # wifical.sh

[edit] Manual Procedure to calibrate

1) Mount system partition as writable

mount -o remount rw /system

2) Remove old NVS file

rm /system/etc/firmware/ti-connectivity/wl1271-nvs.bin

3) Set the following parameters:

For WL1283 chip

export TARGET_FW_DIR=/system/etc/firmware/ti-connectivity
export TARGET_NVS_FILE=$TARGET_FW_DIR/wl1271-nvs.bin
export WL12xx_MODULE=/system/lib/modules/wl12xx_sdio.ko
export TARGET_INI_FILE=/system/etc/wifi/TQS_D_1.7.ini

For WL1271 chip

Please make sure we have the ini file: /system/etc/wifi/TQS_S_2.6.ini.

If not present please copy it from hardware/ti/wlan/mac80211/ti-utils/ini_files/127x/ folder of the ICS repo.

export TARGET_FW_DIR=/system/etc/firmware/ti-connectivity
export TARGET_NVS_FILE=$TARGET_FW_DIR/wl1271-nvs.bin
export WL12xx_MODULE=/system/lib/modules/wl12xx_sdio.ko
export TARGET_INI_FILE=/system/etc/wifi/TQS_S_2.6.ini

4) Execute Calibrator command

# calibrator plt autocalibrate <dev> <module path> <ini file> <nvs file> [<mac addr>]
# dev: Device name. i.e. wlan0
# module path: Full path to wl12xx_sdio.ko kernel module
# ini file: Full path to Radio param ini file i.e. TQS_S_2.6.ini in this case
# nvs file: Full path of nvs file. i.e. wl1271-nvs.bin. Must be the real path as wl12xx will load it
# mac addr: MAC address to program into the NVS file [optional]

calibrator plt autocalibrate wlan0 $WL12xx_MODULE $TARGET_INI_FILE $TARGET_NVS_FILE
or 
calibrator plt autocalibrate wlan0 $WL12xx_MODULE $TARGET_INI_FILE $TARGET_NVS_FILE 08:00:12:34:56:78

[edit] Making Blaze/Tablet dailybuilds work for WiLink7 (WLAN)

The default connectivity hardware on blaze/tablet platforms is WiLink7 (wl1283). The program has moved to WiLink8 (wl1897) and the builds also by default support WiLink8 now.

People who have the new WiLink8/COM8 module don’t have to do anything.

People who still have WiLink7 module on their platform can enable Wi-Fi features by running a small script which is part of the build.

This script replaces driver module suitable for WiLink7 as default modules and reboots the board.


# su
# wilink7.sh
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox