[svn-commits] rmeyerriecks: linux/trunk r9099 - /linux/trunk/drivers/dahdi/wcb4xxp/base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Aug 6 15:10:40 CDT 2010


Author: rmeyerriecks
Date: Fri Aug  6 15:10:24 2010
New Revision: 9099

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9099
Log:
wcb4xxp: Renamed module parameter "alawoverride" to "companding"

Renamed the module parameter "alawoverride" to "companding". The valid
values for "companding" are now the strings "alaw" or "ulaw", instead
of integers. dahdi-673

Modified:
    linux/trunk/drivers/dahdi/wcb4xxp/base.c

Modified: linux/trunk/drivers/dahdi/wcb4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=9099&r1=9098&r2=9099
==============================================================================
--- linux/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcb4xxp/base.c Fri Aug  6 15:10:24 2010
@@ -94,7 +94,7 @@
 static int vpmsupport = 1;
 static int timer_1_ms = 2000;
 static int timer_3_ms = 30000;
-static int alawoverride = 1;
+static char *companding = "alaw";
 
 #if !defined(mmiowb)
 #define mmiowb() barrier()
@@ -684,15 +684,18 @@
 			ec_write(b4, i, 0x33 - j, (mask >> (j << 3)) & 0xff);
 
 /* Setup convergence rate */
-		if (DBG)
-			dev_info(b4->dev, "setting A-law mode\n");
-
 		b = ec_read(b4, i, 0x20);
 		b &= 0xe0;
 		b |= 0x12;
-		if (alawoverride) {
+		if (!strcasecmp(companding, "alaw")) {
+			if (DBG)
+				dev_info(b4->dev, "Setting alaw mode\n");
 			b |= 0x01;
-		}
+		} else {
+			if (DBG)
+				dev_info(b4->dev, "Setting ulaw mode");
+		}
+
 		ec_write(b4, i, 0x20, b);
 		if (DBG)
 			dev_info(b4->dev, "reg 0x20 is 0x%02x\n", b);
@@ -2343,10 +2346,10 @@
 		bspan->span.channels = WCB4XXP_CHANNELS_PER_SPAN;
 		bspan->span.flags = 0;
 
-		if (alawoverride)
+		if (!strcasecmp(companding, "ulaw"))
+			bspan->span.deflaw = DAHDI_LAW_MULAW;
+		else
 			bspan->span.deflaw = DAHDI_LAW_ALAW;
-		else
-			bspan->span.deflaw = DAHDI_LAW_MULAW;
 		/* For simplicty, we'll accept all line modes since BRI
 		 * ignores this setting anyway.*/
 		bspan->span.linecompat = DAHDI_CONFIG_AMI | 
@@ -2961,7 +2964,7 @@
 module_param(vpmsupport, int, S_IRUGO);
 module_param(timer_1_ms, int, S_IRUGO | S_IWUSR);
 module_param(timer_3_ms, int, S_IRUGO | S_IWUSR);
-module_param(alawoverride, int, S_IRUGO | S_IWUSR);
+module_param(companding, charp, S_IRUGO);
 
 MODULE_PARM_DESC(debug, "bitmap: 1=general 2=dtmf 4=regops 8=fops 16=ec 32=st state 64=hdlc 128=alarm");
 MODULE_PARM_DESC(spanfilter, "debug filter for spans. bitmap: 1=port 1, 2=port 2, 4=port 3, 8=port 4");
@@ -2975,6 +2978,8 @@
 MODULE_PARM_DESC(vpmsupport, "1=enable hardware EC, 0=disable hardware EC");
 MODULE_PARM_DESC(timer_1_ms, "NT: msec to wait for link activation, TE: unused.");
 MODULE_PARM_DESC(timer_3_ms, "TE: msec to wait for link activation, NT: unused.");
+MODULE_PARM_DESC(companding, "Change the companding to \"alaw\" or \"ulaw\""\
+				"(alaw by default)");
 
 MODULE_AUTHOR("Digium Incorporated <support at digium.com>");
 MODULE_DESCRIPTION("B410P & Similars multi-port BRI module driver.");




More information about the svn-commits mailing list