summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Fredrickson <creslin@digium.com>2010-08-12 19:38:29 +0000
committerMatthew Fredrickson <creslin@digium.com>2010-08-12 19:38:29 +0000
commit737c134c3795da4656a227c9bedb4151ea57d114 (patch)
treebd59b62ea1fa926ca1aa144bd6ba61226b598e87
parent1b11a240810aaa71f10d25bb62fad38345703948 (diff)
Timing fix where handling math in find_sync_src() would return -2 instead of -1 in cases where automatic timing sync was specified.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9127 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/wcb4xxp/base.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c
index 12e7cc8..c7171df 100644
--- a/drivers/dahdi/wcb4xxp/base.c
+++ b/drivers/dahdi/wcb4xxp/base.c
@@ -1124,6 +1124,10 @@ static void b4xxp_set_sync_src(struct b4xxp *b4, int port)
{
int b;
+#if 0
+ printk("Setting sync to be port %d\n", (port >= 0) ? port + 1 : port);
+#endif
+
if (port == -1) /* automatic */
b = 0;
else
@@ -1151,7 +1155,10 @@ static int b4xxp_find_sync(struct b4xxp *b4)
}
}
- return src - 1;
+ if (src >= 0)
+ return src - 1;
+ else
+ return src;
}
/*
@@ -1284,8 +1291,7 @@ static void hfc_update_st_timers(struct b4xxp *b4)
dahdi_alarm_notify(&s->span);
if (DBG_ALARM)
dev_info(b4->dev, "span %d: alarm %d debounced\n", i + 1, s->newalarm);
- if (!s->te_mode)
- b4xxp_set_sync_src(b4, b4xxp_find_sync(b4));
+ b4xxp_set_sync_src(b4, b4xxp_find_sync(b4));
}
}
}
@@ -2192,11 +2198,12 @@ static int b4xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc
dev_info(b4->dev, "Configuring span %d\n", span->spanno);
#if 0
- if (lc->sync > 0 && bspan->te_mode) {
+ if (lc->sync > 0 && !bspan->te_mode) {
dev_info(b4->dev, "Span %d is not in NT mode, removing from sync source list\n", span->spanno);
lc->sync = 0;
}
#endif
+
if (lc->sync < 0 || lc->sync > 4) {
dev_info(b4->dev, "Span %d has invalid sync priority (%d), removing from sync source list\n", span->spanno, lc->sync);
lc->sync = 0;