summaryrefslogtreecommitdiff
path: root/xpp/waitfor_xpds
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/waitfor_xpds')
-rwxr-xr-xxpp/waitfor_xpds18
1 files changed, 14 insertions, 4 deletions
diff --git a/xpp/waitfor_xpds b/xpp/waitfor_xpds
index 7caa981..6bee5f2 100755
--- a/xpp/waitfor_xpds
+++ b/xpp/waitfor_xpds
@@ -29,6 +29,8 @@ set -e
mydir=`dirname $0`
PATH="${mydir}:${PATH}"
+[ -r /etc/dahdi/init.conf ] && . /etc/dahdi/init.conf
+
ab_list() {
# Only check /sys info (don't use /proc anymore).
ab=`find /sys/bus/astribanks/devices/xbus-*/ -name waitfor_xpds 2> /dev/null || :`
@@ -45,7 +47,7 @@ if ! astribank_is_starting="`which astribank_is_starting 2>/dev/null`"; then
exit 0
fi
if [ "`$dahdi_hardware | grep xpp_usb`" != "" ]; then
- astribank_is_starting -a
+ astribank_is_starting -v -a
fi
if ! astribank_is_starting; then
exit 0
@@ -67,7 +69,7 @@ done
echo ""
# Wait for device to stabilize and XPD's to finish initalizations
-echo 1>&2 "Astribanks initalization "
+echo 1>&2 "Astribanks initializing spans"
while
if ! ab=`ab_list`; then
exit 1
@@ -78,5 +80,13 @@ do
cat $ab
done
-# Handled astribanks
-astribank_is_starting -r
+if [ "$XPP_HOTPLUG_DAHDI" = yes ]; then
+ if [ "$CALLED_FROM_ATRIBANK_HOOK" = '' ]; then
+ # Now we can wait until the hotplug run would remove the semaphore
+ echo -n 1>&2 "Other DAHDI initializations... "
+ astribank_is_starting -v -w 1>&2
+ fi
+else
+ # Non-hotplug -- Sequential initialization, remove semaphore
+ astribank_is_starting -v -r 1>&2
+fi