Lines Matching full:bch
844 struct bchannel *bch = hc->chan[ch].bch; in vpm_echocan_on() local
852 if (!bch) in vpm_echocan_on()
859 recv_Bchannel_skb(bch, skb); in vpm_echocan_on()
876 struct bchannel *bch = hc->chan[ch].bch; in vpm_echocan_off() local
885 if (!bch) in vpm_echocan_off()
892 recv_Bchannel_skb(bch, skb); in vpm_echocan_off()
1830 struct bchannel *bch = NULL; in hfcmulti_dtmf() local
1842 bch = hc->chan[ch].bch; in hfcmulti_dtmf()
1843 if (!bch) in hfcmulti_dtmf()
1847 if (!test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_dtmf()
1916 recv_Bchannel_skb(bch, skb); in hfcmulti_dtmf()
1939 struct bchannel *bch; in hfcmulti_tx() local
1944 bch = hc->chan[ch].bch; in hfcmulti_tx()
1946 if ((!dch) && (!bch)) in hfcmulti_tx()
1957 if (!test_bit(FLG_ACTIVE, &bch->Flags)) in hfcmulti_tx()
1959 sp = &bch->tx_skb; in hfcmulti_tx()
1960 idxp = &bch->tx_idx; in hfcmulti_tx()
1985 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2035 if (bch && test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_tx()
2044 if (bch && (!test_bit(FLG_HDLC, &bch->Flags)) && in hfcmulti_tx()
2078 if (bch && test_bit(FLG_FILLEMPTY, &bch->Flags) in hfcmulti_tx()
2079 && !test_bit(FLG_HDLC, &bch->Flags) && z2 == z1) { in hfcmulti_tx()
2089 if (bch && (!test_bit(FLG_HDLC, &bch->Flags)) && (!*txpending) in hfcmulti_tx()
2123 if (dch || test_bit(FLG_HDLC, &bch->Flags)) in hfcmulti_tx()
2149 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2157 if (bch && get_next_bframe(bch)) { in hfcmulti_tx()
2171 if (bch && test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_tx()
2184 struct bchannel *bch; in hfcmulti_rx() local
2189 bch = hc->chan[ch].bch; in hfcmulti_rx()
2190 if (bch) { in hfcmulti_rx()
2191 if (!test_bit(FLG_ACTIVE, &bch->Flags)) in hfcmulti_rx()
2214 if (bch) in hfcmulti_rx()
2215 bch->dropcnt += poll; /* not exact but fair enough */ in hfcmulti_rx()
2219 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2239 if ((dch || test_bit(FLG_HDLC, &bch->Flags)) && f1 != f2) in hfcmulti_rx()
2248 if (bch) { in hfcmulti_rx()
2249 maxlen = bchannel_get_rxbuf(bch, Zsize); in hfcmulti_rx()
2252 hc->id + 1, bch->nr, Zsize); in hfcmulti_rx()
2255 sp = &bch->rx_skb; in hfcmulti_rx()
2256 maxlen = bch->maxlen; in hfcmulti_rx()
2274 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2343 recv_Bchannel(bch, MISDN_ID_ANY, false); in hfcmulti_rx()
2357 /* only bch is transparent */ in hfcmulti_rx()
2358 recv_Bchannel(bch, hc->chan[ch].Zfill, false); in hfcmulti_rx()
2633 struct bchannel *bch; in fifo_irq() local
2641 bch = hc->chan[ch].bch; in fifo_irq()
2642 if (((!dch) && (!bch)) || (!hc->created[hc->chan[ch].port])) { in fifo_irq()
2653 if (bch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2654 test_bit(FLG_ACTIVE, &bch->Flags)) { in fifo_irq()
2665 if (bch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2666 test_bit(FLG_ACTIVE, &bch->Flags)) { in fifo_irq()
2993 if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) { in mode_hfcmulti()
3002 if (hc->chan[ch].bch) { in mode_hfcmulti()
3003 test_and_clear_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3005 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3114 if (hc->chan[ch].bch) in mode_hfcmulti()
3116 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3126 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) { in mode_hfcmulti()
3142 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) in mode_hfcmulti()
3149 if (hc->chan[ch].bch) { in mode_hfcmulti()
3150 test_and_set_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3439 deactivate_bchannel(struct bchannel *bch) in deactivate_bchannel() argument
3441 struct hfc_multi *hc = bch->hw; in deactivate_bchannel()
3445 mISDN_clear_bchannel(bch); in deactivate_bchannel()
3446 hc->chan[bch->slot].coeff_count = 0; in deactivate_bchannel()
3447 hc->chan[bch->slot].rx_off = 0; in deactivate_bchannel()
3448 hc->chan[bch->slot].conf = -1; in deactivate_bchannel()
3449 mode_hfcmulti(hc, bch->slot, ISDN_P_NONE, -1, 0, -1, 0); in deactivate_bchannel()
3456 struct bchannel *bch = container_of(ch, struct bchannel, ch); in handle_bmsg() local
3457 struct hfc_multi *hc = bch->hw; in handle_bmsg()
3467 ret = bchannel_senddata(bch, skb); in handle_bmsg()
3469 hfcmulti_tx(hc, bch->slot); in handle_bmsg()
3480 __func__, bch->slot); in handle_bmsg()
3483 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) { in handle_bmsg()
3484 hc->chan[bch->slot].txpending = 0; in handle_bmsg()
3485 ret = mode_hfcmulti(hc, bch->slot, in handle_bmsg()
3487 hc->chan[bch->slot].slot_tx, in handle_bmsg()
3488 hc->chan[bch->slot].bank_tx, in handle_bmsg()
3489 hc->chan[bch->slot].slot_rx, in handle_bmsg()
3490 hc->chan[bch->slot].bank_rx); in handle_bmsg()
3536 deactivate_bchannel(bch); /* locked there */ in handle_bmsg()
3551 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq) in channel_bctrl() argument
3556 struct hfc_multi *hc = bch->hw; in channel_bctrl()
3565 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3569 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3570 hc->chan[bch->slot].rx_off = !!cq->p1; in channel_bctrl()
3571 if (!hc->chan[bch->slot].rx_off) { in channel_bctrl()
3573 HFC_outb_nodebug(hc, R_FIFO, (bch->slot << 1) | 1); in channel_bctrl()
3580 __func__, bch->nr, hc->chan[bch->slot].rx_off); in channel_bctrl()
3583 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3584 hc->silence = bch->fill[0]; in channel_bctrl()
3619 hfcmulti_pcm(hc, bch->slot, in channel_bctrl()
3634 hfcmulti_pcm(hc, bch->slot, -1, 0, -1, 0); in channel_bctrl()
3642 hfcmulti_conf(hc, bch->slot, num); in channel_bctrl()
3653 hfcmulti_conf(hc, bch->slot, -1); in channel_bctrl()
3659 vpm_echocan_on(hc, bch->slot, cq->p1); in channel_bctrl()
3669 vpm_echocan_off(hc, bch->slot); in channel_bctrl()
3674 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3683 struct bchannel *bch = container_of(ch, struct bchannel, ch); in hfcm_bctrl() local
3684 struct hfc_multi *hc = bch->hw; in hfcm_bctrl()
3688 if (bch->debug & DEBUG_HW) in hfcm_bctrl()
3693 test_and_clear_bit(FLG_OPEN, &bch->Flags); in hfcm_bctrl()
3694 deactivate_bchannel(bch); /* locked there */ in hfcm_bctrl()
3702 err = channel_bctrl(bch, arg); in hfcm_bctrl()
4085 struct bchannel *bch; in open_bchannel() local
4096 bch = hc->chan[ch].bch; in open_bchannel()
4097 if (!bch) { in open_bchannel()
4098 printk(KERN_ERR "%s:internal error ch %d has no bch\n", in open_bchannel()
4102 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
4104 bch->ch.protocol = rq->protocol; in open_bchannel()
4106 rq->ch = &bch->ch; in open_bchannel()
4563 if (hc->chan[i].bch) { in release_port()
4568 pb = hc->chan[i].bch; in release_port()
4569 hc->chan[i].bch = NULL; in release_port()
4585 if (hc->chan[ci - 2].bch) { in release_port()
4591 pb = hc->chan[ci - 2].bch; in release_port()
4592 hc->chan[ci - 2].bch = NULL; in release_port()
4599 if (hc->chan[ci - 1].bch) { in release_port()
4605 pb = hc->chan[ci - 1].bch; in release_port()
4606 hc->chan[ci - 1].bch = NULL; in release_port()
4799 struct bchannel *bch; in init_e1_port() local
4822 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_e1_port()
4823 if (!bch) { in init_e1_port()
4834 kfree(bch); in init_e1_port()
4837 bch->nr = ch; in init_e1_port()
4838 bch->slot = ch; in init_e1_port()
4839 bch->debug = debug; in init_e1_port()
4840 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_e1_port()
4841 bch->hw = hc; in init_e1_port()
4842 bch->ch.send = handle_bmsg; in init_e1_port()
4843 bch->ch.ctrl = hfcm_bctrl; in init_e1_port()
4844 bch->ch.nr = ch; in init_e1_port()
4845 list_add(&bch->ch.list, &dch->dev.bchannels); in init_e1_port()
4846 hc->chan[ch].bch = bch; in init_e1_port()
4848 set_channelmap(bch->nr, dch->dev.channelmap); in init_e1_port()
4873 struct bchannel *bch; in init_multi_port() local
4895 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_multi_port()
4896 if (!bch) { in init_multi_port()
4907 kfree(bch); in init_multi_port()
4910 bch->nr = ch + 1; in init_multi_port()
4911 bch->slot = i + ch; in init_multi_port()
4912 bch->debug = debug; in init_multi_port()
4913 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_multi_port()
4914 bch->hw = hc; in init_multi_port()
4915 bch->ch.send = handle_bmsg; in init_multi_port()
4916 bch->ch.ctrl = hfcm_bctrl; in init_multi_port()
4917 bch->ch.nr = ch + 1; in init_multi_port()
4918 list_add(&bch->ch.list, &dch->dev.bchannels); in init_multi_port()
4919 hc->chan[i + ch].bch = bch; in init_multi_port()
4921 set_channelmap(bch->nr, dch->dev.channelmap); in init_multi_port()