summaryrefslogtreecommitdiff
path: root/drivers/dahdi
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-07-04 14:04:33 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-07-04 14:04:33 +0000
commit0400a2e6a773a5f30e271e218f124080f2f355ae (patch)
treeee3a35d0520d26ca9934a85c90a6e9366d192e8b /drivers/dahdi
parente721c230bee364d3b716ee6b758b16610e041ed7 (diff)
xpp: add FXO HWEC quirks handling
In some cases the hardware echo canceller cannot be used. Mostly related to an FXO module. * FXO module if the first module is BRI or PRI * FXS module if the Astribank has another FXO, no PRI/BRI, and is a sync slave. Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10019 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi')
-rw-r--r--drivers/dahdi/xpp/xbus-core.c4
-rw-r--r--drivers/dahdi/xpp/xbus-core.h4
-rw-r--r--drivers/dahdi/xpp/xpp_dahdi.c20
3 files changed, 28 insertions, 0 deletions
diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c
index 3d37f71..105c2eb 100644
--- a/drivers/dahdi/xpp/xbus-core.c
+++ b/drivers/dahdi/xpp/xbus-core.c
@@ -664,6 +664,10 @@ static int new_card(xbus_t *xbus,
subunits,
port_dir
);
+ if (type == XPD_TYPE_PRI || type == XPD_TYPE_BRI)
+ xbus->quirks.has_digital_span = 1;
+ if (type == XPD_TYPE_FXO)
+ xbus->quirks.has_fxo = 1;
xbus->worker.num_units += subunits - 1;
for(i = 0; i < subunits; i++) {
int subunit_ports = proto_table->ports_per_subunit;
diff --git a/drivers/dahdi/xpp/xbus-core.h b/drivers/dahdi/xpp/xbus-core.h
index b781e94..14678ff 100644
--- a/drivers/dahdi/xpp/xbus-core.h
+++ b/drivers/dahdi/xpp/xbus-core.h
@@ -207,6 +207,10 @@ struct xbus {
int cpu_rcv_intr[NR_CPUS];
int cpu_rcv_tasklet[NR_CPUS];
+ struct quirks {
+ int has_fxo:1;
+ int has_digital_span:1;
+ } quirks;
bool self_ticking;
enum sync_mode sync_mode;
/* Managed by low-level drivers: */
diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c
index 3bad387..3c25392 100644
--- a/drivers/dahdi/xpp/xpp_dahdi.c
+++ b/drivers/dahdi/xpp/xpp_dahdi.c
@@ -940,6 +940,26 @@ const char *xpp_echocan_name(const struct dahdi_chan *chan)
LINE_DBG(GENERAL, xpd, pos, "%s:\n", __func__);
if (!ECHOOPS(xbus))
return NULL;
+ /*
+ * quirks and limitations
+ */
+ if (xbus->quirks.has_fxo) {
+ if (
+ xbus->quirks.has_digital_span &&
+ xpd->type == XPD_TYPE_FXO) {
+ LINE_NOTICE(xpd, pos,
+ "quirk: give up HWEC on FXO: "
+ "AB has digital span\n");
+ return NULL;
+ } else if (
+ xbus->sync_mode != SYNC_MODE_AB &&
+ xpd->type == XPD_TYPE_FXS) {
+ LINE_NOTICE(xpd, pos,
+ "quirk: give up HWEC on FXS: "
+ "AB has FXO and is sync slave\n");
+ return NULL;
+ }
+ }
return "XPP";
}
EXPORT_SYMBOL(xpp_echocan_name);