[OpenWrt-Devel] [PATCH v2 3/3] ar71xx: add user-space support for the EnGenius ESR900

Forest Crossman cyrozap at gmail.com
Sun Jun 22 16:20:59 EDT 2014


Signed-off-by: Forest Crossman <cyrozap at gmail.com>
---
 package/base-files/files/lib/functions/system.sh           |  1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 |  3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    |  5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 10 ++++++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               |  3 +++
 5 files changed, 22 insertions(+)

diff --git a/package/base-files/files/lib/functions/system.sh b/package/base-files/files/lib/functions/system.sh
index a4c0f26..8d75a5a 100644
--- a/package/base-files/files/lib/functions/system.sh
+++ b/package/base-files/files/lib/functions/system.sh
@@ -82,6 +82,7 @@ macaddr_canonicalize()
 	local mac="$1"
 	local canon=""
 
+	mac=$(echo -n $mac | tr -d \")
 	[ ${#mac} -gt 17 ] && return
 	[ -n "${mac//[a-fA-F0-9\.: -]/}" ] && return
 
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index d5063de..d0306bc 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -65,6 +65,9 @@ get_status_led() {
 	eap7660d)
 		status_led="eap7660d:green:ds4"
 		;;
+	esr900)
+		status_led="engenius:amber:power"
+		;;
 	hiwifi-hc6361)
 		status_led="hiwifi:blue:system"
 		;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index fe5ff93..8265b00 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -103,6 +103,11 @@ dir-825-c1)
 	ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "d-link:blue:wlan2g" "phy0tpt"
 	;;
 
+esr900)
+	ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "engenius:blue:wlan-2g" "phy0tpt"
+	ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "engenius:blue:wlan-5g" "phy1tpt"
+	;;
+
 hiwifi-hc6361)
 	ucidef_set_led_default "inet" "INET" "hiwifi:blue:internet" "0"
 	ucidef_set_led_wlan "wlan" "WLAN" "hiwifi:blue:wlan-2p4" "phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index a2b2762..4604bea 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -241,6 +241,16 @@ wndr4300)
 	[ -n "$mac_wan" ] && ucidef_set_interface_macaddr "wan" "$mac_wan"
 	;;
 
+esr900)
+	local mac
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	ucidef_add_switch_vlan "switch0" "2" "0t 5"
+	mac=$(mtd_get_mac_ascii u-boot-env "wanaddr")
+	[ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
+	;;
+
 all0305 |\
 aw-nr580 |\
 bullet-m |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 6dd5e62..afac42a 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -307,6 +307,9 @@ ar71xx_board_detect() {
 	*EAP7660D)
 		name="eap7660d"
 		;;
+	*"EnGenius ESR900")
+		name="esr900"
+		;;
 	*JA76PF)
 		name="ja76pf"
 		;;
-- 
1.9.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list