From 49a6087deb018ede7870cbd959061045cd89bbb2 Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Thu, 3 May 2018 15:00:46 +0200 Subject: [PATCH] Backport ar71xx: add board detection for UBNT AC-Mesh --- ...add-board-detection-for-UBNT-AC-Mesh.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 patches/lede/0043-ar71xx-add-board-detection-for-UBNT-AC-Mesh.patch diff --git a/patches/lede/0043-ar71xx-add-board-detection-for-UBNT-AC-Mesh.patch b/patches/lede/0043-ar71xx-add-board-detection-for-UBNT-AC-Mesh.patch new file mode 100644 index 00000000..14944907 --- /dev/null +++ b/patches/lede/0043-ar71xx-add-board-detection-for-UBNT-AC-Mesh.patch @@ -0,0 +1,48 @@ +From: David Bauer +Date: Sun, 25 Feb 2018 12:09:38 +0100 +Subject: ar71xx: add board 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. + +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index 8f8158bac8a28db4f4f15ce5c37f48a21084dc03..6282420da534542b26e375d4db7c4a9f4b515a1e 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 + +@@ -1108,6 +1129,7 @@ ar71xx_board_detect() { + ;; + *"UniFi-AC-LITE") + name="unifiac-lite" ++ ubnt_ac_lite_board_detect + ;; + *"UniFi-AC-PRO") + name="unifiac-pro"