Lines Matching full:bch
814 struct bchannel *bch = hc->chan[ch].bch; in vpm_echocan_on() local
822 if (!bch) in vpm_echocan_on()
829 recv_Bchannel_skb(bch, skb); in vpm_echocan_on()
846 struct bchannel *bch = hc->chan[ch].bch; in vpm_echocan_off() local
855 if (!bch) in vpm_echocan_off()
862 recv_Bchannel_skb(bch, skb); in vpm_echocan_off()
1800 struct bchannel *bch = NULL; in hfcmulti_dtmf() local
1812 bch = hc->chan[ch].bch; in hfcmulti_dtmf()
1813 if (!bch) in hfcmulti_dtmf()
1817 if (!test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_dtmf()
1886 recv_Bchannel_skb(bch, skb); in hfcmulti_dtmf()
1909 struct bchannel *bch; in hfcmulti_tx() local
1914 bch = hc->chan[ch].bch; in hfcmulti_tx()
1916 if ((!dch) && (!bch)) in hfcmulti_tx()
1927 if (!test_bit(FLG_ACTIVE, &bch->Flags)) in hfcmulti_tx()
1929 sp = &bch->tx_skb; in hfcmulti_tx()
1930 idxp = &bch->tx_idx; in hfcmulti_tx()
1955 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2005 if (bch && test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_tx()
2014 if (bch && (!test_bit(FLG_HDLC, &bch->Flags)) && in hfcmulti_tx()
2048 if (bch && test_bit(FLG_FILLEMPTY, &bch->Flags) in hfcmulti_tx()
2049 && !test_bit(FLG_HDLC, &bch->Flags) && z2 == z1) { in hfcmulti_tx()
2059 if (bch && (!test_bit(FLG_HDLC, &bch->Flags)) && (!*txpending) in hfcmulti_tx()
2093 if (dch || test_bit(FLG_HDLC, &bch->Flags)) in hfcmulti_tx()
2119 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2128 if (bch && get_next_bframe(bch)) { in hfcmulti_tx()
2142 if (bch && test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_tx()
2155 struct bchannel *bch; in hfcmulti_rx() local
2160 bch = hc->chan[ch].bch; in hfcmulti_rx()
2161 if (bch) { in hfcmulti_rx()
2162 if (!test_bit(FLG_ACTIVE, &bch->Flags)) in hfcmulti_rx()
2185 if (bch) in hfcmulti_rx()
2186 bch->dropcnt += poll; /* not exact but fair enough */ in hfcmulti_rx()
2190 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2210 if ((dch || test_bit(FLG_HDLC, &bch->Flags)) && f1 != f2) in hfcmulti_rx()
2219 if (bch) { in hfcmulti_rx()
2220 maxlen = bchannel_get_rxbuf(bch, Zsize); in hfcmulti_rx()
2223 hc->id + 1, bch->nr, Zsize); in hfcmulti_rx()
2226 sp = &bch->rx_skb; in hfcmulti_rx()
2227 maxlen = bch->maxlen; in hfcmulti_rx()
2245 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2314 recv_Bchannel(bch, MISDN_ID_ANY, false); in hfcmulti_rx()
2328 /* only bch is transparent */ in hfcmulti_rx()
2329 recv_Bchannel(bch, hc->chan[ch].Zfill, false); in hfcmulti_rx()
2604 struct bchannel *bch; in fifo_irq() local
2612 bch = hc->chan[ch].bch; in fifo_irq()
2613 if (((!dch) && (!bch)) || (!hc->created[hc->chan[ch].port])) { in fifo_irq()
2624 if (bch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2625 test_bit(FLG_ACTIVE, &bch->Flags)) { in fifo_irq()
2636 if (bch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2637 test_bit(FLG_ACTIVE, &bch->Flags)) { in fifo_irq()
2962 if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) { in mode_hfcmulti()
2971 if (hc->chan[ch].bch) { in mode_hfcmulti()
2972 test_and_clear_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
2974 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3083 if (hc->chan[ch].bch) in mode_hfcmulti()
3085 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3095 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) { in mode_hfcmulti()
3111 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) in mode_hfcmulti()
3118 if (hc->chan[ch].bch) { in mode_hfcmulti()
3119 test_and_set_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3415 deactivate_bchannel(struct bchannel *bch) in deactivate_bchannel() argument
3417 struct hfc_multi *hc = bch->hw; in deactivate_bchannel()
3421 mISDN_clear_bchannel(bch); in deactivate_bchannel()
3422 hc->chan[bch->slot].coeff_count = 0; in deactivate_bchannel()
3423 hc->chan[bch->slot].rx_off = 0; in deactivate_bchannel()
3424 hc->chan[bch->slot].conf = -1; in deactivate_bchannel()
3425 mode_hfcmulti(hc, bch->slot, ISDN_P_NONE, -1, 0, -1, 0); in deactivate_bchannel()
3432 struct bchannel *bch = container_of(ch, struct bchannel, ch); in handle_bmsg() local
3433 struct hfc_multi *hc = bch->hw; in handle_bmsg()
3443 ret = bchannel_senddata(bch, skb); in handle_bmsg()
3445 hfcmulti_tx(hc, bch->slot); in handle_bmsg()
3456 __func__, bch->slot); in handle_bmsg()
3459 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) { in handle_bmsg()
3460 hc->chan[bch->slot].txpending = 0; in handle_bmsg()
3461 ret = mode_hfcmulti(hc, bch->slot, in handle_bmsg()
3463 hc->chan[bch->slot].slot_tx, in handle_bmsg()
3464 hc->chan[bch->slot].bank_tx, in handle_bmsg()
3465 hc->chan[bch->slot].slot_rx, in handle_bmsg()
3466 hc->chan[bch->slot].bank_rx); in handle_bmsg()
3512 deactivate_bchannel(bch); /* locked there */ in handle_bmsg()
3527 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq) in channel_bctrl() argument
3532 struct hfc_multi *hc = bch->hw; in channel_bctrl()
3541 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3545 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3546 hc->chan[bch->slot].rx_off = !!cq->p1; in channel_bctrl()
3547 if (!hc->chan[bch->slot].rx_off) { in channel_bctrl()
3549 HFC_outb_nodebug(hc, R_FIFO, (bch->slot << 1) | 1); in channel_bctrl()
3556 __func__, bch->nr, hc->chan[bch->slot].rx_off); in channel_bctrl()
3559 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3560 hc->silence = bch->fill[0]; in channel_bctrl()
3595 hfcmulti_pcm(hc, bch->slot, in channel_bctrl()
3610 hfcmulti_pcm(hc, bch->slot, -1, 0, -1, 0); in channel_bctrl()
3618 hfcmulti_conf(hc, bch->slot, num); in channel_bctrl()
3629 hfcmulti_conf(hc, bch->slot, -1); in channel_bctrl()
3635 vpm_echocan_on(hc, bch->slot, cq->p1); in channel_bctrl()
3645 vpm_echocan_off(hc, bch->slot); in channel_bctrl()
3650 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3659 struct bchannel *bch = container_of(ch, struct bchannel, ch); in hfcm_bctrl() local
3660 struct hfc_multi *hc = bch->hw; in hfcm_bctrl()
3664 if (bch->debug & DEBUG_HW) in hfcm_bctrl()
3669 test_and_clear_bit(FLG_OPEN, &bch->Flags); in hfcm_bctrl()
3670 deactivate_bchannel(bch); /* locked there */ in hfcm_bctrl()
3678 err = channel_bctrl(bch, arg); in hfcm_bctrl()
4061 struct bchannel *bch; in open_bchannel() local
4072 bch = hc->chan[ch].bch; in open_bchannel()
4073 if (!bch) { in open_bchannel()
4074 printk(KERN_ERR "%s:internal error ch %d has no bch\n", in open_bchannel()
4078 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
4080 bch->ch.protocol = rq->protocol; in open_bchannel()
4082 rq->ch = &bch->ch; in open_bchannel()
4539 if (hc->chan[i].bch) { in release_port()
4544 pb = hc->chan[i].bch; in release_port()
4545 hc->chan[i].bch = NULL; in release_port()
4561 if (hc->chan[ci - 2].bch) { in release_port()
4567 pb = hc->chan[ci - 2].bch; in release_port()
4568 hc->chan[ci - 2].bch = NULL; in release_port()
4575 if (hc->chan[ci - 1].bch) { in release_port()
4581 pb = hc->chan[ci - 1].bch; in release_port()
4582 hc->chan[ci - 1].bch = NULL; in release_port()
4775 struct bchannel *bch; in init_e1_port() local
4798 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_e1_port()
4799 if (!bch) { in init_e1_port()
4810 kfree(bch); in init_e1_port()
4813 bch->nr = ch; in init_e1_port()
4814 bch->slot = ch; in init_e1_port()
4815 bch->debug = debug; in init_e1_port()
4816 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_e1_port()
4817 bch->hw = hc; in init_e1_port()
4818 bch->ch.send = handle_bmsg; in init_e1_port()
4819 bch->ch.ctrl = hfcm_bctrl; in init_e1_port()
4820 bch->ch.nr = ch; in init_e1_port()
4821 list_add(&bch->ch.list, &dch->dev.bchannels); in init_e1_port()
4822 hc->chan[ch].bch = bch; in init_e1_port()
4824 set_channelmap(bch->nr, dch->dev.channelmap); in init_e1_port()
4849 struct bchannel *bch; in init_multi_port() local
4871 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_multi_port()
4872 if (!bch) { in init_multi_port()
4883 kfree(bch); in init_multi_port()
4886 bch->nr = ch + 1; in init_multi_port()
4887 bch->slot = i + ch; in init_multi_port()
4888 bch->debug = debug; in init_multi_port()
4889 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_multi_port()
4890 bch->hw = hc; in init_multi_port()
4891 bch->ch.send = handle_bmsg; in init_multi_port()
4892 bch->ch.ctrl = hfcm_bctrl; in init_multi_port()
4893 bch->ch.nr = ch + 1; in init_multi_port()
4894 list_add(&bch->ch.list, &dch->dev.bchannels); in init_multi_port()
4895 hc->chan[i + ch].bch = bch; in init_multi_port()
4897 set_channelmap(bch->nr, dch->dev.channelmap); in init_multi_port()