[zaptel-commits] mattf: branch mattf/zaptel-1.4-vpmadt032fwupdate r4030 - in /team/mattf/zapte...
SVN commits to the Zaptel project
zaptel-commits at lists.digium.com
Wed Mar 19 15:02:45 CDT 2008
Author: mattf
Date: Wed Mar 19 15:02:45 2008
New Revision: 4030
URL: http://svn.digium.com/view/zaptel?view=rev&rev=4030
Log:
Add support for new 1.16 fw
Added:
team/mattf/zaptel-1.4-vpmadt032fwupdate/doc/ztscan.8
- copied unchanged from r4022, branches/1.4/doc/ztscan.8
Modified:
team/mattf/zaptel-1.4-vpmadt032fwupdate/ (props changed)
team/mattf/zaptel-1.4-vpmadt032fwupdate/Makefile
team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wcfxo.c
team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wctdm24xxp/base.c
team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/card_fxs.c
team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/xbus-pcm.c
team/mattf/zaptel-1.4-vpmadt032fwupdate/ztscan.c
Propchange: team/mattf/zaptel-1.4-vpmadt032fwupdate/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/mattf/zaptel-1.4-vpmadt032fwupdate/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Mar 19 15:02:45 2008
@@ -1,1 +1,1 @@
-/branches/1.4:1-3988
+/branches/1.4:1-4029
Modified: team/mattf/zaptel-1.4-vpmadt032fwupdate/Makefile
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-vpmadt032fwupdate/Makefile?view=diff&rev=4030&r1=4029&r2=4030
==============================================================================
--- team/mattf/zaptel-1.4-vpmadt032fwupdate/Makefile (original)
+++ team/mattf/zaptel-1.4-vpmadt032fwupdate/Makefile Wed Mar 19 15:02:45 2008
@@ -265,7 +265,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
@@ -582,6 +582,7 @@
rm -f ztcfg-shared fxstest
rm -rf misdn*
rm -rf mISDNuser*
+ rm -rf $(GROFF_HTML)
rm -rf README.html xpp/README.Astribank.html zaptel.conf.asciidoc
distclean: dist-clean
Modified: team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wcfxo.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wcfxo.c?view=diff&rev=4030&r1=4029&r2=4030
==============================================================================
--- team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wcfxo.c (original)
+++ team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wcfxo.c Wed Mar 19 15:02:45 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/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wctdm24xxp/base.c?view=diff&rev=4030&r1=4029&r2=4030
==============================================================================
--- team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wctdm24xxp/base.c (original)
+++ team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/wctdm24xxp/base.c Wed Mar 19 15:02:45 2008
@@ -3432,7 +3432,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/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/card_fxs.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/card_fxs.c?view=diff&rev=4030&r1=4029&r2=4030
==============================================================================
--- team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/card_fxs.c (original)
+++ team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/card_fxs.c Wed Mar 19 15:02:45 2008
@@ -36,7 +36,7 @@
DEF_PARM(int, print_dbg, 0, 0644, "Print DBG statements"); /* must be before zap_debug.h */
DEF_PARM_BOOL(reversepolarity, 0, 0644, "Reverse Line Polarity");
DEF_PARM_BOOL(vmwineon, 0, 0644, "Indicate voicemail to a neon lamp");
-DEF_PARM_BOOL(dtmf_detection, 0, 0644, "Do DTMF detection in hardware");
+DEF_PARM_BOOL(dtmf_detection, 1, 0644, "Do DTMF detection in hardware");
#ifdef POLL_DIGITAL_INPUTS
DEF_PARM(uint, poll_digital_inputs, 1000, 0644, "Poll Digital Inputs");
#endif
Modified: team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/xbus-pcm.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/xbus-pcm.c?view=diff&rev=4030&r1=4029&r2=4030
==============================================================================
--- team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/xbus-pcm.c (original)
+++ team/mattf/zaptel-1.4-vpmadt032fwupdate/kernel/xpp/xbus-pcm.c Wed Mar 19 15:02:45 2008
@@ -675,6 +675,8 @@
for (i = 0;i < xpd->span.channels; i++) {
if(unlikely(IS_SET(xpd->digital_signalling, i))) /* Don't echo cancel BRI D-chans */
continue;
+ if(!IS_SET(xpd->wanted_pcm_mask, i)) /* No ec for unwanted PCM */
+ continue;
#ifdef XPP_EC_CHUNK
/* even if defined, parameterr xpp_ec can override at run-time */
if (xpp_ec)
@@ -860,8 +862,11 @@
volatile u_char *r = xpd->span.chans[i].readchunk;
if(!IS_SET(xpd->wanted_pcm_mask, i)) {
- if(IS_SET(xpd->silence_pcm, i))
+ if(IS_SET(xpd->silence_pcm, i)) {
memset((u_char *)r, 0x7F, ZT_CHUNKSIZE); // SILENCE
+ memset(xpd->ec_chunk2[i], 0x7F, ZT_CHUNKSIZE);
+ memset(xpd->ec_chunk1[i], 0x7F, ZT_CHUNKSIZE);
+ }
continue;
}
pcm_mask &= ~xpd->mute_dtmf;
Modified: team/mattf/zaptel-1.4-vpmadt032fwupdate/ztscan.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-1.4-vpmadt032fwupdate/ztscan.c?view=diff&rev=4030&r1=4029&r2=4030
==============================================================================
--- team/mattf/zaptel-1.4-vpmadt032fwupdate/ztscan.c (original)
+++ team/mattf/zaptel-1.4-vpmadt032fwupdate/ztscan.c Wed Mar 19 15:02:45 2008
@@ -40,116 +40,109 @@
#include <zaptel/zaptel.h>
#endif
-int main(int argc, char *argv[])
+void print_span(int spanno, int ctl)
{
- int ctl;
- int x, y;
+ struct zt_spaninfo spaninfo;
+ int y;
struct zt_params params;
unsigned int basechan = 1;
- struct zt_spaninfo s;
char buf[100];
char alarms[50];
- if ((ctl = open("/dev/zap/ctl", O_RDWR)) < 0) {
- fprintf(stderr, "Unable to open /dev/zap/ctl: %s\n", strerror(errno));
- exit(1);
+ memset(&spaninfo, 0, sizeof(spaninfo));
+ spaninfo.spanno = spanno;
+ if (ioctl(ctl, ZT_SPANSTAT, &spaninfo))
+ return;
+
+ alarms[0] = '\0';
+ if (spaninfo.alarms) {
+ if (spaninfo.alarms & ZT_ALARM_BLUE)
+ strcat(alarms,"BLU/");
+ if (spaninfo.alarms & ZT_ALARM_YELLOW)
+ strcat(alarms, "YEL/");
+ if (spaninfo.alarms & ZT_ALARM_RED)
+ strcat(alarms, "RED/");
+ if (spaninfo.alarms & ZT_ALARM_LOOPBACK)
+ strcat(alarms,"LB/");
+ if (spaninfo.alarms & ZT_ALARM_RECOVER)
+ strcat(alarms,"REC/");
+ if (spaninfo.alarms & ZT_ALARM_NOTOPEN)
+ strcat(alarms, "NOP/");
+ if (!strlen(alarms))
+ strcat(alarms, "UUU/");
+ if (strlen(alarms)) {
+ /* Strip trailing / */
+ alarms[strlen(alarms)-1]='\0';
+ }
+ } else {
+ if (spaninfo.numchans)
+ strcpy(alarms, "OK");
+ else
+ strcpy(alarms, "UNCONFIGURED");
}
-
- for (x = 1; x < ZT_MAX_SPANS; x++) {
- memset(&s, 0, sizeof(s));
- s.spanno = x;
- if (ioctl(ctl, ZT_SPANSTAT, &s))
- continue;
- alarms[0] = '\0';
- if (s.alarms) {
- if (s.alarms & ZT_ALARM_BLUE)
- strcat(alarms,"BLU/");
- if (s.alarms & ZT_ALARM_YELLOW)
- strcat(alarms, "YEL/");
- if (s.alarms & ZT_ALARM_RED)
- strcat(alarms, "RED/");
- if (s.alarms & ZT_ALARM_LOOPBACK)
- strcat(alarms,"LB/");
- if (s.alarms & ZT_ALARM_RECOVER)
- strcat(alarms,"REC/");
- if (s.alarms & ZT_ALARM_NOTOPEN)
- strcat(alarms, "NOP/");
- if (!strlen(alarms))
- strcat(alarms, "UUU/");
- if (strlen(alarms)) {
- /* Strip trailing / */
- alarms[strlen(alarms)-1]='\0';
- }
- } else {
- if (s.numchans)
- strcpy(alarms, "OK");
- else
- strcpy(alarms, "UNCONFIGURED");
- }
+ fprintf(stdout, "[%d]\n", spanno);
+ fprintf(stdout, "active=yes\n");
+ fprintf(stdout, "alarms=%s\n", alarms);
+ fprintf(stdout, "description=%s\n", spaninfo.desc);
+ fprintf(stdout, "name=%s\n", spaninfo.name);
+ fprintf(stdout, "manufacturer=%s\n", spaninfo.manufacturer);
+ fprintf(stdout, "devicetype=%s\n", spaninfo.devicetype);
+ fprintf(stdout, "location=%s\n", spaninfo.location);
+ fprintf(stdout, "basechan=%d\n", basechan);
+ fprintf(stdout, "totchans=%d\n", spaninfo.totalchans);
+ fprintf(stdout, "irq=%d\n", spaninfo.irq);
+ y = basechan;
+ memset(¶ms, 0, sizeof(params));
+ params.channo = y;
+ if (ioctl(ctl, ZT_GET_PARAMS, ¶ms)) {
+ basechan += spaninfo.totalchans;
+ return;
+ }
- fprintf(stdout, "[%d]\n", x);
- fprintf(stdout, "active=yes\n");
- fprintf(stdout, "alarms=%s\n", alarms);
- fprintf(stdout, "description=%s\n", s.desc);
- fprintf(stdout, "name=%s\n", s.name);
- fprintf(stdout, "manufacturer=%s\n", s.manufacturer);
- fprintf(stdout, "devicetype=%s\n", s.devicetype);
- fprintf(stdout, "location=%s\n", s.location);
- fprintf(stdout, "basechan=%d\n", basechan);
- fprintf(stdout, "totchans=%d\n", s.totalchans);
- fprintf(stdout, "irq=%d\n", s.irq);
- y = basechan;
- memset(¶ms, 0, sizeof(params));
- params.channo = y;
- if (ioctl(ctl, ZT_GET_PARAMS, ¶ms)) {
- basechan += s.totalchans;
- continue;
- }
-
- if (params.sigcap & __ZT_SIG_DACS) {
- /* this is a digital span */
- fprintf(stdout, "type=digital-%s\n", s.spantype);
- fprintf(stdout, "syncsrc=%d\n", s.syncsrc);
- fprintf(stdout, "lbo=%s\n", s.lboname);
- fprintf(stdout, "coding_opts=");
- buf[0] = '\0';
- if (s.linecompat & ZT_CONFIG_B8ZS) strcat(buf, "B8ZS,");
- if (s.linecompat & ZT_CONFIG_AMI) strcat(buf, "AMI,");
- if (s.linecompat & ZT_CONFIG_HDB3) strcat(buf, "HDB3,");
- buf[strlen(buf) - 1] = '\0';
- fprintf(stdout, "%s\n", buf);
- fprintf(stdout, "framing_opts=");
- buf[0] = '\0';
- if (s.linecompat & ZT_CONFIG_ESF) strcat(buf, "ESF,");
- if (s.linecompat & ZT_CONFIG_D4) strcat(buf, "D4,");
- if (s.linecompat & ZT_CONFIG_CCS) strcat(buf, "CCS,");
- if (s.linecompat & ZT_CONFIG_CRC4) strcat(buf, "CRC4,");
- buf[strlen(buf) - 1] = '\0';
- fprintf(stdout, "%s\n", buf);
- fprintf(stdout, "coding=");
- if (s.lineconfig & ZT_CONFIG_B8ZS) fprintf(stdout, "B8ZS");
- else if (s.lineconfig & ZT_CONFIG_AMI) fprintf(stdout, "AMI");
- else if (s.lineconfig & ZT_CONFIG_HDB3) fprintf(stdout, "HDB3");
- fprintf(stdout, "\n");
- fprintf(stdout, "framing=");
- if (s.lineconfig & ZT_CONFIG_ESF) fprintf(stdout, "ESF");
- else if (s.lineconfig & ZT_CONFIG_D4) fprintf(stdout, "D4");
- else if (s.lineconfig & ZT_CONFIG_CCS) fprintf(stdout, "CCS");
- else if (s.lineconfig & ZT_CONFIG_CRC4) fprintf(stdout, "/CRC4");
- fprintf(stdout, "\n");
- } else {
- /* this is an analog span */
- fprintf(stdout, "type=analog\n");
- for (y = basechan; y < (basechan + s.totalchans); y++) {
- memset(¶ms, 0, sizeof(params));
- params.channo = y;
- if (ioctl(ctl, ZT_GET_PARAMS, ¶ms)) {
- fprintf(stdout, "port=%d,unknown\n", y);
- continue;
- };
- fprintf(stdout, "port=%d,", y);
- switch (params.sigcap & (__ZT_SIG_FXO | __ZT_SIG_FXS)) {
+ if (params.sigcap & (__ZT_SIG_DACS | ZT_SIG_CAS)) {
+ /* this is a digital span */
+ fprintf(stdout, "type=digital-%s\n", spaninfo.spantype);
+ fprintf(stdout, "syncsrc=%d\n", spaninfo.syncsrc);
+ fprintf(stdout, "lbo=%s\n", spaninfo.lboname);
+ fprintf(stdout, "coding_opts=");
+ buf[0] = '\0';
+ if (spaninfo.linecompat & ZT_CONFIG_B8ZS) strcat(buf, "B8ZS,");
+ if (spaninfo.linecompat & ZT_CONFIG_AMI) strcat(buf, "AMI,");
+ if (spaninfo.linecompat & ZT_CONFIG_HDB3) strcat(buf, "HDB3,");
+ buf[strlen(buf) - 1] = '\0';
+ fprintf(stdout, "%s\n", buf);
+ fprintf(stdout, "framing_opts=");
+ buf[0] = '\0';
+ if (spaninfo.linecompat & ZT_CONFIG_ESF) strcat(buf, "ESF,");
+ if (spaninfo.linecompat & ZT_CONFIG_D4) strcat(buf, "D4,");
+ if (spaninfo.linecompat & ZT_CONFIG_CCS) strcat(buf, "CCS,");
+ if (spaninfo.linecompat & ZT_CONFIG_CRC4) strcat(buf, "CRC4,");
+ buf[strlen(buf) - 1] = '\0';
+ fprintf(stdout, "%s\n", buf);
+ fprintf(stdout, "coding=");
+ if (spaninfo.lineconfig & ZT_CONFIG_B8ZS) fprintf(stdout, "B8ZS");
+ else if (spaninfo.lineconfig & ZT_CONFIG_AMI) fprintf(stdout, "AMI");
+ else if (spaninfo.lineconfig & ZT_CONFIG_HDB3) fprintf(stdout, "HDB3");
+ fprintf(stdout, "\n");
+ fprintf(stdout, "framing=");
+ if (spaninfo.lineconfig & ZT_CONFIG_ESF) fprintf(stdout, "ESF");
+ else if (spaninfo.lineconfig & ZT_CONFIG_D4) fprintf(stdout, "D4");
+ else if (spaninfo.lineconfig & ZT_CONFIG_CCS) fprintf(stdout, "CCS");
+ else if (spaninfo.lineconfig & ZT_CONFIG_CRC4) fprintf(stdout, "/CRC4");
+ fprintf(stdout, "\n");
+ } else {
+ /* this is an analog span */
+ fprintf(stdout, "type=analog\n");
+ for (y = basechan; y < (basechan + spaninfo.totalchans); y++) {
+ memset(¶ms, 0, sizeof(params));
+ params.channo = y;
+ if (ioctl(ctl, ZT_GET_PARAMS, ¶ms)) {
+ fprintf(stdout, "port=%d,unknown\n", y);
+ return;
+ };
+ fprintf(stdout, "port=%d,", y);
+ switch (params.sigcap & (__ZT_SIG_FXO | __ZT_SIG_FXS)) {
case __ZT_SIG_FXO:
fprintf(stdout, "FXS");
break;
@@ -158,15 +151,44 @@
break;
default:
fprintf(stdout, "none");
- }
- if (params.sigcap & ZT_SIG_BROKEN)
- fprintf(stdout, " FAILED");
- fprintf(stdout, "\n");
}
+ if (params.sigcap & ZT_SIG_BROKEN)
+ fprintf(stdout, " FAILED");
+ fprintf(stdout, "\n");
}
-
- basechan += s.totalchans;
}
- exit(0);
+ basechan += spaninfo.totalchans;
}
+
+int main(int argc, char *argv[])
+{
+ int ctl;
+ int x, spanno;
+
+ if ((ctl = open("/dev/zap/ctl", O_RDWR)) < 0) {
+ fprintf(stderr, "Unable to open /dev/zap/ctl: %s\n", strerror(errno));
+ exit(1);
+ }
+
+ /* If no parameters: loop over all spans */
+ if (argc == 1) {
+ for (spanno = 1; spanno < ZT_MAX_SPANS; spanno++)
+ print_span(spanno, ctl);
+ return 0;
+ }
+
+ /* Parameters provided: use them as span numbers */
+ for (x=1; argv[x]; x++) {
+ /* We can use atoi because span numbers must be > 0 */
+ int spanno = atoi(argv[x]);
+ if (spanno <= 0) {
+ fprintf(stderr, "%s: Error: Invalid span number %d (%s). Aborting\n",
+ argv[0], spanno, argv[x]);
+ exit(2);
+ }
+ print_span(spanno, ctl);
+ }
+
+ return 0;
+}
More information about the zaptel-commits
mailing list