aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2018-02-25 12:09:38 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-04-05 15:28:56 +0200
commitf8dbafb234c9a0a836ff3bede0540c20914b6d4e (patch)
treef98a7325321d3d55980101488efdb13ed89b4250 /target/linux/ar71xx
parentd265a8f2ca49a67a46493cf57de7c265855b317f (diff)
downloadupstream-f8dbafb234c9a0a836ff3bede0540c20914b6d4e.tar.gz
upstream-f8dbafb234c9a0a836ff3bede0540c20914b6d4e.tar.bz2
upstream-f8dbafb234c9a0a836ff3bede0540c20914b6d4e.zip
ar71xx: add model detection for UBNT AC-Mesh
This commit adds correct model detection for UniFi AC-Mesh. Previously said device was incorrectly detected as UniFi AC-Lite. The Information about the device is stored at 0xC in the EEPROM partition. It corresponds to the sysid in /etc/board.info of the Ubiquiti stock firmware. Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'target/linux/ar71xx')
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/ar71xx.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 3586cc99ab..f56494ca46 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -98,6 +98,27 @@ ubnt_xm_board_detect() {
[ -z "$model" ] || AR71XX_MODEL="${model}${magic:3:1}"
}
+ubnt_ac_lite_get_mtd_part_magic() {
+ ar71xx_get_mtd_offset_size_format EEPROM 12 2 %02x
+}
+
+ubnt_ac_lite_board_detect() {
+ local model
+ local magic
+
+ magic="$(ubnt_ac_lite_get_mtd_part_magic)"
+ case ${magic:0:4} in
+ "e517")
+ model="Ubiquiti UniFi-AC-LITE"
+ ;;
+ "e557")
+ model="Ubiquiti UniFi-AC-MESH"
+ ;;
+ esac
+
+ [ -z "$model" ] || AR71XX_MODEL="${model}"
+}
+
cybertan_get_hw_magic() {
local part
@@ -1303,6 +1324,7 @@ ar71xx_board_detect() {
;;
*"UniFi-AC-LITE/MESH")
name="unifiac-lite"
+ ubnt_ac_lite_board_detect
;;
*"UniFi-AC-PRO")
name="unifiac-pro"