[svn-commits] kpfleming: branch kpfleming/battery_alarms r3929 - in /team/kpfleming/battery...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 4 13:39:48 CST 2008


Author: kpfleming
Date: Tue Mar  4 13:39:47 2008
New Revision: 3929

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3929
Log:
move fxo_modes array into a header file (instead of duplicating it)
change to using named initializers, which makes the array initialization easier to understand and avoids problems with values going into the wrong fields accidentally
fix a few region name spelling errors
change the XPP print_modes tool to use the new header file instead of creating its own

Added:
    team/kpfleming/battery_alarms/kernel/fxo_modes.h   (with props)
Modified:
    team/kpfleming/battery_alarms/kernel/wctdm.c
    team/kpfleming/battery_alarms/kernel/wctdm24xxp/base.c
    team/kpfleming/battery_alarms/kernel/xpp/utils/Makefile
    team/kpfleming/battery_alarms/kernel/xpp/utils/print_modes.c

Added: team/kpfleming/battery_alarms/kernel/fxo_modes.h
URL: http://svn.digium.com/view/zaptel/team/kpfleming/battery_alarms/kernel/fxo_modes.h?view=auto&rev=3929
==============================================================================
--- team/kpfleming/battery_alarms/kernel/fxo_modes.h (added)
+++ team/kpfleming/battery_alarms/kernel/fxo_modes.h Tue Mar  4 13:39:47 2008
@@ -1,0 +1,588 @@
+/*
+ * FXO port mode settings for various regions
+ *
+ * Copyright (C) 2008 Digium, Inc.
+ *
+ * extracted from wctdm.c by
+ * Kevin P. Fleming <kpfleming at digium.com>
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
+ */
+
+#ifndef _FXO_MODES_H
+#define _FXO_MODES_H
+
+static struct fxo_mode {
+	char *name;
+	int ohs;
+	int ohs2;
+	int rz;
+	int rt;
+	int ilim;
+	int dcv;
+	int mini;
+	int acim;
+	int ring_osc;
+	int ring_x;
+	unsigned int battdebounce; /* in milliseconds */
+	unsigned int battalarm; /* in milliseconds */
+	unsigned int battthresh; /* unknown units */
+} fxo_modes[] =
+{
+ 	/* US, Canada */
+	{ .name = "FCC",
+	  .rt = 1,
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	/* Austria, Belgium, Denmark, Finland, France, Germany, 
+	   Greece, Iceland, Ireland, Italy, Luxembourg, Netherlands,
+	   Norway, Portugal, Spain, Sweden, Switzerland, and UK */
+	{ .name = "TBR21",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .ring_osc = 0x7e6c,
+	  .ring_x = 0x023a,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "ARGENTINA",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "AUSTRALIA",
+	  .ohs = 1,
+	  .mini = 0x3,
+	  .acim = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "AUSTRIA",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "BAHRAIN",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "BELGIUM",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "BRAZIL",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "BULGARIA",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .mini = 0x0,
+	  .acim = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "CANADA",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "CHILE",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "CHINA",
+	  .mini = 0x3,
+	  .acim = 0xf,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "COLOMBIA",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "CROATIA",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .mini = 0,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "CYPRUS",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "CZECH",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .mini = 0,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "DENMARK",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "ECUADOR",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "EGYPT",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "ELSALVADOR",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "FINLAND",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "FRANCE",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .mini = 0,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "GERMANY",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "GREECE",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "GUAM",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "HONGKONG",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "HUNGARY",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "ICELAND",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "INDIA",
+	  .dcv = 0x3,
+	  .acim = 0x4,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "INDONESIA",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "IRELAND",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "ISRAEL",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "ITALY",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "JAPAN",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "JORDAN",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "KAZAKHSTAN",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "KUWAIT",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "LATVIA",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "LEBANON",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "LUXEMBOURG",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "MACAO",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	/* Current loop >= 20ma */
+	{ .name = "MALAYSIA",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "MALTA",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "MEXICO",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "MOROCCO",
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "NETHERLANDS",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "NEWZEALAND",
+	  .dcv = 0x3,
+	  .acim = 0x4,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "NIGERIA",
+	  .ilim = 0x1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "NORWAY",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "OMAN",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "PAKISTAN",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "PERU",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "PHILIPPINES",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "POLAND",
+	  .rz = 1,
+	  .rt = 1,
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "PORTUGAL",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "ROMANIA",
+	  .dcv = 3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "RUSSIA",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SAUDIARABIA",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SINGAPORE",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SLOVAKIA",
+	  .dcv = 0x3,
+	  .acim = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SLOVENIA",
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SOUTHAFRICA",
+	  .ohs = 1,
+	  .rz = 1,
+	  .dcv = 0x3,
+	  .acim = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SOUTHKOREA",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SPAIN",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SWEDEN",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SWITZERLAND",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x2,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "SYRIA",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "TAIWAN",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "THAILAND",
+	  .mini = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "UAE",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "UK",
+	  .ohs2 = 1,
+	  .ilim = 1,
+	  .dcv = 0x3,
+	  .acim = 0x5,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "USA",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+	{ .name = "YEMEN",
+	  .dcv = 0x3,
+	  .battdebounce = 64,
+	  .battalarm = 1000,
+	  .battthresh = 3,
+	},
+};
+
+#endif /* _FXO_MODES_H */

Propchange: team/kpfleming/battery_alarms/kernel/fxo_modes.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/kpfleming/battery_alarms/kernel/fxo_modes.h
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/kpfleming/battery_alarms/kernel/fxo_modes.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/kpfleming/battery_alarms/kernel/wctdm.c
URL: http://svn.digium.com/view/zaptel/team/kpfleming/battery_alarms/kernel/wctdm.c?view=diff&rev=3929&r1=3928&r2=3929
==============================================================================
--- team/kpfleming/battery_alarms/kernel/wctdm.c (original)
+++ team/kpfleming/battery_alarms/kernel/wctdm.c Tue Mar  4 13:39:47 2008
@@ -108,102 +108,9 @@
 {43,66,"LOOP_CLOSE_TRES_LOW",0x1000},
 };
 
-static struct fxo_mode {
-	char *name;
-	int ohs;
-	int ohs2;
-	int rz;
-	int rt;
-	int ilim;
-	int dcv;
-	int mini;
-	int acim;
-	int ring_osc;
-	int ring_x;
-	unsigned int battdebounce; /* in milliseconds */
-	unsigned int battalarm; /* in milliseconds */
-	unsigned int battthresh; /* unknown units */
-} fxo_modes[] =
-{
-	{ "FCC", 0, 0, 0, 1, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, }, 	/* US, Canada */
-	{ "TBR21", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0x7e6c, 0x023a, 64, 1000, 3, },
-										/* 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, 0, 0, 64, 1000, 3, },
-	{ "AUSTRALIA", 1, 0, 0, 0, 0, 0, 0x3, 0x3, 0, 0, 64, 1000, 3, },
-	{ "AUSTRIA", 0, 1, 0, 0, 1, 0x3, 0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "BAHRAIN", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "BELGIUM", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "BRAZIL", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "BULGARIA", 0, 0, 0, 0, 1, 0x3, 0x0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "CANADA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "CHILE", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "CHINA", 0, 0, 0, 0, 0, 0, 0x3, 0xf, 0, 0, 64, 1000, 3, },
-	{ "COLUMBIA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "CROATIA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "CYRPUS", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "CZECH", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "DENMARK", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "ECUADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "EGYPT", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "ELSALVADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "FINLAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "FRANCE", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "GERMANY", 0, 1, 0, 0, 1, 0x3, 0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "GREECE", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "GUAM", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "HONGKONG", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "HUNGARY", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "ICELAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "INDIA", 0, 0, 0, 0, 0, 0x3, 0, 0x4, 0, 0, 64, 1000, 3, },
-	{ "INDONESIA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "IRELAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "ISRAEL", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "ITALY", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "JAPAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "JORDAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "KAZAKHSTAN", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "KUWAIT", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "LATVIA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "LEBANON", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "LUXEMBOURG", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "MACAO", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "MALAYSIA", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },	/* Current loop >= 20ma */
-	{ "MALTA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "MEXICO", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "MOROCCO", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "NETHERLANDS", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "NEWZEALAND", 0, 0, 0, 0, 0, 0x3, 0, 0x4, 0, 0, 64, 1000, 3, },
-	{ "NIGERIA", 0, 0, 0, 0, 0x1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "NORWAY", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "OMAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "PAKISTAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "PERU", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "PHILIPPINES", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "POLAND", 0, 0, 1, 1, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "PORTUGAL", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "ROMANIA", 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "RUSSIA", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "SAUDIARABIA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "SINGAPORE", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "SLOVAKIA", 0, 0, 0, 0, 0, 0x3, 0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "SLOVENIA", 0, 0, 0, 0, 0, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "SOUTHAFRICA", 1, 0, 1, 0, 0, 0x3, 0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "SOUTHKOREA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "SPAIN", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "SWEDEN", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "SWITZERLAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "SYRIA", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "TAIWAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "THAILAND", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "UAE", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "UK", 0, 1, 0, 0, 1, 0x3, 0, 0x5, 0, 0, 64, 1000, 3, },
-	{ "USA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "YEMEN", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-};
-
 #include "zaptel.h"
+
+#include "fxo_modes.h"
 
 #ifdef LINUX26
 #include <linux/moduleparam.h>

Modified: team/kpfleming/battery_alarms/kernel/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/kpfleming/battery_alarms/kernel/wctdm24xxp/base.c?view=diff&rev=3929&r1=3928&r2=3929
==============================================================================
--- team/kpfleming/battery_alarms/kernel/wctdm24xxp/base.c (original)
+++ team/kpfleming/battery_alarms/kernel/wctdm24xxp/base.c Tue Mar  4 13:39:47 2008
@@ -146,103 +146,10 @@
    enable for normal operation! */
 /* #define PAQ_DEBUG */
 
-static struct fxo_mode {
-	char *name;
-	int ohs;
-	int ohs2;
-	int rz;
-	int rt;
-	int ilim;
-	int dcv;
-	int mini;
-	int acim;
-	int ring_osc;
-	int ring_x;
-	unsigned int battdebounce; /* in milliseconds */
-	unsigned int battalarm; /* in milliseconds */
-	unsigned int battthresh; /* unknown units */
-} fxo_modes[] =
-{
-	{ "FCC", 0, 0, 0, 1, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, }, 	/* US, Canada */
-	{ "TBR21", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0x7e6c, 0x023a, 64, 1000, 3, },
-										/* 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, 64, 0, 0, 1000, 3, },
-	{ "AUSTRALIA", 1, 0, 0, 0, 0, 0, 0x3, 0x3, 0, 0, 64, 1000, 3, },
-	{ "AUSTRIA", 0, 1, 0, 0, 1, 0x3, 0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "BAHRAIN", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "BELGIUM", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "BRAZIL", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "BULGARIA", 0, 0, 0, 0, 1, 0x3, 0x0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "CANADA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "CHILE", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "CHINA", 0, 0, 0, 0, 0, 0, 0x3, 0xf, 0, 0, 64, 1000, 3, },
-	{ "COLUMBIA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "CROATIA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "CYRPUS", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "CZECH", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "DENMARK", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "ECUADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "EGYPT", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "ELSALVADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "FINLAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "FRANCE", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "GERMANY", 0, 1, 0, 0, 1, 0x3, 0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "GREECE", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "GUAM", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "HONGKONG", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "HUNGARY", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "ICELAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "INDIA", 0, 0, 0, 0, 0, 0x3, 0, 0x4, 0, 0, 64, 1000, 3, },
-	{ "INDONESIA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "IRELAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "ISRAEL", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "ITALY", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "JAPAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "JORDAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "KAZAKHSTAN", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "KUWAIT", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "LATVIA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "LEBANON", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "LUXEMBOURG", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "MACAO", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "MALAYSIA", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },	/* Current loop >= 20ma */
-	{ "MALTA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "MEXICO", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "MOROCCO", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "NETHERLANDS", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "NEWZEALAND", 0, 0, 0, 0, 0, 0x3, 0, 0x4, 0, 0, 64, 1000, 3, },
-	{ "NIGERIA", 0, 0, 0, 0, 0x1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "NORWAY", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "OMAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "PAKISTAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "PERU", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "PHILIPPINES", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "POLAND", 0, 0, 1, 1, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "PORTUGAL", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "ROMANIA", 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "RUSSIA", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "SAUDIARABIA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "SINGAPORE", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "SLOVAKIA", 0, 0, 0, 0, 0, 0x3, 0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "SLOVENIA", 0, 0, 0, 0, 0, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "SOUTHAFRICA", 1, 0, 1, 0, 0, 0x3, 0, 0x3, 0, 0, 64, 1000, 3, },
-	{ "SOUTHKOREA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "SPAIN", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "SWEDEN", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "SWITZERLAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, 0, 0, 64, 1000, 3, },
-	{ "SYRIA", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "TAIWAN", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "THAILAND", 0, 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 64, 1000, 3, },
-	{ "UAE", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "UK", 0, 1, 0, 0, 1, 0x3, 0, 0x5, 0, 0, 64, 1000, 3, },
-	{ "USA", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-	{ "YEMEN", 0, 0, 0, 0, 0, 0x3, 0, 0, 0, 0, 64, 1000, 3, },
-};
-
 #define DEBUG_CARD (1 << 0)
 #define DEBUG_ECHOCAN (1 << 1)
+
+#include "fxo_modes.h"
 
 struct wctdm_desc {
 	char *name;

Modified: team/kpfleming/battery_alarms/kernel/xpp/utils/Makefile
URL: http://svn.digium.com/view/zaptel/team/kpfleming/battery_alarms/kernel/xpp/utils/Makefile?view=diff&rev=3929&r1=3928&r2=3929
==============================================================================
--- team/kpfleming/battery_alarms/kernel/xpp/utils/Makefile (original)
+++ team/kpfleming/battery_alarms/kernel/xpp/utils/Makefile Tue Mar  4 13:39:47 2008
@@ -42,8 +42,6 @@
 PBX_LIBUSB	= $(shell if [ -r /usr/include/usb.h ]; then echo 1; else echo 0; fi)
 endif
 
-WCTDM=$(ZAPTEL_DIR)/wctdm.c
-
 CFLAGS		= -g -Wall $(EXTRA_CFLAGS)
 
 %.8: %
@@ -54,8 +52,7 @@
 		lszaptel	\
 		xpp_blink	\
 		zapconf		\
-		zaptel_hardware	\
-		#
+		zaptel_hardware
 
 PERL_MANS	= $(PERL_SCRIPTS:%=%.8)
 
@@ -85,7 +82,7 @@
 	$(INSTALL_DATA) $(MAN_INSTALL) $(DESTDIR)$(MANDIR)/
 	$(INSTALL) -d $(DESTDIR)$(HOTPLUG_USB_DIR)
 	$(INSTALL_DATA) xpp_fxloader.usermap $(DESTDIR)$(HOTPLUG_USB_DIR)/
-	# for backward compatibility and for hotplug users:
+        # for backward compatibility and for hotplug users:
 	ln -sf $(DATADIR)/xpp_fxloader $(DESTDIR)$(HOTPLUG_USB_DIR)/
 	$(INSTALL) -d $(DESTDIR)$(UDEV_RULES_DIR)
 	$(INSTALL_DATA) xpp.rules $(DESTDIR)$(UDEV_RULES_DIR)/
@@ -119,11 +116,8 @@
 test_parse: test_parse.o libhexfile.a
 	$(CC) -L. -o $@ $@.o $(EXTRA_LIBS) -lhexfile -lusb
 
-print_modes: print_modes.c wctdm_fxomodes.h
-	$(HOSTCC) -o $@ $(CFLAGS) $<
-
-wctdm_fxomodes.h: $(WCTDM)
-	perl -n -e 'print if (/^static struct fxo_mode {$$/ .. /};$$/)' $(WCTDM) >$@
+print_modes: print_modes.c
+	$(HOSTCC) -o $@ $(CFLAGS) -I$(ZAPTEL_DIR) $<
 
 init_fxo_modes: print_modes
 	./$< >$@

Modified: team/kpfleming/battery_alarms/kernel/xpp/utils/print_modes.c
URL: http://svn.digium.com/view/zaptel/team/kpfleming/battery_alarms/kernel/xpp/utils/print_modes.c?view=diff&rev=3929&r1=3928&r2=3929
==============================================================================
--- team/kpfleming/battery_alarms/kernel/xpp/utils/print_modes.c (original)
+++ team/kpfleming/battery_alarms/kernel/xpp/utils/print_modes.c Tue Mar  4 13:39:47 2008
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-#include "wctdm_fxomodes.h"
+#include "fxo_modes.h"
 
 int main() {
 	size_t i;




More information about the svn-commits mailing list