diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-02-13 02:52:49 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-02-13 02:52:49 +0000 |
commit | b6c9d7f86d673a858bc7a40638be8a02b724e3de (patch) | |
tree | a5a0849478e7cc1a641623497bfb4c5e33f02a55 /package/soloscli/files/etc/hotplug.d/atm | |
parent | 9783aefafee41c494949207019fbacae4adc77c2 (diff) | |
download | master-187ad058-b6c9d7f86d673a858bc7a40638be8a02b724e3de.tar.gz master-187ad058-b6c9d7f86d673a858bc7a40638be8a02b724e3de.tar.bz2 master-187ad058-b6c9d7f86d673a858bc7a40638be8a02b724e3de.zip |
soloscli: allow user to apply settings to solos h/w before bringing up network (patch by Philip Prindeville)
If the network/wan configuration contains "solos0" ... "solos3" then this list of strings will be applied to the FPGA when the hardware is hotplug added.
The syntax should be "tag=value", as per the values enumerated in the solos-attr.c list.
In the canned example, the modem is temporarily turned off, told to detect noise, told to disable annexes M and A (effectively putting it into pure ADSL mode), and re-activated.
There's probably a more appropriate function name than "dialog" but that's what I came up with.
Handle other ATM hardware (Eagle, etc) besides solos-pci.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25510 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/soloscli/files/etc/hotplug.d/atm')
-rw-r--r-- | package/soloscli/files/etc/hotplug.d/atm/15-solos-init | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/package/soloscli/files/etc/hotplug.d/atm/15-solos-init b/package/soloscli/files/etc/hotplug.d/atm/15-solos-init new file mode 100644 index 0000000000..36d13ea5a0 --- /dev/null +++ b/package/soloscli/files/etc/hotplug.d/atm/15-solos-init @@ -0,0 +1,26 @@ +#!/bin/sh + +dialog() { + local tag="$(echo "$1" | cut -d= -f1)" + local value="$(echo "$1" | cut -d= -f2-)" + local response + + response="$(soloscli -s "$port" "$tag" "$value")" + [ $? -ne 0 ] && { + logger "soloscli($port): $tag '$value' returns $response" + } +} + +if [ "$ACTION" = "add" ]; then + include /lib/network + scan_interfaces + + case $DEVICENAME in + solos-pci[0-3]) + port="${DEVICENAME#solos-pci}" + device="solos${port}" + + config_list_foreach wan "$device" dialog + ;; + esac +fi |