diff options
Diffstat (limited to 'xpp/card_bri.c')
-rw-r--r-- | xpp/card_bri.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/xpp/card_bri.c b/xpp/card_bri.c index fb423a3..998d22a 100644 --- a/xpp/card_bri.c +++ b/xpp/card_bri.c @@ -151,7 +151,11 @@ typedef union { ) #define BRI_BCHAN_SIGCAP ZT_SIG_CLEAR -#define IS_NT(xpd) ((xpd)->type == XPD_TYPE_BRI_NT) +#define IS_NT(xpd) ((xpd)->type == XPD_TYPE_BRI_NT) + +/* shift in PCM highway */ +#define SUBUNIT_PCM_SHIFT 4 +#define PCM_SHIFT(mask, sunit) ((mask) << (SUBUNIT_PCM_SHIFT * (sunit))) /*---------------- BRI Protocol Commands ----------------------------------*/ @@ -723,7 +727,7 @@ static int BRI_card_zaptel_preregistration(xpd_t *xpd, bool on) for(i = 0; i < MAX_SUBUNIT; i++) { xpd_t *sub_xpd = xpd_byaddr(xbus, xpd->addr.unit, i); if(sub_xpd) { - tmp_pcm_mask |= (sub_xpd->wanted_pcm_mask << (SUBUNIT_PCM_SHIFT * i)); + tmp_pcm_mask |= PCM_SHIFT(sub_xpd->wanted_pcm_mask, i); line_count += 2; } } @@ -1077,7 +1081,7 @@ static void BRI_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t wanted_li pcm += ZT_CHUNKSIZE; } } - pcm_mask |= (wanted_lines << SUBUNIT_PCM_SHIFT * subunit); + pcm_mask |= PCM_SHIFT(wanted_lines, subunit); XPD_COUNTER(tmp_xpd, PCM_WRITE)++; spin_unlock_irqrestore(&tmp_xpd->lock, flags); } @@ -1399,6 +1403,7 @@ static xproto_table_t PROTO_TABLE(BRI_TE) = { .card_tick = BRI_card_tick, .card_pcm_fromspan = BRI_card_pcm_fromspan, .card_pcm_tospan = BRI_card_pcm_tospan, + .card_ioctl = BRI_card_ioctl, .card_close = BRI_card_close, .card_register_reply = BRI_card_register_reply, |