Lines Matching full:bch

45 	struct bchannel		bch;  member
83 card->bc[0].bch.debug = debug; in _set_debug()
84 card->bc[1].bch.debug = debug; in _set_debug()
448 struct w6692_hw *card = wch->bch.hw; in W6692_empty_Bfifo()
453 if (unlikely(wch->bch.state == ISDN_P_NONE)) { in W6692_empty_Bfifo()
456 if (wch->bch.rx_skb) in W6692_empty_Bfifo()
457 skb_trim(wch->bch.rx_skb, 0); in W6692_empty_Bfifo()
460 if (test_bit(FLG_RX_OFF, &wch->bch.Flags)) { in W6692_empty_Bfifo()
461 wch->bch.dropcnt += count; in W6692_empty_Bfifo()
465 maxlen = bchannel_get_rxbuf(&wch->bch, count); in W6692_empty_Bfifo()
468 if (wch->bch.rx_skb) in W6692_empty_Bfifo()
469 skb_trim(wch->bch.rx_skb, 0); in W6692_empty_Bfifo()
471 card->name, wch->bch.nr, count); in W6692_empty_Bfifo()
474 ptr = skb_put(wch->bch.rx_skb, count); in W6692_empty_Bfifo()
479 wch->bch.nr, card->name, count); in W6692_empty_Bfifo()
487 struct w6692_hw *card = wch->bch.hw; in W6692_fill_Bfifo()
492 if (!wch->bch.tx_skb) { in W6692_fill_Bfifo()
493 if (!test_bit(FLG_TX_EMPTY, &wch->bch.Flags)) in W6692_fill_Bfifo()
495 ptr = wch->bch.fill; in W6692_fill_Bfifo()
499 count = wch->bch.tx_skb->len - wch->bch.tx_idx; in W6692_fill_Bfifo()
502 ptr = wch->bch.tx_skb->data + wch->bch.tx_idx; in W6692_fill_Bfifo()
506 else if (test_bit(FLG_HDLC, &wch->bch.Flags)) in W6692_fill_Bfifo()
510 count, wch->bch.tx_idx); in W6692_fill_Bfifo()
511 wch->bch.tx_idx += count; in W6692_fill_Bfifo()
523 wch->bch.nr, card->name, count); in W6692_fill_Bfifo()
532 struct w6692_hw *card = wch->bch.hw;
537 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
559 struct w6692_hw *card = wch->bch.hw;
562 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
567 card->pctl |= ((wch->bch.nr & 2) ? W_PCTL_PCX : 0);
576 struct w6692_hw *card = wch->bch.hw; in disable_pots()
592 card = wch->bch.hw; in w6692_mode()
594 wch->bch.nr, wch->bch.state, pr); in w6692_mode()
600 mISDN_clear_bchannel(&wch->bch); in w6692_mode()
603 test_and_clear_bit(FLG_HDLC, &wch->bch.Flags); in w6692_mode()
604 test_and_clear_bit(FLG_TRANSPARENT, &wch->bch.Flags); in w6692_mode()
612 test_and_set_bit(FLG_TRANSPARENT, &wch->bch.Flags); in w6692_mode()
622 test_and_set_bit(FLG_HDLC, &wch->bch.Flags); in w6692_mode()
628 wch->bch.state = pr; in w6692_mode()
635 if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) { in send_next()
638 dev_kfree_skb(wch->bch.tx_skb); in send_next()
639 if (get_next_bframe(&wch->bch)) { in send_next()
641 test_and_clear_bit(FLG_TX_EMPTY, &wch->bch.Flags); in send_next()
642 } else if (test_bit(FLG_TX_EMPTY, &wch->bch.Flags)) { in send_next()
656 pr_debug("%s: B%d EXIR %02x\n", card->name, wch->bch.nr, stat); in W6692B_interrupt()
661 test_bit(FLG_ACTIVE, &wch->bch.Flags)) { in W6692B_interrupt()
663 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
665 wch->bch.err_rdo++; in W6692B_interrupt()
668 if (test_bit(FLG_HDLC, &wch->bch.Flags)) { in W6692B_interrupt()
671 card->name, wch->bch.nr); in W6692B_interrupt()
673 wch->bch.err_crc++; in W6692B_interrupt()
678 card->name, wch->bch.nr); in W6692B_interrupt()
680 wch->bch.err_inv++; in W6692B_interrupt()
686 if (wch->bch.rx_skb) in W6692B_interrupt()
687 skb_trim(wch->bch.rx_skb, 0); in W6692B_interrupt()
694 recv_Bchannel(&wch->bch, 0, false); in W6692B_interrupt()
702 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
704 wch->bch.err_rdo++; in W6692B_interrupt()
710 if (test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) in W6692B_interrupt()
711 recv_Bchannel(&wch->bch, 0, false); in W6692B_interrupt()
718 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
720 wch->bch.err_rdo++; in W6692B_interrupt()
730 wch->bch.nr, star); in W6692B_interrupt()
734 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
736 wch->bch.err_xdu++; in W6692B_interrupt()
741 if (wch->bch.tx_skb) { in W6692B_interrupt()
742 if (!test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) in W6692B_interrupt()
743 wch->bch.tx_idx = 0; in W6692B_interrupt()
752 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
754 wch->bch.err_xdu++; in W6692B_interrupt()
757 if (wch->bch.tx_skb) { in W6692B_interrupt()
758 if (!test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) in W6692B_interrupt()
759 wch->bch.tx_idx = 0; in W6692B_interrupt()
760 } else if (test_bit(FLG_FILLEMPTY, &wch->bch.Flags)) { in W6692B_interrupt()
761 test_and_set_bit(FLG_TX_EMPTY, &wch->bch.Flags); in W6692B_interrupt()
934 struct bchannel *bch = container_of(ch, struct bchannel, ch); in w6692_l2l1B() local
935 struct w6692_ch *bc = container_of(bch, struct w6692_ch, bch); in w6692_l2l1B()
936 struct w6692_hw *card = bch->hw; in w6692_l2l1B()
944 ret = bchannel_senddata(bch, skb); in w6692_l2l1B()
953 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) in w6692_l2l1B()
964 mISDN_clear_bchannel(bch); in w6692_l2l1B()
982 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq) in channel_bctrl() argument
984 return mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
990 struct bchannel *bch; in open_bchannel() local
996 bch = &card->bc[rq->adr.channel - 1].bch; in open_bchannel()
997 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
999 bch->ch.protocol = rq->protocol; in open_bchannel()
1000 rq->ch = &bch->ch; in open_bchannel()
1027 struct bchannel *bch = container_of(ch, struct bchannel, ch); in w6692_bctrl() local
1028 struct w6692_ch *bc = container_of(bch, struct w6692_ch, bch); in w6692_bctrl()
1029 struct w6692_hw *card = bch->hw; in w6692_bctrl()
1036 test_and_clear_bit(FLG_OPEN, &bch->Flags); in w6692_bctrl()
1037 cancel_work_sync(&bch->workq); in w6692_bctrl()
1039 mISDN_clear_bchannel(bch); in w6692_bctrl()
1048 ret = channel_bctrl(bch, arg); in w6692_bctrl()
1262 mISDN_freebchannel(&card->bc[1].bch); in release_card()
1263 mISDN_freebchannel(&card->bc[0].bch); in release_card()
1295 mISDN_initbchannel(&card->bc[i].bch, MAX_DATA_MEM, in setup_instance()
1297 card->bc[i].bch.hw = card; in setup_instance()
1298 card->bc[i].bch.nr = i + 1; in setup_instance()
1299 card->bc[i].bch.ch.nr = i + 1; in setup_instance()
1300 card->bc[i].bch.ch.send = w6692_l2l1B; in setup_instance()
1301 card->bc[i].bch.ch.ctrl = w6692_bctrl; in setup_instance()
1303 list_add(&card->bc[i].bch.ch.list, &card->dch.dev.bchannels); in setup_instance()
1328 mISDN_freebchannel(&card->bc[1].bch); in setup_instance()
1329 mISDN_freebchannel(&card->bc[0].bch); in setup_instance()