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
This commit is contained in:
Kinsey Moore
2010-12-09 20:19:26 +00:00
parent fd01eef199
commit 7a7d4000a0
12 changed files with 130 additions and 63 deletions

View File

@@ -268,8 +268,8 @@ struct dahdi_echocan_ops {
/*! A factory for creating instances of software echo cancelers to be used on DAHDI channels. */
struct dahdi_echocan_factory {
/*! The name of the factory. */
const char *name;
/*! Get the name of the factory. */
const char *(*get_name)(const struct dahdi_chan *chan);
/*! Pointer to the module that owns this factory; the module's reference count will be
* incremented/decremented by the DAHDI core as needed.
@@ -851,6 +851,9 @@ struct dahdi_span_ops {
struct dahdi_echocanparams *ecp,
struct dahdi_echocanparam *p,
struct dahdi_echocan_state **ec);
/*! Opt: Provide the name of the echo canceller on a channel */
const char *(*echocan_name)(const struct dahdi_chan *chan);
};
struct dahdi_span {