Lines Matching refs:bch

858 	struct bchannel *bch = hc->chan[ch].bch;  in vpm_echocan_on()  local
866 if (!bch) in vpm_echocan_on()
873 recv_Bchannel_skb(bch, skb); in vpm_echocan_on()
890 struct bchannel *bch = hc->chan[ch].bch; in vpm_echocan_off() local
899 if (!bch) in vpm_echocan_off()
906 recv_Bchannel_skb(bch, skb); in vpm_echocan_off()
1844 struct bchannel *bch = NULL; in hfcmulti_dtmf() local
1856 bch = hc->chan[ch].bch; in hfcmulti_dtmf()
1857 if (!bch) in hfcmulti_dtmf()
1861 if (!test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_dtmf()
1930 recv_Bchannel_skb(bch, skb); in hfcmulti_dtmf()
1953 struct bchannel *bch; in hfcmulti_tx() local
1958 bch = hc->chan[ch].bch; in hfcmulti_tx()
1960 if ((!dch) && (!bch)) in hfcmulti_tx()
1971 if (!test_bit(FLG_ACTIVE, &bch->Flags)) in hfcmulti_tx()
1973 sp = &bch->tx_skb; in hfcmulti_tx()
1974 idxp = &bch->tx_idx; in hfcmulti_tx()
1999 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2049 if (bch && test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_tx()
2058 if (bch && (!test_bit(FLG_HDLC, &bch->Flags)) && in hfcmulti_tx()
2092 if (bch && test_bit(FLG_FILLEMPTY, &bch->Flags) in hfcmulti_tx()
2093 && !test_bit(FLG_HDLC, &bch->Flags) && z2 == z1) { in hfcmulti_tx()
2103 if (bch && (!test_bit(FLG_HDLC, &bch->Flags)) && (!*txpending) in hfcmulti_tx()
2137 if (dch || test_bit(FLG_HDLC, &bch->Flags)) in hfcmulti_tx()
2163 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2171 if (bch && get_next_bframe(bch)) { in hfcmulti_tx()
2185 if (bch && test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_tx()
2198 struct bchannel *bch; in hfcmulti_rx() local
2203 bch = hc->chan[ch].bch; in hfcmulti_rx()
2204 if (bch) { in hfcmulti_rx()
2205 if (!test_bit(FLG_ACTIVE, &bch->Flags)) in hfcmulti_rx()
2228 if (bch) in hfcmulti_rx()
2229 bch->dropcnt += poll; /* not exact but fair enough */ in hfcmulti_rx()
2233 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2253 if ((dch || test_bit(FLG_HDLC, &bch->Flags)) && f1 != f2) in hfcmulti_rx()
2262 if (bch) { in hfcmulti_rx()
2263 maxlen = bchannel_get_rxbuf(bch, Zsize); in hfcmulti_rx()
2266 hc->id + 1, bch->nr, Zsize); in hfcmulti_rx()
2269 sp = &bch->rx_skb; in hfcmulti_rx()
2270 maxlen = bch->maxlen; in hfcmulti_rx()
2288 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2358 recv_Bchannel(bch, MISDN_ID_ANY, false); in hfcmulti_rx()
2373 recv_Bchannel(bch, hc->chan[ch].Zfill, false); in hfcmulti_rx()
2648 struct bchannel *bch; in fifo_irq() local
2656 bch = hc->chan[ch].bch; in fifo_irq()
2657 if (((!dch) && (!bch)) || (!hc->created[hc->chan[ch].port])) { in fifo_irq()
2668 if (bch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2669 test_bit(FLG_ACTIVE, &bch->Flags)) { in fifo_irq()
2680 if (bch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2681 test_bit(FLG_ACTIVE, &bch->Flags)) { in fifo_irq()
3008 if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) { in mode_hfcmulti()
3017 if (hc->chan[ch].bch) { in mode_hfcmulti()
3018 test_and_clear_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3020 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3129 if (hc->chan[ch].bch) in mode_hfcmulti()
3131 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3141 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) { in mode_hfcmulti()
3157 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) in mode_hfcmulti()
3164 if (hc->chan[ch].bch) { in mode_hfcmulti()
3165 test_and_set_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3454 deactivate_bchannel(struct bchannel *bch) in deactivate_bchannel() argument
3456 struct hfc_multi *hc = bch->hw; in deactivate_bchannel()
3460 mISDN_clear_bchannel(bch); in deactivate_bchannel()
3461 hc->chan[bch->slot].coeff_count = 0; in deactivate_bchannel()
3462 hc->chan[bch->slot].rx_off = 0; in deactivate_bchannel()
3463 hc->chan[bch->slot].conf = -1; in deactivate_bchannel()
3464 mode_hfcmulti(hc, bch->slot, ISDN_P_NONE, -1, 0, -1, 0); in deactivate_bchannel()
3471 struct bchannel *bch = container_of(ch, struct bchannel, ch); in handle_bmsg() local
3472 struct hfc_multi *hc = bch->hw; in handle_bmsg()
3482 ret = bchannel_senddata(bch, skb); in handle_bmsg()
3484 hfcmulti_tx(hc, bch->slot); in handle_bmsg()
3495 __func__, bch->slot); in handle_bmsg()
3498 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) { in handle_bmsg()
3499 hc->chan[bch->slot].txpending = 0; in handle_bmsg()
3500 ret = mode_hfcmulti(hc, bch->slot, in handle_bmsg()
3502 hc->chan[bch->slot].slot_tx, in handle_bmsg()
3503 hc->chan[bch->slot].bank_tx, in handle_bmsg()
3504 hc->chan[bch->slot].slot_rx, in handle_bmsg()
3505 hc->chan[bch->slot].bank_rx); in handle_bmsg()
3551 deactivate_bchannel(bch); /* locked there */ in handle_bmsg()
3566 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq) in channel_bctrl() argument
3571 struct hfc_multi *hc = bch->hw; in channel_bctrl()
3580 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3584 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3585 hc->chan[bch->slot].rx_off = !!cq->p1; in channel_bctrl()
3586 if (!hc->chan[bch->slot].rx_off) { in channel_bctrl()
3588 HFC_outb_nodebug(hc, R_FIFO, (bch->slot << 1) | 1); in channel_bctrl()
3595 __func__, bch->nr, hc->chan[bch->slot].rx_off); in channel_bctrl()
3598 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3599 hc->silence = bch->fill[0]; in channel_bctrl()
3634 hfcmulti_pcm(hc, bch->slot, in channel_bctrl()
3649 hfcmulti_pcm(hc, bch->slot, -1, 0, -1, 0); in channel_bctrl()
3657 hfcmulti_conf(hc, bch->slot, num); in channel_bctrl()
3668 hfcmulti_conf(hc, bch->slot, -1); in channel_bctrl()
3674 vpm_echocan_on(hc, bch->slot, cq->p1); in channel_bctrl()
3684 vpm_echocan_off(hc, bch->slot); in channel_bctrl()
3689 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3698 struct bchannel *bch = container_of(ch, struct bchannel, ch); in hfcm_bctrl() local
3699 struct hfc_multi *hc = bch->hw; in hfcm_bctrl()
3703 if (bch->debug & DEBUG_HW) in hfcm_bctrl()
3708 test_and_clear_bit(FLG_OPEN, &bch->Flags); in hfcm_bctrl()
3709 deactivate_bchannel(bch); /* locked there */ in hfcm_bctrl()
3717 err = channel_bctrl(bch, arg); in hfcm_bctrl()
4104 struct bchannel *bch; in open_bchannel() local
4115 bch = hc->chan[ch].bch; in open_bchannel()
4116 if (!bch) { in open_bchannel()
4121 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
4123 bch->ch.protocol = rq->protocol; in open_bchannel()
4125 rq->ch = &bch->ch; in open_bchannel()
4581 if (hc->chan[i].bch) { in release_port()
4586 pb = hc->chan[i].bch; in release_port()
4587 hc->chan[i].bch = NULL; in release_port()
4603 if (hc->chan[ci - 2].bch) { in release_port()
4609 pb = hc->chan[ci - 2].bch; in release_port()
4610 hc->chan[ci - 2].bch = NULL; in release_port()
4617 if (hc->chan[ci - 1].bch) { in release_port()
4623 pb = hc->chan[ci - 1].bch; in release_port()
4624 hc->chan[ci - 1].bch = NULL; in release_port()
4817 struct bchannel *bch; in init_e1_port() local
4840 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_e1_port()
4841 if (!bch) { in init_e1_port()
4852 kfree(bch); in init_e1_port()
4855 bch->nr = ch; in init_e1_port()
4856 bch->slot = ch; in init_e1_port()
4857 bch->debug = debug; in init_e1_port()
4858 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_e1_port()
4859 bch->hw = hc; in init_e1_port()
4860 bch->ch.send = handle_bmsg; in init_e1_port()
4861 bch->ch.ctrl = hfcm_bctrl; in init_e1_port()
4862 bch->ch.nr = ch; in init_e1_port()
4863 list_add(&bch->ch.list, &dch->dev.bchannels); in init_e1_port()
4864 hc->chan[ch].bch = bch; in init_e1_port()
4866 set_channelmap(bch->nr, dch->dev.channelmap); in init_e1_port()
4891 struct bchannel *bch; in init_multi_port() local
4913 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_multi_port()
4914 if (!bch) { in init_multi_port()
4925 kfree(bch); in init_multi_port()
4928 bch->nr = ch + 1; in init_multi_port()
4929 bch->slot = i + ch; in init_multi_port()
4930 bch->debug = debug; in init_multi_port()
4931 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_multi_port()
4932 bch->hw = hc; in init_multi_port()
4933 bch->ch.send = handle_bmsg; in init_multi_port()
4934 bch->ch.ctrl = hfcm_bctrl; in init_multi_port()
4935 bch->ch.nr = ch + 1; in init_multi_port()
4936 list_add(&bch->ch.list, &dch->dev.bchannels); in init_multi_port()
4937 hc->chan[i + ch].bch = bch; in init_multi_port()
4939 set_channelmap(bch->nr, dch->dev.channelmap); in init_multi_port()