ath79: add ubiquiti unifi ap ac lite/lr
[openwrt/staging/dedeckeh.git] / target / linux / ath79 / base-files / etc / board.d / 02_network
index c02d9ff06379c038db65ff0f5195debbbcd4c52c..6a344b7467ea2d793d701ee0f7702b042d4630e9 100755 (executable)
@@ -2,15 +2,20 @@
 
 . /lib/functions/system.sh
 . /lib/functions/uci-defaults.sh
+. /lib/functions/k2t.sh
 
 ath79_setup_interfaces()
 {
        local board="$1"
 
        case "$board" in
+       "etactica,eg200")
+               ucidef_set_interface_lan "eth0" "dhcp"
+               ;;
        "avm,fritz300e"|\
        "tplink,tl-mr10u"|\
        "tplink,tl-wr703n"|\
+       "ubnt,ubnt-unifiac-lite"|\
        "ubnt,unifi")
                ucidef_set_interface_lan "eth0"
                ;;
@@ -23,7 +28,10 @@ ath79_setup_interfaces()
        "glinet,ar150")
                ucidef_set_interfaces_lan_wan "eth1" "eth0"
                ;;
-               
+       "tplink,tl-mr3020-v1")
+               ucidef_set_interface_lan "eth0.1"
+               ucidef_add_switch "switch0" "0@eth0" "1:lan"
+               ;;
        "tplink,tl-wdr3600"|\
        "tplink,tl-wdr4300")
                ucidef_add_switch "switch0" \
@@ -54,6 +62,10 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
                ;;
+       "phicomm,k2t")
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "3:lan:1" "5:lan:2" "4:wan"
+               ;;
        *)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ;;
@@ -68,9 +80,14 @@ ath79_setup_macs()
        avm,fritz300e)
                lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
                ;;
+       phicomm,k2t)
+               lan_mac=$(k2t_get_mac "lan_mac")
+               wan_mac=$(k2t_get_mac "wan_mac")
+               ;;
        esac
 
        [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
+       [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
 }
 
 board_config_update