summaryrefslogtreecommitdiff
path: root/xpp/utils/xpp_fxloader
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-04-29 22:44:32 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-04-29 22:44:32 +0000
commit21263d58b5659eb42d200a38b17da18fce49a881 (patch)
tree205cbb81e5906362c4be4eb11800f028694c620f /xpp/utils/xpp_fxloader
parent2c5d383ce7ad82476fe1687b9d29aad87a80e6ee (diff)
xpp rev. 3814:
* Protocol no. 2.6: syncing improvements. * Support for 8-port Astribank BRI. * Firmware unloading now works: rmmod xpp_usb; /etc/hotplug/usb/xpp_fxloader reset * Defaults of kernel parameters are now part of parameter description. * World-readable kernel parameters. * No need for extra patch beyond bristuff for Astribank BRI. * Default poll intervals changed: 500 in BRI and FXO. * Allow changing FXS polls interval at run time. * BRI initalization fixed on SUSE (path to logger). * When using the SUSE zaptel rpm package, set modules_var=ZAPTEL_MODULES in /etc/sysconfig/zaptel . * zt_registration not verbose by default. * xpp_sync warns if FXO is sync slave. * Fixed genzaptelconf -z (zapscan output emulation). * PCM fixes. * Solves "multiple ticks" bug. No need for pcm_tasklets workaround. git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2478 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/utils/xpp_fxloader')
-rw-r--r--xpp/utils/xpp_fxloader34
1 files changed, 28 insertions, 6 deletions
diff --git a/xpp/utils/xpp_fxloader b/xpp/utils/xpp_fxloader
index 3d200e8..eb46ccc 100644
--- a/xpp/utils/xpp_fxloader
+++ b/xpp/utils/xpp_fxloader
@@ -48,6 +48,10 @@
set -e
+# Make sure fxload is in the path:
+PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin"
+export PATH
+
me=`basename $0`
DEFAULTS="/etc/default/zaptel"
@@ -119,10 +123,22 @@ load_fw() {
if [ "$devices" != '' ]; then sleep $REENUM_SLEEP_TIME; fi
}
-hexfile_version() {
- hexfile=$1
+reset_fpga() {
+ v_id=$1
+ p_id=$2
- grep '$Id:' "$hexfile" | sed -e 's/^.*$Id: *[^ ]\+ *//' -e 's/ .*$//'
+ devices=`find_dev $v_id $p_id`
+ for dev in $devices
+ do
+ $LOGGER "Resetting FPGA Firmware on $dev"
+ sleep_if_race
+ $FPGA_LOAD -D "$dev" -r 2>&1 >/dev/null | $LOGGER
+ status=$PIPESTATUS
+ if [ "$status" != 0 ]; then
+ echo "fpga_load failed remoivng with status $status" | $LOGGER
+ exit 78
+ fi
+ done
}
load_fpga() {
@@ -134,11 +150,10 @@ load_fpga() {
for dev in $devices
do
card_ver=`$FPGA_LOAD -g -D $dev | sed -n 's/^.*Release: *//'`
- firm_ver=`hexfile_version $FIRMWARE_DIR/$fw`
- $LOGGER "FPGA Firmware $FIRMWARE_DIR/$fw (version: $firm_ver) into $dev"
+ $LOGGER "FPGA Firmware into $dev"
sleep_if_race
- $FPGA_LOAD -D "$dev" -I "$FIRMWARE_DIR/$fw" 2>&1 >/dev/null | $LOGGER
+ $FPGA_LOAD -D "$dev" -I "$FIRMWARE_DIR/$fw" -i | $LOGGER
status=$PIPESTATUS
if [ $status != 0 ]; then
echo "fpga_load failed with status $status" | $LOGGER
@@ -160,6 +175,10 @@ udev)
PRODUCT="$2"
# skip on to the rest of the script. Don't exit.
;;
+reset)
+ # TODO: does the use of wildcards here work?
+ reset_fpga e4e4 '11[345][12]'
+ ;;
xppdetect|load|usb)
echo "--------- FIRMWARE LOADING: ($1)"
@@ -195,6 +214,9 @@ esac
## Hotplug run
##
+# allow disabling automatic hotplugging:
+if [ "$XPP_HOTPLUG_DISABLED" != '' ]; then return 0; fi
+
if [ "$ACTION" = "add" ] && [ -w "$DEVICE" ]
then
$LOGGER "Trying to find what to do for product $PRODUCT, device $DEVICE"