[asterisk-dev] [dahdi] Sync cable code for TE405P

Guillaume Knispel gknispel at proformatique.com
Mon Feb 14 12:11:50 CST 2011


I'm investigating the behavior of synchronized TE405P cards and have the
following question after i took a look at
linux/drivers/dahdi/wct4xxp/base.c (DAHDI 2.4.0)

It seems that the synchronization source can only be updated when
__t4_findsync() is called for the first card:

	if (!wc->num) {
		/* If we're the first card, go through all the motions, up to 8 levels
		   of sync source */

It also seems that __t4_findsync() is only called for wc where
T4_CHECK_TIMING has been set in checkflag, and that this is the case on
startup of (a span on) the card, shutdown of (a span on) the card,
alarm change state on (a span on) the card.

So if i understand correctly, the synchronization source can only be
updated when one of said event happens on a span of the first card, and
i can't make sense of this behavior.

Is this indeed the correct behavior for a subtle reason i missed or is
it just a bug?

Still in __t4_findsync(), we have the following code:

	for (x=0;cards[x];x++) {
		for (i = 0; i < wc->numspans; i++) {
			if (cards[x]->tspans[i]->syncpos) {

Should it not rather be:

	for (x=0;cards[x];x++) {
		for (i = 0; i < cards[x]->numspans; i++) {
			if (cards[x]->tspans[i]->syncpos) {

Guillaume Knispel

More information about the asterisk-dev mailing list