ramips: setup mac and network interfaces from separate functions
authorGabor Juhos <juhosg@openwrt.org>
Thu, 1 Dec 2011 22:48:43 +0000 (22:48 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Thu, 1 Dec 2011 22:48:43 +0000 (22:48 +0000)
SVN-Revision: 29382

target/linux/ramips/base-files/etc/uci-defaults/network

index e58accd181f7ecbb4e5044c48642533358a6da78..7baac0c9c07b04559efb7188a69fa14ccb9c628e 100755 (executable)
@@ -107,21 +107,43 @@ set_macs_only_lan_from_nvram()
        set_macs_only_lan "$lan_mac"
 }
 
-board=$(ramips_board_name)
+ramips_setup_interfaces()
+{
+       local board="$1"
 
-case $board in
-       f5d8235-v2)
-               create_lan_wan
-               set_macs_only_lan_from_mtd "u-boot" 262148
-               ;;
+       case $board in
        argus-atp52b | \
        b2c | \
+       f5d8235-v2 | \
        nw718)
                create_lan_wan
-               set_macs_only_lan_from_mtd "factory" 4
                ;;
+
        *)
                RT3X5X=`cat /proc/cpuinfo | grep RT3.5`
                [ -z "${RT3X5X}" ] || create_lan_wan
                ;;
-esac
+       esac
+}
+
+ramips_setup_macs()
+{
+       local board="$1"
+
+       case $board in
+       f5d8235-v2)
+               set_macs_only_lan_from_mtd "u-boot" 262148
+               ;;
+
+       argus-atp52b | \
+       b2c | \
+       nw718)
+               set_macs_only_lan_from_mtd "factory" 4
+               ;;
+       esac
+}
+
+board=$(ramips_board_name)
+
+ramips_setup_interfaces $board
+ramips_setup_macs $board