Lines Matching refs:wch

446 W6692_empty_Bfifo(struct w6692_ch *wch, int count)  in W6692_empty_Bfifo()  argument
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()
455 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); 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()
462 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); in W6692_empty_Bfifo()
465 maxlen = bchannel_get_rxbuf(&wch->bch, count); in W6692_empty_Bfifo()
467 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); 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()
475 insb(wch->addr + W_B_RFIFO, ptr, count); in W6692_empty_Bfifo()
476 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); in W6692_empty_Bfifo()
479 wch->bch.nr, card->name, count); in W6692_empty_Bfifo()
485 W6692_fill_Bfifo(struct w6692_ch *wch) in W6692_fill_Bfifo() argument
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()
514 outsb(wch->addr + W_B_XFIFO, ptr, MISDN_BCH_FILL_SIZE); in W6692_fill_Bfifo()
518 outsb(wch->addr + W_B_XFIFO, ptr, count); in W6692_fill_Bfifo()
520 WriteW6692B(wch, W_B_CMDR, cmd); in W6692_fill_Bfifo()
523 wch->bch.nr, card->name, count); in W6692_fill_Bfifo()
530 setvolume(struct w6692_ch *wch, int mic, struct sk_buff *skb)
532 struct w6692_hw *card = wch->bch.hw;
537 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
557 enable_pots(struct w6692_ch *wch)
559 struct w6692_hw *card = wch->bch.hw;
562 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
564 wch->b_mode |= W_B_MODE_EPCM | W_B_MODE_BSW0;
565 WriteW6692B(wch, W_B_MODE, wch->b_mode);
566 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST);
567 card->pctl |= ((wch->bch.nr & 2) ? W_PCTL_PCX : 0);
574 disable_pots(struct w6692_ch *wch) in disable_pots() argument
576 struct w6692_hw *card = wch->bch.hw; in disable_pots()
580 wch->b_mode &= ~(W_B_MODE_EPCM | W_B_MODE_BSW0); in disable_pots()
581 WriteW6692B(wch, W_B_MODE, wch->b_mode); in disable_pots()
582 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT | in disable_pots()
588 w6692_mode(struct w6692_ch *wch, u32 pr) in w6692_mode() argument
592 card = wch->bch.hw; in w6692_mode()
594 wch->bch.nr, wch->bch.state, pr); in w6692_mode()
597 if ((card->fmask & pots) && (wch->b_mode & W_B_MODE_EPCM)) in w6692_mode()
598 disable_pots(wch); in w6692_mode()
599 wch->b_mode = 0; in w6692_mode()
600 mISDN_clear_bchannel(&wch->bch); in w6692_mode()
601 WriteW6692B(wch, W_B_MODE, wch->b_mode); in w6692_mode()
602 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST); 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()
607 wch->b_mode = W_B_MODE_MMS; in w6692_mode()
608 WriteW6692B(wch, W_B_MODE, wch->b_mode); in w6692_mode()
609 WriteW6692B(wch, W_B_EXIM, 0); in w6692_mode()
610 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT | in w6692_mode()
612 test_and_set_bit(FLG_TRANSPARENT, &wch->bch.Flags); in w6692_mode()
615 wch->b_mode = W_B_MODE_ITF; in w6692_mode()
616 WriteW6692B(wch, W_B_MODE, wch->b_mode); in w6692_mode()
617 WriteW6692B(wch, W_B_ADM1, 0xff); in w6692_mode()
618 WriteW6692B(wch, W_B_ADM2, 0xff); in w6692_mode()
619 WriteW6692B(wch, W_B_EXIM, 0); in w6692_mode()
620 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT | in w6692_mode()
622 test_and_set_bit(FLG_HDLC, &wch->bch.Flags); in w6692_mode()
628 wch->bch.state = pr; in w6692_mode()
633 send_next(struct w6692_ch *wch) in send_next() argument
635 if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) { in send_next()
636 W6692_fill_Bfifo(wch); in send_next()
638 dev_kfree_skb(wch->bch.tx_skb); in send_next()
639 if (get_next_bframe(&wch->bch)) { in send_next()
640 W6692_fill_Bfifo(wch); 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()
643 W6692_fill_Bfifo(wch); in send_next()
651 struct w6692_ch *wch = &card->bc[ch]; in W6692B_interrupt() local
655 stat = ReadW6692B(wch, W_B_EXIR); in W6692B_interrupt()
656 pr_debug("%s: B%d EXIR %02x\n", card->name, wch->bch.nr, stat); in W6692B_interrupt()
658 star = ReadW6692B(wch, W_B_STAR); 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()
684 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | in W6692B_interrupt()
686 if (wch->bch.rx_skb) in W6692B_interrupt()
687 skb_trim(wch->bch.rx_skb, 0); in W6692B_interrupt()
689 count = ReadW6692B(wch, W_B_RBCL) & in W6692B_interrupt()
693 W6692_empty_Bfifo(wch, count); in W6692B_interrupt()
694 recv_Bchannel(&wch->bch, 0, false); in W6692B_interrupt()
699 star = ReadW6692B(wch, W_B_STAR); in W6692B_interrupt()
702 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
704 wch->bch.err_rdo++; in W6692B_interrupt()
706 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | in W6692B_interrupt()
709 W6692_empty_Bfifo(wch, W_B_FIFO_THRESH); 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()
722 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | in W6692B_interrupt()
728 star = ReadW6692B(wch, W_B_STAR); 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()
738 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_XRST | 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()
746 send_next(wch); 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()
763 send_next(wch); in W6692B_interrupt()