gluon/patches/openwrt/0013-fix-UBNT-XM-model-detection.patch

75 lines
1.5 KiB
Diff
Raw Normal View History

2016-02-14 19:59:49 +00:00
From: Neal Oakey <neal.oakey@bingo-ev.de>
Date: Sun, 14 Feb 2016 20:58:20 +0100
Subject: fix UBNT XM model detection
Signed-off-by: Neal Oakey <neal.oakey@bingo-ev.de>
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index a9dca58..0aa1c86 100755
2016-02-14 19:59:49 +00:00
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -64,6 +64,40 @@ wndr3700_board_detect() {
AR71XX_MODEL="$machine"
}
+ubnt_get_mtd_part_magic() {
+ ar71xx_get_mtd_offset_size_format EEPROM 4118 2 %02x
+}
+
+ubnt_xm_board_detect() {
+ local model
+ local magic
+
+ magic="$(ubnt_get_mtd_part_magic)"
+ case ${magic:0:3} in
+ "e00"|\
+ "e01"|\
+ "e80")
2016-02-14 19:59:49 +00:00
+ model="Ubiquiti NanoStation M"
+ ;;
+ "e0a")
+ model="Ubiquiti NanoStation loco M"
+ ;;
+ "e1b"|\
+ "e1d")
2016-02-14 19:59:49 +00:00
+ model="Ubiquiti Rocket M"
+ ;;
+ "e20"|\
+ "e2d")
2016-02-14 19:59:49 +00:00
+ model="Ubiquiti Bullet M"
+ ;;
+ "e30")
+ model="Ubiquiti PicoStation M"
+ ;;
+ esac
+
+ [ ! -z "$model" ] && AR71XX_MODEL="${model}${magic:3:1}"
+}
+
cybertan_get_hw_magic() {
local part
2016-11-02 16:33:54 +00:00
@@ -478,12 +512,14 @@ ar71xx_board_detect() {
2016-02-14 19:59:49 +00:00
;;
*"Bullet M")
name="bullet-m"
+ ubnt_xm_board_detect
;;
*"Loco M XW")
name="loco-m-xw"
;;
*"Nanostation M")
name="nanostation-m"
+ ubnt_xm_board_detect
;;
*"Nanostation M XW")
name="nanostation-m-xw"
2016-11-02 16:33:54 +00:00
@@ -685,6 +721,7 @@ ar71xx_board_detect() {
2016-02-14 19:59:49 +00:00
;;
*"Rocket M")
name="rocket-m"
+ ubnt_xm_board_detect
;;
*"Rocket M XW")
name="rocket-m-xw"