diff options
author | Mathias Kresin <dev@kresin.me> | 2017-10-15 12:29:22 +0200 |
---|---|---|
committer | Mathias Kresin <dev@kresin.me> | 2017-10-25 08:45:05 +0200 |
commit | 1470c79cebdae83161a48a5e08c6002ecf090f42 (patch) | |
tree | cfd81b21e036ea69651028df67027bd79a5bd977 /package/network/config/ltq-adsl-app/files | |
parent | d456a888d07e97491ad2d57f470801bbbc4c06a6 (diff) | |
download | upstream-1470c79cebdae83161a48a5e08c6002ecf090f42.tar.gz upstream-1470c79cebdae83161a48a5e08c6002ecf090f42.tar.bz2 upstream-1470c79cebdae83161a48a5e08c6002ecf090f42.zip |
ltq-adsl-app: use notification based ATM/PTM driver load
This patch removes the fixed atm/ptm driver loading and
switches to notification based driver loading.
Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'package/network/config/ltq-adsl-app/files')
-rwxr-xr-x | package/network/config/ltq-adsl-app/files/10_atm.sh | 31 | ||||
-rwxr-xr-x | package/network/config/ltq-adsl-app/files/10_ptm.sh | 29 |
2 files changed, 60 insertions, 0 deletions
diff --git a/package/network/config/ltq-adsl-app/files/10_atm.sh b/package/network/config/ltq-adsl-app/files/10_atm.sh new file mode 100755 index 0000000000..898d8ec07c --- /dev/null +++ b/package/network/config/ltq-adsl-app/files/10_atm.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "ATM" ] && \ +! grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer ATM" + +if grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading ATM driver while EFM/PTM driver is loaded is not possible. Reboot is needed." + exit +fi + +case "$(strings /proc/device-tree/compatible)" in +*lantiq,ar9*) + soc="ar9" + ;; +*lantiq,ase*) + soc="ase" + ;; +*lantiq,danube*) + soc="danube" + ;; +*) + logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" + exit +esac + +modprobe ltq_atm_${soc} + +/etc/init.d/br2684ctl reload diff --git a/package/network/config/ltq-adsl-app/files/10_ptm.sh b/package/network/config/ltq-adsl-app/files/10_ptm.sh new file mode 100755 index 0000000000..8a76b926f7 --- /dev/null +++ b/package/network/config/ltq-adsl-app/files/10_ptm.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "EFM" ] && \ +! grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer EFM/PTM" + +if grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading EFM/PTM driver while ATM driver is loaded is not possible. Reboot is needed." + exit +fi + +case "$(strings /proc/device-tree/compatible)" in +*lantiq,ar9*) + soc="ar9" + ;; +*lantiq,ase*) + soc="ase" + ;; +*lantiq,danube*) + soc="danube" + ;; +*) + logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" + exit +esac + +modprobe ltq_ptm_${soc} |