Author: juhosg
Date: 2015-04-07 22:04:14 +0200 (Tue, 07 Apr 2015)
New Revision: 45300

Added:
   trunk/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
Modified:
   trunk/target/linux/ar71xx/base-files/etc/diag.sh
   trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
   trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
Log:
ar71xx: add user-space support for RB911G-5HPacD

Signed-off-by: Gabor Juhos <[email protected]>

Modified: trunk/target/linux/ar71xx/base-files/etc/diag.sh
===================================================================
--- trunk/target/linux/ar71xx/base-files/etc/diag.sh    2015-04-07 20:04:03 UTC 
(rev 45299)
+++ trunk/target/linux/ar71xx/base-files/etc/diag.sh    2015-04-07 20:04:14 UTC 
(rev 45300)
@@ -161,6 +161,7 @@
                status_led="rb750:green:act"
                ;;
        rb-911g-2hpnd|\
+       rb-911g-5hpacd|\
        rb-911g-5hpnd|\
        rb-912uag-2hpnd|\
        rb-912uag-5hpnd)

Added: 
trunk/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
===================================================================
--- 
trunk/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata   
                            (rev 0)
+++ 
trunk/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata   
    2015-04-07 20:04:14 UTC (rev 45300)
@@ -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
+}

Modified: trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
===================================================================
--- trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network    
2015-04-07 20:04:03 UTC (rev 45299)
+++ trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network    
2015-04-07 20:04:14 UTC (rev 45300)
@@ -312,6 +312,7 @@
 mr900v2 |\
 rb-411 |\
 rb-911g-2hpnd |\
+rb-911g-5hpacd |\
 rb-911g-5hpnd |\
 rb-912uag-2hpnd |\
 rb-912uag-5hpnd |\

Modified: trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
===================================================================
--- trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh  2015-04-07 20:04:03 UTC 
(rev 45299)
+++ trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh  2015-04-07 20:04:14 UTC 
(rev 45300)
@@ -582,6 +582,9 @@
        *"RouterBOARD 911G-5HPnD")
                name="rb-911g-5hpnd"
                ;;
+       *"RouterBOARD 911G-5HPacD")
+               name="rb-911g-5hpacd"
+               ;;
        *"RouterBOARD 912UAG-2HPnD")
                name="rb-912uag-2hpnd"
                ;;
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to