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