[zaptel-commits] kpfleming: branch 1.4 r3294 - in /branches/1.4: ./ wctdm24xxp/

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Tue Dec 4 12:13:04 CST 2007


Author: kpfleming
Date: Tue Dec  4 12:13:04 2007
New Revision: 3294

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3294
Log:
the analog card drivers can now mark failed modules as 'broken', and ztscan can output that information

Modified:
    branches/1.4/wctdm.c
    branches/1.4/wctdm24xxp/base.c
    branches/1.4/zaptel.h
    branches/1.4/ztscan.c

Modified: branches/1.4/wctdm.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm.c?view=diff&rev=3294&r1=3293&r2=3294
==============================================================================
--- branches/1.4/wctdm.c (original)
+++ branches/1.4/wctdm.c Tue Dec  4 12:13:04 2007
@@ -2061,6 +2061,7 @@
 static void wctdm_post_initialize(struct wctdm *wc)
 {
 	int x;
+
 	/* Finalize signalling  */
 	for (x = 0; x < NUM_CARDS; x++) {
 		if (wc->cardflag & (1 << x)) {
@@ -2068,6 +2069,8 @@
 				wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
 			else
 				wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
+		} else if (!(wc->chans[x].sigcap == ZT_SIG_BROKEN)) {
+			wc->chans[x].sigcap = 0;
 		}
 	}
 }
@@ -2184,6 +2187,7 @@
 					printk("Module %d: Installed -- MANUAL FXS\n",x);
 				} else {
 					printk("Module %d: FAILED FXS (%s)\n", x, fxshonormode ? fxo_modes[_opermode].name : "FCC");
+					wc->chans[x].sigcap = ZT_SIG_BROKEN;
 				} 
 			} else if (!(ret = wctdm_init_voicedaa(wc, x, 0, 0, sane))) {
 				wc->cardflag |= (1 << x);

Modified: branches/1.4/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm24xxp/base.c?view=diff&rev=3294&r1=3293&r2=3294
==============================================================================
--- branches/1.4/wctdm24xxp/base.c (original)
+++ branches/1.4/wctdm24xxp/base.c Tue Dec  4 12:13:04 2007
@@ -3093,8 +3093,9 @@
 static void wctdm_post_initialize(struct wctdm *wc)
 {
 	int x;
+
 	/* Finalize signalling  */
-	for (x=0;x<wc->cards;x++) {
+	for (x = 0; x <wc->cards; x++) {
 		if (wc->cardflag & (1 << x)) {
 			if (wc->modtype[x] == MOD_TYPE_FXO)
 				wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF | ZT_SIG_CLEAR;
@@ -3102,6 +3103,8 @@
 				wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
 			else if (wc->modtype[x] == MOD_TYPE_QRV)
 				wc->chans[x].sigcap = ZT_SIG_SF | ZT_SIG_EM | ZT_SIG_CLEAR;
+		} else if (!(wc->chans[x].sigcap == ZT_SIG_BROKEN)) {
+			wc->chans[x].sigcap = 0;
 		}
 	}
 }
@@ -3946,6 +3949,7 @@
 					printk("Port %d: Installed -- MANUAL FXS\n",x + 1);
 				} else {
 					printk("Port %d: FAILED FXS (%s)\n", x + 1, fxshonormode ? fxo_modes[_opermode].name : "FCC");
+					wc->chans[x].sigcap = ZT_SIG_BROKEN;
 				} 
 			} else if (!(ret = wctdm_init_voicedaa(wc, x, 0, 0, sane))) {
 				wc->cardflag |= (1 << x);

Modified: branches/1.4/zaptel.h
URL: http://svn.digium.com/view/zaptel/branches/1.4/zaptel.h?view=diff&rev=3294&r1=3293&r2=3294
==============================================================================
--- branches/1.4/zaptel.h (original)
+++ branches/1.4/zaptel.h Tue Dec  4 12:13:04 2007
@@ -110,8 +110,10 @@
 #define ZT_CONFIG_NOTOPEN (1 << 16)
 
 /* Signalling types */
-#define __ZT_SIG_FXO	 (1 << 12)	/* Never use directly */
-#define __ZT_SIG_FXS	 (1 << 13)	/* Never use directly */
+#define ZT_SIG_BROKEN	(1 << 31)	/* The port is broken and/or failed initialization */
+
+#define __ZT_SIG_FXO	(1 << 12)	/* Never use directly */
+#define __ZT_SIG_FXS	(1 << 13)	/* Never use directly */
 
 #define ZT_SIG_NONE		(0)			/* Channel not configured */
 #define ZT_SIG_FXSLS	((1 << 0) | __ZT_SIG_FXS)	/* FXS, Loopstart */
@@ -126,18 +128,18 @@
 
 /* The following are all variations on clear channel */
 
-#define __ZT_SIG_DACS	 (1 << 16)
-
-#define ZT_SIG_CLEAR	 (1 << 7)					/* Clear channel */
+#define __ZT_SIG_DACS	(1 << 16)
+
+#define ZT_SIG_CLEAR	(1 << 7)					/* Clear channel */
 #define ZT_SIG_HDLCRAW	((1 << 8)  | ZT_SIG_CLEAR)	/* Raw unchecked HDLC */
 #define ZT_SIG_HDLCFCS	((1 << 9)  | ZT_SIG_HDLCRAW)	/* HDLC with FCS calculation */
 #define ZT_SIG_HDLCNET	((1 << 10) | ZT_SIG_HDLCFCS)	/* HDLC Network */
-#define ZT_SIG_SLAVE	 (1 << 11) 					/* Slave to another channel */
-#define	ZT_SIG_SF	 (1 << 14)			/* Single Freq. tone only, no sig bits */
-#define ZT_SIG_CAS	 (1 << 15)			/* Just get bits */
+#define ZT_SIG_SLAVE	(1 << 11) 					/* Slave to another channel */
+#define	ZT_SIG_SF	(1 << 14)			/* Single Freq. tone only, no sig bits */
+#define ZT_SIG_CAS	(1 << 15)			/* Just get bits */
 #define ZT_SIG_DACS	(__ZT_SIG_DACS | ZT_SIG_CLEAR)	/* Cross connect */
-#define ZT_SIG_EM_E1	 (1 << 17)			/* E1 E&M Variation */
-#define ZT_SIG_DACS_RBS	 ((1 << 18) | __ZT_SIG_DACS)	/* Cross connect w/ RBS */
+#define ZT_SIG_EM_E1	(1 << 17)			/* E1 E&M Variation */
+#define ZT_SIG_DACS_RBS	((1 << 18) | __ZT_SIG_DACS)	/* Cross connect w/ RBS */
 #define ZT_SIG_HARDHDLC	((1 << 19) | ZT_SIG_CLEAR)
 
 /* tone flag values */

Modified: branches/1.4/ztscan.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/ztscan.c?view=diff&rev=3294&r1=3293&r2=3294
==============================================================================
--- branches/1.4/ztscan.c (original)
+++ branches/1.4/ztscan.c Tue Dec  4 12:13:04 2007
@@ -149,7 +149,9 @@
 					continue;
 				};
 				fprintf(stdout, "port=%d,", y);
-				switch (params.sigcap & (__ZT_SIG_FXO | __ZT_SIG_FXS)) {
+				if (params.sigcap == ZT_SIG_BROKEN)
+					fprintf(stdout, "FXS FAILED");
+				else switch (params.sigcap & (__ZT_SIG_FXO | __ZT_SIG_FXS)) {
 				case __ZT_SIG_FXO:
 					fprintf(stdout, "FXO");
 					break;




More information about the zaptel-commits mailing list