diff options
Diffstat (limited to 'target/linux/lantiq/ase')
-rwxr-xr-x | target/linux/lantiq/ase/base-files/etc/board.d/02_network | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/target/linux/lantiq/ase/base-files/etc/board.d/02_network b/target/linux/lantiq/ase/base-files/etc/board.d/02_network index 2334d6c25b..0bda3e4763 100755 --- a/target/linux/lantiq/ase/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/ase/base-files/etc/board.d/02_network @@ -7,37 +7,50 @@ . /lib/functions/system.sh . /lib/functions/lantiq.sh -board_config_update - -annex="a" - -lan_mac="" -wan_mac="" +lantiq_setup_interfaces() +{ + local board="$1" + + case "$board" in + *) + ucidef_set_interface_lan 'eth0' + ;; + esac +} + +lantiq_setup_dsl() +{ + local board="$1" + local annex="b" + + case "$board" in + esac + + lantiq_setup_dsl_helper "$annex" +} + +lantiq_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + + case "$board" in + allnet,all0333cj) + lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac" + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac" +} +board_config_update board=$(board_name) - -case "$board" in -allnet,all0333cj) - annex="b" - lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) - wan_mac=$(macaddr_add "$lan_mac" 1) - ucidef_set_interface_lan 'eth0' - ;; -netgear,dgn1000b) - annex="b" - ucidef_set_interface_lan 'eth0' - ;; -*) - ucidef_set_interface_lan 'eth0' - ;; -esac - -lantiq_setup_dsl_helper "$annex" - -[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac" -[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac" - +lantiq_setup_interfaces $board +lantiq_setup_dsl $board +lantiq_setup_macs $board board_config_flush exit 0 - |