[svn-commits] russell: branch group/vldtmf r1323 - in /team/group/vldtmf: ./ xpp/ xpp/utils/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Aug 17 14:19:14 MST 2006


Author: russell
Date: Thu Aug 17 16:19:13 2006
New Revision: 1323

URL: http://svn.digium.com/view/zaptel?rev=1323&view=rev
Log:
Merged revisions 1277-1294,1296-1297,1299,1301-1303,1305,1307,1310,1312,1314,1316,1318-1320 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/trunk

................
r1277 | north | 2006-08-09 22:04:13 -0400 (Wed, 09 Aug 2006) | 4 lines

Fixed a typo.

Makes one wonder how long this has been like that..

................
r1278 | tzafrir | 2006-08-09 22:15:20 -0400 (Wed, 09 Aug 2006) | 1 line

fixed a typo: it's waitfor_xpds and not wait_for_xpds
................
r1279 | tzafrir | 2006-08-09 22:38:43 -0400 (Wed, 09 Aug 2006) | 4 lines

- In SIG_CHANGED only sig_toggles bits are interesting (was good in FXS,
  now fixed in FXO).
- Better DBG messages for SIG_CHANGED (FXS and FXO).
- Start work on new RING logic (for FXO caller id).
................
r1280 | tzafrir | 2006-08-09 22:40:45 -0400 (Wed, 09 Aug 2006) | 4 lines

Better LED handling for fxo (copied from fxs):
  - Fix both branches/RELEASE-1.1.0 and trunk/
  - Use a ledcontrol bitmask to mark led on/off
  - Actuall led commands are send only from handle_fxo_leds()
................
r1281 | tzafrir | 2006-08-09 22:42:03 -0400 (Wed, 09 Aug 2006) | 3 lines

* xpp_fxloader: Allow loading just USB firmware with command 'usb'
* xpp_fxloader: also add 'load' as an alias of 'xppdetect'
* xpp_fxloader: and add a 'help' message.
................
r1282 | tzafrir | 2006-08-09 22:48:07 -0400 (Wed, 09 Aug 2006) | 2 lines

Bugfix: the PROC_USBXPP_SUMMARY does not own xpp->proc_xbus_dir and should
        not nullify it (partial reversal of changeset:1225)
................
r1283 | tzafrir | 2006-08-09 22:53:20 -0400 (Wed, 09 Aug 2006) | 1 line

genzaptelconf: fixed typo that prevented getting caller ID on zaptel trunks
................
r1284 | tzafrir | 2006-08-09 22:55:25 -0400 (Wed, 09 Aug 2006) | 1 line

xbus-core.c: documentation updates.
................
r1285 | tzafrir | 2006-08-09 23:12:25 -0400 (Wed, 09 Aug 2006) | 8 lines

* New SOFT_RING detection in FXO:
  - Poll register 0x05 on each DAA
  - When enough energy (value of 0x20|0x40 occurs enough times), raise
    the ringing[] flag.
  - When the value show no energy, lower the ringing[] flag.
  - When we get SIG_CHANGED of stop ringing -- stop polling.

* More debugging messages for proc files
................
r1286 | tzafrir | 2006-08-09 23:16:36 -0400 (Wed, 09 Aug 2006) | 1 line

Bugfix: should not call zaptel for unregistered XPD's.
................
r1287 | tzafrir | 2006-08-09 23:19:07 -0400 (Wed, 09 Aug 2006) | 1 line

Improve checking order in xpp_zap.c
................
r1288 | tzafrir | 2006-08-09 23:21:47 -0400 (Wed, 09 Aug 2006) | 1 line

card_fxo.c: Fix a potential bug: battery voltage is a 2's complement value.
................
r1289 | tzafrir | 2006-08-09 23:26:12 -0400 (Wed, 09 Aug 2006) | 6 lines

Solves spinlock-panic in CentOS 4.

zt_transmit() was called in spinlock protected context. However, it may
call back our hook setting code which tries to lock the same spinlock.

As a safeguard, the same logic was applied to zt_receive().
................
r1290 | tzafrir | 2006-08-09 23:33:57 -0400 (Wed, 09 Aug 2006) | 3 lines

* Added support for readingconfiguration from /etc/sysconfig/zaptel .
* Config file location can be overriden by environment.
* Removed an obsolete function.
................
r1291 | tzafrir | 2006-08-09 23:40:10 -0400 (Wed, 09 Aug 2006) | 3 lines

Fix ring detection logic in FXO:
Detect ring stop only when register 0x05 shows no ring voltage for
enough samples. This is done via noring_thresh[].
................
r1292 | tzafrir | 2006-08-09 23:47:30 -0400 (Wed, 09 Aug 2006) | 1 line

Show SOFT_RING compile status when xpd_fxo module is loaded.
................
r1293 | tzafrir | 2006-08-09 23:56:43 -0400 (Wed, 09 Aug 2006) | 6 lines

* A delay loop waiting for a slow udev to generate /dev/zap/ctl
* Work around stupid call to ztcfg on modprobe (as inserted by zaptel 
  install script)
* -M now edits /etc/sysconfig/zaptel if it find that file and not /etc/modules
* editing of /etc/sysconfig/zaptel: remove all lines that begin with 
  MODULES=, and add MODULES="list of modules" to the end.
................
r1294 | tzafrir | 2006-08-12 11:03:08 -0400 (Sat, 12 Aug 2006) | 3 lines

* Wait for /dev/zap/ctl to appear if udev takes its time creating it.
* Try looking for ztcfg in /usr/sbin as well.
* Also allow setting the location of ztcfg from environment.
................
r1296 | russell | 2006-08-13 19:19:52 -0400 (Sun, 13 Aug 2006) | 2 lines

use LDLIBS instead of LDFLAGS in various places (issue #7708, Mithraen)

................
r1297 | russell | 2006-08-13 19:46:10 -0400 (Sun, 13 Aug 2006) | 2 lines

use AC_MSG_* instead of echo to support ./configure --silent (issue #7722)

................
r1299 | russell | 2006-08-13 20:56:04 -0400 (Sun, 13 Aug 2006) | 11 lines

Merged revisions 1298 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1298 | russell | 2006-08-13 20:54:28 -0400 (Sun, 13 Aug 2006) | 3 lines

the change from $(PWD) to $(SUBDIRS) breaks the build on some systems. So, just
use them both ... (issue #7720)

........

................
r1301 | russell | 2006-08-13 21:45:55 -0400 (Sun, 13 Aug 2006) | 10 lines

Merged revisions 1300 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1300 | russell | 2006-08-13 21:44:59 -0400 (Sun, 13 Aug 2006) | 2 lines

add a note that ENABLE_TASKLETS is not implemented in wct4xxp (issue #7688)

........

................
r1302 | russell | 2006-08-13 21:55:06 -0400 (Sun, 13 Aug 2006) | 3 lines

don't try to include menuselect.makeopts or makeopts if the target is clean,
distclean, or update (fixes issue #7723)

................
r1303 | russell | 2006-08-13 22:48:33 -0400 (Sun, 13 Aug 2006) | 4 lines

add a SHORT_FLASH_TIME option to zconfig.h for european phones with short flash
times that sometimes get misinterpreted as a pulse digit 1 
(issue #7365, gagravarr)

................
r1305 | russell | 2006-08-14 00:07:49 -0400 (Mon, 14 Aug 2006) | 11 lines

Merged revisions 1304 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1304 | russell | 2006-08-14 00:07:00 -0400 (Mon, 14 Aug 2006) | 3 lines

fix potential deadlock found by kernel's lock checker 
(issue #7620, reported by smurfix, fixed by Corydon)

........

................
r1307 | kpfleming | 2006-08-14 16:42:35 -0400 (Mon, 14 Aug 2006) | 10 lines

Merged revisions 1306 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1306 | kpfleming | 2006-08-14 15:40:55 -0500 (Mon, 14 Aug 2006) | 2 lines

revert this change until a version that compiles on 2.4 kernels and older 2.6 kernels is made available and tested

........

................
r1310 | mattf | 2006-08-15 14:42:22 -0400 (Tue, 15 Aug 2006) | 2 lines

Add support for looping back a single channel

................
r1312 | russell | 2006-08-15 17:34:16 -0400 (Tue, 15 Aug 2006) | 11 lines

Merged revisions 1311 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1311 | russell | 2006-08-15 17:30:49 -0400 (Tue, 15 Aug 2006) | 3 lines

fix passing a 'w' to wait when using pulse dialing 
(issue #7738, hanabana)

........

................
r1314 | russell | 2006-08-15 17:44:46 -0400 (Tue, 15 Aug 2006) | 12 lines

Merged revisions 1313 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1313 | russell | 2006-08-15 17:43:26 -0400 (Tue, 15 Aug 2006) | 4 lines

fix erroneous check to see if PWD was set before setting it in the Zaptel
Makefile.  It should always be set.  If not, it breaks the build when using
recursive calls to make. (issue #7733, tzafrir)

........

................
r1316 | russell | 2006-08-15 18:14:21 -0400 (Tue, 15 Aug 2006) | 12 lines

Merged revisions 1315 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1315 | russell | 2006-08-15 18:06:13 -0400 (Tue, 15 Aug 2006) | 4 lines

Ensure that fopen() is only called once for the debug output file to prevent
excessive file descriptor leakage when this function is called many times in
a loop.  (issue #7203)

........

................
r1318 | tilghman | 2006-08-15 21:40:16 -0400 (Tue, 15 Aug 2006) | 10 lines

Merged revisions 1317 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1317 | tilghman | 2006-08-15 20:36:34 -0500 (Tue, 15 Aug 2006) | 2 lines

Bug 7624 - Debian lacks /var/lock/subsys

........

................
r1319 | kpfleming | 2006-08-16 16:01:27 -0400 (Wed, 16 Aug 2006) | 2 lines

clean up libtonezone-related rules

................
r1320 | kpfleming | 2006-08-16 17:09:21 -0400 (Wed, 16 Aug 2006) | 2 lines

run ranlib on static library

................

Modified:
    team/group/vldtmf/   (props changed)
    team/group/vldtmf/Makefile
    team/group/vldtmf/acinclude.m4
    team/group/vldtmf/configure
    team/group/vldtmf/configure.ac
    team/group/vldtmf/fxotune.c
    team/group/vldtmf/wct4xxp_base.c
    team/group/vldtmf/xpp/Makefile
    team/group/vldtmf/xpp/card_fxo.c
    team/group/vldtmf/xpp/card_fxs.c
    team/group/vldtmf/xpp/utils/genzaptelconf
    team/group/vldtmf/xpp/utils/xpp_fxloader
    team/group/vldtmf/xpp/xbus-core.c
    team/group/vldtmf/xpp/xpp_usb.c
    team/group/vldtmf/xpp/xpp_zap.c
    team/group/vldtmf/zaptel.c
    team/group/vldtmf/zaptel.h
    team/group/vldtmf/zaptel.init
    team/group/vldtmf/zconfig.h

Propchange: team/group/vldtmf/
------------------------------------------------------------------------------
--- branch-1.2-merged (original)
+++ branch-1.2-merged Thu Aug 17 16:19:13 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-916,918-936,938-949,958,962,970,990,1004,1011,1017,1031,1033,1060,1062,1064-1066,1069,1071,1076,1079,1081,1097,1101,1151,1185,1187,1205,1233,1235-1236,1243,1248,1259,1262
+/branches/1.2:1-916,918-936,938-949,958,962,970,990,1004,1011,1017,1031,1033,1060,1062,1064-1066,1069,1071,1076,1079,1081,1097,1101,1151,1185,1187,1205,1233,1235-1236,1243,1248,1259,1262,1298,1300,1304,1306,1311,1313,1315,1317

Propchange: team/group/vldtmf/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Aug 17 16:19:13 2006
@@ -1,1 +1,1 @@
-/trunk:1-1265
+/trunk:1-1322

Modified: team/group/vldtmf/Makefile
URL: http://svn.digium.com/view/zaptel/team/group/vldtmf/Makefile?rev=1323&r1=1322&r2=1323&view=diff
==============================================================================
--- team/group/vldtmf/Makefile (original)
+++ team/group/vldtmf/Makefile Thu Aug 17 16:19:13 2006
@@ -11,9 +11,8 @@
 
 HOSTCC=gcc
 CC=gcc
-ifeq ($(PWD),)
 PWD=$(shell pwd)
-endif
+
 ifeq ($(DEB_HOST_GNU_TYPE),)
 UNAME_M:=$(shell uname -m)
 else
@@ -68,12 +67,16 @@
 GLOBAL_MAKEOPTS=$(wildcard /etc/zaptel.makeopts)
 USER_MAKEOPTS=$(wildcard ~/.zaptel.makeopts)
 
-ifneq ($(wildcard menuselect.makeopts),)
+ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),)
+ ifneq ($(wildcard menuselect.makeopts),)
   include menuselect.makeopts
-endif
-
-ifneq ($(wildcard makeopts),)
+ endif
+endif
+
+ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),)
+ ifneq ($(wildcard makeopts),)
   include makeopts
+ endif
 endif
 
 #
@@ -122,11 +125,12 @@
   ZAPTELVERSION=SVN-$(shell build_tools/make_svn_branch_name)
 endif
 
-TZOBJS:=zonedata.lo tonezone.lo
-LIBTONEZONE_SO:=libtonezone.so
-LIBTONEZONE_SO_MAJOR_VER:=1
-LIBTONEZONE_SO_MINOR_VER:=0
-LIBTONEZONE_A:=libtonezone.a
+LTZ_A:=libtonezone.a
+LTZ_A_OBJS:=zonedata.o tonezone.o
+LTZ_SO:=libtonezone.so
+LTZ_SO_OBJS:=zonedata.lo tonezone.lo
+LTZ_SO_MAJOR_VER:=1
+LTZ_SO_MINOR_VER:=0
 
 ifeq ($(findstring xpp_usb,$(MENUSELECT_MODULES)),)
   BUILD_XPP:=yes
@@ -181,7 +185,7 @@
 all: menuselect.makeopts 
 	@$(MAKE) _all
 
-_all: $(if $(MODULES),modules) programs $(LIBTONEZONE_SO)
+_all: $(if $(MODULES),modules) programs $(LTZ_SO) $(LTZ_A)
 
 programs: $(BINS)
 
@@ -230,14 +234,14 @@
 	$(CC) $(KFLAGS) -o $@ -c $<
 
 vpm450m.o: vpm450m.c zaptel.h
-	$(CC) $(KFLAGS) -I$(SUBDIRS)/include  -I$(SUBDIRS)/include/oct6100api -o $@ -c $<
+	$(CC) $(KFLAGS) -I$(PWD)/include -I$(PWD)/include/oct6100api -I$(SUBDIRS)/include -I$(SUBDIRS)/include/oct6100api -o $@ -c $<
 
 wct4xxp.o: wct4xxp_base.o vpm450m.o
 	$(LD) -r -o $@ wct4xxp_base.o vpm450m.o
 
 tor2ee.o: tor2-hw.h
 
-tor2ee: LDFLAGS+=-lpci
+tor2ee: LDLIBS+=-lpci
 
 zonedata.lo: zonedata.c
 	$(CC) -c $(LCFLAGS) -o $@ $^
@@ -259,7 +263,7 @@
 
 makefw: CFLAGS=
 
-gendigits: LDFLAGS+=-lm
+gendigits: LDLIBS+=-lm
 gendigits: CFLAGS=
 
 fw2h: CFLAGS=
@@ -280,27 +284,28 @@
 
 ztspeed: CFLAGS=
 ztspeed.o: CFLAGS=
-zttool: LDFLAGS+=$(NEWT_LIB)
+zttool: LDLIBS+=$(NEWT_LIB)
 sethdlc-new.o: CFLAGS+=-I$(KINCLUDES)
 
-libtonezone.a: $(TZOBJS)
-	ar rcs libtonezone.a $^
-
-$(LIBTONEZONE_SO): $(TZOBJS)
-	$(CC) -shared -Wl,-soname,$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) -lm -o $@ $^
+$(LTZ_A): $(LTZ_A_OBJS)
+	ar rcs $@ $^
+	ranlib $@
+
+$(LTZ_SO): $(LTZ_SO_OBJS)
+	$(CC) -shared -Wl,-soname,$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) -o $@ $^ -lm
 
 ztcfg.c: ztcfg.h
 
-ztcfg-shared: ztcfg.o $(LIBTONEZONE_SO)
+ztcfg-shared: ztcfg.o $(LTZ_SO)
 	$(CC) -o $@ $^ -lm
 
 data:
 	$(MAKE) -C datamods datamods
 
-ztcfg: ztcfg.o libtonezone.a
+ztcfg: ztcfg.o $(LTZ_A)
 	$(CC) -o $@ $^ -lm
 
-ztcfg-dude: ztcfg-dude.o mknotch.o complex.o $(LIBTONEZONE_SO)
+ztcfg-dude: ztcfg-dude.o mknotch.o complex.o $(LTZ_SO)
 	$(CC) -o $@ $^ -lm
 
 mknotch.o: mknotch.cc
@@ -309,11 +314,11 @@
 complex.o: complex.cc
 	$(CC) -o $@ -c $^
 
-usbfxstest: LDFLAGS+=-lzap
-fxstest: $(LIBTONEZONE_SO)
-fxstest: LDFLAGS+=-lm
-fxotune: LDFLAGS+=-lm
-fxsdump: LDFLAGS+=-lm
+usbfxstest: LDLIBS+=-lzap
+fxstest: $(LTZ_SO)
+fxstest: LDLIBS+=-lm
+fxotune: LDLIBS+=-lm
+fxsdump: LDLIBS+=-lm
 
 stackcheck: checkstack $(BUILDVER)
 	./checkstack *.o
@@ -328,7 +333,7 @@
 	$(MAKE) -C mISDNuser install
 
 $(UTILS): %: %.o
-	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS)
 
 $(UTILSO): %.o: %.c
 	$(CC) $(CFLAGS) -o $@ -c $<
@@ -404,18 +409,18 @@
 		/sbin/update-modules ; \
 	fi
 
-install-libs: $(LIBTONEZONE_SO) $(LIBTONEZONE_A)
-	$(INSTALL) -D -m 755 $(LIBTONEZONE_A) $(LIB_DIR)/$(LIBTONEZONE_A)
-	$(INSTALL) -D -m 755 $(LIBTONEZONE_SO) $(LIB_DIR)/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER)
+install-libs: $(LTZ_SO) $(LTZ_A)
+	$(INSTALL) -D -m 755 $(LTZ_A) $(LIB_DIR)/$(LTZ_A)
+	$(INSTALL) -D -m 755 $(LTZ_SO) $(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER)
 	if [ -z "$(INSTALL_PREFIX)" -a `id -u` = 0 ]; then \
 		/sbin/ldconfig || : ;\
 	fi
-	rm -f $(LIB_DIR)$(LIBTONEZONE_SO)
-	$(LN) -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
-		$(LIB_DIR)/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER)
-	$(LN) -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
-		$(LIB_DIR)/$(LIBTONEZONE_SO)
-	if [ -z "$(INSTALL_PREFIX)" && -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(LIB_DIR)/$(LIBTONEZONE_SO); fi
+	rm -f $(LIB_DIR)$(LTZ_SO)
+	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
+		$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER)
+	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
+		$(LIB_DIR)/$(LTZ_SO)
+	if [ -z "$(INSTALL_PREFIX)" && -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(LIB_DIR)/$(LTZ_SO); fi
 
 install-include:
 	$(INSTALL) -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/zaptel/zaptel.h
@@ -494,7 +499,7 @@
 	rm -f torisatool makefw tor2fw.h radfw.h
 	rm -f $(BINS)
 	rm -f *.o ztcfg tzdriver sethdlc sethdlc-new
-	rm -f $(TZOBJS) $(LIBTONEZONE_SO) *.lo
+	rm -f $(LTZ_SO) $(LTZ_A) *.lo
 ifeq ($(BUILDVER),linux26)
 	$(KMAKE) clean
 	$(MAKE) -C datamods clean

Modified: team/group/vldtmf/acinclude.m4
URL: http://svn.digium.com/view/zaptel/team/group/vldtmf/acinclude.m4?rev=1323&r1=1322&r2=1323&view=diff
==============================================================================
--- team/group/vldtmf/acinclude.m4 (original)
+++ team/group/vldtmf/acinclude.m4 Thu Aug 17 16:19:13 2006
@@ -43,10 +43,10 @@
       if test "x${$4_HEADER_FOUND}" = "x0" ; then
          if test ! -z "${$4_MANDATORY}" ;
          then
-            echo " ***"
-            echo " *** It appears that you do not have the $1 development package installed."
-            echo " *** Please install it to include $5 support, or re-run configure"
-            echo " *** without explicitly specifying --with-$1"
+            AC_MSG_NOTICE(***)
+            AC_MSG_NOTICE(*** It appears that you do not have the $1 development package installed.)
+            AC_MSG_NOTICE(*** Please install it to include $5 support, or re-run configure)
+            AC_MSG_NOTICE(*** without explicitly specifying --with-$1)
             exit 1
          fi
          $4_LIB=""
@@ -58,10 +58,10 @@
       fi
    elif test ! -z "${$4_MANDATORY}";
    then
-      echo "***"
-      echo "*** The $5 installation on this system appears to be broken."
-      echo "*** Either correct the installation, or run configure"
-      echo "*** without explicity specifying --with-$1"
+      AC_MSG_NOTICE(***)
+      AC_MSG_NOTICE(*** The $5 installation on this system appears to be broken.)
+      AC_MSG_NOTICE(*** Either correct the installation, or run configure)
+      AC_MSG_NOTICE(*** without explicity specifying --with-$1)
       exit 1
    fi
 fi
@@ -83,8 +83,7 @@
    done ;
 ) ;
 if test  "x$GNU_MAKE" = "xNot Found"  ; then
-   echo " *** Please install GNU make.  It is required to build Asterisk!"
-   exit 1
+   AC_MSG_ERROR(*** Please install GNU make.  It is required to build Asterisk!)
 fi
 AC_SUBST([GNU_MAKE])
 ])

Modified: team/group/vldtmf/configure
URL: http://svn.digium.com/view/zaptel/team/group/vldtmf/configure?rev=1323&r1=1322&r2=1323&view=diff
==============================================================================
--- team/group/vldtmf/configure (original)
+++ team/group/vldtmf/configure Thu Aug 17 16:19:13 2006
@@ -1,7 +1,7 @@
 #! /bin/sh
-# From configure.ac Revision: 1147 .
+# From configure.ac Revision: 1179 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59e.
+# Generated by GNU Autoconf 2.60.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -233,8 +233,8 @@
 
 
       for as_shell in $as_candidate_shells $SHELL; do
-	 # Try only shells which exist, to save several forks.
-	 if test -f "$as_shell" &&
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
 		{ ("$as_shell") 2> /dev/null <<\_ASEOF
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -1320,7 +1320,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 configure
-generated by GNU Autoconf 2.59e
+generated by GNU Autoconf 2.60
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -1336,7 +1336,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.59e.  Invocation command line was
+generated by GNU Autoconf 2.60.  Invocation command line was
 
   $ $0 $@
 
@@ -1684,9 +1684,6 @@
 # check existence of the package
 
 
-# specify output header file
-# AC_CONFIG_HEADER(autoconfig.h)
-
 
 
 
@@ -1709,15 +1706,6 @@
 _ACEOF
 
 
-
-#AH_TOP(
-#ifndef ZAPTEL_AUTOCONFIG_H
-#define ZAPTEL_AUTOCONFIG_H
-#)
-
-#AH_BOTTOM(
-#endif
-#)
 
 # Checks for programs.
 ac_ext=c
@@ -2370,7 +2358,7 @@
 	ac_compiler_gnu=no
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
@@ -2556,13 +2544,13 @@
 
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
@@ -2627,6 +2615,11 @@
    that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -2687,7 +2680,7 @@
 
 fi
 
-rm -f conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext
   test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
 rm -f conftest.$ac_ext
@@ -3113,8 +3106,9 @@
 { echo "$as_me:$LINENO: result: $GNU_MAKE" >&5
 echo "${ECHO_T}$GNU_MAKE" >&6; } ;
 if test  "x$GNU_MAKE" = "xNot Found"  ; then
-   echo " *** Please install GNU make.  It is required to build Asterisk!"
-   exit 1
+   { { echo "$as_me:$LINENO: error: *** Please install GNU make.  It is required to build Asterisk!" >&5
+echo "$as_me: error: *** Please install GNU make.  It is required to build Asterisk!" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 
@@ -3480,7 +3474,7 @@
 	ac_cv_header_stdc=no
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
@@ -3676,7 +3670,7 @@
 	eval "$as_ac_Header=no"
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 ac_res=`eval echo '${'$as_ac_Header'}'`
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
@@ -3790,7 +3784,7 @@
 	ac_cv_lib_curses_initscr=no
 fi
 
-rm -f conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -3875,7 +3869,7 @@
 	ac_header_compiler=no
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
@@ -4035,7 +4029,7 @@
 	ac_header_compiler=no
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
@@ -4133,10 +4127,14 @@
       if test "x${CURSES_HEADER_FOUND}" = "x0" ; then
          if test ! -z "${CURSES_MANDATORY}" ;
          then
-            echo " ***"
-            echo " *** It appears that you do not have the curses development package installed."
-            echo " *** Please install it to include curses support, or re-run configure"
-            echo " *** without explicitly specifying --with-curses"
+            { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+            { echo "$as_me:$LINENO: *** It appears that you do not have the curses development package installed." >&5
+echo "$as_me: *** It appears that you do not have the curses development package installed." >&6;}
+            { echo "$as_me:$LINENO: *** Please install it to include curses support" >&5
+echo "$as_me: *** Please install it to include curses support" >&or re-run configure;}
+            { echo "$as_me:$LINENO: *** without explicitly specifying --with-curses" >&5
+echo "$as_me: *** without explicitly specifying --with-curses" >&6;}
             exit 1
          fi
          CURSES_LIB=""
@@ -4152,10 +4150,14 @@
       fi
    elif test ! -z "${CURSES_MANDATORY}";
    then
-      echo "***"
-      echo "*** The curses installation on this system appears to be broken."
-      echo "*** Either correct the installation, or run configure"
-      echo "*** without explicity specifying --with-curses"
+      { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+      { echo "$as_me:$LINENO: *** The curses installation on this system appears to be broken." >&5
+echo "$as_me: *** The curses installation on this system appears to be broken." >&6;}
+      { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+      { echo "$as_me:$LINENO: *** without explicity specifying --with-curses" >&5
+echo "$as_me: *** without explicity specifying --with-curses" >&6;}
       exit 1
    fi
 fi
@@ -4262,7 +4264,7 @@
 	ac_cv_lib_ncurses_initscr=no
 fi
 
-rm -f conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -4347,7 +4349,7 @@
 	ac_header_compiler=no
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
@@ -4507,7 +4509,7 @@
 	ac_header_compiler=no
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
@@ -4605,10 +4607,14 @@
       if test "x${NCURSES_HEADER_FOUND}" = "x0" ; then
          if test ! -z "${NCURSES_MANDATORY}" ;
          then
-            echo " ***"
-            echo " *** It appears that you do not have the ncurses development package installed."
-            echo " *** Please install it to include ncurses support, or re-run configure"
-            echo " *** without explicitly specifying --with-ncurses"
+            { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+            { echo "$as_me:$LINENO: *** It appears that you do not have the ncurses development package installed." >&5
+echo "$as_me: *** It appears that you do not have the ncurses development package installed." >&6;}
+            { echo "$as_me:$LINENO: *** Please install it to include ncurses support" >&5
+echo "$as_me: *** Please install it to include ncurses support" >&or re-run configure;}
+            { echo "$as_me:$LINENO: *** without explicitly specifying --with-ncurses" >&5
+echo "$as_me: *** without explicitly specifying --with-ncurses" >&6;}
             exit 1
          fi
          NCURSES_LIB=""
@@ -4624,10 +4630,14 @@
       fi
    elif test ! -z "${NCURSES_MANDATORY}";
    then
-      echo "***"
-      echo "*** The ncurses installation on this system appears to be broken."
-      echo "*** Either correct the installation, or run configure"
-      echo "*** without explicity specifying --with-ncurses"
+      { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+      { echo "$as_me:$LINENO: *** The ncurses installation on this system appears to be broken." >&5
+echo "$as_me: *** The ncurses installation on this system appears to be broken." >&6;}
+      { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+      { echo "$as_me:$LINENO: *** without explicity specifying --with-ncurses" >&5
+echo "$as_me: *** without explicity specifying --with-ncurses" >&6;}
       exit 1
    fi
 fi
@@ -4734,7 +4744,7 @@
 	ac_cv_lib_newt_newtBell=no
 fi
 
-rm -f conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
@@ -4819,7 +4829,7 @@
 	ac_header_compiler=no
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
@@ -4979,7 +4989,7 @@
 	ac_header_compiler=no
 fi
 
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
@@ -5077,10 +5087,14 @@
       if test "x${NEWT_HEADER_FOUND}" = "x0" ; then
          if test ! -z "${NEWT_MANDATORY}" ;
          then
-            echo " ***"
-            echo " *** It appears that you do not have the newt development package installed."
-            echo " *** Please install it to include newt support, or re-run configure"
-            echo " *** without explicitly specifying --with-newt"
+            { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+            { echo "$as_me:$LINENO: *** It appears that you do not have the newt development package installed." >&5
+echo "$as_me: *** It appears that you do not have the newt development package installed." >&6;}
+            { echo "$as_me:$LINENO: *** Please install it to include newt support" >&5
+echo "$as_me: *** Please install it to include newt support" >&or re-run configure;}
+            { echo "$as_me:$LINENO: *** without explicitly specifying --with-newt" >&5
+echo "$as_me: *** without explicitly specifying --with-newt" >&6;}
             exit 1
          fi
          NEWT_LIB=""
@@ -5096,10 +5110,14 @@
       fi
    elif test ! -z "${NEWT_MANDATORY}";
    then
-      echo "***"
-      echo "*** The newt installation on this system appears to be broken."
-      echo "*** Either correct the installation, or run configure"
-      echo "*** without explicity specifying --with-newt"
+      { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+      { echo "$as_me:$LINENO: *** The newt installation on this system appears to be broken." >&5
+echo "$as_me: *** The newt installation on this system appears to be broken." >&6;}
+      { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+      { echo "$as_me:$LINENO: *** without explicity specifying --with-newt" >&5
+echo "$as_me: *** without explicity specifying --with-newt" >&6;}
       exit 1
    fi
 fi
@@ -5524,7 +5542,7 @@
 # values after options handling.
 ac_log="
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59e.  Invocation command line was
+generated by GNU Autoconf 2.60.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -5567,7 +5585,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.59e,
+configured by $0, generated by GNU Autoconf 2.60,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright (C) 2006 Free Software Foundation, Inc.
@@ -6078,6 +6096,7 @@
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
   { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined." >&5
 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
@@ -6125,5 +6144,6 @@
 fi
 
 
-echo "*** Zaptel build successfully configured ***"
-
+{ echo "$as_me:$LINENO: *** Zaptel build successfully configured ***" >&5
+echo "$as_me: *** Zaptel build successfully configured ***" >&6;}
+

Modified: team/group/vldtmf/configure.ac
URL: http://svn.digium.com/view/zaptel/team/group/vldtmf/configure.ac?rev=1323&r1=1322&r2=1323&view=diff
==============================================================================
--- team/group/vldtmf/configure.ac (original)
+++ team/group/vldtmf/configure.ac Thu Aug 17 16:19:13 2006
@@ -49,5 +49,5 @@
 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
 AC_OUTPUT
 
-echo "*** Zaptel build successfully configured ***"
+AC_MSG_NOTICE(*** Zaptel build successfully configured ***)
 

Modified: team/group/vldtmf/fxotune.c
URL: http://svn.digium.com/view/zaptel/team/group/vldtmf/fxotune.c?rev=1323&r1=1322&r2=1323&view=diff
==============================================================================
--- team/group/vldtmf/fxotune.c (original)
+++ team/group/vldtmf/fxotune.c Thu Aug 17 16:19:13 2006
@@ -43,7 +43,7 @@
 static char *usage =
 "Usage: fxotune [-v[vv] (-s | -i <options> | -d <options>)\n"
 "\n"
-"	-s : set priviously calibrated echo settings\n"
+"	-s : set previously calibrated echo settings\n"
 "	-i : calibrate echo settings\n"
 "		options : [<dialstring>] [-t <calibtype>]\n"
 "		[-b <startdev>][-e <stopdev>]\n"
@@ -86,6 +86,8 @@
 static short outbuf[TEST_DURATION];
 static int debug = 0;
 
+static FILE *debugoutfile = NULL;
+
 /**
  * Makes sure that the line is clear.
  * Right now, we do this by relying on the user to specify how long after dialing the
@@ -261,7 +263,6 @@
 	struct zt_bufferinfo bi;
 	short inbuf[TEST_DURATION]; /* changed from BUFFER_LENGTH - this buffer is for short values, so it should be allocated using the length of the test */
 	FILE *outfile = NULL;
-
 
 	outfile = fopen("fxotune_dump.vals", "w");
 	if (!outfile) {
@@ -392,12 +393,9 @@
 	struct zt_bufferinfo bi;
 
 	short inbuf[TEST_DURATION];
-	FILE *outfile = NULL;
-
-
-	if (debug) {
-		outfile = fopen("fxotune.vals", "w");
-		if (!outfile) {
+
+	if (debug && !debugoutfile) {
+		if (!(debugoutfile = fopen("fxotune.vals", "w"))) {
 			fprintf(stdout, "Cannot create fxotune.vals\n");
 			return -1;
 		}
@@ -516,7 +514,7 @@
 						echo
 					);
 			
-			fprintf(outfile, "%s\n", result);
+			fprintf(debugoutfile, "%s\n", result);
 			if (debug > 1)
 				fprintf(stdout, "%s\n", result);
 		}

Modified: team/group/vldtmf/wct4xxp_base.c
URL: http://svn.digium.com/view/zaptel/team/group/vldtmf/wct4xxp_base.c?rev=1323&r1=1322&r2=1323&view=diff
==============================================================================
--- team/group/vldtmf/wct4xxp_base.c (original)
+++ team/group/vldtmf/wct4xxp_base.c Thu Aug 17 16:19:13 2006
@@ -59,6 +59,8 @@
  * you are more concerned with the performance of your machine, enable the
  * tasklets.  If you are strict about absolutely no drops, then do not enable
  * tasklets.
+ *
+ * XXX THIS IS NOT CURRENTLY IMPLEMENTED FOR THIS MODULE.  FOR NOW, DO NOT USE!
  */
 
 /* #define ENABLE_TASKLETS */

Modified: team/group/vldtmf/xpp/Makefile
URL: http://svn.digium.com/view/zaptel/team/group/vldtmf/xpp/Makefile?rev=1323&r1=1322&r2=1323&view=diff
==============================================================================
--- team/group/vldtmf/xpp/Makefile (original)
+++ team/group/vldtmf/xpp/Makefile Thu Aug 17 16:19:13 2006
@@ -1,4 +1,4 @@
-EXTRA_CFLAGS	= -I$(SUBDIRS) -DDEBUG -DPOLL_DIGITAL_INPUTS -DWITH_ECHO_SUPPRESSION -DWITH_RBS
+EXTRA_CFLAGS	= -I$(SUBDIRS) -DDEBUG -DPOLL_DIGITAL_INPUTS -DWITH_ECHO_SUPPRESSION -DWITH_RBS -DSOFT_RING
 
 obj-m			= xpp.o xpp_usb.o xpd_fxs.o xpd_fxo.o
 xpp-y			+= xbus-core.o xpp_zap.o xproto.o card_global.o

Modified: team/group/vldtmf/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/team/group/vldtmf/xpp/card_fxo.c?rev=1323&r1=1322&r2=1323&view=diff
==============================================================================
--- team/group/vldtmf/xpp/card_fxo.c (original)
+++ team/group/vldtmf/xpp/card_fxo.c Thu Aug 17 16:19:13 2006
@@ -70,6 +70,13 @@
 #define	PROC_DAA_FNAME		"slics"
 #define	PROC_FXO_INFO_FNAME	"fxo_info"
 
+#ifdef SOFT_RING
+#define	POLL_RING_INTERVAL	1
+#define	RING_THRESHOLD		3
+#define	NORING_THRESHOLD	50
+#define	DAA_RING_REGISTER	0x05
+#endif
+
 struct FXO_priv_data {
 	struct proc_dir_entry		*xpd_slic;
 	struct proc_dir_entry		*fxo_info;
@@ -77,13 +84,28 @@
 	slic_reply_t			last_reply;
 	xpp_line_t			battery;
 	xpp_line_t			ledstate[NUM_LEDS];	/* 0 - OFF, 1 - ON */
+	xpp_line_t			ledcontrol[NUM_LEDS];	/* 0 - OFF, 1 - ON */
 	int				blinking[NUM_LEDS][CHANNELS_PERXPD];
+#ifdef SOFT_RING
+	ushort				ring_thresh[CHANNELS_PERXPD];
+	ushort				noring_thresh[CHANNELS_PERXPD];
+#endif
 };
 
 /*---------------- FXO: Static functions ----------------------------------*/
 
 #define	IS_BLINKING(priv,pos,color)	((priv)->blinking[color][pos] != 0)
-#define	DO_BLINK(priv,pos,color,val)	((priv)->blinking[color][pos] = (val))
+#define	MARK_BLINK(priv,pos,color,val)	((priv)->blinking[color][pos] = (val))
+
+void MARK_LED(xpd_t *xpd, lineno_t pos, byte color, bool on)
+{
+	struct FXO_priv_data *priv = xpd->priv;
+
+	if(on)
+		BIT_SET(priv->ledcontrol[color], pos);
+	else
+		BIT_CLR(priv->ledcontrol[color], pos);
+}
 
 /*
  * LED control is done via DAA register 0x20
@@ -130,10 +152,10 @@
 
 static void handle_fxo_leds(xpd_t *xpd)
 {
-	int		i;
-	unsigned long	flags;
+	int			i;
+	unsigned long		flags;
 	const enum fxo_leds	color = LED_GREEN;
-	unsigned int	timer_count;
+	unsigned int		timer_count;
 	struct FXO_priv_data	*priv;
 
 	BUG_ON(!xpd);
@@ -146,7 +168,7 @@
 		if(IS_BLINKING(priv,i,color)) {
 			// led state is toggled
 			if((timer_count % LED_BLINK_PERIOD) == 0) {
-				DBG("%s/%s/%d: led_state=%s\n", xpd->xbus->busname, xpd->xpdname, i,
+				DBG("%s/%s/%d: ledstate=%s\n", xpd->xbus->busname, xpd->xpdname, i,
 						(IS_SET(priv->ledstate[color], i))?"ON":"OFF");
 				if(!IS_SET(priv->ledstate[color], i)) {
 					do_led(xpd, i, color, 1);
@@ -154,9 +176,31 @@
 					do_led(xpd, i, color, 0);
 				}
 			}
+		} else if(IS_SET(priv->ledcontrol[color], i) && !IS_SET(priv->ledstate[color], i)) {
+			do_led(xpd, i, color, 1);
+		} else if(!IS_SET(priv->ledcontrol[color], i) && IS_SET(priv->ledstate[color], i)) {
+			do_led(xpd, i, color, 0);
 		}
 	}
 	spin_unlock_irqrestore(&xpd->lock, flags);
+}
+
+static void mark_ring(xpd_t *xpd, lineno_t pos, bool on)
+{
+	struct FXO_priv_data	*priv;
+
+	priv = xpd->priv;
+	BUG_ON(!priv);
+	if(on && !xpd->ringing[pos]) {
+		DBG("%s/%s/%d: START\n", xpd->xbus->busname, xpd->xpdname, pos);
+		xpd->ringing[pos] = 1;
+		MARK_BLINK(priv, pos, LED_GREEN, LED_BLINK);
+	} else if(!on && xpd->ringing[pos]) {
+		DBG("%s/%s/%d: STOP\n", xpd->xbus->busname, xpd->xpdname, pos);
+		xpd->ringing[pos] = 0;
+		if(IS_BLINKING(priv, pos, LED_GREEN))
+			MARK_BLINK(priv, pos, LED_GREEN, 0);
+	}
 }
 
 static void do_sethook(xpd_t *xpd, int pos, bool offhook)
@@ -172,7 +216,7 @@
 		DBG("%s/%s/%d: WARNING: called while battery is off\n", xpd->xbus->busname, xpd->xpdname, pos);
 	}
 	spin_lock_irqsave(&xpd->lock, flags);
-	xpd->ringing[pos] = 0;				// No more rings
+	mark_ring(xpd, pos, 0);				// No more rings
 	CALL_XMETHOD(SETHOOK, xpd->xbus, xpd, pos, offhook);
 	if(offhook) {
 		BIT_SET(xpd->hookstate, pos);
@@ -282,7 +326,6 @@
 	xbus_t			*xbus;
 	struct FXO_priv_data	*priv;
 	int			i;
-	unsigned long		flags;
 
 	BUG_ON(!xpd);
 	xbus = xpd->xbus;
@@ -300,11 +343,9 @@
 		cur_chan->pvt = xpd;
 		cur_chan->sigcap = FXO_DEFAULT_SIGCAP;
 	}
-	spin_lock_irqsave(&xpd->lock, flags);
-	do_led(xpd, ALL_LINES, LED_GREEN, LED_OFF);
-	spin_unlock_irqrestore(&xpd->lock, flags);
-	for_each_line(xpd, i) {
-		do_led(xpd, i, LED_GREEN, LED_ON);
+	MARK_LED(xpd, ALL_LINES, LED_GREEN, LED_OFF);
+	for_each_line(xpd, i) {
+		MARK_LED(xpd, i, LED_GREEN, LED_ON);
 		mdelay(50);
 	}
 	return 0;
@@ -323,7 +364,7 @@
 	BUG_ON(!priv);
 	DBG("%s/%s (%d)\n", xbus->busname, xpd->xpdname, on);
 	for_each_line(xpd, i) {
-		do_led(xpd, i, LED_GREEN, LED_OFF);
+		MARK_LED(xpd, i, LED_GREEN, LED_OFF);
 		mdelay(50);
 	}
 	return 0;
@@ -401,6 +442,21 @@
 	}
 }
 
+#ifdef	SOFT_RING
+

[... 868 lines stripped ...]


More information about the svn-commits mailing list