From 0b00ed9193abe925b01b063c9d965cfd13970b3d Mon Sep 17 00:00:00 2001
From: Dark4MD <github.web@manu.li>
Date: Tue, 15 Jun 2021 20:12:35 +0200
Subject: [PATCH] ramips-mt76x8: add Xiaomi Mi Router 4A (100M Edition)

---
 docs/user/supported_devices.rst                            | 4 ++++
 .../gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac    | 3 +++
 targets/ramips-mt76x8                                      | 7 +++++++
 3 files changed, 14 insertions(+)

diff --git a/docs/user/supported_devices.rst b/docs/user/supported_devices.rst
index af95cd78c..5dd0ae6fe 100644
--- a/docs/user/supported_devices.rst
+++ b/docs/user/supported_devices.rst
@@ -405,6 +405,10 @@ ramips-mt76x8
 
   - VoCore2
 
+* Xiaomi
+
+  - Xiaomi Mi Router 4A (100M Edition)
+
 ramips-rt305x [#deprecated]_  [#device-class-tiny]_
 ---------------------------------------------------
 
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
index 027239ac6..dae573db6 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac
@@ -130,6 +130,9 @@ local primary_addrs = {
 			'tplink,c2-v1',
 			'ex3700'
 		}},
+		{'ramips', 'mt76x8', {
+			'xiaomi,mir4a-100m',
+		}},
 		{'x86'},
 	}},
 	{interface('wan'), {
diff --git a/targets/ramips-mt76x8 b/targets/ramips-mt76x8
index ccc83143f..1af12e5ca 100644
--- a/targets/ramips-mt76x8
+++ b/targets/ramips-mt76x8
@@ -74,3 +74,10 @@ device('tp-link-tl-wr902ac-v3', 'tplink_tl-wr902ac-v3', {
 device('vocore2', 'vocore2', {
 	factory = false,
 })
+
+
+-- Xiaomi
+
+device('xiaomi-mi-router-4a-100m-edition', 'xiaomi_mir4a-100m', {
+	factory = false,
+})
-- 
GitLab