[Asterisk-cvs] zaptel wcfxo.c,1.22,1.23

markster at lists.digium.com markster at lists.digium.com
Sat Jan 31 16:16:29 CST 2004


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

Modified Files:
	wcfxo.c 
Log Message:
Minor FXO adjustments for gain adjustments


Index: wcfxo.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wcfxo.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- wcfxo.c	6 Jan 2004 13:26:44 -0000	1.22
+++ wcfxo.c	31 Jan 2004 22:25:10 -0000	1.23
@@ -172,6 +172,9 @@
 static struct wcfxo_desc wcx101p = { "Wildcard X101P",
 		FLAG_USE_XTAL | FLAG_DOUBLE_CLOCK };
 
+static struct wcfxo_desc generic = { "Generic Clone",
+		FLAG_USE_XTAL | FLAG_DOUBLE_CLOCK };
+
 static struct wcfxo *ifaces[WC_MAX_IFACES];
 
 static void wcfxo_release(struct wcfxo *wc);
@@ -182,6 +185,8 @@
 
 static int quiet = 0;
 
+static int boost = 0;
+
 static int opermode = 0;
 
 static struct fxo_mode {
@@ -766,6 +771,7 @@
 {
 	/* This must not be called in an interrupt */
 	/* We let things settle for a bit */
+	unsigned char reg15;
 //	set_current_state(TASK_INTERRUPTIBLE);
 //	schedule_timeout(10);
 
@@ -802,12 +808,17 @@
 	/* Wait a couple of jiffies for our writes to finish */
 	set_current_state(TASK_INTERRUPTIBLE);
 	schedule_timeout(1 + (ZT_CHUNKSIZE * HZ) / 800);
-
+	reg15 = 0x0;
 	/* Go ahead and attenuate transmit signal by 6 db */
 	if (quiet) {
 		printk("wcfxo: Attenuating transmit signal for quiet operation\n");
-		wcfxo_setreg(wc, 0xf, 0x10);
+		reg15 |= (quiet & 0x3) << 4;
+	}
+	if (boost) {
+		printk("wcfxo: Boosting receive signal\n");
+		reg15 |= (boost & 0x3);
 	}
+	wcfxo_setreg(wc, 0xf, reg15);
 	/* Didn't get it right.  Register 9 is still garbage */
 	if (wc->readregs[0x9] != 0x89)
 		return -1;
@@ -963,6 +974,7 @@
 
 static struct pci_device_id wcfxo_pci_tbl[] __devinitdata = {
 	{ 0xe159, 0x0001, 0x8085, PCI_ANY_ID, 0, 0, (unsigned long) &wcx101p },
+	{ 0xe159, 0x0001, 0x8086, PCI_ANY_ID, 0, 0, (unsigned long) &generic },
 	{ 0x1057, 0x5608, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long) &wcx100p },
 };
 
@@ -998,6 +1010,7 @@
 
 MODULE_PARM(debug, "i");
 MODULE_PARM(quiet, "i");
+MODULE_PARM(boost, "i");
 MODULE_PARM(monitor, "i");
 MODULE_PARM(opermode, "i");
 MODULE_DESCRIPTION("Wildcard X100P Zaptel Driver");




More information about the svn-commits mailing list