From 706dc43483e5012a5a8266bd646713750c7d52f2 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Wed, 18 Sep 2013 18:17:37 -0500 Subject: [PATCH] wct4xxp: Print warning in dmesg if span priority is not set correctly. dahdi_genconf currently does not take into account the number of spans configured for a particular board. Therefore if you have two dual span cards installed in the system, it could be possible to have something like this in /etc/dahdi/system.conf: spans=1,1,... spans=2,2,... spans=3,3,... spans=4,4,... When what you really want is something like this: spans=1,1,... spans=2,2,... spans=3,1,... spans=4,2,... Otherwise, spans 3 and 4 will be configured to not recover the clock from the span which is most likely NOT what you want. Signed-off-by: Shaun Ruffell --- drivers/dahdi/wct4xxp/base.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 1ed10b1..7b531cc 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -1712,8 +1712,11 @@ _t4_spanconfig(struct file *file, struct dahdi_span *span, if (lc->sync < 0) lc->sync = 0; - if (lc->sync > wc->numspans) + if (lc->sync > wc->numspans) { + dev_warn(&wc->dev->dev, "WARNING: Cannot set priority on span %d to %d. Please set to a number between 1 and %d\n", + span->spanno, lc->sync, wc->numspans); lc->sync = 0; + } /* remove this span number from the current sync sources, if there */ for(i = 0; i < wc->numspans; i++) {