Lines Matching full:bch

42 	struct bchannel		bch;  member
96 card->bc[0].bch.debug = debug; in _set_debug()
97 card->bc[1].bch.debug = debug; in _set_debug()
178 struct tiger_hw *card = bc->bch.hw; in fill_mem()
182 bc->bch.nr, fill, cnt, idx, card->send.idx); in fill_mem()
183 if (bc->bch.nr & 2) { in fill_mem()
201 struct tiger_hw *card = bc->bch.hw; in mode_tiger()
204 bc->bch.nr, bc->bch.state, protocol); in mode_tiger()
207 if (bc->bch.state == ISDN_P_NONE) in mode_tiger()
210 bc->bch.state = protocol; in mode_tiger()
212 if ((card->bc[0].bch.state == ISDN_P_NONE) && in mode_tiger()
213 (card->bc[1].bch.state == ISDN_P_NONE)) { in mode_tiger()
218 test_and_clear_bit(FLG_HDLC, &bc->bch.Flags); in mode_tiger()
219 test_and_clear_bit(FLG_TRANSPARENT, &bc->bch.Flags); in mode_tiger()
225 test_and_set_bit(FLG_TRANSPARENT, &bc->bch.Flags); in mode_tiger()
226 bc->bch.state = protocol; in mode_tiger()
239 test_and_set_bit(FLG_HDLC, &bc->bch.Flags); in mode_tiger()
240 bc->bch.state = protocol; in mode_tiger()
366 struct tiger_hw *card = bc->bch.hw; in read_dma()
374 bc->bch.nr, idx); in read_dma()
377 if (test_bit(FLG_RX_OFF, &bc->bch.Flags)) { in read_dma()
378 bc->bch.dropcnt += cnt; in read_dma()
381 stat = bchannel_get_rxbuf(&bc->bch, cnt); in read_dma()
385 card->name, bc->bch.nr, cnt); in read_dma()
388 if (test_bit(FLG_TRANSPARENT, &bc->bch.Flags)) in read_dma()
389 p = skb_put(bc->bch.rx_skb, cnt); in read_dma()
395 if (bc->bch.nr & 2) in read_dma()
402 if (test_bit(FLG_TRANSPARENT, &bc->bch.Flags)) { in read_dma()
403 recv_Bchannel(&bc->bch, 0, false); in read_dma()
410 bc->bch.rx_skb->data, bc->bch.maxlen); in read_dma()
412 p = skb_put(bc->bch.rx_skb, stat); in read_dma()
415 "B%1d-recv %s %d ", bc->bch.nr, in read_dma()
421 recv_Bchannel(&bc->bch, 0, false); in read_dma()
422 stat = bchannel_get_rxbuf(&bc->bch, bc->bch.maxlen); in read_dma()
425 card->name, bc->bch.nr, cnt); in read_dma()
430 card->name, bc->bch.nr); in read_dma()
433 card->name, bc->bch.nr); in read_dma()
436 card->name, bc->bch.nr, bc->bch.maxlen); in read_dma()
458 if (test_bit(FLG_ACTIVE, &card->bc[0].bch.Flags)) in recv_tiger()
460 if (test_bit(FLG_ACTIVE, &card->bc[1].bch.Flags)) in recv_tiger()
482 __func__, bc->bch.nr, bc->free, bc->idx, card->send.idx); in resync()
490 struct tiger_hw *card = bc->bch.hw; in fill_hdlc_flag()
498 __func__, bc->bch.nr, bc->free, bc->txstate, in fill_hdlc_flag()
505 bc->bch.nr, count); in fill_hdlc_flag()
508 m = (bc->bch.nr & 1) ? 0xffffff00 : 0xffff00ff; in fill_hdlc_flag()
514 v |= (bc->bch.nr & 1) ? (u32)(p[i]) : ((u32)(p[i])) << 8; in fill_hdlc_flag()
519 bc->bch.nr, card->name, count); in fill_hdlc_flag()
527 struct tiger_hw *card = bc->bch.hw; in fill_dma()
534 if (!bc->bch.tx_skb) { in fill_dma()
535 if (!test_bit(FLG_TX_EMPTY, &bc->bch.Flags)) in fill_dma()
539 p = bc->bch.fill; in fill_dma()
541 count = bc->bch.tx_skb->len - bc->bch.tx_idx; in fill_dma()
545 card->name, __func__, bc->bch.nr, count, bc->free, in fill_dma()
546 bc->bch.tx_idx, bc->bch.tx_skb->len, bc->txstate, in fill_dma()
548 p = bc->bch.tx_skb->data + bc->bch.tx_idx; in fill_dma()
552 if (test_bit(FLG_HDLC, &bc->bch.Flags) && !fillempty) { in fill_dma()
556 bc->bch.nr, i, count); in fill_dma()
557 bc->bch.tx_idx += i; in fill_dma()
564 bc->bch.tx_idx += count; in fill_dma()
567 m = (bc->bch.nr & 1) ? 0xffffff00 : 0xffff00ff; in fill_dma()
570 if (!(bc->bch.nr & 1)) in fill_dma()
587 v |= (bc->bch.nr & 1) ? n : n << 8; in fill_dma()
593 bc->bch.nr, card->name, count); in fill_dma()
606 if (bc->bch.tx_skb && bc->bch.tx_idx < bc->bch.tx_skb->len) { in bc_next_frame()
609 dev_kfree_skb(bc->bch.tx_skb); in bc_next_frame()
610 if (get_next_bframe(&bc->bch)) { in bc_next_frame()
612 test_and_clear_bit(FLG_TX_EMPTY, &bc->bch.Flags); in bc_next_frame()
613 } else if (test_bit(FLG_TX_EMPTY, &bc->bch.Flags)) { in bc_next_frame()
615 } else if (test_bit(FLG_FILLEMPTY, &bc->bch.Flags)) { in bc_next_frame()
616 test_and_set_bit(FLG_TX_EMPTY, &bc->bch.Flags); in bc_next_frame()
634 bc->bch.nr, bc->txstate); in send_tiger_bc()
641 if (test_bit(FLG_HDLC, &bc->bch.Flags)) { in send_tiger_bc()
646 bc->bch.nr, bc->free, bc->idx, card->send.idx); in send_tiger_bc()
670 if (test_bit(FLG_ACTIVE, &card->bc[i].bch.Flags)) in send_tiger()
741 struct bchannel *bch = container_of(ch, struct bchannel, ch); in nj_l2l1B() local
742 struct tiger_ch *bc = container_of(bch, struct tiger_ch, bch); in nj_l2l1B()
743 struct tiger_hw *card = bch->hw; in nj_l2l1B()
750 ret = bchannel_senddata(bch, skb); in nj_l2l1B()
759 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) in nj_l2l1B()
770 mISDN_clear_bchannel(bch); in nj_l2l1B()
786 return mISDN_ctrl_bchannel(&bc->bch, cq); in channel_bctrl()
792 struct bchannel *bch = container_of(ch, struct bchannel, ch); in nj_bctrl() local
793 struct tiger_ch *bc = container_of(bch, struct tiger_ch, bch); in nj_bctrl()
794 struct tiger_hw *card = bch->hw; in nj_bctrl()
801 test_and_clear_bit(FLG_OPEN, &bch->Flags); in nj_bctrl()
802 cancel_work_sync(&bch->workq); in nj_bctrl()
804 mISDN_clear_bchannel(bch); in nj_bctrl()
852 struct bchannel *bch; in open_bchannel() local
858 bch = &card->bc[rq->adr.channel - 1].bch; in open_bchannel()
859 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
861 test_and_clear_bit(FLG_FILLEMPTY, &bch->Flags); in open_bchannel()
862 bch->ch.protocol = rq->protocol; in open_bchannel()
863 rq->ch = &bch->ch; in open_bchannel()
964 mISDN_freebchannel(&card->bc[i].bch); in nj_release()
1018 card->bc[i].bch.nr = i + 1; in setup_instance()
1020 mISDN_initbchannel(&card->bc[i].bch, MAX_DATA_MEM, in setup_instance()
1022 card->bc[i].bch.hw = card; in setup_instance()
1023 card->bc[i].bch.ch.send = nj_l2l1B; in setup_instance()
1024 card->bc[i].bch.ch.ctrl = nj_bctrl; in setup_instance()
1025 card->bc[i].bch.ch.nr = i + 1; in setup_instance()
1026 list_add(&card->bc[i].bch.ch.list, in setup_instance()
1028 card->bc[i].bch.hw = card; in setup_instance()