[svn-commits] sruffell: branch linux/2.4 r9663 - /linux/branches/2.4/drivers/dahdi/wctdm24xxp/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Jan 20 23:28:46 CST 2011
Author: sruffell
Date: Thu Jan 20 23:28:42 2011
New Revision: 9663
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9663
Log:
wctdm24xxp: Add optional FXO digital loopback if DEBUG is defined.
This module parameter will allow patgen/pattest to be used only on FXO
ports. *ALL* FXO ports will be placed in digital loopback mode when
set.
The current intent is for this to be removed as an optional module
parameter when there is a channel by channel representation in sysfs.
Otherwise, a new IOCTL would have to be defined and a tool written in
order to support this. DAHDI-696.
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9391
Modified:
linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c
Modified: linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=9663&r1=9662&r2=9663
==============================================================================
--- linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c Thu Jan 20 23:28:42 2011
@@ -218,6 +218,7 @@
static int debug = 0;
#ifdef DEBUG
static int robust = 0;
+static int digitalloopback;
#endif
static int lowpower = 0;
static int boostringer = 0;
@@ -2707,6 +2708,15 @@
/* Take values for fxotxgain and fxorxgain and apply them to module */
wctdm_set_hwgain(wc, card, fxotxgain, 1);
wctdm_set_hwgain(wc, card, fxorxgain, 0);
+
+#ifdef DEBUG
+ if (digitalloopback) {
+ dev_info(&wc->vb.pdev->dev,
+ "Turning on digital loopback for port %d.\n",
+ card + 1);
+ wctdm_setreg(wc, card, 10, 0x01);
+ }
+#endif
if (debug)
dev_info(&wc->vb.pdev->dev, "DEBUG fxotxgain:%i.%i fxorxgain:%i.%i\n", (wctdm_getreg(wc, card, 38)/16) ? -(wctdm_getreg(wc, card, 38) - 16) : wctdm_getreg(wc, card, 38), (wctdm_getreg(wc, card, 40)/16) ? -(wctdm_getreg(wc, card, 40) - 16) : wctdm_getreg(wc, card, 40), (wctdm_getreg(wc, card, 39)/16) ? -(wctdm_getreg(wc, card, 39) - 16): wctdm_getreg(wc, card, 39), (wctdm_getreg(wc, card, 41)/16)?-(wctdm_getreg(wc, card, 41) - 16) : wctdm_getreg(wc, card, 41));
@@ -3890,9 +3900,13 @@
y, s->chans[y]);
}
if (wc->modtype[x] == MOD_TYPE_FXO) {
+ int val;
s->chans[y++]->sigcap = DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF | DAHDI_SIG_CLEAR;
- wctdm_setreg(wc, x, 33,
- (should_set_alaw(wc) ? 0x20 : 0x28));
+ val = should_set_alaw(wc) ? 0x20 : 0x28;
+#ifdef DEBUG
+ val = (digitalloopback) ? 0x30 : val;
+#endif
+ wctdm_setreg(wc, x, 33, val);
} else if (wc->modtype[x] == MOD_TYPE_FXS) {
s->chans[y++]->sigcap = DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS | DAHDI_SIG_FXOGS | DAHDI_SIG_SF | DAHDI_SIG_EM | DAHDI_SIG_CLEAR;
wctdm_setreg(wc, x, 1,
@@ -5316,6 +5330,9 @@
module_param(reversepolarity, int, 0600);
#ifdef DEBUG
module_param(robust, int, 0600);
+module_param(digitalloopback, int, 0400);
+MODULE_PARM_DESC(digitalloopback, "Set to 1 to place FXO modules into " \
+ "loopback mode for troubleshooting.");
#endif
module_param(opermode, charp, 0600);
module_param(lowpower, int, 0600);
More information about the svn-commits
mailing list