[Asterisk-cvs] zaptel wcfxs.c,1.75,1.76

markster at lists.digium.com markster at lists.digium.com
Sat Jun 26 15:27:37 CDT 2004


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

Modified Files:
	wcfxs.c 
Log Message:
Add honorfxs mode (request for bug #1926), not generally valuable


Index: wcfxs.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wcfxs.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- wcfxs.c	25 Jun 2004 22:51:24 -0000	1.75
+++ wcfxs.c	26 Jun 2004 19:13:31 -0000	1.76
@@ -92,6 +92,7 @@
 
 static struct fxo_mode {
 	char *name;
+	/* FXO */
 	int ohs;
 	int ohs2;
 	int rz;
@@ -316,6 +317,7 @@
 
 static struct wcfxs_desc wcfxs = { "Wildcard S400P Prototype", 0 };
 static struct wcfxs_desc wcfxse = { "Wildcard TDM400P REV E/F", 0 };
+static int acim2tiss[16] = { 0x0, 0x1, 0x4, 0x5, 0x7, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x2, 0x0, 0x3 };
 
 static struct wcfxs *ifaces[WC_MAX_IFACES];
 
@@ -328,6 +330,7 @@
 static int boostringer = 0;
 static int _opermode = 0;
 static char *opermode = "FCC";
+static int fxshonormode = 0;
 
 static int wcfxs_init_proslic(struct wcfxs *wc, int card, int fast , int manual, int sane);
 
@@ -1139,6 +1142,7 @@
 	unsigned short tmp[5];
 	unsigned char r19;
 	int x;
+	int fxsmode=0;
 
 	/* By default, don't send on hook */
 	wc->mod.fxs.idletxhookstate [card] = 1;
@@ -1271,6 +1275,10 @@
     wcfxs_setreg(wc, card, 19, 0xff);
     wcfxs_setreg(wc, card, 20, 0xff);
     wcfxs_setreg(wc, card, 73, 0x04);
+	if (fxshonormode) {
+		fxsmode = acim2tiss[fxo_modes[_opermode].acim];
+		wcfxs_setreg(wc, card, 10, fxsmode);
+	}
     if (lowpower)
     	wcfxs_setreg(wc, card, 72, 0x10);
 
@@ -1816,7 +1824,7 @@
 					wc->cardflag |= (1 << x);
 					printk("Module %d: Installed -- MANUAL FXS\n",x);
 				} else {
-					printk("Module %d: FAILED FXS\n", x);
+					printk("Module %d: FAILED FXS (%s)\n", x, fxshonormode ? fxo_modes[_opermode].name : "FCC");
 				} 
 			} else if (!(ret = wcfxs_init_voicedaa(wc, x, 0, 0, sane))) {
 				wc->cardflag |= (1 << x);
@@ -2087,6 +2095,7 @@
 MODULE_PARM(timingonly, "i");
 MODULE_PARM(lowpower, "i");
 MODULE_PARM(boostringer, "i");
+MODULE_PARM(fxshonormode, "i");
 MODULE_DESCRIPTION("Wildcard TDM400P Zaptel Driver");
 MODULE_AUTHOR("Mark Spencer <markster at digium.com>");
 #ifdef MODULE_LICENSE




More information about the svn-commits mailing list