From 716ca530e1c4515d8683c9d5be3d56b301758b66 Mon Sep 17 00:00:00 2001 From: James <> Date: Wed, 4 Nov 2015 11:49:21 +0000 Subject: trunk-47381 --- package/network/config/soloscli/Makefile | 45 ++++++++++++++++++++++ .../soloscli/files/etc/hotplug.d/atm/15-solos-init | 26 +++++++++++++ .../config/soloscli/files/etc/uci-default/solos | 15 ++++++++ .../network/config/soloscli/files/solos-log-stats | 19 +++++++++ .../config/soloscli/patches/001-no-driver.patch | 11 ++++++ .../config/soloscli/patches/002-cflags.patch | 12 ++++++ 6 files changed, 128 insertions(+) create mode 100644 package/network/config/soloscli/Makefile create mode 100644 package/network/config/soloscli/files/etc/hotplug.d/atm/15-solos-init create mode 100644 package/network/config/soloscli/files/etc/uci-default/solos create mode 100644 package/network/config/soloscli/files/solos-log-stats create mode 100644 package/network/config/soloscli/patches/001-no-driver.patch create mode 100644 package/network/config/soloscli/patches/002-cflags.patch (limited to 'package/network/config/soloscli') diff --git a/package/network/config/soloscli/Makefile b/package/network/config/soloscli/Makefile new file mode 100644 index 0000000..12bc15e --- /dev/null +++ b/package/network/config/soloscli/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=soloscli +PKG_VERSION:=1.04 +PKG_RELEASE:=1 + +PKG_SOURCE:=solos-pci-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/openadsl +PKG_MD5SUM:=c398866de3c059b14eb953c89d698124 +PKG_LICENSE:=GPL-2.0 + +PKG_BUILD_DIR:=$(BUILD_DIR)/solos-pci-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/soloscli + SECTION:=net + CATEGORY:=Network + TITLE:=Configuration utility for Solos ADSL2+ modems + DEPENDS:=+kmod-solos-pci + URL:=http://sourceforge.net/projects/openadsl +endef + +define Package/soloscli/description + This package contains the soloscli utility + for interrogating Traverse Technologies' Solos ADSL2+ modems. +endef + +define Package/soloscli/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/soloscli/soloscli $(1)/usr/bin/ + $(INSTALL_BIN) ./files/solos-log-stats $(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)) diff --git a/package/network/config/soloscli/files/etc/hotplug.d/atm/15-solos-init b/package/network/config/soloscli/files/etc/hotplug.d/atm/15-solos-init new file mode 100644 index 0000000..36d13ea --- /dev/null +++ b/package/network/config/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 diff --git a/package/network/config/soloscli/files/etc/uci-default/solos b/package/network/config/soloscli/files/etc/uci-default/solos new file mode 100644 index 0000000..7f69da6 --- /dev/null +++ b/package/network/config/soloscli/files/etc/uci-default/solos @@ -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__ diff --git a/package/network/config/soloscli/files/solos-log-stats b/package/network/config/soloscli/files/solos-log-stats new file mode 100644 index 0000000..2b75ee3 --- /dev/null +++ b/package/network/config/soloscli/files/solos-log-stats @@ -0,0 +1,19 @@ +#!/bin/sh + +cd /sys/class/atm/ || exit 1 + +for PORT in solos-pci* ; do + + RXRATE=`cat $PORT/parameters/RxBitRate` + TXRATE=`cat $PORT/parameters/TxBitRate` + RXSNR=`cat $PORT/parameters/LocalSNRMargin | sed "s/ dB//"` + TXSNR=`cat $PORT/parameters/RemoteSNRMargin | sed "s/ dB//"` + RXERR=`cat $PORT/parameters/RSUnCorrectedErrorsDn` + TXERR=`cat $PORT/parameters/RSUnCorrectedErrorsUp` + RXFEC=`cat $PORT/parameters/RSCorrectedErrorsDn` + TXFEC=`cat $PORT/parameters/RSCorrectedErrorsUp` + + echo "$RXRATE $RXSNR $RXERR $RXFEC / $TXRATE $TXSNR $TXERR $TXFEC" | + logger -t $PORT +done + diff --git a/package/network/config/soloscli/patches/001-no-driver.patch b/package/network/config/soloscli/patches/001-no-driver.patch new file mode 100644 index 0000000..95588aa --- /dev/null +++ b/package/network/config/soloscli/patches/001-no-driver.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -11,7 +11,7 @@ else + KDIR ?= /lib/modules/$(shell uname -r)/build + PWD := $(shell pwd) + +-all: soloscli driver ++all: soloscli + + soloscli: soloscli/soloscli + diff --git a/package/network/config/soloscli/patches/002-cflags.patch b/package/network/config/soloscli/patches/002-cflags.patch new file mode 100644 index 0000000..a7d6a86 --- /dev/null +++ b/package/network/config/soloscli/patches/002-cflags.patch @@ -0,0 +1,12 @@ +--- a/soloscli/Makefile ++++ b/soloscli/Makefile +@@ -4,9 +4,6 @@ + # Last Mod: 2009-06-16 + # + +-CC=gcc +-CFLAGS=-Wall +- + soloscli: soloscli.c soloscli.h + + clean: -- cgit v1.2.3