[zaptel-commits] mattf: branch mattf/zaptel-1.4-stackcleanup r4151 - in /team/mattf/zaptel-1.4...

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Sat Apr 5 15:19:20 CDT 2008


Author: mattf
Date: Sat Apr  5 15:19:18 2008
New Revision: 4151

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4151
Log:
Merged revisions 4095-4096,4100-4101,4106-4107,4110,4113-4114,4119,4122,4130,4134,4137,4139,4141 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.4

........
r4095 | tzafrir | 2008-03-27 15:37:56 -0500 (Thu, 27 Mar 2008) | 2 lines

Also install wct4xxp/wct4xxp.o in 2.4 kernels...

........
r4096 | sruffell | 2008-03-27 16:17:46 -0500 (Thu, 27 Mar 2008) | 5 lines

- Updated wctdm24xxp and wcte12xp driver which are now more tolerant of
  systems which do not exhibit good real-time characteristics.
- Bringing in improvements to battery alarm generation that was on kpflemings
  battery_alarms branch. (Issue #12099)

........
r4100 | sruffell | 2008-03-27 16:48:30 -0500 (Thu, 27 Mar 2008) | 2 lines

The location of the fxo_modes structure changed.

........
r4101 | sruffell | 2008-03-27 17:08:24 -0500 (Thu, 27 Mar 2008) | 3 lines

No need to make the wctdm_fxomodes.h file anymore, since it would be the same
as the fxo_modes.h file.

........
r4106 | tzafrir | 2008-03-29 01:30:02 -0500 (Sat, 29 Mar 2008) | 2 lines

Document some ABI changes.

........
r4107 | tzafrir | 2008-03-29 01:57:44 -0500 (Sat, 29 Mar 2008) | 2 lines

Minor asciidoc fix.

........
r4110 | tzafrir | 2008-03-31 03:30:17 -0500 (Mon, 31 Mar 2008) | 5 lines

Document when "D-Chan RX Bad checksum" is not a problem.

Merged revisions 4109 via svnmerge from 
http://svn.digium.com/svn/zaptel/branches/1.2

........
r4113 | russell | 2008-03-31 12:27:08 -0500 (Mon, 31 Mar 2008) | 4 lines

Remove the ztd-ethmf driver for now.  It was not ready to be committed.

(issue #12241)

........
r4114 | russell | 2008-03-31 12:39:14 -0500 (Mon, 31 Mar 2008) | 2 lines

revert a portion of rev 4113 that was committed by accident

........
r4119 | tzafrir | 2008-03-31 19:45:04 -0500 (Mon, 31 Mar 2008) | 7 lines

Do clean some modules when there's no kernel tree available.

(and block the backport of r4082).

Merged revisions 4118 via svnmerge from 
http://svn.digium.com/svn/zaptel/branches/1.2

........
r4122 | sruffell | 2008-04-01 11:39:05 -0500 (Tue, 01 Apr 2008) | 3 lines

Work around for host bridges that generate fast back to back transactions
which the current version of the quad span cards do not advertise support for.

........
r4130 | markster | 2008-04-03 18:27:33 -0500 (Thu, 03 Apr 2008) | 2 lines

Have to use 'O' since 'F' is reserved (MFR2 fOrward)

........
r4134 | mattf | 2008-04-04 11:21:06 -0500 (Fri, 04 Apr 2008) | 1 line


........
r4137 | mattf | 2008-04-04 12:47:58 -0500 (Fri, 04 Apr 2008) | 1 line

Add support for AEX410
........
r4139 | tzafrir | 2008-04-04 13:20:16 -0500 (Fri, 04 Apr 2008) | 5 lines

Zaptel::Hardware - Add support for AEX410.

Merged revisions 4138 via svnmerge from 
http://svn.digium.com/svn/zaptel/branches/1.2

........
r4141 | markster | 2008-04-04 18:12:04 -0500 (Fri, 04 Apr 2008) | 2 lines

Allow continuous MFR2 transmission continuously

........

Removed:
    team/mattf/zaptel-1.4-stackcleanup/kernel/ztd-ethmf.c
Modified:
    team/mattf/zaptel-1.4-stackcleanup/   (props changed)
    team/mattf/zaptel-1.4-stackcleanup/Makefile
    team/mattf/zaptel-1.4-stackcleanup/README
    team/mattf/zaptel-1.4-stackcleanup/doc/module-parameters.txt
    team/mattf/zaptel-1.4-stackcleanup/firmware/Makefile
    team/mattf/zaptel-1.4-stackcleanup/kernel/wct4xxp/base.c
    team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm.c
    team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.c
    team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.h
    team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/Kbuild
    team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/base.c
    team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/wctdm24xxp.h
    team/mattf/zaptel-1.4-stackcleanup/kernel/wcte12xp/GpakApi.c
    team/mattf/zaptel-1.4-stackcleanup/kernel/wcte12xp/GpakApi.h
    team/mattf/zaptel-1.4-stackcleanup/kernel/wcte12xp/GpakErrs.h
    team/mattf/zaptel-1.4-stackcleanup/kernel/wcte12xp/GpakHpi.h
    team/mattf/zaptel-1.4-stackcleanup/kernel/wcte12xp/Kbuild
    team/mattf/zaptel-1.4-stackcleanup/kernel/wcte12xp/base.c
    team/mattf/zaptel-1.4-stackcleanup/kernel/wcte12xp/gpakenum.h
    team/mattf/zaptel-1.4-stackcleanup/kernel/wcte12xp/vpmadt032.c
    team/mattf/zaptel-1.4-stackcleanup/kernel/wcte12xp/wcte12xp.h
    team/mattf/zaptel-1.4-stackcleanup/kernel/xpp/README.Astribank
    team/mattf/zaptel-1.4-stackcleanup/kernel/xpp/utils/Makefile
    team/mattf/zaptel-1.4-stackcleanup/kernel/xpp/utils/print_modes.c
    team/mattf/zaptel-1.4-stackcleanup/kernel/xpp/utils/zconf/Zaptel/Hardware/PCI.pm
    team/mattf/zaptel-1.4-stackcleanup/kernel/zaptel-base.c
    team/mattf/zaptel-1.4-stackcleanup/zaptel.conf.sample

Propchange: team/mattf/zaptel-1.4-stackcleanup/
------------------------------------------------------------------------------
--- branch-1.2-blocked (original)
+++ branch-1.2-blocked Sat Apr  5 15:19:18 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,4037-4038
+/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,4117

Propchange: team/mattf/zaptel-1.4-stackcleanup/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/mattf/zaptel-1.4-stackcleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Apr  5 15:19:18 2008
@@ -1,1 +1,1 @@
-/branches/1.4:1-4088
+/branches/1.4:1-4150

Modified: team/mattf/zaptel-1.4-stackcleanup/Makefile
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/Makefile?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/Makefile (original)
+++ team/mattf/zaptel-1.4-stackcleanup/Makefile Sat Apr  5 15:19:18 2008
@@ -142,7 +142,7 @@
 
 ifeq ($(BUILDVER),linux24)
   INSTALL_MODULES:=$(BUILD_TOPDIR_MODULES:%=$(KERN_DIR)/%.o)
-  INSTALL_MODULES+=$(foreach mod,$(BUILD_SUBDIR_MODULES),$(mod)/$(mod).o)
+  INSTALL_MODULES+=$(foreach mod,$(BUILD_SUBDIR_MODULES),$(KERN_DIR)/$(mod)/$(mod).o)
   ALL_MODULES:=$(TOPDIR_MODULES:%=$(KERN_DIR)/%.o)
   ALL_MODULES+=$(SUBDIR_MODULES:%=$(KERN_DIR)/%/%.o)
 else
@@ -585,6 +585,8 @@
 	rm -f $(LTZ_SO) $(LTZ_A) *.lo
 ifeq (yes,$(HAS_KSRC))
 	$(KMAKE) clean
+else
+	rm -f kernel/*.o kernel/*.ko kernel/*/*.o kernel/*/*.ko
 endif
 	@for dir in $(SUBDIRS_UTILS_ALL); do \
 		$(MAKE) -C $$dir clean; \

Modified: team/mattf/zaptel-1.4-stackcleanup/README
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/README?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/README (original)
+++ team/mattf/zaptel-1.4-stackcleanup/README Sat Apr  5 15:19:18 2008
@@ -46,7 +46,6 @@
 - 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.
 
@@ -576,6 +575,89 @@
 
            2 XPP_FXS/0/0/1 FXOLS (In use)
 
+
+ABI Compatibility
+~~~~~~~~~~~~~~~~~
+Like any other kernel code, Zaptel strives to maintain a stable
+interface to userspace programs. The API of Zaptel to userspace
+programs, zaptel.h, has remained backword-compatible for a long time and
+is expected to remain so in the future. With the ABI (the bits
+themselves) things are slightly trickier.
+
+Zaptel's interface to userspace is mostly ioctl(3) calls. Ioctl calls
+are identified by a number that stems from various things, one of which
+is the size of the data structure passed between the kernel and
+userspace. 
+
+Many of the Zaptel ioctl-s use some sepcific structs to pass information
+between kernel and userspace. In some cases the need arose to pass a few
+more data members in each call. Simply adding a new member to the struct
+would have meant a new number for the ioctl, as its number depends on
+the size of the data passed.
+
+Thus we would add a new ioctl with the same base number and with the
+original struct.
+
+So suppose we had the following ioctl:
+----------------------------------
+struct zt_example {
+	int sample;
+}
+
+#define ZT_EXAMPLE     _IOWR (ZT_CODE, 62, struct zt_example)
+----------------------------------
+
+And we want to add the field 'int onemore', we won't just add it to the
+struct. We will do something that is more complex:
+------------------------------------
+/* The original, unchanged: */
+struct zt_example_v1 {
+	int sample;
+}
+
+/* The new struct: */
+struct zt_example {
+	int sample;
+	int onemore;
+}
+
+#define ZT_EXAMPLE_V1  _IOWR (ZT_CODE, 62, struct zt_example_v1)
+#define ZT_EXAMPLE     _IOWR (ZT_CODE, 62, struct zt_example)
+------------------------------------
+We actually have here two different ioctls: the old ZT_EXAMPLE would be
+0xC0044A3E . ZT_EXAMPLE_V1 would have the same value. But the new value
+of ZT_EXAMPLE would be 0xC0084A3E .
+
+Programs built with the original zaptel.h (before the change) use the
+original ioctl, whether or not the kerenl code is actually of the newer
+version. Thus in most cases there are no compatibility issues.
+
+When can we have compatibility issues? if we have code built with the
+new zaptel.h, but the loaded kernel code (modules) are of the older
+version. Thus the userspace program will try to use the newer ZT_EXAMPLE
+(0xC0084A3E). But the kernel code has no handler for that ioctl. The
+result: the error 25, ENOTTY, which means "Inappropriate ioctl for
+device".
+
+As a by-product of that method, for each interface change a new #define
+is added. That definition is for the old version and thus it might
+appear slightly confusing in the code, but it is useful for writing code
+that works with both versions of Zaptel. 
+
+Past Incompatibilities
+^^^^^^^^^^^^^^^^^^^^^^
+.Zaptel 1.4.8:
+* ZT_GET_PARAMS_V1
+* ZT_SET_PARAMS_V1
+* ZT_SPANINFO_V2
+
+.Zaptel 1.4.6:
+* ZT_SPANINFO_V1
+
+ZT_SPANINFO_V1 was originally called (up to zaptel 1.4.8)
+"ZT_SPANINFO_COMPAT".
+
+
 PPP Support
 -----------
 Zaptel digital cards can provide data channels through ppp as

Modified: team/mattf/zaptel-1.4-stackcleanup/doc/module-parameters.txt
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/doc/module-parameters.txt?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/doc/module-parameters.txt (original)
+++ team/mattf/zaptel-1.4-stackcleanup/doc/module-parameters.txt Sat Apr  5 15:19:18 2008
@@ -2,6 +2,7 @@
 
 (Note: this list is woefully incomplete, but is a starting point and
 will be improved as time permits.)
+
 
  --- VPMADT032 Parameters ---
 
@@ -42,3 +43,15 @@
 	When vpmnlptype is 'Suppress', this value indicates the
 	relative energy level decrease that should be applied to the
 	echo signal).
+
+ --- General Module Parameters ---
+
+latency - 3 to 32, defaults to 3
+
+	For the wctdm24xxp and wcte12xp drivers.  Specifies the amount of
+	latency the driver inserts into the voice conversation.  On systems
+	that are unable to service the interrupt in a timely manner,
+	increasing the latency can increase module init time since the driver
+	will not have to dynamically grow the latency during initialization.
+	However, the latency in the driver does add to the overall latency of
+	any voice conversation.

Modified: team/mattf/zaptel-1.4-stackcleanup/firmware/Makefile
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/firmware/Makefile?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/firmware/Makefile (original)
+++ team/mattf/zaptel-1.4-stackcleanup/firmware/Makefile Sat Apr  5 15:19:18 2008
@@ -20,7 +20,7 @@
 OCT6114_064_VERSION:=1.05.01
 OCT6114_128_VERSION:=1.05.01
 TC400M_VERSION:=MR6.12
-VPMADT032_VERSION:=1.16
+VPMADT032_VERSION:=1.07
 
 FIRMWARE_URL:=http://downloads.digium.com/pub/telephony/firmware/releases
 

Modified: team/mattf/zaptel-1.4-stackcleanup/kernel/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/kernel/wct4xxp/base.c?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/kernel/wct4xxp/base.c (original)
+++ team/mattf/zaptel-1.4-stackcleanup/kernel/wct4xxp/base.c Sat Apr  5 15:19:18 2008
@@ -411,6 +411,13 @@
 static inline unsigned int __t4_pci_in(struct t4 *wc, const unsigned int addr)
 {
 	unsigned int res = readl(&wc->membase[addr]);
+	if (pedanticpci) {
+		/* Even though we do not support fast back-to-back
+		 * transactions, some host bridges appear to generate them.
+		 * This delay prevents this. 
+		 */
+		udelay(3);
+	}
 	return res;
 }
 
@@ -419,6 +426,11 @@
 	unsigned int tmp;
 	writel(value, &wc->membase[addr]);
 	if (pedanticpci) {
+		/* Even though we do not support fast back-to-back
+		 * transactions, some host bridges appear to generate them.
+		 * This delay prevents this. 
+		 */
+		udelay(3);
 		tmp = __t4_pci_in(wc, WC_VERSION);
 		if ((tmp & 0xffff0000) != 0xc01a0000)
 			printk("TE4XXP: Version Synchronization Error!\n");

Modified: team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm.c?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm.c (original)
+++ team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm.c Sat Apr  5 15:19:18 2008
@@ -108,100 +108,9 @@
 {43,66,"LOOP_CLOSE_TRES_LOW",0x1000},
 };
 
-static struct fxo_mode {
-	char *name;
-	/* FXO */
-	int ohs;
-	int ohs2;
-	int rz;
-	int rt;
-	int ilim;
-	int dcv;
-	int mini;
-	int acim;
-	int ring_osc;
-	int ring_x;
-} fxo_modes[] =
-{
-	{ "FCC", 0, 0, 0, 1, 0, 0x3, 0, 0, }, 	/* US, Canada */
-	{ "TBR21", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0x7e6c, 0x023a, },
-										/* Austria, Belgium, Denmark, Finland, France, Germany, 
-										   Greece, Iceland, Ireland, Italy, Luxembourg, Netherlands,
-										   Norway, Portugal, Spain, Sweden, Switzerland, and UK */
-	{ "ARGENTINA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "AUSTRALIA", 1, 0, 0, 0, 0, 0, 0x3, 0x3, },
-	{ "AUSTRIA", 0, 1, 0, 0, 1, 0x3, 0, 0x3, },
-	{ "BAHRAIN", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "BELGIUM", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "BRAZIL", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "BULGARIA", 0, 0, 0, 0, 1, 0x3, 0x0, 0x3, },
-	{ "CANADA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "CHILE", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "CHINA", 0, 0, 0, 0, 0, 0, 0x3, 0xf, },
-	{ "COLUMBIA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "CROATIA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "CYRPUS", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "CZECH", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "DENMARK", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "ECUADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "EGYPT", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "ELSALVADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "FINLAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "FRANCE", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "GERMANY", 0, 1, 0, 0, 1, 0x3, 0, 0x3, },
-	{ "GREECE", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "GUAM", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "HONGKONG", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "HUNGARY", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "ICELAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "INDIA", 0, 0, 0, 0, 0, 0x3, 0, 0x4, },
-	{ "INDONESIA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "IRELAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "ISRAEL", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "ITALY", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "JAPAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "JORDAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "KAZAKHSTAN", 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "KUWAIT", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "LATVIA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "LEBANON", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "LUXEMBOURG", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "MACAO", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "MALAYSIA", 0, 0, 0, 0, 0, 0, 0x3, 0, },	/* Current loop >= 20ma */
-	{ "MALTA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "MEXICO", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "MOROCCO", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "NETHERLANDS", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "NEWZEALAND", 0, 0, 0, 0, 0, 0x3, 0, 0x4, },
-	{ "NIGERIA", 0, 0, 0, 0, 0x1, 0x3, 0, 0x2, },
-	{ "NORWAY", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "OMAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "PAKISTAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "PERU", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "PHILIPPINES", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "POLAND", 0, 0, 1, 1, 0, 0x3, 0, 0, },
-	{ "PORTUGAL", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "ROMANIA", 0, 0, 0, 0, 0, 3, 0, 0, },
-	{ "RUSSIA", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "SAUDIARABIA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "SINGAPORE", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "SLOVAKIA", 0, 0, 0, 0, 0, 0x3, 0, 0x3, },
-	{ "SLOVENIA", 0, 0, 0, 0, 0, 0x3, 0, 0x2, },
-	{ "SOUTHAFRICA", 1, 0, 1, 0, 0, 0x3, 0, 0x3, },
-	{ "SOUTHKOREA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "SPAIN", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "SWEDEN", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "SWITZERLAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "SYRIA", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "TAIWAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "THAILAND", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "UAE", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "UK", 0, 1, 0, 0, 1, 0x3, 0, 0x5, },
-	{ "USA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "YEMEN", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-};
-
 #include "zaptel.h"
+
+#include "fxo_modes.h"
 
 #ifdef LINUX26
 #include <linux/moduleparam.h>
@@ -249,14 +158,7 @@
 
 #define DEFAULT_RING_DEBOUNCE	64		/* Ringer Debounce (64 ms) */
 
-/* the constants below control the 'debounce' periods enforced by the
-   check_hook routines; these routines are called once every 4 interrupts
-   (the interrupt cycles around the four modules), so the periods are
-   specified in _4 millisecond_ increments
-*/
-#define DEFAULT_BATT_DEBOUNCE	4		/* Battery debounce (64 ms) */
-#define POLARITY_DEBOUNCE 	4		/* Polarity debounce (64 ms) */
-#define DEFAULT_BATT_THRESH	3		/* Anything under this is "no battery" */
+#define POLARITY_DEBOUNCE 	64		/* Polarity debounce (64 ms) */
 
 #define OHT_TIMER		6000	/* How long after RING to retain OHT */
 
@@ -283,6 +185,12 @@
 	PROSLIC_POWER_UNKNOWN = 0,
 	PROSLIC_POWER_ON,
 	PROSLIC_POWER_WARNED,
+};
+
+enum battery_state {
+	BATTERY_UNKNOWN = 0,
+	BATTERY_PRESENT,
+	BATTERY_LOST,
 };
 
 struct wctdm {
@@ -303,7 +211,7 @@
 	spinlock_t lock;
 
 	union {
-		struct {
+		struct fxo {
 #ifdef AUDIO_RINGCHECK
 			unsigned int pegtimer;
 			int pegcount;
@@ -315,14 +223,14 @@
 #endif			
 			int ringdebounce;
 			int offhook;
-			int battdebounce;
-			int nobatttimer;
-			int battery;
+			unsigned int battdebounce;
+			unsigned int battalarm;
+			enum battery_state battery;
 		        int lastpol;
 		        int polarity;
 		        int polaritydebounce;
 		} fxo;
-		struct {
+		struct fxs {
 			int oldrxhook;
 			int debouncehook;
 			int lastrxhook;
@@ -364,8 +272,9 @@
 
 static void wctdm_release(struct wctdm *wc);
 
-static int battdebounce = DEFAULT_BATT_DEBOUNCE;
-static int battthresh = DEFAULT_BATT_THRESH;
+static unsigned int battdebounce;
+static unsigned int battalarm;
+static unsigned int battthresh;
 static int ringdebounce = DEFAULT_RING_DEBOUNCE;
 static int fwringdetect = 0;
 static int debug = 0;
@@ -834,11 +743,15 @@
 
 static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card)
 {
+#define MS_PER_CHECK_HOOK 16
+
 #ifndef AUDIO_RINGCHECK
 	unsigned char res;
 #endif	
 	signed char b;
 	int poopy = 0;
+	struct fxo *fxo = &wc->mod[card].fxo;
+
 	/* Try to track issues that plague slot one FXO's */
 	b = wc->reg0shadow[card];
 	if ((b & 0x2) || !(b & 0x8)) {
@@ -848,7 +761,7 @@
 		poopy++;
 	}
 	b &= 0x9b;
-	if (wc->mod[card].fxo.offhook) {
+	if (fxo->offhook) {
 		if (b != 0x9)
 			wctdm_setreg(wc, card, 5, 0x9);
 	} else {
@@ -857,150 +770,182 @@
 	}
 	if (poopy)
 		return;
-#ifndef AUDIO_RINGCHECK
-	if (!wc->mod[card].fxo.offhook) {
+	if (!fxo->offhook) {
 		if (fwringdetect) {
 			res = wc->reg0shadow[card] & 0x60;
-			if (wc->mod[card].fxo.ringdebounce--) {
-				if (res && (res != wc->mod[card].fxo.lastrdtx) && (wc->mod[card].fxo.battery == 1)) {
-					if (!wc->mod[card].fxo.wasringing) {
-						wc->mod[card].fxo.wasringing = 1;
+			if (fxo->ringdebounce--) {
+				if (res && (res != fxo->lastrdtx) &&
+				    (fxo->battery == BATTERY_PRESENT)) {
+					if (!fxo->wasringing) {
+						fxo->wasringing = 1;
 						if (debug)
 							printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
 						zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
 					}
-					wc->mod[card].fxo.lastrdtx = res;
-					wc->mod[card].fxo.ringdebounce = 10;
+					fxo->lastrdtx = res;
+					fxo->ringdebounce = 10;
 				} else if (!res) {
-					if ((wc->mod[card].fxo.ringdebounce == 0) && wc->mod[card].fxo.wasringing) {
-						wc->mod[card].fxo.wasringing = 0;
+					if ((fxo->ringdebounce == 0) && fxo->wasringing) {
+						fxo->wasringing = 0;
 						if (debug)
 							printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
 						zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
 					}
 				}
-			} else if (res && (wc->mod[card].fxo.battery == 1)) {
-				wc->mod[card].fxo.lastrdtx = res;
-				wc->mod[card].fxo.ringdebounce = 10;
+			} else if (res && (fxo->battery == BATTERY_PRESENT)) {
+				fxo->lastrdtx = res;
+				fxo->ringdebounce = 10;
 			}
 		} else {
 			res = wc->reg0shadow[card];
-			if ((res & 0x60) && (wc->mod[card].fxo.battery == 1)) {
-				wc->mod[card].fxo.ringdebounce += (ZT_CHUNKSIZE * 16);
-				if (wc->mod[card].fxo.ringdebounce >= ZT_CHUNKSIZE * ringdebounce) {
-					if (!wc->mod[card].fxo.wasringing) {
-						wc->mod[card].fxo.wasringing = 1;
+			if ((res & 0x60) && (fxo->battery == BATTERY_PRESENT)) {
+				fxo->ringdebounce += (ZT_CHUNKSIZE * 16);
+				if (fxo->ringdebounce >= ZT_CHUNKSIZE * ringdebounce) {
+					if (!fxo->wasringing) {
+						fxo->wasringing = 1;
 						zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
 						if (debug)
 							printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
 					}
-					wc->mod[card].fxo.ringdebounce = ZT_CHUNKSIZE * ringdebounce;
+					fxo->ringdebounce = ZT_CHUNKSIZE * ringdebounce;
 				}
 			} else {
-				wc->mod[card].fxo.ringdebounce -= ZT_CHUNKSIZE * 4;
-				if (wc->mod[card].fxo.ringdebounce <= 0) {
-					if (wc->mod[card].fxo.wasringing) {
-						wc->mod[card].fxo.wasringing = 0;
+				fxo->ringdebounce -= ZT_CHUNKSIZE * 4;
+				if (fxo->ringdebounce <= 0) {
+					if (fxo->wasringing) {
+						fxo->wasringing = 0;
 						zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
 						if (debug)
 							printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
 					}
-					wc->mod[card].fxo.ringdebounce = 0;
+					fxo->ringdebounce = 0;
 				}
 			}
 		}
 	}
+
+	b = wc->reg1shadow[card];
+
+	if (abs(b) < battthresh) {
+		/* possible existing states:
+		   battery lost, no debounce timer
+		   battery lost, debounce timer (going to battery present)
+		   battery present or unknown, no debounce timer
+		   battery present or unknown, debounce timer (going to battery lost)
+		*/
+
+		if (fxo->battery == BATTERY_LOST) {
+			if (fxo->battdebounce) {
+				/* we were going to BATTERY_PRESENT, but battery was lost again,
+				   so clear the debounce timer */
+				fxo->battdebounce = 0;
+			}
+		} else {
+			if (fxo->battdebounce) {
+				/* going to BATTERY_LOST, see if we are there yet */
+				if (--fxo->battdebounce == 0) {
+					fxo->battery = BATTERY_LOST;
+					if (debug)
+						printk("NO BATTERY on %d/%d!\n", wc->span.spanno, card + 1);
+#ifdef	JAPAN
+					if (!wc->ohdebounce && wc->offhook) {
+						zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
+						if (debug)
+							printk("Signalled On Hook\n");
+#ifdef	ZERO_BATT_RING
+						wc->onhook++;
 #endif
-	b = wc->reg1shadow[card];
-#if 0 
-	{
-		static int count = 0;
-		if (!(count++ % 100)) {
-			printk("Card %d: Voltage: %d  Debounce %d\n", card + 1, 
-			       b, wc->mod[card].fxo.battdebounce);
-		}
-	}
-#endif	
-	if (abs(b) < battthresh) {
-		wc->mod[card].fxo.nobatttimer++;
-#if 0
-		if (wc->mod[card].fxo.battery == 1)
-			printk("Battery loss: %d (%d debounce)\n", b, wc->mod[card].fxo.battdebounce);
+					}
+#else
+					zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
+					/* set the alarm timer, taking into account that part of its time
+					   period has already passed while debouncing occurred */
+					fxo->battalarm = (battalarm - battdebounce) / MS_PER_CHECK_HOOK;
 #endif
-		if (wc->mod[card].fxo.battery && !wc->mod[card].fxo.battdebounce) {
-			if (debug)
-				printk("NO BATTERY on %d/%d!\n", wc->span.spanno, card + 1);
-			wc->mod[card].fxo.battery =  0;
-#ifdef	JAPAN
-			if ((!wc->ohdebounce) && wc->offhook) {
-				zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
-				if (debug)
-					printk("Signalled On Hook\n");
+				}
+			} else {
+				/* start the debounce timer to verify that battery has been lost */
+				fxo->battdebounce = battdebounce / MS_PER_CHECK_HOOK;
+			}
+		}
+	} else {
+		/* possible existing states:
+		   battery lost or unknown, no debounce timer
+		   battery lost or unknown, debounce timer (going to battery present)
+		   battery present, no debounce timer
+		   battery present, debounce timer (going to battery lost)
+		*/
+
+		if (fxo->battery == BATTERY_PRESENT) {
+			if (fxo->battdebounce) {
+				/* we were going to BATTERY_LOST, but battery appeared again,
+				   so clear the debounce timer */
+				fxo->battdebounce = 0;
+			}
+		} else {
+			if (fxo->battdebounce) {
+				/* going to BATTERY_PRESENT, see if we are there yet */
+				if (--fxo->battdebounce == 0) {
+					fxo->battery = BATTERY_PRESENT;
+					if (debug)
+						printk("BATTERY on %d/%d (%s)!\n", wc->span.spanno, card + 1, 
+						       (b < 0) ? "-" : "+");			    
 #ifdef	ZERO_BATT_RING
-				wc->onhook++;
+					if (wc->onhook) {
+						wc->onhook = 0;
+						zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+						if (debug)
+							printk("Signalled Off Hook\n");
+					}
+#else
+					zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
 #endif
+					/* set the alarm timer, taking into account that part of its time
+					   period has already passed while debouncing occurred */
+					fxo->battalarm = (battalarm - battdebounce) / MS_PER_CHECK_HOOK;
+				}
+			} else {
+				/* start the debounce timer to verify that battery has appeared */
+				fxo->battdebounce = battdebounce / MS_PER_CHECK_HOOK;
 			}
-#else
-			zt_hooksig(&wc->chans[card], ZT_RXSIG_ONHOOK);
-			zt_alarm_channel(&wc->chans[card], ZT_ALARM_RED);
-#endif
-			wc->mod[card].fxo.battdebounce = battdebounce;
-		} else if (!wc->mod[card].fxo.battery)
-			wc->mod[card].fxo.battdebounce = battdebounce;
-	} else if (abs(b) > battthresh) {
-		if ((wc->mod[card].fxo.battery < 1) && !wc->mod[card].fxo.battdebounce) {
-			if (debug)
-				printk("BATTERY on %d/%d (%s)!\n", wc->span.spanno, card + 1, 
-					(b < 0) ? "-" : "+");			    
-#ifdef	ZERO_BATT_RING
-			if (wc->onhook) {
-				wc->onhook = 0;
-				zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
-				if (debug)
-					printk("Signalled Off Hook\n");
+		}
+
+		if (fxo->lastpol >= 0) {
+			if (b < 0) {
+				fxo->lastpol = -1;
+				fxo->polaritydebounce = POLARITY_DEBOUNCE / MS_PER_CHECK_HOOK;
 			}
-#else
-			zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
-			zt_alarm_channel(&wc->chans[card], ZT_ALARM_NONE);
-#endif
-			wc->mod[card].fxo.battery = 1;
-			wc->mod[card].fxo.nobatttimer = 0;
-			wc->mod[card].fxo.battdebounce = battdebounce;
-		} else if (wc->mod[card].fxo.battery == 1)
-			wc->mod[card].fxo.battdebounce = battdebounce;
-
-		if (wc->mod[card].fxo.lastpol >= 0) {
-		    if (b < 0) {
-			wc->mod[card].fxo.lastpol = -1;
-			wc->mod[card].fxo.polaritydebounce = POLARITY_DEBOUNCE;
-		    }
 		} 
-		if (wc->mod[card].fxo.lastpol <= 0) {
-		    if (b > 0) {
-			wc->mod[card].fxo.lastpol = 1;
-			wc->mod[card].fxo.polaritydebounce = POLARITY_DEBOUNCE;
-		    }
-		}
-	} else {
-		/* It's something else... */
-		wc->mod[card].fxo.battdebounce = battdebounce;
-	}
-	if (wc->mod[card].fxo.battdebounce)
-		wc->mod[card].fxo.battdebounce--;
-	if (wc->mod[card].fxo.polaritydebounce) {
-	        wc->mod[card].fxo.polaritydebounce--;
-		if (wc->mod[card].fxo.polaritydebounce < 1) {
-		    if (wc->mod[card].fxo.lastpol != wc->mod[card].fxo.polarity) {
+		if (fxo->lastpol <= 0) {
+			if (b > 0) {
+				fxo->lastpol = 1;
+				fxo->polaritydebounce = POLARITY_DEBOUNCE / MS_PER_CHECK_HOOK;
+			}
+		}
+	}
+
+	if (fxo->battalarm) {
+		if (--fxo->battalarm == 0) {
+			/* the alarm timer has expired, so update the battery alarm state
+			   for this channel */
+			zt_alarm_channel(&wc->chans[card], fxo->battery ? ZT_ALARM_NONE : ZT_ALARM_RED);
+		}
+	}
+
+	if (fxo->polaritydebounce) {
+		if (--fxo->polaritydebounce == 0) {
+		    if (fxo->lastpol != fxo->polarity) {
 				if (debug)
 					printk("%lu Polarity reversed (%d -> %d)\n", jiffies, 
-				       wc->mod[card].fxo.polarity, 
-				       wc->mod[card].fxo.lastpol);
-				if (wc->mod[card].fxo.polarity)
-				    zt_qevent_lock(&wc->chans[card], ZT_EVENT_POLARITY);
-				wc->mod[card].fxo.polarity = wc->mod[card].fxo.lastpol;
+				       fxo->polarity, 
+				       fxo->lastpol);
+				if (fxo->polarity)
+					zt_qevent_lock(&wc->chans[card], ZT_EVENT_POLARITY);
+				fxo->polarity = fxo->lastpol;
 		    }
 		}
 	}
+#undef MS_PER_CHECK_HOOK
 }
 
 static inline void wctdm_proslic_check_hook(struct wctdm *wc, int card)
@@ -1607,9 +1552,6 @@
 	if(debug)
 		printk("DEBUG fxotxgain:%i.%i fxorxgain:%i.%i\n", (wctdm_getreg(wc, card, 38)/16)?-(wctdm_getreg(wc, card, 38) - 16) : wctdm_getreg(wc, card, 38), (wctdm_getreg(wc, card, 40)/16)? -(wctdm_getreg(wc, card, 40) - 16):wctdm_getreg(wc, card, 40), (wctdm_getreg(wc, card, 39)/16)? -(wctdm_getreg(wc, card, 39) - 16) : wctdm_getreg(wc, card, 39),(wctdm_getreg(wc, card, 41)/16)?-(wctdm_getreg(wc, card, 41) - 16):wctdm_getreg(wc, card, 41));
 
-	/* battery state still unknown */
-	wc->mod[card].fxo.battery = -1;
-	
 	return 0;
 		
 }
@@ -2514,7 +2456,8 @@
 {
 	int res;
 	int x;
-	for (x=0;x<(sizeof(fxo_modes) / sizeof(fxo_modes[0])); x++) {
+
+	for (x = 0; x < (sizeof(fxo_modes) / sizeof(fxo_modes[0])); x++) {
 		if (!strcmp(fxo_modes[x].name, opermode))
 			break;
 	}
@@ -2522,16 +2465,30 @@
 		_opermode = x;
 	} else {
 		printk("Invalid/unknown operating mode '%s' specified.  Please choose one of:\n", opermode);
-		for (x=0;x<sizeof(fxo_modes) / sizeof(fxo_modes[0]); x++)
+		for (x = 0; x < sizeof(fxo_modes) / sizeof(fxo_modes[0]); x++)
 			printk("  %s\n", fxo_modes[x].name);
 		printk("Note this option is CASE SENSITIVE!\n");
 		return -ENODEV;
 	}
-	if (!strcmp(fxo_modes[_opermode].name, "AUSTRALIA")) {
-		boostringer=1;
-		fxshonormode=1;
-	}
-	
+
+	if (!strcmp(opermode, "AUSTRALIA")) {
+		boostringer = 1;
+		fxshonormode = 1;
+	}
+
+	/* for the voicedaa_check_hook defaults, if the user has not overridden
+	   them by specifying them as module parameters, then get the values
+	   from the selected operating mode
+	*/
+	if (battdebounce == 0) {
+		battdebounce = fxo_modes[_opermode].battdebounce;
+	}
+	if (battalarm == 0) {
+		battalarm = fxo_modes[_opermode].battalarm;
+	}
+	if (battthresh == 0) {
+		battthresh = fxo_modes[_opermode].battthresh;
+	}
 
 	res = zap_pci_module(&wctdm_driver);
 	if (res)
@@ -2549,15 +2506,15 @@
 module_param(loopcurrent, int, 0600);
 module_param(reversepolarity, int, 0600);
 module_param(robust, int, 0600);
-module_param(_opermode, int, 0600);
 module_param(opermode, charp, 0600);
 module_param(timingonly, int, 0600);
 module_param(lowpower, int, 0600);
 module_param(boostringer, int, 0600);
 module_param(fastringer, int, 0600);
 module_param(fxshonormode, int, 0600);
-module_param(battdebounce, int, 0600);
-module_param(battthresh, int, 0600);
+module_param(battdebounce, uint, 0600);
+module_param(battalarm, uint, 0600);
+module_param(battthresh, uint, 0600);
 module_param(ringdebounce, int, 0600);
 module_param(fwringdetect, int, 0600);
 module_param(alawoverride, int, 0600);
@@ -2571,7 +2528,6 @@
 MODULE_PARM(loopcurrent, "i");
 MODULE_PARM(reversepolarity, "i");
 MODULE_PARM(robust, "i");
-MODULE_PARM(_opermode, "i");
 MODULE_PARM(opermode, "s");
 MODULE_PARM(timingonly, "i");
 MODULE_PARM(lowpower, "i");
@@ -2579,6 +2535,7 @@
 MODULE_PARM(fastringer, "i");
 MODULE_PARM(fxshonormode, "i");
 MODULE_PARM(battdebounce, "i");
+MODULE_PARM(battalarm, "i");
 MODULE_PARM(battthresh, "i");
 MODULE_PARM(ringdebounce, "i");
 MODULE_PARM(fwringdetect, "i");

Modified: team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.c?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.c (original)
+++ team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.c Sat Apr  5 15:19:18 2008
@@ -32,9 +32,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
  */
- 
+
 #include <linux/version.h>
 #include <asm/semaphore.h>
+
 #include "zaptel.h"
 
 #include "GpakHpi.h"
@@ -562,7 +563,7 @@
                     ((pPortConfig->RxFrameSyncPolarity2 << 4) & 0x0010) |
                     ((pPortConfig->TxFrameSyncPolarity2 << 3) & 0x0008) |
                     ((pPortConfig->CompandingMode2 << 1) & 0x0006) |
-                    (pPortConfig->SerialWordSize2 & 0x0001));
+                    (pPortConfig->SerialWordSize1 & 0x0001));
 
     MsgBuffer[12] = (DSP_WORD)
                    (((pPortConfig->DxDelay3 << 11) & 0x0800) |
@@ -734,16 +735,8 @@
                          pChanConfig->EcanParametersB.EcanNumFirSegments;  
         MsgBuffer[34]  = (DSP_WORD)
                          pChanConfig->EcanParametersB.EcanFirSegmentLen;   
-        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 
+
+        MsgLength = 70; // byte number == 35*2 
         break;
 
 
@@ -956,6 +949,9 @@
             if (EventDataLength > WORD_BUFFER_SIZE)
             {
                 gpakUnlockAccess(DspId);
+#if 0
+		printk("EventDataLength > WORD_BUFFER_SIZE (%d)\n", EventDataLength);
+#endif
                 return (RefInvalidEvent);
             }
             ReadCircBuffer(DspId, BufrBaseAddress, BufrLastAddress, &TakeAddress,
@@ -968,11 +964,18 @@
             TakeIndex += EventDataLength;
             if (TakeIndex >= BufrSize)
                 TakeIndex -= BufrSize;
-            if (EventDataLength != 4)
+            if (EventDataLength != 4) {
+#if 0
+		    printk("EventDataLength != 4 it's %d\n", EventDataLength);
+#endif
                 EventError = 1;
+	    }
             break;
 
         default:
+#if 0
+	    printk("Event Code not in switch\n");
+#endif
             EventError = 1;
             break;
     };

Modified: team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.h
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.h?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.h (original)
+++ team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/GpakApi.h Sat Apr  5 15:19:18 2008
@@ -77,9 +77,6 @@
     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/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/Kbuild
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/Kbuild?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/Kbuild (original)
+++ team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/Kbuild Sat Apr  5 15:19:18 2008
@@ -8,7 +8,7 @@
   EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE
 endif
 
-wctdm24xxp-objs := base.o GpakCust.o GpakApi.o
+wctdm24xxp-objs := base.o GpakCust.o GpakApi.o ../voicebus.o
 
 ifneq ($(HOTPLUG_FIRMWARE),yes)
 wctdm24xxp-objs += $(FIRM_DIR)/zaptel-fw-vpmadt032.o

Modified: team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/base.c?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/base.c (original)
+++ team/mattf/zaptel-1.4-stackcleanup/kernel/wctdm24xxp/base.c Sat Apr  5 15:19:18 2008
@@ -4,7 +4,7 @@
  * Written by Mark Spencer <markster at digium.com>
  * Support for TDM800P and VPM150M by Matthew Fredrickson <creslin at digium.com>
  *
- * Copyright (C) 2005,2006, Digium, Inc.
+ * Copyright (C) 2005 - 2008 Digium, Inc.
  * All rights reserved.
  *
  * Sections for QRV cards written by Jim Dixon <jim at lambdatel.com>
@@ -146,101 +146,10 @@
    enable for normal operation! */
 /* #define PAQ_DEBUG */
 
-static struct fxo_mode {
-	char *name;
-	/* FXO */
-	int ohs;
-	int ohs2;
-	int rz;
-	int rt;
-	int ilim;
-	int dcv;
-	int mini;
-	int acim;
-	int ring_osc;
-	int ring_x;
-} fxo_modes[] =
-{
-	{ "FCC", 0, 0, 0, 1, 0, 0x3, 0, 0, }, 	/* US, Canada */
-	{ "TBR21", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0x7e6c, 0x023a, },
-										/* Austria, Belgium, Denmark, Finland, France, Germany, 
-										   Greece, Iceland, Ireland, Italy, Luxembourg, Netherlands,
-										   Norway, Portugal, Spain, Sweden, Switzerland, and UK */
-	{ "ARGENTINA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "AUSTRALIA", 1, 0, 0, 0, 0, 0, 0x3, 0x3, },
-	{ "AUSTRIA", 0, 1, 0, 0, 1, 0x3, 0, 0x3, },
-	{ "BAHRAIN", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "BELGIUM", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "BRAZIL", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "BULGARIA", 0, 0, 0, 0, 1, 0x3, 0x0, 0x3, },
-	{ "CANADA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "CHILE", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "CHINA", 0, 0, 0, 0, 0, 0, 0x3, 0xf, },
-	{ "COLUMBIA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "CROATIA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "CYRPUS", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "CZECH", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "DENMARK", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "ECUADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "EGYPT", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-	{ "ELSALVADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-	{ "FINLAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "FRANCE", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-	{ "GERMANY", 0, 1, 0, 0, 1, 0x3, 0, 0x3, },

[... 3122 lines stripped ...]



More information about the zaptel-commits mailing list