diff options
author | Kinsey Moore <kmoore@digium.com> | 2010-12-09 20:19:26 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2010-12-09 20:19:26 +0000 |
commit | 63fdc5efa8ae957a31b5d5897b65835e06677f6e (patch) | |
tree | 0fbcdd9ff5ed0efbeb663981bb6ff32e6d163159 /drivers/dahdi/wcte12xp | |
parent | 2c00501000487765fe74037315e144c596c09a20 (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/wcte12xp')
-rw-r--r-- | drivers/dahdi/wcte12xp/base.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 8631f98..99267be 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -95,6 +95,10 @@ static const struct t1_desc te120p = {"Wildcard TE120P"}; static const struct t1_desc te122 = {"Wildcard TE122"}; static const struct t1_desc te121 = {"Wildcard TE121"}; +/* names of HWEC modules */ +static const char *vpmadt032_name = "VPMADT032"; +static const char *noec_name = "NONE"; + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) static kmem_cache_t *cmd_cache; #else @@ -945,10 +949,9 @@ static void set_span_devicetype(struct t1 *wc) sizeof(wc->span.devicetype) - 1); #if defined(VPM_SUPPORT) - if (wc->vpmadt032) { + if (wc->vpmadt032) strncat(wc->span.devicetype, " (VPMADT032)", sizeof(wc->span.devicetype) - 1); - } #endif } @@ -1308,6 +1311,14 @@ static int t1xxp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long return 0; } +static const char *t1xxp_echocan_name(const struct dahdi_chan *chan) +{ + struct t1 *wc = chan->pvt; + if (wc->vpmadt032) + return vpmadt032_name; + return noec_name; +} + static int t1xxp_echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p, @@ -1537,6 +1548,7 @@ static const struct dahdi_span_ops t1_span_ops = { .ioctl = t1xxp_ioctl, #ifdef VPM_SUPPORT .echocan_create = t1xxp_echocan_create, + .echocan_name = t1xxp_echocan_name, #endif }; |