aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorNeal Oakey <neal.oakey@bingo-ev.de>2016-09-24 19:00:14 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-09-24 19:07:27 +0200
commit524d4110f9a21bb570390303503c61a79435a984 (patch)
tree66d7243390360e3eac8e945e8d9b8a57792877e8 /target
parent3675e657ed2746776a031766c7c121fc1936235b (diff)
downloadupstream-524d4110f9a21bb570390303503c61a79435a984.tar.gz
upstream-524d4110f9a21bb570390303503c61a79435a984.tar.bz2
upstream-524d4110f9a21bb570390303503c61a79435a984.zip
ar71xx: add model detection for many Ubiquiti AirMax XM devices
Signed-off-by: Neal Oakey <neal.oakey@bingo-ev.de> [Matthias Schiffer: minor adjustments] Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Diffstat (limited to 'target')
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/ar71xx.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index e57701ab53..7a3759e7d5 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -64,6 +64,39 @@ 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") # Different revisions of the NanoStation?
+ model="Ubiquiti NanoStation M"
+ ;;
+ "e0a")
+ model="Ubiquiti NanoStation loco M"
+ ;;
+ "e1b") # Rocket M5 untested
+ model="Ubiquiti Rocket M"
+ ;;
+ "e20"|\
+ "e2d") # Bullet M Ti
+ model="Ubiquiti Bullet M"
+ ;;
+ "e30")
+ model="Ubiquiti PicoStation M"
+ ;;
+ esac
+
+ [ -z "$model" ] || AR71XX_MODEL="${model}${magic:3:1}"
+}
+
cybertan_get_hw_magic() {
local part
@@ -569,12 +602,14 @@ ar71xx_board_detect() {
;;
*"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"
@@ -791,6 +826,7 @@ ar71xx_board_detect() {
;;
*"Rocket M")
name="rocket-m"
+ ubnt_xm_board_detect
;;
*"Rocket M TI")
name="rocket-m-ti"