[svn-commits] tzafrir: branch tools/tzafrir/sysfs r8706 - in /tools/team/tzafrir/sysfs: ./ ...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu May 27 09:47:46 CDT 2010
Author: tzafrir
Date: Thu May 27 09:47:44 2010
New Revision: 8706
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8706
Log:
change span readiness criteria:
* Don't wait for dahdi_cfg ioctl()
* Instead create a read/write 'user_ready' span attribute:
- Writing to it from UDEV symlink_span (online)
- Reading it blocks until writing
- Used by dahdi_waitfor_spans to verify spans are ready
* Don't need to use udevsettle in dahdi_waitfor_spans.
* Also add a 'configured_channels' readonly attributes that shows
the same info as 'user_ready' without blocking.
Modified:
tools/team/tzafrir/sysfs/dahdi_waitfor_spans
tools/team/tzafrir/sysfs/xpp/symlink_span
Modified: tools/team/tzafrir/sysfs/dahdi_waitfor_spans
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/sysfs/dahdi_waitfor_spans?view=diff&rev=8706&r1=8705&r2=8706
==============================================================================
--- tools/team/tzafrir/sysfs/dahdi_waitfor_spans (original)
+++ tools/team/tzafrir/sysfs/dahdi_waitfor_spans Thu May 27 09:47:44 2010
@@ -1,14 +1,29 @@
#! /bin/sh
+wait_spans() {
+ status=0
+ list1=`ls /sys/bus/dahdi_spans/devices/span-*/user_ready 2>/dev/null`
+ for file in $list1
+ do
+ if ! cat $file
+ then
+ status=1
+ fi
+ done
+ list2=`ls /sys/bus/dahdi_spans/devices/span-*/user_ready 2>/dev/null`
+ if [ "$list1" != "$list2" ]; then
+ echo 1>&2 "$0: More spans detected"
+ status=1
+ fi
+ return $status
+}
+
echo "Waiting for DAHDI spans to be ready..."
-udevsettle
for i in 1 2 3
do
- if cat -n /sys/bus/dahdi_spans/devices/span-*/wait_for_channels
- then
+ if wait_spans; then
break
else
echo 1>&2 "$0: retry ($i)"
fi
done
-udevsettle
Modified: tools/team/tzafrir/sysfs/xpp/symlink_span
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/sysfs/xpp/symlink_span?view=diff&rev=8706&r1=8705&r2=8706
==============================================================================
--- tools/team/tzafrir/sysfs/xpp/symlink_span (original)
+++ tools/team/tzafrir/sysfs/xpp/symlink_span Thu May 27 09:47:44 2010
@@ -39,7 +39,7 @@
}
eval set -- "$ARGS"
-echo >&2 "$0: DEBUG($#): '$*'"
+echo >&2 "$0: DEBUG($# args): '$*'"
while [ $# -gt 0 ]; do
case "$1" in
@@ -130,5 +130,6 @@
;;
online)
dahdi_cfg -c "$dahdiconfdir/system.conf" -S "$SPAN_NUM" -k 2>&1 | $LOGGER
+ ( echo 1 > "/sys$DEVPATH/user_ready" ) 2>&1 | $LOGGER
;;
esac
More information about the svn-commits
mailing list