[OpenWrt-Devel] [PATCH] [CC] ramips: Backport changes to 07_set_preinit_iface_ramips from trunk.

Vittorio Gambaletta (VittGam) openwrt at vittgam.net
Mon May 2 00:20:14 EDT 2016


Fix failsafe for all rt3050 routers where the LAN port is not wired
to port 0 of the internal switch.

Fix failsafe for MT7620-based routers.

Fix ticket #18768.

Signed-off-by: Vittorio Gambaletta <openwrt at vittgam.net>
---

--- a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
+++ b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
@@ -6,29 +6,24 @@
 . /lib/ramips.sh
 
 ramips_set_preinit_iface() {
-	RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350|MT7628|MT7688)"`
+	RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350|MT7628|MT7688|MT7620)"`
+
 	if [ -n "${RT3X5X}" ]; then
-		swconfig dev rt305x set reset 1
+		# The ethernet switch driver enables VLAN by default, but
+		# failsafe uses eth0, making the device unreachable:
+		# https://dev.openwrt.org/ticket/18768
+		ralink_switchdev=rt305x
+		case "${RT3X5X}" in
+		*MT7620*)
+			ralink_switchdev=mt7620
+			;;
+		esac
+		swconfig dev $ralink_switchdev set reset 1
+		swconfig dev $ralink_switchdev set enable_vlan 0
+		swconfig dev $ralink_switchdev set apply 1
 	fi
 
-	if echo $RT3X5X | egrep -q "(RT5350|MT7628|MT7688)"; then
-		# This is a dirty hack to get by while the switch
-		# problem is investigated. When VLAN is disabled, ICMP
-		# pings work as expected, but TCP connections time
-		# out, so telnetting in failsafe is impossible. The
-		# likely reason is TCP checksumming hardware getting
-		# disabled:
-		# https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg19870.html
-		swconfig dev rt305x set enable_vlan 1
-		swconfig dev rt305x vlan 1 set ports "0 6"
-		swconfig dev rt305x port 6 set untag 0
-		swconfig dev rt305x set apply 1
-		vconfig add eth0 1
-		ifconfig eth0 up
-		ifname=eth0.1
-	else
-		ifname=eth0
-	fi
+	ifname=eth0
 }
 
 boot_hook_add preinit_main ramips_set_preinit_iface
_______________________________________________
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