diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-09-29 16:45:15 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-09-29 16:45:15 +0000 |
commit | 8d2bf266da60c9e13c8fe9b791edef35bf397fd9 (patch) | |
tree | 37768239fc0800ae60711b8838ce01e2de8f104a /drivers/dahdi/xpp/card_pri.c | |
parent | 5d91a043f4d0c55ec1d1dbd08942387465ae9ccb (diff) |
xpp: refactor pcm mask handling.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7245 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/card_pri.c')
-rw-r--r-- | drivers/dahdi/xpp/card_pri.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c index d8fb36b..999849b 100644 --- a/drivers/dahdi/xpp/card_pri.c +++ b/drivers/dahdi/xpp/card_pri.c @@ -452,6 +452,8 @@ static void pri_pcm_update(xpd_t *xpd) struct PRI_priv_data *priv; int channels = xpd->channels; xpp_line_t mask = BITMASK(xpd->channels); + uint pcm_len; + unsigned long flags; priv = xpd->priv; if(priv->is_cas) { @@ -459,8 +461,10 @@ static void pri_pcm_update(xpd_t *xpd) channels--; mask &= ~BIT(PRI_DCHAN_IDX(priv)); } - xpd->pcm_len = RPACKET_HEADERSIZE + sizeof(xpp_line_t) + channels * DAHDI_CHUNKSIZE; - xpd->wanted_pcm_mask = mask; + pcm_len = RPACKET_HEADERSIZE + sizeof(xpp_line_t) + channels * DAHDI_CHUNKSIZE; + spin_lock_irqsave(&xpd->lock_recompute_pcm, flags); + update_wanted_pcm_mask(xpd, mask, pcm_len); + spin_unlock_irqrestore(&xpd->lock_recompute_pcm, flags); } /* |