summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wcb4xxp
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/wcb4xxp
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/wcb4xxp')
-rw-r--r--drivers/dahdi/wcb4xxp/base.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c
index 2b09ed3..6b147c4 100644
--- a/drivers/dahdi/wcb4xxp/base.c
+++ b/drivers/dahdi/wcb4xxp/base.c
@@ -103,6 +103,10 @@ static char *companding = "alaw";
#define MAX_B4_CARDS 64
static struct b4xxp *cards[MAX_B4_CARDS];
+/* names of HWEC modules */
+static const char *lasvegas2_name = "LASVEGAS2";
+static const char *noec_name = "NONE";
+
static int led_fader_table[] = {
0, 0, 0, 1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18, 20, 22, 24,
25, 27, 28, 29, 30, 31, 31, 32, 31, 31, 30, 29, 28, 27, 25, 23, 22,
@@ -2129,6 +2133,15 @@ static void b4xxp_update_leds(struct b4xxp *b4)
}
}
+static const char *b4xxp_echocan_name(const struct dahdi_chan *chan)
+{
+ struct b4xxp_span *bspan = container_of(chan->span, struct b4xxp_span,
+ span);
+ if (bspan->parent->card_type == B410P)
+ return lasvegas2_name;
+ return noec_name;
+}
+
static int b4xxp_echocan_create(struct dahdi_chan *chan,
struct dahdi_echocanparams *ecp,
struct dahdi_echocanparam *p,
@@ -2370,6 +2383,7 @@ static const struct dahdi_span_ops b4xxp_span_ops = {
.ioctl = b4xxp_ioctl,
.hdlc_hard_xmit = b4xxp_hdlc_hard_xmit,
.echocan_create = b4xxp_echocan_create,
+ .echocan_name = b4xxp_echocan_name,
};
/* initialize the span/chan structures. Doesn't touch hardware, although the callbacks might. */