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.
Third time's a charm... this time with the diffs.
Index: package/soloscli/files/etc/uci-default/solos
===================================================================
--- package/soloscli/files/etc/uci-default/solos (revision 0)
+++ package/soloscli/files/etc/uci-default/solos (revision 0)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+uci batch <<__EOF__
+
+delete network.wan.solos0
+
+add_list network.wan.solos0="ActivateLine=Abort"
+add_list network.wan.solos0="Retrain=EnableAll"
+add_list network.wan.solos0="DetectNoise=Enable"
+add_list network.wan.solos0="BisMCapability=Disable"
+add_list network.wan.solos0="BisACapability=Disable"
+add_list network.wan.solos0="ActivateLine=Start"
+
+commit network
+__EOF__
Index: package/soloscli/files/etc/hotplug.d/atm/15-solos-init
===================================================================
--- package/soloscli/files/etc/hotplug.d/atm/15-solos-init (revision 0)
+++ package/soloscli/files/etc/hotplug.d/atm/15-solos-init (revision 0)
@@ -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
Index: package/soloscli/Makefile
===================================================================
--- package/soloscli/Makefile (revision 25243)
+++ package/soloscli/Makefile (working copy)
@@ -37,6 +37,8 @@
define Package/soloscli/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/soloscli/soloscli $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/atm
+ $(INSTALL_DATA) ./files/etc/hotplug.d/atm/15-solos-init
$(1)/etc/hotplug.d/atm/
endef
$(eval $(call BuildPackage,soloscli))
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel