lantiq: xway: rename nas0/ptm0 to dsl0
authorMathias Kresin <dev@kresin.me>
Sat, 14 Oct 2017 18:52:22 +0000 (20:52 +0200)
committerMathias Kresin <dev@kresin.me>
Wed, 25 Oct 2017 06:45:05 +0000 (08:45 +0200)
This change makes it possible to configure the wan/dsl ppp interface
settings independantly from the used TC-Layer (ATM/PTM).

By using dsl0 as interface name as for the xrx200 we can get rid of a
few conditionals which were introduced because of the different default
TC-Layer in xway and xrx200.

Signed-off-by: Mathias Kresin <dev@kresin.me>
package/network/config/ltq-adsl-app/Makefile
package/network/config/ltq-adsl-app/files/10-adsl_rename [new file with mode: 0644]
target/linux/lantiq/base-files/etc/board.d/01_leds
target/linux/lantiq/base-files/etc/board.d/02_network
target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface

index db3decaabec2047681baf747382d67b9c2829af2..1b9de80279d62e61f781997d748b31ff85b99f7f 100644 (file)
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=dsl_cpe_control_danube
 PKG_VERSION:=3.24.4.4
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(BUILD_DIR)/dsl_cpe_control-$(PKG_VERSION)
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
@@ -35,7 +35,7 @@ define Package/ltq-adsl-app
   CATEGORY:=Network
   TITLE:=Lantiq DSL userland tool
   URL:=http://www.lantiq.com/
-  DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +libpthread
+  DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +libpthread +ip
   MENU:=1
 endef
 
@@ -76,10 +76,11 @@ CONFIGURE_ARGS += \
 TARGET_CFLAGS += -I$(LINUX_DIR)/include
 
 define Package/ltq-adsl-app/install
-       $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl
+       $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl $(1)/etc/hotplug.d/net
        $(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/
        $(INSTALL_BIN) ./files/10_atm.sh $(1)/etc/hotplug.d/dsl
        $(INSTALL_BIN) ./files/10_ptm.sh $(1)/etc/hotplug.d/dsl
+       $(INSTALL_BIN) ./files/10-adsl_rename $(1)/etc/hotplug.d/net
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dsl_cpe_control $(1)/sbin
 endef
 
diff --git a/package/network/config/ltq-adsl-app/files/10-adsl_rename b/package/network/config/ltq-adsl-app/files/10-adsl_rename
new file mode 100644 (file)
index 0000000..faa5911
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ "$ACTION" = add ]; then
+       [ "$DEVICENAME" = "nas0" ] ||[ "$DEVICENAME" = "ptm0" ] || exit
+
+       ip link set $DEVICENAME name dsl0
+fi
index 5a692c4fa077077b583033b31b4349591c63c3ee..2c7a402dfb7559505a127da41ad27175a7aeede3 100755 (executable)
@@ -20,15 +20,12 @@ led_usb2="$(lantiq_get_dt_led usb2)"
 
 led_dsl="$(lantiq_get_dt_led dsl)"
 [ -n "$led_dsl" ] && {
-       interface="nas0"
-       lantiq_is_vdsl_system && interface="dsl0"
-
        led_internet="$(lantiq_get_dt_led internet)"
        if [ -n "$led_internet" ]; then
                ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0"
                ucidef_set_led_netdev "internet" "internet" "$led_internet" "pppoe-wan"
        else
-               ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "$interface"
+               ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "dsl0"
        fi
 }
 
index 8c2a118d96a8b85ec7cfd513d1adfd10acec1f04..18d0ba4926ef0bf00c5eae483c650b2b3a63aa77 100755 (executable)
@@ -18,7 +18,7 @@ encaps="llc"
 payload="bridged"
 lan_mac=""
 wan_mac=""
-interface_wan=""
+interface_wan="dsl0"
 
 board=$(board_name)
 
@@ -230,10 +230,8 @@ ls /lib/modules/$(uname -r)/ltq_atm* 1> /dev/null 2>&1 && \
        ucidef_add_atm_bridge "$vpi" "$vci" "$encaps" "$payload"
 
 if lantiq_is_vdsl_system; then
-       interface_wan="dsl0"
        ucidef_add_vdsl_modem "$annex" "$tone" "$xfer_mode"
 else
-       interface_wan="nas0"
        ucidef_add_adsl_modem "$annex" "/lib/firmware/adsl.bin"
 fi
 
index 1a7cd337e71a341373500bedc799ee7f59aab217..292d407c30bdf84392ae11a480d0f36ef2a8fb9f 100644 (file)
@@ -40,8 +40,6 @@ migrate_led_xdsl_ifname()
        rename_xdsl_ifname system "$1" dev
 }
 
-lantiq_is_vdsl_system || exit 0
-
 config_load network
 config_foreach migrate_network_xdsl_ifname