diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-10-20 20:52:56 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-10-20 20:52:56 +0000 |
commit | 6174412f4f1763c213f9130b6c7de5741077f50a (patch) | |
tree | e84a54f4eb674ac1d56d50a6671401f055a81cc1 /drivers/dahdi/wcte12xp | |
parent | 6238621c1ad360eb2876762d2828dc4ab1c27c86 (diff) |
wcte12xp: 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.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Michael Spiceland <mspiceland@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10243 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wcte12xp')
-rw-r--r-- | drivers/dahdi/wcte12xp/base.c | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 3b48b5d..6a6bf24 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -55,13 +55,18 @@ #error VOICEBUS_SFRAME_SIZE != SFRAME_SIZE #endif +#ifndef pr_fmt +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#endif + static int debug; static int j1mode = 0; static int alarmdebounce = 2500; /* LOF/LFA def to 2.5s AT&T TR54016*/ static int losalarmdebounce = 2500; /* LOS def to 2.5s AT&T TR54016*/ static int aisalarmdebounce = 2500; /* AIS(blue) def to 2.5s AT&T TR54016*/ static int yelalarmdebounce = 500; /* RAI(yellow) def to 0.5s AT&T devguide */ -static int t1e1override = -1; +static int t1e1override = -1; /* deprecated */ +static char *default_linemode = "auto"; /* 'auto', 'e1', or 't1' */ static int latency = VOICEBUS_DEFAULT_LATENCY; static unsigned int max_latency = VOICEBUS_DEFAULT_MAXLATENCY; static int vpmsupport = 1; @@ -1866,20 +1871,23 @@ static int t1_hardware_post_init(struct t1 *wc) int x; /* T1 or E1 */ - if (t1e1override > -1) { - if (t1e1override) + if (-1 != t1e1override) { + pr_info("t1e1override is deprecated. Please use 'spantype'.\n"); + wc->spantype = (t1e1override) ? TYPE_E1 : TYPE_T1; + } else { + if (!strcasecmp(default_linemode, "e1")) { wc->spantype = TYPE_E1; - else + } else if (!strcasecmp(default_linemode, "t1")) { wc->spantype = TYPE_T1; - } else { - u8 pins; - res = t1_getpins(wc, &pins); - if (res) - return res; - - wc->spantype = (pins & 0x01) ? TYPE_T1 : TYPE_E1; + } else { + u8 pins; + res = t1_getpins(wc, &pins); + if (res) + return res; + wc->spantype = (pins & 0x01) ? TYPE_T1 : TYPE_E1; + } } - debug_printk(wc, 1, "spantype: %s\n", 1 == wc->spantype ? "T1" : "E1"); + debug_printk(wc, 1, "linemode: %s\n", 1 == wc->spantype ? "T1" : "E1"); /* what version of the FALC are we using? */ reg = t1_setreg(wc, 0x4a, 0xaa); @@ -2793,6 +2801,16 @@ static int __init te12xp_init(void) if (!cmd_cache) return -ENOMEM; + if (-1 != t1e1override) { + pr_info("'t1e1override' is deprecated. " + "Please use 'default_linemode' instead\n"); + } else if (strcasecmp(default_linemode, "auto") && + strcasecmp(default_linemode, "t1") && + strcasecmp(default_linemode, "e1")) { + pr_err("'%s' is an unknown span type.", default_linemode); + default_linemode = "auto"; + return -EINVAL; + } res = dahdi_pci_module(&te12xp_driver); if (res) { kmem_cache_destroy(cmd_cache); @@ -2811,6 +2829,9 @@ static void __exit te12xp_cleanup(void) module_param(debug, int, S_IRUGO | S_IWUSR); module_param(t1e1override, int, S_IRUGO | S_IWUSR); +module_param(default_linemode, charp, S_IRUGO); +MODULE_PARM_DESC(default_linemode, "\"auto\"(default), \"e1\", or \"t1\". " + "\"auto\" will use the value from the hardware jumpers."); module_param(j1mode, int, S_IRUGO | S_IWUSR); module_param(alarmdebounce, int, S_IRUGO | S_IWUSR); module_param(losalarmdebounce, int, S_IRUGO | S_IWUSR); |