ramips: fix network setup for various NETGEAR boards
authorDavid Bauer <mail@david-bauer.net>
Fri, 30 Aug 2019 20:41:18 +0000 (22:41 +0200)
committerDavid Bauer <mail@david-bauer.net>
Fri, 6 Sep 2019 22:59:41 +0000 (00:59 +0200)
There are currently the following issues present for the Netgear R6220,
R6350 and WNDR3700 v5:

 - LAN and WAN MAC-addresses are inverted
 - WAN MAC-address is off. It are +2 compared to the LAN MAC-address
   (R6350 only)
 - Switchport order is inverted in LuCi

This commit fixes both these issues by assigning correct MAC-addresses
to LAN and WAN interfaces and defining the switchports with the correct
labels.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 13937a16d40693df67d3d39faa3a80644bdb7abf)

target/linux/ramips/base-files/etc/board.d/02_network

index 0f2afe042523cd8843a92f928dc69c64b7d5fcec..a5cfd8343a94245aa3d858fb791ca08e22d5d7e7 100755 (executable)
@@ -114,8 +114,6 @@ ramips_setup_interfaces()
        pbr-m1|\
        psg1208|\
        psg1218a|\
-       r6220|\
-       netgear,r6350|\
        rt-n12p|\
        sap-g3200u3|\
        sk-wb8|\
@@ -130,7 +128,6 @@ ramips_setup_interfaces()
        whr-g300n|\
        mqmaker,witi-256m|\
        mqmaker,witi-512m|\
-       wndr3700v5|\
        youku-yk1|\
        youku,yk-l2|\
        zbt-ape522ii|\
@@ -355,7 +352,10 @@ ramips_setup_interfaces()
                        "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0"
                ucidef_set_interface_wan "usb0"
                ;;
-       netgear,r6120)
+       netgear,r6120|\
+       r6220|\
+       netgear,r6350|\
+       wndr3700v5)
                ucidef_add_switch "switch0" \
                        "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
                ;;
@@ -559,7 +559,8 @@ ramips_setup_macs()
        e1700)
                wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
                ;;
-       edimax,br-6478ac-v2)
+       edimax,br-6478ac-v2|\
+       netgear,r6350)
                lan_mac=$(cat /sys/class/net/eth0/address)
                wan_mac=$(macaddr_add "$lan_mac" 2)
                ;;
@@ -628,12 +629,6 @@ ramips_setup_macs()
                lan_mac=$(mtd_get_mac_binary factory 40)
                wan_mac=$(mtd_get_mac_binary factory 46)
                ;;
-       r6220|\
-       netgear,r6350|\
-       wndr3700v5)
-               wan_mac=$(mtd_get_mac_binary factory 4)
-               lan_mac=$(macaddr_add "$wan_mac" 1)
-               ;;
        rt-n56u)
                lan_mac=$(cat /sys/class/net/eth0/address)
                lan_mac=$(macaddr_setbit_la "$lan_mac")