aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/base-files/etc/hotplug.d
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2015-04-07 20:04:14 +0000
committerGabor Juhos <juhosg@openwrt.org>2015-04-07 20:04:14 +0000
commit0bd06aca206a3b3ee4d4fbfbad9b7a29744dc35f (patch)
treea1968ec1c15657342c3c4bcfd4af9a35a534194f /target/linux/ar71xx/base-files/etc/hotplug.d
parentd0a6b278db4ffc286cd335c149fb96b386ffab40 (diff)
downloadupstream-0bd06aca206a3b3ee4d4fbfbad9b7a29744dc35f.tar.gz
upstream-0bd06aca206a3b3ee4d4fbfbad9b7a29744dc35f.tar.bz2
upstream-0bd06aca206a3b3ee4d4fbfbad9b7a29744dc35f.zip
ar71xx: add user-space support for RB911G-5HPacD
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 45300
Diffstat (limited to 'target/linux/ar71xx/base-files/etc/hotplug.d')
-rw-r--r--target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata45
1 files changed, 45 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
new file mode 100644
index 0000000000..164d3abd39
--- /dev/null
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+ath10kcal_die() {
+ echo "ath10cal: " "$*"
+ exit 1
+}
+
+ath10kcal_from_file() {
+ local source=$1
+ local offset=$2
+ local target=$3
+
+ dd if=$source of=$target bs=1 skip=$offset count=2116 2>/dev/null || \
+ ath10kcal_die "failed to extract calibration data from $source"
+}
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/ar71xx.sh
+. /lib/functions.sh
+. /lib/functions/system.sh
+
+ath10kcal_mac=""
+ath10kcal_tmp="/tmp/ath10k-caldata.bin"
+
+board=$(ar71xx_board_name)
+
+case "$FIRMWARE" in
+"ath10k/cal-pci-0000:01:00.0.bin")
+ case $board in
+ rb-911g-5hpacd)
+ ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 $ath10kcal_tmp
+ ;;
+ esac
+ ;;
+
+*)
+ exit 1
+ ;;
+esac
+
+[ -f $ath10kcal_tmp ] && {
+ cp $ath10kcal_tmp /lib/firmware/$FIRMWARE
+ rm -f $ath10kcal_tmp
+}