aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2019-12-17 01:15:35 +0100
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-01-14 22:04:29 +0100
commit355f0444f3622347650776dd8f1e388dc5d000ca (patch)
treeb1d60761c4f170df95c94c3bc7055f300e9bac1a /target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
parentb070101c506ca5541d6f232c2da3e0f7b1383106 (diff)
downloadupstream-355f0444f3622347650776dd8f1e388dc5d000ca.tar.gz
upstream-355f0444f3622347650776dd8f1e388dc5d000ca.tar.bz2
upstream-355f0444f3622347650776dd8f1e388dc5d000ca.zip
lantiq: split base-files into subtargets
This splits the device-dependent base-files into subtarget directories, like done recently for ath79 and ramips. While this increases the overall lines of codes, it will make the code per subtarget smaller and easier to keep track of features and devices. While at it, several variables at the top of 02_network are removed, as they were never changed. The values are put directly into the function calls where they are used. Remove unneeded LED setup from 01_leds, and remove 01_leds entirely for falcon subtarget (as it is not used there). Applies alphabetic reordering to device cases in base-files. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/lantiq/xrx200/base-files/etc/board.d/02_network')
-rwxr-xr-xtarget/linux/lantiq/xrx200/base-files/etc/board.d/02_network143
1 files changed, 143 insertions, 0 deletions
diff --git a/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network b/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
new file mode 100755
index 0000000000..f56de32614
--- /dev/null
+++ b/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
@@ -0,0 +1,143 @@
+#!/bin/sh
+#
+# Copyright (C) 2011-2015 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+. /lib/functions/system.sh
+. /lib/functions/lantiq.sh
+
+board_config_update
+
+annex="a"
+
+lan_mac=""
+wan_mac=""
+
+board=$(board_name)
+
+case "$board" in
+alphanetworks,asl56026)
+ lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
+ wan_mac=$(mtd_get_mac_ascii uboot_env wanmac)
+ ucidef_add_switch "switch0"\
+ "2:lan" "3:lan" "6t@eth0"
+ ;;
+arcadyan,arv7519rw22)
+ wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 0x16)" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan:5" "2:lan:3" "3:lan:4" "4:lan:1" "5:lan:2" "6t@eth0"
+ ;;
+arcadyan,vg3503j)
+ lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_add_switch "switch0" \
+ "2:lan:2" "4:lan:1" "6t@eth0"
+ ;;
+arcadyan,vgv7510kw22-brn|\
+arcadyan,vgv7510kw22-nor)
+ annex="b"
+ wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 0x16)" 2)
+ ucidef_add_switch "switch0" \
+ "2:lan:2" "3:lan:1" "4:lan:4" "5:lan:3" "0:wan:5" "6t@eth0"
+ ;;
+arcadyan,vgv7519-brn|\
+arcadyan,vgv7519-nor)
+ wan_mac=$(mtd_get_mac_binary board_config 0x16)
+ ucidef_add_switch "switch0" \
+ "0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0"
+ ;;
+avm,fritz3370-rev2-hynix|\
+avm,fritz3370-rev2-micron)
+ annex="b"
+ lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
+ wan_mac=$(macaddr_add "$lan_mac" 3)
+ ucidef_add_switch "switch0" \
+ "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t@eth0"
+ ;;
+avm,fritz7360sl)
+ annex="b"
+ wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 0xa91)" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t@eth0"
+ ;;
+avm,fritz7362sl)
+ annex="b"
+ lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
+ wan_mac=$(fritz_tffs -n macdsl -i $(find_mtd_part "tffs (1)"))
+ ucidef_add_switch "switch0" \
+ "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t@eth0"
+ ;;
+avm,fritz7412)
+ tffsdev=$(find_mtd_chardev "nand-tffs")
+ annex="b"
+ lan_mac=$(/usr/bin/fritz_tffs_nand -d $tffsdev -n maca -o)
+ wan_mac=$(/usr/bin/fritz_tffs_nand -d $tffsdev -n macdsl -o)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+bt,homehub-v5a)
+ lan_mac=$(mtd_get_mac_binary_ubi caldata 0x110c)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0"
+ ;;
+buffalo,wbmr-300hpd)
+ lan_mac=$(mtd_get_mac_ascii ubootconfig ethaddr)
+ wan_mac="$lan_mac"
+ ucidef_add_switch "switch0" \
+ "5:lan:2" "2:lan:3" "3:lan:4" "4:wan:1" "6t@eth0"
+ ;;
+lantiq,easy80920-nand|\
+lantiq,easy80920-nor)
+ lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0"
+ ;;
+netgear,dm200)
+ lan_mac=$(mtd_get_mac_binary ART 0x0)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+tplink,tdw8970|\
+tplink,tdw8980)
+ wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 0xf100)" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan:2" "2:lan:3" "4:lan:4" "5:lan:1" "6t@eth0"
+ ;;
+tplink,vr200|\
+tplink,vr200v)
+ wan_mac=$(macaddr_add "$(mtd_get_mac_binary romfile 0xf100)" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan" "2:lan" "4:lan" "5:lan" "6t@eth0"
+ ;;
+zyxel,p-2812hnu-f1|\
+zyxel,p-2812hnu-f3)
+ lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_add_switch "switch0" \
+ "0:lan" "1:lan" "2:lan" "4:lan" "5:wan" "6t@eth0"
+ ;;
+*)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+esac
+
+ls /lib/modules/$(uname -r)/ltq_atm* 1> /dev/null 2>&1 && \
+ ucidef_add_atm_bridge 1 32 "llc" "bridged" "dsl"
+
+if lantiq_is_vdsl_system; then
+ ucidef_add_vdsl_modem "$annex" "av"
+else
+ ucidef_add_adsl_modem "$annex" "/lib/firmware/adsl.bin"
+fi
+
+ucidef_set_interface_wan "dsl0" "pppoe"
+
+[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
+[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
+
+board_config_flush
+
+exit 0
+