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()
447 struct w6692_hw *card = wch->bch.hw; in W6692_empty_Bfifo()
452 if (unlikely(wch->bch.state == ISDN_P_NONE)) { in W6692_empty_Bfifo()
455 if (wch->bch.rx_skb) in W6692_empty_Bfifo()
456 skb_trim(wch->bch.rx_skb, 0); in W6692_empty_Bfifo()
459 if (test_bit(FLG_RX_OFF, &wch->bch.Flags)) { in W6692_empty_Bfifo()
460 wch->bch.dropcnt += count; in W6692_empty_Bfifo()
464 maxlen = bchannel_get_rxbuf(&wch->bch, count); in W6692_empty_Bfifo()
467 if (wch->bch.rx_skb) in W6692_empty_Bfifo()
468 skb_trim(wch->bch.rx_skb, 0); in W6692_empty_Bfifo()
470 card->name, wch->bch.nr, count); in W6692_empty_Bfifo()
473 ptr = skb_put(wch->bch.rx_skb, count); in W6692_empty_Bfifo()
478 wch->bch.nr, card->name, count); in W6692_empty_Bfifo()
486 struct w6692_hw *card = wch->bch.hw; in W6692_fill_Bfifo()
491 if (!wch->bch.tx_skb) { in W6692_fill_Bfifo()
492 if (!test_bit(FLG_TX_EMPTY, &wch->bch.Flags)) in W6692_fill_Bfifo()
494 ptr = wch->bch.fill; in W6692_fill_Bfifo()
498 count = wch->bch.tx_skb->len - wch->bch.tx_idx; in W6692_fill_Bfifo()
501 ptr = wch->bch.tx_skb->data + wch->bch.tx_idx; in W6692_fill_Bfifo()
505 else if (test_bit(FLG_HDLC, &wch->bch.Flags)) in W6692_fill_Bfifo()
509 count, wch->bch.tx_idx); in W6692_fill_Bfifo()
510 wch->bch.tx_idx += count; in W6692_fill_Bfifo()
522 wch->bch.nr, card->name, count); in W6692_fill_Bfifo()
531 struct w6692_hw *card = wch->bch.hw;
536 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
558 struct w6692_hw *card = wch->bch.hw;
561 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
566 card->pctl |= ((wch->bch.nr & 2) ? W_PCTL_PCX : 0);
575 struct w6692_hw *card = wch->bch.hw; in disable_pots()
591 card = wch->bch.hw; in w6692_mode()
593 wch->bch.nr, wch->bch.state, pr); in w6692_mode()
599 mISDN_clear_bchannel(&wch->bch); in w6692_mode()
602 test_and_clear_bit(FLG_HDLC, &wch->bch.Flags); in w6692_mode()
603 test_and_clear_bit(FLG_TRANSPARENT, &wch->bch.Flags); in w6692_mode()
611 test_and_set_bit(FLG_TRANSPARENT, &wch->bch.Flags); in w6692_mode()
621 test_and_set_bit(FLG_HDLC, &wch->bch.Flags); in w6692_mode()
627 wch->bch.state = pr; in w6692_mode()
634 if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) { in send_next()
637 dev_kfree_skb(wch->bch.tx_skb); in send_next()
638 if (get_next_bframe(&wch->bch)) { in send_next()
640 test_and_clear_bit(FLG_TX_EMPTY, &wch->bch.Flags); in send_next()
641 } else if (test_bit(FLG_TX_EMPTY, &wch->bch.Flags)) { in send_next()
655 pr_debug("%s: B%d EXIR %02x\n", card->name, wch->bch.nr, stat); in W6692B_interrupt()
660 test_bit(FLG_ACTIVE, &wch->bch.Flags)) { in W6692B_interrupt()
662 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
664 wch->bch.err_rdo++; in W6692B_interrupt()
667 if (test_bit(FLG_HDLC, &wch->bch.Flags)) { in W6692B_interrupt()
670 card->name, wch->bch.nr); in W6692B_interrupt()
672 wch->bch.err_crc++; in W6692B_interrupt()
677 card->name, wch->bch.nr); in W6692B_interrupt()
679 wch->bch.err_inv++; in W6692B_interrupt()
685 if (wch->bch.rx_skb) in W6692B_interrupt()
686 skb_trim(wch->bch.rx_skb, 0); in W6692B_interrupt()
693 recv_Bchannel(&wch->bch, 0, false); in W6692B_interrupt()
701 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
703 wch->bch.err_rdo++; in W6692B_interrupt()
709 if (test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) in W6692B_interrupt()
710 recv_Bchannel(&wch->bch, 0, false); in W6692B_interrupt()
717 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
719 wch->bch.err_rdo++; in W6692B_interrupt()
729 wch->bch.nr, star); in W6692B_interrupt()
733 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
735 wch->bch.err_xdu++; in W6692B_interrupt()
740 if (wch->bch.tx_skb) { in W6692B_interrupt()
741 if (!test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) in W6692B_interrupt()
742 wch->bch.tx_idx = 0; in W6692B_interrupt()
751 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
753 wch->bch.err_xdu++; in W6692B_interrupt()
756 if (wch->bch.tx_skb) { in W6692B_interrupt()
757 if (!test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) in W6692B_interrupt()
758 wch->bch.tx_idx = 0; in W6692B_interrupt()
759 } else if (test_bit(FLG_FILLEMPTY, &wch->bch.Flags)) { in W6692B_interrupt()
760 test_and_set_bit(FLG_TX_EMPTY, &wch->bch.Flags); in W6692B_interrupt()
933 struct bchannel *bch = container_of(ch, struct bchannel, ch); in w6692_l2l1B() local
934 struct w6692_ch *bc = container_of(bch, struct w6692_ch, bch); in w6692_l2l1B()
935 struct w6692_hw *card = bch->hw; in w6692_l2l1B()
943 ret = bchannel_senddata(bch, skb); in w6692_l2l1B()
952 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) in w6692_l2l1B()
963 mISDN_clear_bchannel(bch); in w6692_l2l1B()
981 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq) in channel_bctrl() argument
983 return mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
989 struct bchannel *bch; in open_bchannel() local
995 bch = &card->bc[rq->adr.channel - 1].bch; in open_bchannel()
996 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
998 bch->ch.protocol = rq->protocol; in open_bchannel()
999 rq->ch = &bch->ch; in open_bchannel()
1026 struct bchannel *bch = container_of(ch, struct bchannel, ch); in w6692_bctrl() local
1027 struct w6692_ch *bc = container_of(bch, struct w6692_ch, bch); in w6692_bctrl()
1028 struct w6692_hw *card = bch->hw; in w6692_bctrl()
1035 test_and_clear_bit(FLG_OPEN, &bch->Flags); in w6692_bctrl()
1036 cancel_work_sync(&bch->workq); in w6692_bctrl()
1038 mISDN_clear_bchannel(bch); in w6692_bctrl()
1047 ret = channel_bctrl(bch, arg); in w6692_bctrl()
1261 mISDN_freebchannel(&card->bc[1].bch); in release_card()
1262 mISDN_freebchannel(&card->bc[0].bch); in release_card()
1294 mISDN_initbchannel(&card->bc[i].bch, MAX_DATA_MEM, in setup_instance()
1296 card->bc[i].bch.hw = card; in setup_instance()
1297 card->bc[i].bch.nr = i + 1; in setup_instance()
1298 card->bc[i].bch.ch.nr = i + 1; in setup_instance()
1299 card->bc[i].bch.ch.send = w6692_l2l1B; in setup_instance()
1300 card->bc[i].bch.ch.ctrl = w6692_bctrl; in setup_instance()
1302 list_add(&card->bc[i].bch.ch.list, &card->dch.dev.bchannels); in setup_instance()
1327 mISDN_freebchannel(&card->bc[1].bch); in setup_instance()
1328 mISDN_freebchannel(&card->bc[0].bch); in setup_instance()