summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-12-07 19:45:16 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-12-07 19:45:16 +0000
commit80892050d7b95101bac5266c0cb20028c55d2338 (patch)
tree0825e3315b6cd5dc196cd9b17704f060fbf97356
parent9f3d735c06a21c9be7ea719bdf26f1fcd73c5a68 (diff)
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@xorcom.com> Acked-by: : Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.5@10376 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/xpp/card_bri.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c
index a6296f0..a0301ef 100644
--- a/drivers/dahdi/xpp/card_bri.c
+++ b/drivers/dahdi/xpp/card_bri.c
@@ -1201,6 +1201,8 @@ static int bri_spanconfig(struct file *file, struct dahdi_span *span,
framingstr, codingstr, crcstr,
lc->lineconfig,
lc->sync);
+ PHONEDEV(xpd).timing_priority = lc->sync;
+ elect_syncer("BRI-spanconfig");
/*
* FIXME: validate
*/
@@ -1428,6 +1430,18 @@ static void BRI_card_pcm_tospan(xpd_t *xpd, xpacket_t *pack)
}
}
+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)
{
return xpd->addr.subunit * 4 + pos;
@@ -1695,7 +1709,7 @@ static const struct phoneops bri_phoneops = {
.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,