[zaptel-commits] sruffell: branch sruffell/voicebus r4094 - in /team/sruffell/voicebus: ./ bui...

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Thu Mar 27 14:27:37 CDT 2008


Author: sruffell
Date: Thu Mar 27 14:27:36 2008
New Revision: 4094

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4094
Log:
Merged revisions 3957-3958,3964,3969,3973,3976,3979,3983-3984,3990,3996-3997,4006,4009,4013,4016,4019,4022,4031,4039,4042,4050,4057,4062-4063,4069,4073,4078,4081-4082,4086 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.4

................
  r3957 | tzafrir | 2008-03-06 16:45:53 -0800 (Thu, 06 Mar 2008) | 58 lines
  
  xpp.r5512:
  * Build:
    - Zaptel >= 1.4.9 is migrating to storing kernel stuff in zaptel/kernel/*
    -  We conditionally use old/new directory scheme:
       In xpp/Kbuild and xpp/utils/Makefile use ZAP_KERNEL variable, so it's
       not confused with ZAPTEL_DIR (which appears in zaptel/Makefile as well).
    - Fix compile warnings on 64 bit systems.
    - Compile fixes for kernel-2.6.24
  * UDEV:
    - /etc/udev/rules.d/xpp.rules now uses XPP_INIT_DIR to find astribank_hook.
    - astribank_hook: Modify to do nothing. Add some documentation.
  * Autoconfiguration -- zapconf:
    - Don't fail zapconf et.al. if no config file was found.
    - Skip the 'IRQ Missing:' line in /proc/zaptel/nnn for wcte1xp(?).
    - Add some newer Digium cards to our hardware inventory.
    - Partially handle cases where the /proc/zaptel strings does not contain
      info about E1/T1/J1 or NT/TE.
  * Better SYNC:
    - Finer tuning of PLL (New firmware).
    - Change calculation algorithm of sync offset. It now copes better
      with the variance in USB frame reception timing.
    - Statistics:
      . The view of results was moved from /proc/xpp/XBUS-*/summary to
        a new /sys/bus/astribanks/devices/xbus-*/timing and enhanced.
      . A new xpp_timing script shows all astribanks.
      . A new write only /sys/bus/astribanks/devices/xbus-*/cls is
        used to clear statistics. Eventually, clearing of XBUS related
        statistics should be done here. One that was migrated is the
        clearing of 'PCM [TR]X:' numbers currently appearing in
        /proc/xpp/XBUS-*/summary (they should be moved too later).
    - Shorten the strings representation sync_mode ("SYNC_MODE_AB" -> "AB")
      adapted their use in printk and /proc so the text is clear.
    - Added a command line parameter xpp.disable_pll_sync to stop all
      adjustments command to AB (calculations still continue as usual).
  * PRI:
    - 4 port support
    - set clocking master span via ztcfg, like other zaptel devices.
  * FXO:
    - Fix false hangups in some countries (voltage fluctuations).
    - Some countries send caller-id before first ring.
      Added code to handle caller-id PCM pass through according to
      a new command line parameter (xpd_fxo.caller_id_style).
    - No longer sends an event on zt_open. See #12160 .
  * Misc:
    - Adapt to zaptel-1.4.8 and above ztscan: added fields returend by
      new ZT_SPANSTAT_V2 ioctl()
    - Document sysfs and waitfor_xpds.
    - Miscelaneous optimizations and bugfixes.
    - Remove deprecated pcm_tasklet parameter. The rx_tasklet parameter has
      replaced it a long time ago.
    - Add RX_CMD counter to /proc/xpp/XBUS-*/summary
    - Unclutter some of the usb disconnect messages.
    - xpp_usb: minor preformance improvements in receive.
      Expose the number of pending receive URB's in /proc/xpp/XBUS-*/xpp_usb
  
  Merged revisions 3952 via svnmerge from 
  http://svn.digium.com/svn/zaptel/branches/1.2
................
  r3958 | tzafrir | 2008-03-06 17:01:42 -0800 (Thu, 06 Mar 2008) | 2 lines
  
  Also print channel alarms in /proc/zaptel files.
................
  r3964 | qwell | 2008-03-07 08:18:13 -0800 (Fri, 07 Mar 2008) | 7 lines
  
  Fix compilation when using devfs
  
  (closes issue #12156)
  Reported by: zandbelt
  Patches:
        zaptel-1.4.9.2-devfs-mode.patch uploaded by zandbelt (license 33)
................
  r3969 | tzafrir | 2008-03-09 01:51:48 -0800 (Sun, 09 Mar 2008) | 6 lines
  
  Integrating sample / reference configuration file into the reference
  documentation.
  
  Merged revisions 3968 via svnmerge from 
  http://svn.digium.com/svn/zaptel/branches/1.2
................
  r3973 | tzafrir | 2008-03-09 05:06:50 -0700 (Sun, 09 Mar 2008) | 5 lines
  
  More asciidoc polishes and small sample file fixes.
  
  Merged revisions 3972 via svnmerge from 
  http://svn.digium.com/svn/zaptel/branches/1.2
................
  r3976 | tzafrir | 2008-03-09 07:30:23 -0700 (Sun, 09 Mar 2008) | 6 lines
  
  The main Makefile now knows if we don't have kernel source.
  * Nicer handling of situations where we don't have kernel source and
    don't really need it ('make clean', mainly).
  * The test for hotplug firmware is now from the same .config file. No
    more strange message about autoconf.h .
................
  r3979 | tzafrir | 2008-03-09 11:18:10 -0700 (Sun, 09 Mar 2008) | 2 lines
  
  Hush grep's output once again and allow building with firmware support.
................
  r3983 | mattf | 2008-03-14 08:39:17 -0700 (Fri, 14 Mar 2008) | 1 line
  
  Update linked mISDN version to latest (1.1.7.2)
................
  r3984 | mattf | 2008-03-14 09:09:15 -0700 (Fri, 14 Mar 2008) | 1 line
  
  When doing the ISR rewrite, forgot to include the vpmdtmfcheck when doing DTMF polling causing it to check for DTMF events even when it was told not to
................
  r3990 | mattf | 2008-03-14 09:39:39 -0700 (Fri, 14 Mar 2008) | 1 line
  
  Update wctdm24xxp's VPMADT032 firmware to version 1.16
................
  r3996 | tzafrir | 2008-03-16 11:27:28 -0700 (Sun, 16 Mar 2008) | 3 lines
  
  ztscan: detect xpp (pri/bri), tor2 and torisa as digital as well as they
  currently claim to support CAS but not DACS.
................
  r3997 | tzafrir | 2008-03-16 11:30:00 -0700 (Sun, 16 Mar 2008) | 4 lines
  
  cleanup wcfxo module parameters: 
  * Make them all world-readable.
  * If value only used at initialization, make them read-only.
................
  r4006 | tzafrir | 2008-03-18 14:34:16 -0700 (Tue, 18 Mar 2008) | 3 lines
  
  ztscan.c: Moving some code, renaming some variables, no change in
  functionality.
................
  r4009 | tzafrir | 2008-03-18 15:53:01 -0700 (Tue, 18 Mar 2008) | 4 lines
  
  ztscan can now accept optional list of span numbers and print output for
  those spans only. Default remains (when there are no parameters) to
  print output for all spans.
................
  r4013 | tzafrir | 2008-03-18 18:19:01 -0700 (Tue, 18 Mar 2008) | 7 lines
  
  * We need to silence the echo-canceller buffers as well.
  * But no need to cancel echo on channels without PCM.
  * Switch to FXS hardware DTMF detection again.
  
  Merged revisions 4012 via svnmerge from 
  http://svn.digium.com/svn/zaptel/branches/1.2
................
  r4016 | tzafrir | 2008-03-18 19:11:29 -0700 (Tue, 18 Mar 2008) | 2 lines
  
  A man page for ztscan.
................
  r4019 | tzafrir | 2008-03-18 19:24:35 -0700 (Tue, 18 Mar 2008) | 3 lines
  
  * Generate html pages from the xpp utils dir as well.
  * Clean generated HTML-ized man pages on clean.
................
  r4022 | dbailey | 2008-03-19 09:02:17 -0700 (Wed, 19 Mar 2008) | 3 lines
  
  Properly handle return value before testing parameter
  (Parameter may be uninitialized) 
................
  r4031 | mattf | 2008-03-19 13:05:32 -0700 (Wed, 19 Mar 2008) | 1 line
  
  Merging in 1.16 software for VPMADT032 on wcte12xp driver
................
  r4039 | tzafrir | 2008-03-20 18:51:39 -0700 (Thu, 20 Mar 2008) | 8 lines
  
  * Earleier initialization of PRI module's register.
  * Fix zaptel-perl reporting of battery after procfs changes.
  * Documentation updates.
  * Block hdlcstress/test fixes that followed: already merged.
  
  Merged revisions 4036 via svnmerge from 
  http://svn.digium.com/svn/zaptel/branches/1.2
................
  r4042 | tzafrir | 2008-03-21 04:29:43 -0700 (Fri, 21 Mar 2008) | 2 lines
  
  Bugs? ztscan has no bugs.
................
  r4050 | kpfleming | 2008-03-21 08:36:37 -0700 (Fri, 21 Mar 2008) | 2 lines
  
  silence some compiler warnings about unused variables
................
  r4057 | kpfleming | 2008-03-21 13:40:15 -0700 (Fri, 21 Mar 2008) | 2 lines
  
  the hotplug firmware detection logic got broken in r3969... this fixes it
................
  r4062 | kpfleming | 2008-03-21 16:30:07 -0700 (Fri, 21 Mar 2008) | 2 lines
  
  minor fixes... some missing dependencies and extraneous output when downloading firmware
................
  r4063 | kpfleming | 2008-03-21 16:30:41 -0700 (Fri, 21 Mar 2008) | 2 lines
  
  add MF R2 tone generation, and along the way do a lot of cleanup of the tone building and playback code
................
  r4069 | tzafrir | 2008-03-23 15:29:48 -0700 (Sun, 23 Mar 2008) | 10 lines
  
  ztd-ethmf.c: Ztdynamic driver for Redfone Communications foneBRIDGE 2.
  
  This driver uses a network protocol that is different from the existing
  ztd-eth driver.
  
  This commit adds the driver though does not yet build it by default.
  For the moment use make MODULES_EXTRA="ztd-ethmf" .
  
  Patch  multiframe-032108.patch from #12241 by brettcar.
................
  r4073 | mattf | 2008-03-24 14:09:21 -0700 (Mon, 24 Mar 2008) | 9 lines
  
  Merged revisions 4072 via svnmerge from 
  https://origsvn.digium.com/svn/zaptel/branches/1.2
  
  ........
  r4072 | mattf | 2008-03-24 16:06:00 -0500 (Mon, 24 Mar 2008) | 1 line
  
  Add in new parameters added for 1.16 version of the firmware for the TE120 which should have already been merged in.
  ........
................
  r4078 | tzafrir | 2008-03-25 11:42:53 -0700 (Tue, 25 Mar 2008) | 3 lines
  
  Remove yet another "static" inside a struct and allow building 1.4 in
  devfs 2.4 systems.
................
  r4081 | tzafrir | 2008-03-25 12:28:38 -0700 (Tue, 25 Mar 2008) | 3 lines
  
  Allow overriding DYNFS and UDEVRULES to both ways from the make
  command-line.
................
  r4082 | tzafrir | 2008-03-25 12:36:45 -0700 (Tue, 25 Mar 2008) | 4 lines
  
  * Include the .config file. That adds some useful information.
  * If we have devfs support, assume we have dynamic file system, but not
    UDEV rules.
................
  r4086 | tzafrir | 2008-03-26 01:45:25 -0700 (Wed, 26 Mar 2008) | 9 lines
  
  Don't easily fail for missing udevinfo. 
  Nobody has that older udev version (or otherwise we might have recieved
  a bug report about a bogus == rule).
  
  TODO: fix the UDEVRULES test in Makefile.
  
  Merged revisions 4085 via svnmerge from 
  http://svn.digium.com/svn/zaptel/branches/1.2
................

Modified:
    team/sruffell/voicebus/   (props changed)
    team/sruffell/voicebus/Makefile
    team/sruffell/voicebus/README
    team/sruffell/voicebus/build_tools/genudevrules
    team/sruffell/voicebus/firmware/Makefile
    team/sruffell/voicebus/kernel/digits.h
    team/sruffell/voicebus/kernel/wcfxo.c
    team/sruffell/voicebus/kernel/wct4xxp/base.c
    team/sruffell/voicebus/kernel/wctdm24xxp/base.c
    team/sruffell/voicebus/kernel/wcte12xp/GpakApi.c
    team/sruffell/voicebus/kernel/wcte12xp/GpakApi.h
    team/sruffell/voicebus/kernel/wcte12xp/GpakErrs.h
    team/sruffell/voicebus/kernel/wcte12xp/GpakHpi.h
    team/sruffell/voicebus/kernel/wcte12xp/gpakenum.h
    team/sruffell/voicebus/kernel/wcte12xp/vpmadt032.c
    team/sruffell/voicebus/kernel/wcusb.c
    team/sruffell/voicebus/kernel/zaptel-base.c
    team/sruffell/voicebus/kernel/zaptel.h
    team/sruffell/voicebus/tonezone.c
    team/sruffell/voicebus/tonezone.h
    team/sruffell/voicebus/zaptel.conf.sample
    team/sruffell/voicebus/zonedata.c
    team/sruffell/voicebus/ztscan.c

Propchange: team/sruffell/voicebus/
------------------------------------------------------------------------------
--- branch-1.2-blocked (original)
+++ branch-1.2-blocked Thu Mar 27 14:27:36 2008
@@ -1,1 +1,1 @@
-/branches/1.2:917,937,1073,1206,1613,2018,2434,2583,2668,2750,2789,2868,2871,2878,3083,3098-3099,3201,3509,3645,3833,3847,3917,3951
+/branches/1.2:917,937,1073,1206,1613,2018,2434,2583,2668,2750,2789,2868,2871,2878,3083,3098-3099,3201,3509,3645,3833,3847,3917,3951,4037-4038

Propchange: team/sruffell/voicebus/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/sruffell/voicebus/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Mar 27 14:27:36 2008
@@ -1,1 +1,1 @@
-/branches/1.4:1-3955
+/branches/1.4:1-4092

Modified: team/sruffell/voicebus/Makefile
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/Makefile?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/Makefile (original)
+++ team/sruffell/voicebus/Makefile Thu Mar 27 14:27:36 2008
@@ -41,6 +41,20 @@
 KVERS_MAJ:=$(shell echo $(KVERS) | cut -d. -f1-2)
 KINCLUDES:=$(KSRC)/include
 
+# We use the kernel's .config file as an indication that the KSRC
+# directory is indeed a valid and configured kernel source (or partial
+# source) directory.
+#
+# We also source it, as it has the format of Makefile variables list.
+# Thus we will have many CONFIG_* variables from there.
+KCONFIG:=$(KSRC)/.config
+ifneq (,$(wildcard $(KCONFIG)))
+  HAS_KSRC=yes
+  include $(KCONFIG)
+else
+  HAS_KSRC=no
+endif
+
 ifeq ($(KVERS_MAJ),2.4)
   BUILDVER:=linux24
 else
@@ -54,7 +68,14 @@
     DYNFS=yes
     UDEVRULES=yes
   endif
-  HOTPLUG_FIRMWARE:=$(shell if grep CONFIG_FW_LOADER $(KINCLUDES)/linux/autoconf.h | grep -q undef; then echo "no"; else echo "yes"; fi)
+  ifeq (yes,$(HAS_KSRC))
+    HOTPLUG_FIRMWARE:=$(shell if grep -q '^CONFIG_FW_LOADER=[ym]' $(KCONFIG); then echo "yes"; else echo "no"; fi)
+  endif
+endif
+
+ifneq (,$(findstring $(CONFIG_DEVFS_FS),y m))
+  DYNFS=yes
+  HAS_DEVFS=yes
 endif
 
 # If the file .zaptel.makeopts is present in your home directory, you can
@@ -256,7 +277,7 @@
 MAN_PAGES:=$(wildcard $(BINS:%=doc/%.8))
 
 # All the man pages. Not just installed ones:
-GROFF_PAGES	:= $(wildcard doc/*.8)
+GROFF_PAGES	:= $(wildcard doc/*.8 kernel/xpp/utils/*.8)
 GROFF_HTML	:= $(GROFF_PAGES:%=%.html)
 
 all: menuselect.makeopts 
@@ -276,7 +297,10 @@
 utils: $(BINS) utils-subdirs
 
 modules: prereq
-	@if [ -z "$(KSRC)" -o ! -d "$(KSRC)" ]; then echo "You do not appear to have the sources for the $(KVERS) kernel installed."; exit 1 ; fi
+ifeq (no,$(HAS_KSRC))
+	echo "You do not appear to have the sources for the $(KVERS) kernel installed."
+	exit 1
+endif
 	$(KMAKE) modules
 
 version.h:
@@ -288,11 +312,15 @@
 
 tests: patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest
 
-zonedata.lo: zonedata.c
-	$(CC) -c $(CFLAGS) -o $@ $^
-
-tonezone.lo: tonezone.c
-	$(CC) -c $(CFLAGS) -o $@ $^
+zonedata.o: tonezone.h
+
+zonedata.lo: zonedata.c tonezone.h
+	$(CC) -c $(CFLAGS) -o $@ $<
+
+tonezone.o: kernel/zaptel.h tonezone.h
+
+tonezone.lo: tonezone.c tonezone.h kernel/zaptel.h
+	$(CC) -c $(CFLAGS) -o $@ $<
 
 prereq: config.status version.h
 
@@ -343,7 +371,12 @@
 stackcheck: checkstack modules
 	./checkstack kernel/*.ko kernel/*/*.ko
 
-README.html: README
+zaptel.conf.asciidoc: zaptel.conf.sample
+	perl -n -e \
+		'if (/^#($$|\s)(.*)/){ if (!$$in_doc){print "\n"}; $$in_doc=1; print "$$2\n" } else { if ($$in_doc){print "\n"}; $$in_doc=0; print "  $$_" }' \
+		$< >$@
+
+README.html: README zaptel.conf.asciidoc
 	$(ASCIIDOC) -n -a toc -a toclevels=3 $<
 
 kernel/xpp/README.Astribank.html: kernel/xpp/README.Astribank
@@ -356,8 +389,8 @@
 htmlman: $(GROFF_HTML)
 
 
-MISDNVERSION=1_1_3
-MISDNUSERVERSION=1_1_3
+MISDNVERSION=1_1_7_2
+MISDNUSERVERSION=1_1_7_2
 b410p:
 	@if test "$(DOWNLOAD)" = ":" ; then \
 		echo "**************************************************"; \
@@ -448,7 +481,7 @@
 	$(INSTALL) -D -m 644 kernel/zaptel.h $(DESTDIR)$(INC_DIR)/zaptel.h
 
 devices:
-ifndef DYNFS
+ifneq (yes,$(DYNFS))
 	mkdir -p $(DESTDIR)/dev/zap
 	rm -f $(DESTDIR)/dev/zap/ctl
 	rm -f $(DESTDIR)/dev/zap/channel
@@ -471,7 +504,7 @@
 		N=$$[$$N+1]; \
 	done
 else # DYNFS
-  ifdef UDEVRULES
+  ifneq (yes,$(UDEVRULES))
 	install -d $(DESTDIR)/etc/udev/rules.d
 	build_tools/genudevrules > $(DESTDIR)/etc/udev/rules.d/zaptel.rules
   else # !UDEVRULES
@@ -550,7 +583,9 @@
 	rm -f $(BINS)
 	rm -f *.o ztcfg tzdriver sethdlc sethdlc-new
 	rm -f $(LTZ_SO) $(LTZ_A) *.lo
+ifeq (yes,$(HAS_KSRC))
 	$(KMAKE) clean
+endif
 	@for dir in $(SUBDIRS_UTILS_ALL); do \
 		$(MAKE) -C $$dir clean; \
 	done
@@ -563,7 +598,8 @@
 	rm -f ztcfg-shared fxstest
 	rm -rf misdn*
 	rm -rf mISDNuser*
-	rm -rf README.html xpp/README.Astribank.html
+	rm -rf $(GROFF_HTML)
+	rm -rf README.html xpp/README.Astribank.html zaptel.conf.asciidoc
 
 distclean: dist-clean
 

Modified: team/sruffell/voicebus/README
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/README?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/README (original)
+++ team/sruffell/voicebus/README Thu Mar 27 14:27:36 2008
@@ -46,6 +46,7 @@
 - pciradio: Zapata Telephony PCI Quad Radio Interface
 - wctc4xxp: Digium hardware transcoder cards (also need zttranscode)
 - ztd-eth: TDM over Ethernet (TDMoE) driver. Requires ztdynamic
+- ztd-ethmf: TDMoE MultiFrame driver. Requires ztdynamic
 - ztd-loc: Mirror a local span. Requires ztdynamic
 - ztdummy: A dummy driver that only provides a zaptel timing source.
 
@@ -409,6 +410,11 @@
 in README.Astribank .
 
 
+Reference Configuration
+-----------------------
+include::zaptel.conf.asciidoc[]
+
+
 Zaptel PERL modules
 -------------------
 The directory xpp/utils has, in addition to helper utilities for the
@@ -452,7 +458,6 @@
   what PCI/USB Zaptel hardware is connected and if it is currently used
   by a driver. Shows also some more information for Astrobanks from
   /proc/xpp .
-
 
 Internals
 ---------

Modified: team/sruffell/voicebus/build_tools/genudevrules
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/build_tools/genudevrules?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/build_tools/genudevrules (original)
+++ team/sruffell/voicebus/build_tools/genudevrules Thu Mar 27 14:27:36 2008
@@ -3,8 +3,8 @@
 ver=`udevinfo -V | cut -f3 -d" "`
 
 if [ -z "${ver}" ]; then
-   echo Cannot determine the version of udev installed this system... exiting.
-   exit 1
+   # nobody has that old version, anyway.
+   ver=54
 fi
 
 # udev versions prior to 055 use a single '=' for matching key values
@@ -31,5 +31,5 @@
 KERNEL${match}"zap[0-9]*", NAME="zap/%n"
 
 # zaptel devices with ownership/permissions for running as non-root
-SUBSYSTEM=="zaptel",  OWNER="asterisk", GROUP="asterisk", MODE="0660"
+SUBSYSTEM${match}"zaptel",  OWNER="asterisk", GROUP="asterisk", MODE="0660"
 EOF

Modified: team/sruffell/voicebus/firmware/Makefile
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/firmware/Makefile?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/firmware/Makefile (original)
+++ team/sruffell/voicebus/firmware/Makefile Thu Mar 27 14:27:36 2008
@@ -66,7 +66,7 @@
 ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
 	@echo "Attempting to download $@"
 	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
-	if test ! -f $@; then exit 1; fi; \
+	@if test ! -f $@; then exit 1; fi; \
 	(cat $@ | gzip -d | tar -xf -)
 ifeq ($(HOTPLUG_FIRMWARE),yes)
 	@echo "Installing zaptel-fw-oct6114-064.bin to hotplug firmware directories"
@@ -89,7 +89,7 @@
 ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
 	@echo "Attempting to download $@"
 	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
-	if test ! -f $@; then exit 1; fi; \
+	@if test ! -f $@; then exit 1; fi; \
 	(cat $@ | gzip -d | tar -xf -)
 ifeq ($(HOTPLUG_FIRMWARE),yes)
 	@echo "Installing zaptel-fw-oct6114-128.bin to hotplug firmware directories"
@@ -112,7 +112,7 @@
 ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
 	@echo "Attempting to download $@"
 	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
-	if test ! -f $@; then exit 1; fi; \
+	@if test ! -f $@; then exit 1; fi; \
 	(cat $@ | gzip -d | tar -xf -)
 ifeq ($(HOTPLUG_FIRMWARE),yes)
 	@echo "Installing zaptel-fw-tc400m.bin to hotplug firmware directories"
@@ -135,7 +135,7 @@
 ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
 	@echo "Attempting to download $@"
 	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
-	if test ! -f $@; then exit 1; fi; \
+	@if test ! -f $@; then exit 1; fi; \
 	(cat $@ | gzip -d | tar -xf -)
 ifeq ($(HOTPLUG_FIRMWARE),yes)
 	@echo "Installing zaptel-fw-vpmadt032.bin to hotplug firmware directories"

Modified: team/sruffell/voicebus/kernel/digits.h
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/digits.h?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/digits.h (original)
+++ team/sruffell/voicebus/kernel/digits.h Thu Mar 27 14:27:36 2008
@@ -15,14 +15,14 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
  *
- * Use DTMF/MFv1 tables 
  */
 
 #ifndef _DIGITS_H
 #define _DIGITS_H
 
 #define DEFAULT_DTMF_LENGTH	100 * ZT_CHUNKSIZE
-#define DEFAULT_MFV1_LENGTH	60 * ZT_CHUNKSIZE
+#define DEFAULT_MFR1_LENGTH	68 * ZT_CHUNKSIZE
+#define DEFAULT_MFR2_LENGTH	100 * ZT_CHUNKSIZE
 #define	PAUSE_LENGTH		500 * ZT_CHUNKSIZE
 
 /* At the end of silence, the tone stops */
@@ -31,8 +31,13 @@
 };
 
 /* At the end of silence, the tone stops */
-static struct zt_tone mfv1_silence = {
-	.tonesamples = DEFAULT_MFV1_LENGTH,
+static struct zt_tone mfr1_silence = {
+	.tonesamples = DEFAULT_MFR1_LENGTH,
+};
+
+/* At the end of silence, the tone stops */
+static struct zt_tone mfr2_silence = {
+	.tonesamples = DEFAULT_MFR2_LENGTH,
 };
 
 /* A pause in the dialing */

Modified: team/sruffell/voicebus/kernel/wcfxo.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wcfxo.c?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wcfxo.c (original)
+++ team/sruffell/voicebus/kernel/wcfxo.c Thu Mar 27 14:27:36 2008
@@ -1081,11 +1081,11 @@
 }
 
 #ifdef LINUX26
-module_param(debug, int, 0600);
-module_param(quiet, int, 0600);
-module_param(boost, int, 0600);
-module_param(monitor, int, 0600);
-module_param(opermode, int, 0600);
+module_param(debug, int, 0644);
+module_param(quiet, int, 0444);
+module_param(boost, int, 0444);
+module_param(monitor, int, 0444);
+module_param(opermode, int, 0444);
 #else
 MODULE_PARM(debug, "i");
 MODULE_PARM(quiet, "i");

Modified: team/sruffell/voicebus/kernel/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wct4xxp/base.c?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wct4xxp/base.c (original)
+++ team/sruffell/voicebus/kernel/wct4xxp/base.c Thu Mar 27 14:27:36 2008
@@ -2957,7 +2957,7 @@
 			t4_framer_interrupt(wc, 3);
 	}
 
-	if (wc->vpm) {
+	if (wc->vpm && vpmdtmfsupport) {
 		if (wc->vpm450m) {
 			/* How stupid is it that the octasic can't generate an
 			   interrupt when there's a tone, in spite of what their

Modified: team/sruffell/voicebus/kernel/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wctdm24xxp/base.c?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wctdm24xxp/base.c (original)
+++ team/sruffell/voicebus/kernel/wctdm24xxp/base.c Thu Mar 27 14:27:36 2008
@@ -3028,7 +3028,11 @@
 				printk("ReadEventFIFOMessage took %d ms\n", wc->intcount - start);
 
 			if (res == RefInvalidEvent || res == RefDspCommFailure) {
-				printk("Uh oh (%d)\n", res);
+				printk("VPM Comm Error\n");
+				continue;
+			}
+
+			if (res == RefNoEventAvail) {
 				continue;
 			}
 

Modified: team/sruffell/voicebus/kernel/wcte12xp/GpakApi.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wcte12xp/GpakApi.c?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wcte12xp/GpakApi.c (original)
+++ team/sruffell/voicebus/kernel/wcte12xp/GpakApi.c Thu Mar 27 14:27:36 2008
@@ -128,10 +128,12 @@
     DSP_ADDRESS IfBlockPntr; /* Interface Block pointer */
     DSP_WORD DspStatus;      /* DSP Status */
     DSP_WORD DspChannels;    /* number of DSP channels */
-    //DSP_WORD DspConfs;       /* number of DSP conferences */
-    //DSP_ADDRESS PktBufrMem;  /* address of Packet Buffer */
     DSP_WORD  Temp[2];
-    //unsigned short int i;    /* loop index / counter */
+#if 0
+    DSP_WORD DspConfs;       /* number of DSP conferences */
+    DSP_ADDRESS PktBufrMem;  /* address of Packet Buffer */
+    unsigned short int i;    /* loop index / counter */
+#endif
 
     /* Read the pointer to the Interface Block. */
     gpakReadDspMemory(DspId, DSP_IFBLK_ADDRESS, 2, Temp);
@@ -560,7 +562,7 @@
                     ((pPortConfig->RxFrameSyncPolarity2 << 4) & 0x0010) |
                     ((pPortConfig->TxFrameSyncPolarity2 << 3) & 0x0008) |
                     ((pPortConfig->CompandingMode2 << 1) & 0x0006) |
-                    (pPortConfig->SerialWordSize1 & 0x0001));
+                    (pPortConfig->SerialWordSize2 & 0x0001));
 
     MsgBuffer[12] = (DSP_WORD)
                    (((pPortConfig->DxDelay3 << 11) & 0x0800) |
@@ -672,7 +674,7 @@
                        ((pChanConfig->SoftwareCompand & 3) << 2) |
                         (pChanConfig->EcanEnableB << 1) | 
                         (pChanConfig->EcanEnableA & 1)
-						);
+                        );
                         
         MsgBuffer[7]   = (DSP_WORD)
                          pChanConfig->EcanParametersA.EcanTapLength;       
@@ -732,8 +734,16 @@
                          pChanConfig->EcanParametersB.EcanNumFirSegments;  
         MsgBuffer[34]  = (DSP_WORD)
                          pChanConfig->EcanParametersB.EcanFirSegmentLen;   
-
-        MsgLength = 70; // byte number == 35*2 
+        MsgBuffer[35]  = (DSP_WORD)
+                         pChanConfig->EcanParametersA.EcanTandemOperationEnable;  
+        MsgBuffer[36]  = (DSP_WORD)
+                         pChanConfig->EcanParametersA.EcanMixedFourWireMode;   
+        MsgBuffer[37]  = (DSP_WORD)
+                         pChanConfig->EcanParametersB.EcanTandemOperationEnable;  
+        MsgBuffer[38]  = (DSP_WORD)
+                         pChanConfig->EcanParametersB.EcanMixedFourWireMode;   
+
+        MsgLength = 78; // byte number == 39*2 
         break;
 
 
@@ -889,7 +899,9 @@
     DSP_WORD TakeIndex;     /* event fifo take index */
     DSP_WORD WordsReady;    /* number words ready for read out of event fifo */
     DSP_WORD EventError;    /* flag indicating error with event fifo msg  */
-    //DSP_WORD *pDebugData;   /* debug data buffer pointer in event data struct */
+#if 0
+    DSP_WORD *pDebugData;   /* debug data buffer pointer in event data struct */
+#endif
 
     /* Make sure the DSP Id is valid. */
     if (DspId >= MAX_DSP_CORES)

Modified: team/sruffell/voicebus/kernel/wcte12xp/GpakApi.h
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wcte12xp/GpakApi.h?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wcte12xp/GpakApi.h (original)
+++ team/sruffell/voicebus/kernel/wcte12xp/GpakApi.h Thu Mar 27 14:27:36 2008
@@ -77,6 +77,9 @@
     short int EcanCrossCorrLimit;  // Echo Can Cross Correlation limit 
     short int EcanNumFirSegments;  // Echo Can Num FIR Segments 
     short int EcanFirSegmentLen;   // Echo Can FIR Segment Length 
+    short int EcanTandemOperationEnable;   //Enable tandem operation 
+    short int EcanMixedFourWireMode; 	// Handle possible 4-wire (echo-free) lines
+
 } GpakEcanParms_t;
 
 /* Definition of a Channel Configuration information structure. */

Modified: team/sruffell/voicebus/kernel/wcte12xp/GpakErrs.h
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wcte12xp/GpakErrs.h?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wcte12xp/GpakErrs.h (original)
+++ team/sruffell/voicebus/kernel/wcte12xp/GpakErrs.h Thu Mar 27 14:27:36 2008
@@ -99,7 +99,8 @@
 
 	Cc_InvalidMuteToneA = 51,        /* invalid MuteToneA set, no detector */
 	Cc_InvalidMuteToneB = 52,         /* invalid MuteToneB set, no detector */
-    Cc_InsuffFaxCngDetResources = 53     /* insufficient tdm block resources avail. */
+    Cc_InsuffFaxCngDetResources = 53,     /* insufficient tdm block resources avail. */
+	Cc_PortDmaNotStarted = 54,     /* SerialPort not ready  */
 
 } GPAK_ChannelConfigStat_t;
 

Modified: team/sruffell/voicebus/kernel/wcte12xp/GpakHpi.h
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wcte12xp/GpakHpi.h?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wcte12xp/GpakHpi.h (original)
+++ team/sruffell/voicebus/kernel/wcte12xp/GpakHpi.h Thu Mar 27 14:27:36 2008
@@ -75,6 +75,6 @@
 #define MSG_READ_DSP_MEMORY         49 /* read small section of DSP's memory */
 #define MSG_READ_DSP_MEMORY_REPLY   50 /* read memory reply */
 
-#define MSG_ACCESSGPIO				51
-#define MSG_ACCESSGPIO_REPLY		52
+#define MSG_ACCESSGPIO              51
+#define MSG_ACCESSGPIO_REPLY        52
 #endif  /* prevent multiple inclusion */

Modified: team/sruffell/voicebus/kernel/wcte12xp/gpakenum.h
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wcte12xp/gpakenum.h?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wcte12xp/gpakenum.h (original)
+++ team/sruffell/voicebus/kernel/wcte12xp/gpakenum.h Thu Mar 27 14:27:36 2008
@@ -114,7 +114,7 @@
 
     EnableMuLawSwCompanding  = 6,// Enable Mu-law Software companding
     EnableALawSwCompanding  = 7, // Enable Mu-law Software companding
-    BypassSwCompanding  = 8,     // Bypass Software companding
+    BypassSwCompanding   = 8,    // Bypass Software companding
 	EnableDTMFMuteA       = 9,   // Mute A side Dtmf digit after tone detected
 	DisableDTMFMuteA      = 10,  // Do not mute A side Dtmf digit once tone detected
 	EnableDTMFMuteB       = 11,  // Mute B side Dtmf digit after tone detected
@@ -174,7 +174,7 @@
     DtmfDigitPnd = 14,    // DTMF Digit # 
     DtmfDigitD   = 15,    // DTMF Digit D 
 
-	FaxCngDigit  = 90,    // Fax Calling Tone (1100 Hz)
+    FaxCngDigit = 90,       // Fax Calling Tone (1100 Hz) 
 
     EndofMFDigit = 100,     // End of MF digit 
     EndofCngDigit = 101     // End of Cng Digit
@@ -188,4 +188,5 @@
 	GPIO_DIR = 2
 } GpakGPIOCotrol_t;
 
+
 #endif // end multiple inclusion

Modified: team/sruffell/voicebus/kernel/wcte12xp/vpmadt032.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wcte12xp/vpmadt032.c?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wcte12xp/vpmadt032.c (original)
+++ team/sruffell/voicebus/kernel/wcte12xp/vpmadt032.c Thu Mar 27 14:27:36 2008
@@ -1253,6 +1253,8 @@
 		chanconfig.EcanParametersA.EcanCrossCorrLimit = 15;
 		chanconfig.EcanParametersA.EcanNumFirSegments = 3;
 		chanconfig.EcanParametersA.EcanFirSegmentLen = 64;
+		chanconfig.EcanParametersA.EcanTandemOperationEnable = 1;
+		chanconfig.EcanParametersA.EcanMixedFourWireMode = 1;
 	
 		chanconfig.EcanParametersB.EcanTapLength = 1024;
 		chanconfig.EcanParametersB.EcanNlpType = vpmnlptype;
@@ -1268,6 +1270,8 @@
 		chanconfig.EcanParametersB.EcanCrossCorrLimit = 15;
 		chanconfig.EcanParametersB.EcanNumFirSegments = 3;
 		chanconfig.EcanParametersB.EcanFirSegmentLen = 64;
+		chanconfig.EcanParametersB.EcanTandemOperationEnable = 1;
+		chanconfig.EcanParametersB.EcanMixedFourWireMode = 1;
 	
 		if ((res = gpakConfigureChannel(vpm150m->dspid, i, tdmToTdm, &chanconfig, &cstatus))) {
 			module_printk("Unable to configure channel (%d)\n", res);

Modified: team/sruffell/voicebus/kernel/wcusb.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/wcusb.c?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/wcusb.c (original)
+++ team/sruffell/voicebus/kernel/wcusb.c Thu Mar 27 14:27:36 2008
@@ -393,7 +393,7 @@
 			}
 			if (debug) printk("wcusb: got digit %d\n", d->scanned_event);
 			if (digit != 'z') {
-				d->tone = zt_dtmf_tone(&p->chan, digit);
+				d->tone = zt_mf_tone(&p->chan, digit, p->chan.digitmode);
 				if (!d->tone) {
 					printk("wcusb: Didn't get a tone structure\n");
 					goto func_end;

Modified: team/sruffell/voicebus/kernel/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/zaptel-base.c?view=diff&rev=4094&r1=4093&r2=4094
==============================================================================
--- team/sruffell/voicebus/kernel/zaptel-base.c (original)
+++ team/sruffell/voicebus/kernel/zaptel-base.c Thu Mar 27 14:27:36 2008
@@ -116,7 +116,7 @@
 
 EXPORT_SYMBOL(zt_transcode_fops);
 EXPORT_SYMBOL(zt_init_tone_state);
-EXPORT_SYMBOL(zt_dtmf_tone);
+EXPORT_SYMBOL(zt_mf_tone);
 EXPORT_SYMBOL(zt_register);
 EXPORT_SYMBOL(zt_unregister);
 EXPORT_SYMBOL(__zt_mulaw);
@@ -301,14 +301,17 @@
 */
 
 #define DIGIT_MODE_DTMF 	0
-#define DIGIT_MODE_MFV1		1
+#define DIGIT_MODE_MFR1		1
 #define DIGIT_MODE_PULSE	2
+#define DIGIT_MODE_MFR2_FWD	3
+#define DIGIT_MODE_MFR2_REV	4
 
 #include "digits.h"
 
 static struct zt_dialparams global_dialparams = {
 	.dtmf_tonelen = DEFAULT_DTMF_LENGTH,
-	.mfv1_tonelen = DEFAULT_MFV1_LENGTH,
+	.mfv1_tonelen = DEFAULT_MFR1_LENGTH,
+	.mfr2_tonelen = DEFAULT_MFR2_LENGTH,
 };
 
 static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit);
@@ -372,8 +375,9 @@
 	   unavailable */
 	struct zt_tone dtmf[16];		/* DTMF tones for this zone, with desired length */
 	struct zt_tone dtmf_continuous[16];	/* DTMF tones for this zone, continuous play */
-	struct zt_tone mf[15];			/* MF tones for this zone, with desired length */
-	struct zt_tone mf_continuous[15];	/* MF tones for this zone, continuous play */
+	struct zt_tone mfr1[15];		/* MFR1 tones for this zone, with desired length */
+	struct zt_tone mfr2_fwd[15];		/* MFR2 FWD tones for this zone, with desired length */
+	struct zt_tone mfr2_rev[15];		/* MFR2 REV tones for this zone, with desired length */
 };
 
 static struct zt_span *spans[ZT_MAX_SPANS];
@@ -1170,18 +1174,26 @@
 		} else { /* Indicate that zone is loaded but no such tone exists */
 			res = -ENOSYS;
 		}
-	} else if (tone >= ZT_TONE_DTMF_BASE && tone <= ZT_TONE_DTMF_MAX) {
-		/* ZT_SENDTONE should never be used on a channel configured for pulse dialing */
-		chan->dialing = 1;
-		res = 0;
-		if (chan->digitmode == DIGIT_MODE_DTMF) {
-			chan->curtone = &chan->curzone->dtmf_continuous[tone - ZT_TONE_DTMF_BASE];
-		} 
-	} else if ((tone >= ZT_TONE_MF_BASE) && (tone <= ZT_TONE_MF_MAX)) {
-		chan->dialing = 1;
-		res = 0;
-		if (chan->digitmode == DIGIT_MODE_MFV1) {
-			chan->curtone = &chan->curzone->mf_continuous[tone - ZT_TONE_MF_BASE];
+	} else if (chan->digitmode == DIGIT_MODE_DTMF) {
+		if ((tone >= ZT_TONE_DTMF_BASE) && (tone <= ZT_TONE_DTMF_MAX)) {
+			chan->dialing = 1;
+			res = 0;
+			tone -= ZT_TONE_DTMF_BASE;
+			if (chan->curzone) {
+				/* Have a tone zone */
+				if (chan->curzone->dtmf_continuous[tone].tonesamples) {
+					chan->curtone = &chan->curzone->dtmf_continuous[tone];
+					res = 0;
+				} else {
+					/* Indicate that zone is loaded but no such tone exists */
+					res = -ENOSYS;
+				}
+			} else {
+				/* Note that no tone zone exists at the moment */
+				res = -ENODATA;
+			}
+		} else {
+			res = -EINVAL;
 		}
 	} else {
 		chan->dialing = 0;
@@ -2687,7 +2699,9 @@
 		enum {
 			REGULAR_TONE,
 			DTMF_TONE,
-			MF_TONE,
+			MFR1_TONE,
+			MFR2_FWD_TONE,
+			MFR2_REV_TONE,
 		} tone_type;
 
 		if (space < sizeof(*t)) {
@@ -2723,15 +2737,23 @@
 		} else if ((td.tone >= ZT_TONE_DTMF_BASE) &&
 			   (td.tone <= ZT_TONE_DTMF_MAX)) {
 			tone_type = DTMF_TONE;
-
 			td.tone -= ZT_TONE_DTMF_BASE;
 			t = &z->dtmf[td.tone];
-		} else if ((td.tone >= ZT_TONE_MF_BASE) &&
-			   (td.tone <= ZT_TONE_MF_MAX)) {
-			tone_type = MF_TONE;
-
-			td.tone -= ZT_TONE_MF_BASE;
-			t = &z->mf[td.tone];
+		} else if ((td.tone >= ZT_TONE_MFR1_BASE) &&
+			   (td.tone <= ZT_TONE_MFR1_MAX)) {
+			tone_type = MFR1_TONE;
+			td.tone -= ZT_TONE_MFR1_BASE;
+			t = &z->mfr1[td.tone];
+		} else if ((td.tone >= ZT_TONE_MFR2_FWD_BASE) &&
+			   (td.tone <= ZT_TONE_MFR2_FWD_MAX)) {
+			tone_type = MFR2_FWD_TONE;
+			td.tone -= ZT_TONE_MFR2_FWD_BASE;
+			t = &z->mfr2_fwd[td.tone];
+		} else if ((td.tone >= ZT_TONE_MFR2_REV_BASE) &&
+			   (td.tone <= ZT_TONE_MFR2_REV_MAX)) {
+			tone_type = MFR2_REV_TONE;
+			td.tone -= ZT_TONE_MFR2_REV_BASE;
+			t = &z->mfr2_rev[td.tone];
 		} else {
 			printk("Invalid tone (%d) defined\n", td.tone);
 			kfree(slab);
@@ -2758,14 +2780,26 @@
 			z->dtmf_continuous[td.tone] = *t;
 			z->dtmf_continuous[td.tone].next = &z->dtmf_continuous[td.tone];
 			break;
-		case MF_TONE:
-			t->tonesamples = global_dialparams.mfv1_tonelen;
-			t->next = &mfv1_silence;
-			/* Special case for K/P tone */
-			if (td.tone == 10)
-				t->tonesamples *= 5 / 3;
-			z->mf_continuous[td.tone] = *t;
-			z->mf_continuous[td.tone].next = &z->mf_continuous[td.tone];
+		case MFR1_TONE:
+			switch (td.tone + ZT_TONE_MFR1_BASE) {
+			case ZT_TONE_MFR1_KP:
+			case ZT_TONE_MFR1_ST:
+			case ZT_TONE_MFR1_STP:
+			case ZT_TONE_MFR1_ST2P:
+			case ZT_TONE_MFR1_ST3P:
+				/* signaling control tones are always 100ms */
+				t->tonesamples = 100 * ZT_CHUNKSIZE;
+				break;
+			default:
+				t->tonesamples = global_dialparams.mfv1_tonelen;
+				break;
+			}
+			t->next = &mfr1_silence;
+			break;
+		case MFR2_FWD_TONE:
+		case MFR2_REV_TONE:
+			t->tonesamples = global_dialparams.mfr2_tonelen;
+			t->next = &dtmf_silence;
 			break;
 		}
 	}
@@ -2797,9 +2831,9 @@
 	ts->modulate = zt->modulate;
 }
 

[... 1589 lines stripped ...]



More information about the zaptel-commits mailing list