Lines Matching defs:bch

61 	struct bchannel		bch;
99 card->bc[0].bch.debug = debug;
100 card->bc[1].bch.debug = debug;
466 struct w6692_hw *card = wch->bch.hw;
471 if (unlikely(wch->bch.state == ISDN_P_NONE)) {
474 if (wch->bch.rx_skb)
475 skb_trim(wch->bch.rx_skb, 0);
478 if (test_bit(FLG_RX_OFF, &wch->bch.Flags)) {
479 wch->bch.dropcnt += count;
483 maxlen = bchannel_get_rxbuf(&wch->bch, count);
486 if (wch->bch.rx_skb)
487 skb_trim(wch->bch.rx_skb, 0);
489 card->name, wch->bch.nr, count);
492 ptr = skb_put(wch->bch.rx_skb, count);
497 wch->bch.nr, card->name, count);
505 struct w6692_hw *card = wch->bch.hw;
510 if (!wch->bch.tx_skb) {
511 if (!test_bit(FLG_TX_EMPTY, &wch->bch.Flags))
513 ptr = wch->bch.fill;
517 count = wch->bch.tx_skb->len - wch->bch.tx_idx;
520 ptr = wch->bch.tx_skb->data + wch->bch.tx_idx;
524 else if (test_bit(FLG_HDLC, &wch->bch.Flags))
528 count, wch->bch.tx_idx);
529 wch->bch.tx_idx += count;
541 wch->bch.nr, card->name, count);
550 struct w6692_hw *card = wch->bch.hw;
555 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
577 struct w6692_hw *card = wch->bch.hw;
580 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
585 card->pctl |= ((wch->bch.nr & 2) ? W_PCTL_PCX : 0);
594 struct w6692_hw *card = wch->bch.hw;
610 card = wch->bch.hw;
612 wch->bch.nr, wch->bch.state, pr);
618 mISDN_clear_bchannel(&wch->bch);
621 test_and_clear_bit(FLG_HDLC, &wch->bch.Flags);
622 test_and_clear_bit(FLG_TRANSPARENT, &wch->bch.Flags);
630 test_and_set_bit(FLG_TRANSPARENT, &wch->bch.Flags);
640 test_and_set_bit(FLG_HDLC, &wch->bch.Flags);
646 wch->bch.state = pr;
653 if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) {
656 if (wch->bch.tx_skb)
657 dev_kfree_skb(wch->bch.tx_skb);
658 if (get_next_bframe(&wch->bch)) {
660 test_and_clear_bit(FLG_TX_EMPTY, &wch->bch.Flags);
661 } else if (test_bit(FLG_TX_EMPTY, &wch->bch.Flags)) {
675 pr_debug("%s: B%d EXIR %02x\n", card->name, wch->bch.nr, stat);
680 test_bit(FLG_ACTIVE, &wch->bch.Flags)) {
682 wch->bch.nr, wch->bch.state);
684 wch->bch.err_rdo++;
687 if (test_bit(FLG_HDLC, &wch->bch.Flags)) {
690 card->name, wch->bch.nr);
692 wch->bch.err_crc++;
697 card->name, wch->bch.nr);
699 wch->bch.err_inv++;
705 if (wch->bch.rx_skb)
706 skb_trim(wch->bch.rx_skb, 0);
713 recv_Bchannel(&wch->bch, 0, false);
721 wch->bch.nr, wch->bch.state);
723 wch->bch.err_rdo++;
729 if (test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
730 recv_Bchannel(&wch->bch, 0, false);
737 wch->bch.nr, wch->bch.state);
739 wch->bch.err_rdo++;
749 wch->bch.nr, star);
753 wch->bch.nr, wch->bch.state);
755 wch->bch.err_xdu++;
760 if (wch->bch.tx_skb) {
761 if (!test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
762 wch->bch.tx_idx = 0;
771 wch->bch.nr, wch->bch.state);
773 wch->bch.err_xdu++;
776 if (wch->bch.tx_skb) {
777 if (!test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
778 wch->bch.tx_idx = 0;
779 } else if (test_bit(FLG_FILLEMPTY, &wch->bch.Flags)) {
780 test_and_set_bit(FLG_TX_EMPTY, &wch->bch.Flags);
954 struct bchannel *bch = container_of(ch, struct bchannel, ch);
955 struct w6692_ch *bc = container_of(bch, struct w6692_ch, bch);
956 struct w6692_hw *card = bch->hw;
964 ret = bchannel_senddata(bch, skb);
973 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags))
984 mISDN_clear_bchannel(bch);
1002 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq)
1004 return mISDN_ctrl_bchannel(bch, cq);
1010 struct bchannel *bch;
1016 bch = &card->bc[rq->adr.channel - 1].bch;
1017 if (test_and_set_bit(FLG_OPEN, &bch->Flags))
1019 bch->ch.protocol = rq->protocol;
1020 rq->ch = &bch->ch;
1047 struct bchannel *bch = container_of(ch, struct bchannel, ch);
1048 struct w6692_ch *bc = container_of(bch, struct w6692_ch, bch);
1049 struct w6692_hw *card = bch->hw;
1056 test_and_clear_bit(FLG_OPEN, &bch->Flags);
1057 cancel_work_sync(&bch->workq);
1059 mISDN_clear_bchannel(bch);
1068 ret = channel_bctrl(bch, arg);
1282 mISDN_freebchannel(&card->bc[1].bch);
1283 mISDN_freebchannel(&card->bc[0].bch);
1315 mISDN_initbchannel(&card->bc[i].bch, MAX_DATA_MEM,
1317 card->bc[i].bch.hw = card;
1318 card->bc[i].bch.nr = i + 1;
1319 card->bc[i].bch.ch.nr = i + 1;
1320 card->bc[i].bch.ch.send = w6692_l2l1B;
1321 card->bc[i].bch.ch.ctrl = w6692_bctrl;
1323 list_add(&card->bc[i].bch.ch.list, &card->dch.dev.bchannels);
1348 mISDN_freebchannel(&card->bc[1].bch);
1349 mISDN_freebchannel(&card->bc[0].bch);