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()
2991 if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) { in mode_hfcmulti()
3000 if (hc->chan[ch].bch) { in mode_hfcmulti()
3001 test_and_clear_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3003 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3112 if (hc->chan[ch].bch) in mode_hfcmulti()
3114 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3124 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) { in mode_hfcmulti()
3140 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) in mode_hfcmulti()
3147 if (hc->chan[ch].bch) { in mode_hfcmulti()
3148 test_and_set_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3437 deactivate_bchannel(struct bchannel *bch) in deactivate_bchannel() argument
3439 struct hfc_multi *hc = bch->hw; in deactivate_bchannel()
3443 mISDN_clear_bchannel(bch); in deactivate_bchannel()
3444 hc->chan[bch->slot].coeff_count = 0; in deactivate_bchannel()
3445 hc->chan[bch->slot].rx_off = 0; in deactivate_bchannel()
3446 hc->chan[bch->slot].conf = -1; in deactivate_bchannel()
3447 mode_hfcmulti(hc, bch->slot, ISDN_P_NONE, -1, 0, -1, 0); in deactivate_bchannel()
3454 struct bchannel *bch = container_of(ch, struct bchannel, ch); in handle_bmsg() local
3455 struct hfc_multi *hc = bch->hw; in handle_bmsg()
3465 ret = bchannel_senddata(bch, skb); in handle_bmsg()
3467 hfcmulti_tx(hc, bch->slot); in handle_bmsg()
3478 __func__, bch->slot); in handle_bmsg()
3481 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) { in handle_bmsg()
3482 hc->chan[bch->slot].txpending = 0; in handle_bmsg()
3483 ret = mode_hfcmulti(hc, bch->slot, in handle_bmsg()
3485 hc->chan[bch->slot].slot_tx, in handle_bmsg()
3486 hc->chan[bch->slot].bank_tx, in handle_bmsg()
3487 hc->chan[bch->slot].slot_rx, in handle_bmsg()
3488 hc->chan[bch->slot].bank_rx); in handle_bmsg()
3534 deactivate_bchannel(bch); /* locked there */ in handle_bmsg()
3549 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq) in channel_bctrl() argument
3554 struct hfc_multi *hc = bch->hw; in channel_bctrl()
3563 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3567 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3568 hc->chan[bch->slot].rx_off = !!cq->p1; in channel_bctrl()
3569 if (!hc->chan[bch->slot].rx_off) { in channel_bctrl()
3571 HFC_outb_nodebug(hc, R_FIFO, (bch->slot << 1) | 1); in channel_bctrl()
3578 __func__, bch->nr, hc->chan[bch->slot].rx_off); in channel_bctrl()
3581 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3582 hc->silence = bch->fill[0]; in channel_bctrl()
3617 hfcmulti_pcm(hc, bch->slot, in channel_bctrl()
3632 hfcmulti_pcm(hc, bch->slot, -1, 0, -1, 0); in channel_bctrl()
3640 hfcmulti_conf(hc, bch->slot, num); in channel_bctrl()
3651 hfcmulti_conf(hc, bch->slot, -1); in channel_bctrl()
3657 vpm_echocan_on(hc, bch->slot, cq->p1); in channel_bctrl()
3667 vpm_echocan_off(hc, bch->slot); in channel_bctrl()
3672 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3681 struct bchannel *bch = container_of(ch, struct bchannel, ch); in hfcm_bctrl() local
3682 struct hfc_multi *hc = bch->hw; in hfcm_bctrl()
3686 if (bch->debug & DEBUG_HW) in hfcm_bctrl()
3691 test_and_clear_bit(FLG_OPEN, &bch->Flags); in hfcm_bctrl()
3692 deactivate_bchannel(bch); /* locked there */ in hfcm_bctrl()
3700 err = channel_bctrl(bch, arg); in hfcm_bctrl()
4083 struct bchannel *bch; in open_bchannel() local
4094 bch = hc->chan[ch].bch; in open_bchannel()
4095 if (!bch) { in open_bchannel()
4096 printk(KERN_ERR "%s:internal error ch %d has no bch\n", in open_bchannel()
4100 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
4102 bch->ch.protocol = rq->protocol; in open_bchannel()
4104 rq->ch = &bch->ch; in open_bchannel()
4561 if (hc->chan[i].bch) { in release_port()
4566 pb = hc->chan[i].bch; in release_port()
4567 hc->chan[i].bch = NULL; in release_port()
4583 if (hc->chan[ci - 2].bch) { in release_port()
4589 pb = hc->chan[ci - 2].bch; in release_port()
4590 hc->chan[ci - 2].bch = NULL; in release_port()
4597 if (hc->chan[ci - 1].bch) { in release_port()
4603 pb = hc->chan[ci - 1].bch; in release_port()
4604 hc->chan[ci - 1].bch = NULL; in release_port()
4797 struct bchannel *bch; in init_e1_port() local
4820 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_e1_port()
4821 if (!bch) { in init_e1_port()
4832 kfree(bch); in init_e1_port()
4835 bch->nr = ch; in init_e1_port()
4836 bch->slot = ch; in init_e1_port()
4837 bch->debug = debug; in init_e1_port()
4838 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_e1_port()
4839 bch->hw = hc; in init_e1_port()
4840 bch->ch.send = handle_bmsg; in init_e1_port()
4841 bch->ch.ctrl = hfcm_bctrl; in init_e1_port()
4842 bch->ch.nr = ch; in init_e1_port()
4843 list_add(&bch->ch.list, &dch->dev.bchannels); in init_e1_port()
4844 hc->chan[ch].bch = bch; in init_e1_port()
4846 set_channelmap(bch->nr, dch->dev.channelmap); in init_e1_port()
4871 struct bchannel *bch; in init_multi_port() local
4893 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_multi_port()
4894 if (!bch) { in init_multi_port()
4905 kfree(bch); in init_multi_port()
4908 bch->nr = ch + 1; in init_multi_port()
4909 bch->slot = i + ch; in init_multi_port()
4910 bch->debug = debug; in init_multi_port()
4911 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_multi_port()
4912 bch->hw = hc; in init_multi_port()
4913 bch->ch.send = handle_bmsg; in init_multi_port()
4914 bch->ch.ctrl = hfcm_bctrl; in init_multi_port()
4915 bch->ch.nr = ch + 1; in init_multi_port()
4916 list_add(&bch->ch.list, &dch->dev.bchannels); in init_multi_port()
4917 hc->chan[i + ch].bch = bch; in init_multi_port()
4919 set_channelmap(bch->nr, dch->dev.channelmap); in init_multi_port()