Lines Matching refs:wch

445 W6692_empty_Bfifo(struct w6692_ch *wch, int count)  in W6692_empty_Bfifo()  argument
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()
454 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); 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()
461 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); in W6692_empty_Bfifo()
464 maxlen = bchannel_get_rxbuf(&wch->bch, count); in W6692_empty_Bfifo()
466 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); 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()
474 insb(wch->addr + W_B_RFIFO, ptr, count); in W6692_empty_Bfifo()
475 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); in W6692_empty_Bfifo()
478 wch->bch.nr, card->name, count); in W6692_empty_Bfifo()
484 W6692_fill_Bfifo(struct w6692_ch *wch) in W6692_fill_Bfifo() argument
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()
513 outsb(wch->addr + W_B_XFIFO, ptr, MISDN_BCH_FILL_SIZE); in W6692_fill_Bfifo()
517 outsb(wch->addr + W_B_XFIFO, ptr, count); in W6692_fill_Bfifo()
519 WriteW6692B(wch, W_B_CMDR, cmd); in W6692_fill_Bfifo()
522 wch->bch.nr, card->name, count); in W6692_fill_Bfifo()
529 setvolume(struct w6692_ch *wch, int mic, struct sk_buff *skb)
531 struct w6692_hw *card = wch->bch.hw;
536 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
556 enable_pots(struct w6692_ch *wch)
558 struct w6692_hw *card = wch->bch.hw;
561 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags))
563 wch->b_mode |= W_B_MODE_EPCM | W_B_MODE_BSW0;
564 WriteW6692B(wch, W_B_MODE, wch->b_mode);
565 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST);
566 card->pctl |= ((wch->bch.nr & 2) ? W_PCTL_PCX : 0);
573 disable_pots(struct w6692_ch *wch) in disable_pots() argument
575 struct w6692_hw *card = wch->bch.hw; in disable_pots()
579 wch->b_mode &= ~(W_B_MODE_EPCM | W_B_MODE_BSW0); in disable_pots()
580 WriteW6692B(wch, W_B_MODE, wch->b_mode); in disable_pots()
581 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT | in disable_pots()
587 w6692_mode(struct w6692_ch *wch, u32 pr) in w6692_mode() argument
591 card = wch->bch.hw; in w6692_mode()
593 wch->bch.nr, wch->bch.state, pr); in w6692_mode()
596 if ((card->fmask & pots) && (wch->b_mode & W_B_MODE_EPCM)) in w6692_mode()
597 disable_pots(wch); in w6692_mode()
598 wch->b_mode = 0; in w6692_mode()
599 mISDN_clear_bchannel(&wch->bch); in w6692_mode()
600 WriteW6692B(wch, W_B_MODE, wch->b_mode); in w6692_mode()
601 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST); 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()
606 wch->b_mode = W_B_MODE_MMS; in w6692_mode()
607 WriteW6692B(wch, W_B_MODE, wch->b_mode); in w6692_mode()
608 WriteW6692B(wch, W_B_EXIM, 0); in w6692_mode()
609 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT | in w6692_mode()
611 test_and_set_bit(FLG_TRANSPARENT, &wch->bch.Flags); in w6692_mode()
614 wch->b_mode = W_B_MODE_ITF; in w6692_mode()
615 WriteW6692B(wch, W_B_MODE, wch->b_mode); in w6692_mode()
616 WriteW6692B(wch, W_B_ADM1, 0xff); in w6692_mode()
617 WriteW6692B(wch, W_B_ADM2, 0xff); in w6692_mode()
618 WriteW6692B(wch, W_B_EXIM, 0); in w6692_mode()
619 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT | in w6692_mode()
621 test_and_set_bit(FLG_HDLC, &wch->bch.Flags); in w6692_mode()
627 wch->bch.state = pr; in w6692_mode()
632 send_next(struct w6692_ch *wch) in send_next() argument
634 if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) { in send_next()
635 W6692_fill_Bfifo(wch); in send_next()
637 dev_kfree_skb(wch->bch.tx_skb); in send_next()
638 if (get_next_bframe(&wch->bch)) { in send_next()
639 W6692_fill_Bfifo(wch); 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()
642 W6692_fill_Bfifo(wch); in send_next()
650 struct w6692_ch *wch = &card->bc[ch]; in W6692B_interrupt() local
654 stat = ReadW6692B(wch, W_B_EXIR); in W6692B_interrupt()
655 pr_debug("%s: B%d EXIR %02x\n", card->name, wch->bch.nr, stat); in W6692B_interrupt()
657 star = ReadW6692B(wch, W_B_STAR); 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()
683 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | in W6692B_interrupt()
685 if (wch->bch.rx_skb) in W6692B_interrupt()
686 skb_trim(wch->bch.rx_skb, 0); in W6692B_interrupt()
688 count = ReadW6692B(wch, W_B_RBCL) & in W6692B_interrupt()
692 W6692_empty_Bfifo(wch, count); in W6692B_interrupt()
693 recv_Bchannel(&wch->bch, 0, false); in W6692B_interrupt()
698 star = ReadW6692B(wch, W_B_STAR); in W6692B_interrupt()
701 wch->bch.nr, wch->bch.state); in W6692B_interrupt()
703 wch->bch.err_rdo++; in W6692B_interrupt()
705 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | in W6692B_interrupt()
708 W6692_empty_Bfifo(wch, W_B_FIFO_THRESH); 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()
721 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | in W6692B_interrupt()
727 star = ReadW6692B(wch, W_B_STAR); 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()
737 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_XRST | 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()
745 send_next(wch); 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()
762 send_next(wch); in W6692B_interrupt()