[svn-commits] tzafrir: branch linux/2.5 r10376 - /linux/branches/2.5/drivers/dahdi/xpp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Dec 7 13:45:20 CST 2011


Author: tzafrir
Date: Wed Dec  7 13:45:16 2011
New Revision: 10376

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10376
Log:
xpp: BRI: fix timing priority calculation

Use similar caculation as in the PRI module:
* Save timing_priority from spanconfig and
  elect syncer when spanconfig is called.
* Create custom timing_priority() function that returns
  the value or error if span is disconnected.

Signed-off-by: Oron Peled <oron.peled at xorcom.com>
Acked-by: : Tzafrir Cohen <tzafrir.cohen at xorcom.com>

Modified:
    linux/branches/2.5/drivers/dahdi/xpp/card_bri.c

Modified: linux/branches/2.5/drivers/dahdi/xpp/card_bri.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.5/drivers/dahdi/xpp/card_bri.c?view=diff&rev=10376&r1=10375&r2=10376
==============================================================================
--- linux/branches/2.5/drivers/dahdi/xpp/card_bri.c (original)
+++ linux/branches/2.5/drivers/dahdi/xpp/card_bri.c Wed Dec  7 13:45:16 2011
@@ -1201,6 +1201,8 @@
 		framingstr, codingstr, crcstr,
 		lc->lineconfig,
 		lc->sync);
+	PHONEDEV(xpd).timing_priority = lc->sync;
+	elect_syncer("BRI-spanconfig");
 	/*
 	 * FIXME: validate
 	 */
@@ -1426,6 +1428,18 @@
 		XPD_COUNTER(tmp_xpd, PCM_READ)++;
 		spin_unlock_irqrestore(&tmp_xpd->lock, flags);
 	}
+}
+
+static int BRI_timing_priority(xpd_t *xpd)
+{
+	struct BRI_priv_data	*priv;
+
+	priv = xpd->priv;
+	BUG_ON(!priv);
+	if (priv->layer1_up)
+		return PHONEDEV(xpd).timing_priority;
+	XPD_DBG(SYNC, xpd, "No timing priority (no layer1)\n");
+	return -ENOENT;
 }
 
 int BRI_echocancel_timeslot(xpd_t *xpd, int pos)
@@ -1695,7 +1709,7 @@
 	.card_pcm_recompute	= BRI_card_pcm_recompute,
 	.card_pcm_fromspan	= BRI_card_pcm_fromspan,
 	.card_pcm_tospan	= BRI_card_pcm_tospan,
-	.card_timing_priority	= generic_timing_priority,
+	.card_timing_priority	= BRI_timing_priority,
 	.echocancel_timeslot	= BRI_echocancel_timeslot,
 	.echocancel_setmask	= BRI_echocancel_setmask,
 	.card_ioctl	= BRI_card_ioctl,




More information about the svn-commits mailing list