summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi_echocan_kb1.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
commit63fdc5efa8ae957a31b5d5897b65835e06677f6e (patch)
tree0fbcdd9ff5ed0efbeb663981bb6ff32e6d163159 /drivers/dahdi/dahdi_echocan_kb1.c
parent2c00501000487765fe74037315e144c596c09a20 (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_kb1.c')
-rw-r--r--drivers/dahdi/dahdi_echocan_kb1.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/dahdi/dahdi_echocan_kb1.c b/drivers/dahdi/dahdi_echocan_kb1.c
index 3bf14c1..cf58260 100644
--- a/drivers/dahdi/dahdi_echocan_kb1.c
+++ b/drivers/dahdi/dahdi_echocan_kb1.c
@@ -148,9 +148,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 = "KB1";
+static const char *ec_name(const struct dahdi_chan *chan) { return name; }
static const struct dahdi_echocan_factory my_factory = {
- .name = "KB1",
+ .get_name = ec_name,
.owner = THIS_MODULE,
.echocan_create = echo_can_create,
};
@@ -722,7 +724,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;
}