summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi_echocan_sec.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2010-12-09 20:19:26 +0000
committerKinsey Moore <kmoore@digium.com>2010-12-09 20:19:26 +0000
commit0a0862817efc1c7a420c155a98c15ac5740513cb (patch)
tree0fbcdd9ff5ed0efbeb663981bb6ff32e6d163159 /drivers/dahdi/dahdi_echocan_sec.c
parentbee3474ea340a48c48323cb97334bbf8b43f78b3 (diff)
dahdi-base, dahdi_echocan_*, wcb4xxp, wct4xxp, wctdm24xxp, wcte12xp, kernel: Allow name of EC factory to vary based on channel
Changed the echocan factory name to a function (get_name) called to get the name. This allows a factory to return a different name when being called in reference to a channel such as in the case of hardware echo cancellers. To further accommodate this change for HWEC, a new echocan_name function was added to the span ops struct and is used in hwec_factory in dahdi-base for all cards that support hardware echo cancellation. Signed-off-by: Kinsey Moore <kmoore@digium.com> Acked-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9524 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi_echocan_sec.c')
-rw-r--r--drivers/dahdi/dahdi_echocan_sec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/dahdi/dahdi_echocan_sec.c b/drivers/dahdi/dahdi_echocan_sec.c
index bd7cb90..5f6f9ae 100644
--- a/drivers/dahdi/dahdi_echocan_sec.c
+++ b/drivers/dahdi/dahdi_echocan_sec.c
@@ -86,9 +86,11 @@ static void echo_can_free(struct dahdi_chan *chan, struct dahdi_echocan_state *e
static void echo_can_process(struct dahdi_echocan_state *ec, short *isig, const short *iref, u32 size);
static int echo_can_traintap(struct dahdi_echocan_state *ec, int pos, short val);
static void echocan_NLP_toggle(struct dahdi_echocan_state *ec, unsigned int enable);
+static const char *name = "SEC";
+static const char *ec_name(const struct dahdi_chan *chan) { return name; }
static const struct dahdi_echocan_factory my_factory = {
- .name = "SEC",
+ .get_name = ec_name,
.owner = THIS_MODULE,
.echocan_create = echo_can_create,
};
@@ -335,7 +337,8 @@ static int __init mod_init(void)
return -EPERM;
}
- module_printk(KERN_NOTICE, "Registered echo canceler '%s'\n", my_factory.name);
+ module_printk(KERN_NOTICE, "Registered echo canceler '%s'\n",
+ my_factory.get_name(NULL));
return 0;
}