[svn-commits] sruffell: linux/trunk r10269 - /linux/trunk/drivers/dahdi/wct4xxp/base.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Oct 24 17:19:18 CDT 2011
Author: sruffell
Date: Mon Oct 24 17:19:11 2011
New Revision: 10269
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10269
Log:
wct4xxp: Deprecate 't1e1override' module parameter in favor of 'default_linemode'.
't1e1override' isn't immediately apparent what it is supposed to do by the
name. Instead 'default_linemode' module parameter can be set to "auto", "t1",
or "e1" to make it clear.
This change was introduced earlier in the wcte12xp driver.
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Modified:
linux/trunk/drivers/dahdi/wct4xxp/base.c
Modified: linux/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=10269&r1=10268&r2=10269
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Mon Oct 24 17:19:11 2011
@@ -182,7 +182,8 @@
static int debug=0;
static int timingcable = 0;
-static int t1e1override = -1; /* 0xff for E1, 0x00 for T1 */
+static int t1e1override = -1; /* deprecated */
+static char *default_linemode = "auto";
static int j1mode = 0;
static int sigmode = FRMR_MODE_NO_ADDR_CMP;
static int alarmdebounce = 2500; /* LOF/LFA def to 2.5s AT&T TR54016*/
@@ -3957,10 +3958,28 @@
t4_pci_out(wc, WC_INTR, 0x00000000);
/* Read T1/E1 status */
- if (t1e1override > -1)
- wc->t1e1 = t1e1override;
- else
- wc->t1e1 = ((t4_pci_in(wc, WC_LEDS)) & 0x0f00) >> 8;
+ if (!strcasecmp("auto", default_linemode)) {
+ if (-1 == t1e1override) {
+ wc->t1e1 = (((t4_pci_in(wc, WC_LEDS)) & 0x0f00) >> 8);
+ wc->t1e1 &= 0xf;
+ } else {
+ dev_warn(&wc->dev->dev, "'t1e1override' is deprecated. "
+ "Please use 'default_linemode'.\n");
+ wc->t1e1 = t1e1override & 0xf;
+ }
+ } else if (!strcasecmp("t1", default_linemode)) {
+ wc->t1e1 = 0;
+ } else if (!strcasecmp("e1", default_linemode)) {
+ wc->t1e1 = 0xff;
+ } else if (!strcasecmp("j1", default_linemode)) {
+ wc->t1e1 = 0;
+ j1mode = 1;
+ } else {
+ dev_err(&wc->dev->dev, "'%s' is an unknown linemode.\n",
+ default_linemode);
+ wc->t1e1 = 0;
+ }
+
wc->order = ((t4_pci_in(wc, WC_LEDS)) & 0xf0000000) >> 28;
order_index[wc->order]++;
return 0;
@@ -4500,7 +4519,11 @@
module_param(debug, int, 0600);
module_param(noburst, int, 0600);
module_param(timingcable, int, 0600);
-module_param(t1e1override, int, 0600);
+module_param(t1e1override, int, 0400);
+module_param(default_linemode, charp, S_IRUGO);
+MODULE_PARM_DESC(default_linemode, "\"auto\"(default), \"e1\", \"t1\", "
+ "or \"j1\". \"auto\" will use the value from any hardware "
+ "jumpers.");
module_param(alarmdebounce, int, 0600);
module_param(losalarmdebounce, int, 0600);
module_param(aisalarmdebounce, int, 0600);
More information about the svn-commits
mailing list