From 833b602248b2b6ef5efe9e9d80811b03c5d63d75 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Fri, 15 Dec 2006 13:52:45 +0000 Subject: r1719@boole: tzafrir | 2006-12-15 15:50:57 +0200 Sync to xpp RELEASE-1.2.0 2933. r2847@boole: diego | 2006-12-03 10:33:00 +0200 added documentation which explains which packages are needed to build the drivers on different distributions. r2862@boole: tzafrir | 2006-12-05 08:43:50 +0200 README.Astribank: A typo in the sample config (changeset:2861). r2891@boole: tzafrir | 2006-12-08 01:11:45 +0200 Re-accept changeset:2832 after all. r2892@boole: tzafrir | 2006-12-08 02:46:07 +0200 Merge genzaptelconf changeset:2866 from trunk: * Zapata comment on unidentified channel goes to $zapata_file * Correct pattern for Sangoma A200 card's channels. r2893@boole: tzafrir | 2006-12-08 03:11:37 +0200 genzaptelconf: * Add options xpp_fxo_rxgain: add a custom rxgain for every XPP FXO channel. * Do print the original line for every channel. r2909@boole: tzafrir | 2006-12-10 20:03:59 +0200 Add some sleeps in older kernels in the firmware loading script. r2932@boole: tzafrir | 2006-12-14 17:30:12 +0200 Make the warning about a call to off-hook FXO debug. At least if we cannot suppress it at module load time. r2933@boole: tzafrir | 2006-12-14 17:32:00 +0200 Don't redefine 'bool' on newer kerenls to fix building with kernel 2.6.19. Taken from Digium tree. (from changeset:2930) git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1720 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- xpp/utils/xpp_fxloader | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xpp/utils/xpp_fxloader') diff --git a/xpp/utils/xpp_fxloader b/xpp/utils/xpp_fxloader index 8c54370..b14f746 100644 --- a/xpp/utils/xpp_fxloader +++ b/xpp/utils/xpp_fxloader @@ -75,6 +75,17 @@ REENUM_SLEEP_TIME=3 # only used on manual runs FPGA_LOAD="/usr/sbin/fpga_load" +# With Kernels older that 2.6.10 it seems to be possible +# to trigger a race condition by running fxload or fpga_load +# immediately after the detection of the device. +KERNEL_HAS_USB_RACE=0 +case "`uname -r`" in 2.6.[89]*) KERNEL_HAS_USB_RACE=1;; esac +sleep_if_race() { + if [ "$KERNEL_HAS_USB_RACE" = '1' ]; then + sleep 2 + fi +} + find_dev() { v_id=$1 p_id=$2 @@ -83,6 +94,7 @@ find_dev() { } do_fxload() { + sleep_if_race ( fxload -t fx2 $* 2>&1 1>/dev/null || exit 1 ) | $LOGGER } @@ -120,6 +132,7 @@ load_fpga() { firm_ver=`hexfile_version $FIRMWARE_DIR/$fw` $LOGGER "FPGA Firmware $FIRMWARE_DIR/$fw into $dev" + sleep_if_race $FPGA_LOAD -D "$dev" -I "$FIRMWARE_DIR/$fw" 2>&1 >/dev/null | $LOGGER status=$PIPESTATUS if [ $status != 0 ]; then @@ -193,6 +206,7 @@ then else FIRM_FPGA="$FIRMWARE_DIR/FPGA_$prod_id.hex" fi + sleep_if_race $FPGA_LOAD -D "$DEVICE" -I "$FIRM_FPGA" 2>&1 >/dev/null | $LOGGER ;; esac -- cgit v1.2.3