Lines Matching full:bch

813 	struct bchannel *bch = hc->chan[ch].bch;  in vpm_echocan_on()  local
821 if (!bch) in vpm_echocan_on()
828 recv_Bchannel_skb(bch, skb); in vpm_echocan_on()
845 struct bchannel *bch = hc->chan[ch].bch; in vpm_echocan_off() local
854 if (!bch) in vpm_echocan_off()
861 recv_Bchannel_skb(bch, skb); in vpm_echocan_off()
1799 struct bchannel *bch = NULL; in hfcmulti_dtmf() local
1811 bch = hc->chan[ch].bch; in hfcmulti_dtmf()
1812 if (!bch) in hfcmulti_dtmf()
1816 if (!test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_dtmf()
1885 recv_Bchannel_skb(bch, skb); in hfcmulti_dtmf()
1908 struct bchannel *bch; in hfcmulti_tx() local
1913 bch = hc->chan[ch].bch; in hfcmulti_tx()
1915 if ((!dch) && (!bch)) in hfcmulti_tx()
1926 if (!test_bit(FLG_ACTIVE, &bch->Flags)) in hfcmulti_tx()
1928 sp = &bch->tx_skb; in hfcmulti_tx()
1929 idxp = &bch->tx_idx; in hfcmulti_tx()
1954 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2004 if (bch && test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_tx()
2013 if (bch && (!test_bit(FLG_HDLC, &bch->Flags)) && in hfcmulti_tx()
2047 if (bch && test_bit(FLG_FILLEMPTY, &bch->Flags) in hfcmulti_tx()
2048 && !test_bit(FLG_HDLC, &bch->Flags) && z2 == z1) { in hfcmulti_tx()
2058 if (bch && (!test_bit(FLG_HDLC, &bch->Flags)) && (!*txpending) in hfcmulti_tx()
2092 if (dch || test_bit(FLG_HDLC, &bch->Flags)) in hfcmulti_tx()
2118 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2127 if (bch && get_next_bframe(bch)) { in hfcmulti_tx()
2141 if (bch && test_bit(FLG_TRANSPARENT, &bch->Flags)) in hfcmulti_tx()
2154 struct bchannel *bch; in hfcmulti_rx() local
2159 bch = hc->chan[ch].bch; in hfcmulti_rx()
2160 if (bch) { in hfcmulti_rx()
2161 if (!test_bit(FLG_ACTIVE, &bch->Flags)) in hfcmulti_rx()
2184 if (bch) in hfcmulti_rx()
2185 bch->dropcnt += poll; /* not exact but fair enough */ in hfcmulti_rx()
2189 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2209 if ((dch || test_bit(FLG_HDLC, &bch->Flags)) && f1 != f2) in hfcmulti_rx()
2218 if (bch) { in hfcmulti_rx()
2219 maxlen = bchannel_get_rxbuf(bch, Zsize); in hfcmulti_rx()
2222 hc->id + 1, bch->nr, Zsize); in hfcmulti_rx()
2225 sp = &bch->rx_skb; in hfcmulti_rx()
2226 maxlen = bch->maxlen; in hfcmulti_rx()
2244 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2313 recv_Bchannel(bch, MISDN_ID_ANY, false); in hfcmulti_rx()
2327 /* only bch is transparent */ in hfcmulti_rx()
2328 recv_Bchannel(bch, hc->chan[ch].Zfill, false); in hfcmulti_rx()
2603 struct bchannel *bch; in fifo_irq() local
2611 bch = hc->chan[ch].bch; in fifo_irq()
2612 if (((!dch) && (!bch)) || (!hc->created[hc->chan[ch].port])) { in fifo_irq()
2623 if (bch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2624 test_bit(FLG_ACTIVE, &bch->Flags)) { in fifo_irq()
2635 if (bch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2636 test_bit(FLG_ACTIVE, &bch->Flags)) { in fifo_irq()
2961 if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) { in mode_hfcmulti()
2970 if (hc->chan[ch].bch) { in mode_hfcmulti()
2971 test_and_clear_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
2973 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3082 if (hc->chan[ch].bch) in mode_hfcmulti()
3084 &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3094 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) { in mode_hfcmulti()
3110 if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) in mode_hfcmulti()
3117 if (hc->chan[ch].bch) { in mode_hfcmulti()
3118 test_and_set_bit(FLG_HDLC, &hc->chan[ch].bch->Flags); in mode_hfcmulti()
3414 deactivate_bchannel(struct bchannel *bch) in deactivate_bchannel() argument
3416 struct hfc_multi *hc = bch->hw; in deactivate_bchannel()
3420 mISDN_clear_bchannel(bch); in deactivate_bchannel()
3421 hc->chan[bch->slot].coeff_count = 0; in deactivate_bchannel()
3422 hc->chan[bch->slot].rx_off = 0; in deactivate_bchannel()
3423 hc->chan[bch->slot].conf = -1; in deactivate_bchannel()
3424 mode_hfcmulti(hc, bch->slot, ISDN_P_NONE, -1, 0, -1, 0); in deactivate_bchannel()
3431 struct bchannel *bch = container_of(ch, struct bchannel, ch); in handle_bmsg() local
3432 struct hfc_multi *hc = bch->hw; in handle_bmsg()
3442 ret = bchannel_senddata(bch, skb); in handle_bmsg()
3444 hfcmulti_tx(hc, bch->slot); in handle_bmsg()
3455 __func__, bch->slot); in handle_bmsg()
3458 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) { in handle_bmsg()
3459 hc->chan[bch->slot].txpending = 0; in handle_bmsg()
3460 ret = mode_hfcmulti(hc, bch->slot, in handle_bmsg()
3462 hc->chan[bch->slot].slot_tx, in handle_bmsg()
3463 hc->chan[bch->slot].bank_tx, in handle_bmsg()
3464 hc->chan[bch->slot].slot_rx, in handle_bmsg()
3465 hc->chan[bch->slot].bank_rx); in handle_bmsg()
3511 deactivate_bchannel(bch); /* locked there */ in handle_bmsg()
3526 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq) in channel_bctrl() argument
3531 struct hfc_multi *hc = bch->hw; in channel_bctrl()
3540 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3544 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3545 hc->chan[bch->slot].rx_off = !!cq->p1; in channel_bctrl()
3546 if (!hc->chan[bch->slot].rx_off) { in channel_bctrl()
3548 HFC_outb_nodebug(hc, R_FIFO, (bch->slot << 1) | 1); in channel_bctrl()
3555 __func__, bch->nr, hc->chan[bch->slot].rx_off); in channel_bctrl()
3558 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3559 hc->silence = bch->fill[0]; in channel_bctrl()
3594 hfcmulti_pcm(hc, bch->slot, in channel_bctrl()
3609 hfcmulti_pcm(hc, bch->slot, -1, 0, -1, 0); in channel_bctrl()
3617 hfcmulti_conf(hc, bch->slot, num); in channel_bctrl()
3628 hfcmulti_conf(hc, bch->slot, -1); in channel_bctrl()
3634 vpm_echocan_on(hc, bch->slot, cq->p1); in channel_bctrl()
3644 vpm_echocan_off(hc, bch->slot); in channel_bctrl()
3649 ret = mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
3658 struct bchannel *bch = container_of(ch, struct bchannel, ch); in hfcm_bctrl() local
3659 struct hfc_multi *hc = bch->hw; in hfcm_bctrl()
3663 if (bch->debug & DEBUG_HW) in hfcm_bctrl()
3668 test_and_clear_bit(FLG_OPEN, &bch->Flags); in hfcm_bctrl()
3669 deactivate_bchannel(bch); /* locked there */ in hfcm_bctrl()
3677 err = channel_bctrl(bch, arg); in hfcm_bctrl()
4060 struct bchannel *bch; in open_bchannel() local
4071 bch = hc->chan[ch].bch; in open_bchannel()
4072 if (!bch) { in open_bchannel()
4073 printk(KERN_ERR "%s:internal error ch %d has no bch\n", in open_bchannel()
4077 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
4079 bch->ch.protocol = rq->protocol; in open_bchannel()
4081 rq->ch = &bch->ch; in open_bchannel()
4538 if (hc->chan[i].bch) { in release_port()
4543 pb = hc->chan[i].bch; in release_port()
4544 hc->chan[i].bch = NULL; in release_port()
4560 if (hc->chan[ci - 2].bch) { in release_port()
4566 pb = hc->chan[ci - 2].bch; in release_port()
4567 hc->chan[ci - 2].bch = NULL; in release_port()
4574 if (hc->chan[ci - 1].bch) { in release_port()
4580 pb = hc->chan[ci - 1].bch; in release_port()
4581 hc->chan[ci - 1].bch = NULL; in release_port()
4774 struct bchannel *bch; in init_e1_port() local
4797 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_e1_port()
4798 if (!bch) { in init_e1_port()
4809 kfree(bch); in init_e1_port()
4812 bch->nr = ch; in init_e1_port()
4813 bch->slot = ch; in init_e1_port()
4814 bch->debug = debug; in init_e1_port()
4815 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_e1_port()
4816 bch->hw = hc; in init_e1_port()
4817 bch->ch.send = handle_bmsg; in init_e1_port()
4818 bch->ch.ctrl = hfcm_bctrl; in init_e1_port()
4819 bch->ch.nr = ch; in init_e1_port()
4820 list_add(&bch->ch.list, &dch->dev.bchannels); in init_e1_port()
4821 hc->chan[ch].bch = bch; in init_e1_port()
4823 set_channelmap(bch->nr, dch->dev.channelmap); in init_e1_port()
4848 struct bchannel *bch; in init_multi_port() local
4870 bch = kzalloc(sizeof(struct bchannel), GFP_KERNEL); in init_multi_port()
4871 if (!bch) { in init_multi_port()
4882 kfree(bch); in init_multi_port()
4885 bch->nr = ch + 1; in init_multi_port()
4886 bch->slot = i + ch; in init_multi_port()
4887 bch->debug = debug; in init_multi_port()
4888 mISDN_initbchannel(bch, MAX_DATA_MEM, poll >> 1); in init_multi_port()
4889 bch->hw = hc; in init_multi_port()
4890 bch->ch.send = handle_bmsg; in init_multi_port()
4891 bch->ch.ctrl = hfcm_bctrl; in init_multi_port()
4892 bch->ch.nr = ch + 1; in init_multi_port()
4893 list_add(&bch->ch.list, &dch->dev.bchannels); in init_multi_port()
4894 hc->chan[i + ch].bch = bch; in init_multi_port()
4896 set_channelmap(bch->nr, dch->dev.channelmap); in init_multi_port()