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()
177 struct tiger_hw *card = bc->bch.hw; in fill_mem()
181 bc->bch.nr, fill, cnt, idx, card->send.idx); in fill_mem()
182 if (bc->bch.nr & 2) { in fill_mem()
200 struct tiger_hw *card = bc->bch.hw; in mode_tiger()
203 bc->bch.nr, bc->bch.state, protocol); in mode_tiger()
206 if (bc->bch.state == ISDN_P_NONE) in mode_tiger()
209 bc->bch.state = protocol; in mode_tiger()
211 if ((card->bc[0].bch.state == ISDN_P_NONE) && in mode_tiger()
212 (card->bc[1].bch.state == ISDN_P_NONE)) { in mode_tiger()
217 test_and_clear_bit(FLG_HDLC, &bc->bch.Flags); in mode_tiger()
218 test_and_clear_bit(FLG_TRANSPARENT, &bc->bch.Flags); in mode_tiger()
224 test_and_set_bit(FLG_TRANSPARENT, &bc->bch.Flags); in mode_tiger()
225 bc->bch.state = protocol; in mode_tiger()
238 test_and_set_bit(FLG_HDLC, &bc->bch.Flags); in mode_tiger()
239 bc->bch.state = protocol; in mode_tiger()
365 struct tiger_hw *card = bc->bch.hw; in read_dma()
373 bc->bch.nr, idx); in read_dma()
376 if (test_bit(FLG_RX_OFF, &bc->bch.Flags)) { in read_dma()
377 bc->bch.dropcnt += cnt; in read_dma()
380 stat = bchannel_get_rxbuf(&bc->bch, cnt); in read_dma()
384 card->name, bc->bch.nr, cnt); in read_dma()
387 if (test_bit(FLG_TRANSPARENT, &bc->bch.Flags)) in read_dma()
388 p = skb_put(bc->bch.rx_skb, cnt); in read_dma()
394 if (bc->bch.nr & 2) in read_dma()
401 if (test_bit(FLG_TRANSPARENT, &bc->bch.Flags)) { in read_dma()
402 recv_Bchannel(&bc->bch, 0, false); in read_dma()
409 bc->bch.rx_skb->data, bc->bch.maxlen); in read_dma()
411 p = skb_put(bc->bch.rx_skb, stat); in read_dma()
414 "B%1d-recv %s %d ", bc->bch.nr, in read_dma()
420 recv_Bchannel(&bc->bch, 0, false); in read_dma()
421 stat = bchannel_get_rxbuf(&bc->bch, bc->bch.maxlen); in read_dma()
424 card->name, bc->bch.nr, cnt); in read_dma()
429 card->name, bc->bch.nr); in read_dma()
432 card->name, bc->bch.nr); in read_dma()
435 card->name, bc->bch.nr, bc->bch.maxlen); in read_dma()
457 if (test_bit(FLG_ACTIVE, &card->bc[0].bch.Flags)) in recv_tiger()
459 if (test_bit(FLG_ACTIVE, &card->bc[1].bch.Flags)) in recv_tiger()
481 __func__, bc->bch.nr, bc->free, bc->idx, card->send.idx); in resync()
489 struct tiger_hw *card = bc->bch.hw; in fill_hdlc_flag()
497 __func__, bc->bch.nr, bc->free, bc->txstate, in fill_hdlc_flag()
504 bc->bch.nr, count); in fill_hdlc_flag()
507 m = (bc->bch.nr & 1) ? 0xffffff00 : 0xffff00ff; in fill_hdlc_flag()
513 v |= (bc->bch.nr & 1) ? (u32)(p[i]) : ((u32)(p[i])) << 8; in fill_hdlc_flag()
518 bc->bch.nr, card->name, count); in fill_hdlc_flag()
526 struct tiger_hw *card = bc->bch.hw; in fill_dma()
533 if (!bc->bch.tx_skb) { in fill_dma()
534 if (!test_bit(FLG_TX_EMPTY, &bc->bch.Flags)) in fill_dma()
538 p = bc->bch.fill; in fill_dma()
540 count = bc->bch.tx_skb->len - bc->bch.tx_idx; in fill_dma()
544 card->name, __func__, bc->bch.nr, count, bc->free, in fill_dma()
545 bc->bch.tx_idx, bc->bch.tx_skb->len, bc->txstate, in fill_dma()
547 p = bc->bch.tx_skb->data + bc->bch.tx_idx; in fill_dma()
551 if (test_bit(FLG_HDLC, &bc->bch.Flags) && !fillempty) { in fill_dma()
555 bc->bch.nr, i, count); in fill_dma()
556 bc->bch.tx_idx += i; in fill_dma()
563 bc->bch.tx_idx += count; in fill_dma()
566 m = (bc->bch.nr & 1) ? 0xffffff00 : 0xffff00ff; in fill_dma()
569 if (!(bc->bch.nr & 1)) in fill_dma()
586 v |= (bc->bch.nr & 1) ? n : n << 8; in fill_dma()
592 bc->bch.nr, card->name, count); in fill_dma()
605 if (bc->bch.tx_skb && bc->bch.tx_idx < bc->bch.tx_skb->len) { in bc_next_frame()
608 dev_kfree_skb(bc->bch.tx_skb); in bc_next_frame()
609 if (get_next_bframe(&bc->bch)) { in bc_next_frame()
611 test_and_clear_bit(FLG_TX_EMPTY, &bc->bch.Flags); in bc_next_frame()
612 } else if (test_bit(FLG_TX_EMPTY, &bc->bch.Flags)) { in bc_next_frame()
614 } else if (test_bit(FLG_FILLEMPTY, &bc->bch.Flags)) { in bc_next_frame()
615 test_and_set_bit(FLG_TX_EMPTY, &bc->bch.Flags); in bc_next_frame()
633 bc->bch.nr, bc->txstate); in send_tiger_bc()
640 if (test_bit(FLG_HDLC, &bc->bch.Flags)) { in send_tiger_bc()
645 bc->bch.nr, bc->free, bc->idx, card->send.idx); in send_tiger_bc()
669 if (test_bit(FLG_ACTIVE, &card->bc[i].bch.Flags)) in send_tiger()
740 struct bchannel *bch = container_of(ch, struct bchannel, ch); in nj_l2l1B() local
741 struct tiger_ch *bc = container_of(bch, struct tiger_ch, bch); in nj_l2l1B()
742 struct tiger_hw *card = bch->hw; in nj_l2l1B()
749 ret = bchannel_senddata(bch, skb); in nj_l2l1B()
758 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) in nj_l2l1B()
769 mISDN_clear_bchannel(bch); in nj_l2l1B()
785 return mISDN_ctrl_bchannel(&bc->bch, cq); in channel_bctrl()
791 struct bchannel *bch = container_of(ch, struct bchannel, ch); in nj_bctrl() local
792 struct tiger_ch *bc = container_of(bch, struct tiger_ch, bch); in nj_bctrl()
793 struct tiger_hw *card = bch->hw; in nj_bctrl()
800 test_and_clear_bit(FLG_OPEN, &bch->Flags); in nj_bctrl()
801 cancel_work_sync(&bch->workq); in nj_bctrl()
803 mISDN_clear_bchannel(bch); in nj_bctrl()
851 struct bchannel *bch; in open_bchannel() local
857 bch = &card->bc[rq->adr.channel - 1].bch; in open_bchannel()
858 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
860 test_and_clear_bit(FLG_FILLEMPTY, &bch->Flags); in open_bchannel()
861 bch->ch.protocol = rq->protocol; in open_bchannel()
862 rq->ch = &bch->ch; in open_bchannel()
963 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()