Lines Matching refs:bch

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