summaryrefslogtreecommitdiff
path: root/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mtocgd3/calibrate-wifi.sh
blob: 21659cdaf5a2023752a1bbea05801c498d76c0d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

if [[ $# -ne 1 ]]; then
	echo "usage: $0 <wifi-mac-address>"
	exit 1
fi

WIFIMAC=$1

set -x

killall hostapd
killall wpa_supplicant

modprobe -r wl12xx_sdio
modprobe -r atmel_mci

mts-io-sysfs store wlan-enabled 0
sleep 1
mts-io-sysfs store wlan-enabled 1
sleep 1

mount -o remount,rw /var/oem
rm -f /var/oem/mts/wl1271-nvs.bin
ln -f -s /var/oem/mts/wl1271-nvs.bin /lib/firmware/ti-connectivity/wl1271-nvs.bin

modprobe atmel_mci
sleep 1
rmmod wl12xx_sdio

calibrator plt autocalibrate wlan0 \
    /lib/modules/2.6.39.4/updates/drivers/net/wireless/wl12xx/wl12xx_sdio.ko \
    /usr/share/ti/wifi-utils/ini_files/127x/TQS_S_2.6.ini \
    /lib/firmware/ti-connectivity/wl1271-nvs.bin \
    $WIFIMAC

mount -o remount,ro /var/oem