[Asterisk-cvs] zaptel wct4xxp.c,1.57,1.58

mattf at lists.digium.com mattf at lists.digium.com
Fri Apr 1 12:26:07 CST 2005


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv1053

Modified Files:
	wct4xxp.c 
Log Message:
J1 support on the TE4XXP.  Needs to be tested.


Index: wct4xxp.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- wct4xxp.c	21 Mar 2005 05:14:11 -0000	1.57
+++ wct4xxp.c	1 Apr 2005 18:19:29 -0000	1.58
@@ -61,6 +61,7 @@
 static int timingcable;
 static int highestorder;
 static int t1e1override = -1;
+static int j1mode = 0;
 static int loopback = 0;
 static int alarmdebounce = 0;
 static int noburst = 0;
@@ -80,6 +81,7 @@
 
 #define	TYPE_T1	1		/* is a T1 card */
 #define	TYPE_E1	2		/* is an E1 card */
+#define TYPE_J1 3		/* is a running J1 */
 
 #define CANARY 0xc0de
 
@@ -138,7 +140,7 @@
 	int txerrors;
 	struct tasklet_struct t4xxp_tlet;
 #endif
-	int spantype[4];		/* card type, T1 or E1 */
+	int spantype[4];		/* card type, T1 or E1 or J1 */
 	unsigned int passno;	/* number of interrupt passes */
 	char *variety;
 	int last0;		/* for detecting double-missed IRQ */
@@ -576,7 +578,7 @@
 		wc->spans[x].maint = t4_maint;
 		wc->spans[x].open = t4_open;
 		wc->spans[x].close  = t4_close;
-		if (wc->spantype[x] == TYPE_T1) {
+		if (wc->spantype[x] == TYPE_T1 || wc->spantype[x] == TYPE_J1) {
 			wc->spans[x].channels = 24;
 			wc->spans[x].deflaw = ZT_LAW_MULAW;
 		} else {
@@ -629,12 +631,15 @@
 	t4_framer_out(wc, unit, 0x3f, unit << 1); /* SIC2: No FFS, no center receive eliastic buffer, phase */
 	t4_framer_out(wc, unit, 0x40, 0x04);	/* SIC3: Edges for capture */
 	t4_framer_out(wc, unit, 0x45, 0x00);	/* CMR2: We provide sync and clock for tx and rx. */
-	if (!wc->t1e1) {
+	if (!wc->t1e1) { /* T1 mode */
 		t4_framer_out(wc, unit, 0x22, 0x03);	/* XC0: Normal operation of Sa-bits */
 		t4_framer_out(wc, unit, 0x23, 0x84);	/* XC1: 0 offset */
-		t4_framer_out(wc, unit, 0x24, 0x03);	/* RC0: Just shy of 1023 */
+		if (wc->spantype[unit] == TYPE_J1)
+			t4_framer_out(wc, unit, 0x24, 0x83);	/* RC0: Just shy of 1023 */
+		else
+			t4_framer_out(wc, unit, 0x24, 0x03);	/* RC0: Just shy of 1023 */
 		t4_framer_out(wc, unit, 0x25, 0x84);	/* RC1: The rest of RC0 */
-	} else {
+	} else {  /* E1 mode */
 		t4_framer_out(wc, unit, 0x22, 0x00);	/* XC0: Normal operation of Sa-bits */
 		t4_framer_out(wc, unit, 0x23, 0x04);	/* XC1: 0 offset */
 		t4_framer_out(wc, unit, 0x24, 0x04);	/* RC0: Just shy of 1023 */
@@ -1600,7 +1605,10 @@
 					wc->chans[x] = kmalloc(sizeof(struct zt_chan) * 31,GFP_KERNEL);
 					memset(wc->chans[x],0,sizeof(struct zt_chan) * 31);
 				} else {
-					wc->spantype[x] = TYPE_T1;
+					if (j1mode)
+						wc->spantype[x] = TYPE_J1;
+					else
+						wc->spantype[x] = TYPE_T1;
 					wc->chans[x] = kmalloc(sizeof(struct zt_chan) * 24,GFP_KERNEL);
 					memset(wc->chans[x],0,sizeof(struct zt_chan) * 24);
 				}
@@ -1750,6 +1758,7 @@
 module_param(timingcable, int, 0600);
 module_param(t1e1override, int, 0600);
 module_param(alarmdebounce, int, 0600);
+module_param(j1mode, int, 0600);
 #else
 MODULE_PARM(debug, "i");
 MODULE_PARM(loopback, "i");
@@ -1757,6 +1766,7 @@
 MODULE_PARM(timingcable, "i");
 MODULE_PARM(t1e1override, "i");
 MODULE_PARM(alarmdebounce, "i");
+MODULE_PARM(j1mode, "i");
 #endif
 
 MODULE_DEVICE_TABLE(pci, t4_pci_tbl);




More information about the svn-commits mailing list