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>
Sat, 31 Aug 2019 08:31:00 +0000 (10:31 +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>
target/linux/ramips/base-files/etc/board.d/02_network

index 27f85d74588a79e96ccf684ecd6be792e17613b8..2fd7b07bd72b5f54e9dce0b7ddcf8ed8fc27da77 100755 (executable)
@@ -66,9 +66,6 @@ ramips_setup_interfaces()
        mercury,mac1200r-v2|\
        mqmaker,witi|\
        mtc,wr1201|\
-       netgear,r6220|\
-       netgear,r6350|\
-       netgear,wndr3700-v5|\
        netis,wf-2881|\
        nixcore,x1-16m|\
        nixcore,x1-8m|\
@@ -396,7 +393,10 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0"
                ;;
-       netgear,r6120)
+       netgear,r6120|\
+       netgear,r6220|\
+       netgear,r6350|\
+       netgear,wndr3700-v5)
                ucidef_add_switch "switch0" \
                        "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
                ;;
@@ -592,7 +592,8 @@ ramips_setup_macs()
        edimax,br-6475nd)
                wan_mac=$(mtd_get_mac_binary devdata 0x7)
                ;;
-       edimax,br-6478ac-v2)
+       edimax,br-6478ac-v2|\
+       netgear,r6350)
                wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 2)
                ;;
        elecom,wrc-1167ghbk2-s|\
@@ -640,12 +641,6 @@ ramips_setup_macs()
                lan_mac=$(mtd_get_mac_binary factory_info 0xd)
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
-       netgear,r6220|\
-       netgear,r6350|\
-       netgear,wndr3700-v5)
-               wan_mac=$(mtd_get_mac_binary factory 0x4)
-               lan_mac=$(macaddr_add "$wan_mac" 1)
-               ;;
        ohyeah,oy-0001|\
        phicomm,k2g|\
        skylab,skw92a)