summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-06-26 19:13:31 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-06-26 19:13:31 +0000
commitd039bea12645bf1134320bda0ef2fcf43e62f43c (patch)
treebf28ba78b13a549f731102be5a288b86e7469385
parent883b2724c255cdefec8e6ae361715e930ea3b46d (diff)
Add honorfxs mode (request for bug #1926), not generally valuable
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@423 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xwcfxs.c11
-rwxr-xr-xwctdm.c11
2 files changed, 20 insertions, 2 deletions
diff --git a/wcfxs.c b/wcfxs.c
index 13c1f71..f880edb 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -92,6 +92,7 @@ static alpha indirect_regs[] =
static struct fxo_mode {
char *name;
+ /* FXO */
int ohs;
int ohs2;
int rz;
@@ -316,6 +317,7 @@ struct wcfxs_desc {
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 lowpower = 0;
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 @@ static int wcfxs_init_proslic(struct wcfxs *wc, int card, int fast, int manual,
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 @@ static int wcfxs_init_proslic(struct wcfxs *wc, int card, int fast, int manual,
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 @@ static int wcfxs_hardware_init(struct wcfxs *wc)
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(opermode, "s");
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@digium.com>");
#ifdef MODULE_LICENSE
diff --git a/wctdm.c b/wctdm.c
index 13c1f71..f880edb 100755
--- a/wctdm.c
+++ b/wctdm.c
@@ -92,6 +92,7 @@ static alpha indirect_regs[] =
static struct fxo_mode {
char *name;
+ /* FXO */
int ohs;
int ohs2;
int rz;
@@ -316,6 +317,7 @@ struct wcfxs_desc {
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 lowpower = 0;
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 @@ static int wcfxs_init_proslic(struct wcfxs *wc, int card, int fast, int manual,
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 @@ static int wcfxs_init_proslic(struct wcfxs *wc, int card, int fast, int manual,
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 @@ static int wcfxs_hardware_init(struct wcfxs *wc)
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(opermode, "s");
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@digium.com>");
#ifdef MODULE_LICENSE