H A D | w6692.c | 464 W6692_empty_Bfifo(struct w6692_ch *wch, int count) W6692_empty_Bfifo() argument 466 struct w6692_hw *card = wch->bch.hw; W6692_empty_Bfifo() 471 if (unlikely(wch->bch.state == ISDN_P_NONE)) { W6692_empty_Bfifo() 473 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); W6692_empty_Bfifo() 474 if (wch->bch.rx_skb) W6692_empty_Bfifo() 475 skb_trim(wch->bch.rx_skb, 0); W6692_empty_Bfifo() 478 if (test_bit(FLG_RX_OFF, &wch->bch.Flags)) { W6692_empty_Bfifo() 479 wch->bch.dropcnt += count; W6692_empty_Bfifo() 480 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); W6692_empty_Bfifo() 483 maxlen = bchannel_get_rxbuf(&wch->bch, count); W6692_empty_Bfifo() 485 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); W6692_empty_Bfifo() 486 if (wch->bch.rx_skb) W6692_empty_Bfifo() 487 skb_trim(wch->bch.rx_skb, 0); W6692_empty_Bfifo() 489 card->name, wch->bch.nr, count); W6692_empty_Bfifo() 492 ptr = skb_put(wch->bch.rx_skb, count); W6692_empty_Bfifo() 493 insb(wch->addr + W_B_RFIFO, ptr, count); W6692_empty_Bfifo() 494 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); W6692_empty_Bfifo() 497 wch->bch.nr, card->name, count); W6692_empty_Bfifo() 503 W6692_fill_Bfifo(struct w6692_ch *wch) W6692_fill_Bfifo() argument 505 struct w6692_hw *card = wch->bch.hw; W6692_fill_Bfifo() 510 if (!wch->bch.tx_skb) { W6692_fill_Bfifo() 511 if (!test_bit(FLG_TX_EMPTY, &wch->bch.Flags)) W6692_fill_Bfifo() 513 ptr = wch->bch.fill; W6692_fill_Bfifo() 517 count = wch->bch.tx_skb->len - wch->bch.tx_idx; W6692_fill_Bfifo() 520 ptr = wch->bch.tx_skb->data + wch->bch.tx_idx; W6692_fill_Bfifo() 524 else if (test_bit(FLG_HDLC, &wch->bch.Flags)) W6692_fill_Bfifo() 528 count, wch->bch.tx_idx); W6692_fill_Bfifo() 529 wch->bch.tx_idx += count; W6692_fill_Bfifo() 532 outsb(wch->addr + W_B_XFIFO, ptr, MISDN_BCH_FILL_SIZE); W6692_fill_Bfifo() 536 outsb(wch->addr + W_B_XFIFO, ptr, count); W6692_fill_Bfifo() 538 WriteW6692B(wch, W_B_CMDR, cmd); W6692_fill_Bfifo() 541 wch->bch.nr, card->name, count); W6692_fill_Bfifo() 548 setvolume(struct w6692_ch *wch, int mic, struct sk_buff *skb) 550 struct w6692_hw *card = wch->bch.hw; 555 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) 575 enable_pots(struct w6692_ch *wch) 577 struct w6692_hw *card = wch->bch.hw; 580 !test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) 582 wch->b_mode |= W_B_MODE_EPCM | W_B_MODE_BSW0; 583 WriteW6692B(wch, W_B_MODE, wch->b_mode); 584 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST); 585 card->pctl |= ((wch->bch.nr & 2) ? W_PCTL_PCX : 0); 592 disable_pots(struct w6692_ch *wch) disable_pots() argument 594 struct w6692_hw *card = wch->bch.hw; disable_pots() 598 wch->b_mode &= ~(W_B_MODE_EPCM | W_B_MODE_BSW0); disable_pots() 599 WriteW6692B(wch, W_B_MODE, wch->b_mode); disable_pots() 600 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT | disable_pots() 606 w6692_mode(struct w6692_ch *wch, u32 pr) w6692_mode() argument 610 card = wch->bch.hw; w6692_mode() 612 wch->bch.nr, wch->bch.state, pr); w6692_mode() 615 if ((card->fmask & pots) && (wch->b_mode & W_B_MODE_EPCM)) w6692_mode() 616 disable_pots(wch); w6692_mode() 617 wch->b_mode = 0; w6692_mode() 618 mISDN_clear_bchannel(&wch->bch); w6692_mode() 619 WriteW6692B(wch, W_B_MODE, wch->b_mode); w6692_mode() 620 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST); w6692_mode() 621 test_and_clear_bit(FLG_HDLC, &wch->bch.Flags); w6692_mode() 622 test_and_clear_bit(FLG_TRANSPARENT, &wch->bch.Flags); w6692_mode() 625 wch->b_mode = W_B_MODE_MMS; w6692_mode() 626 WriteW6692B(wch, W_B_MODE, wch->b_mode); w6692_mode() 627 WriteW6692B(wch, W_B_EXIM, 0); w6692_mode() 628 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT | w6692_mode() 630 test_and_set_bit(FLG_TRANSPARENT, &wch->bch.Flags); w6692_mode() 633 wch->b_mode = W_B_MODE_ITF; w6692_mode() 634 WriteW6692B(wch, W_B_MODE, wch->b_mode); w6692_mode() 635 WriteW6692B(wch, W_B_ADM1, 0xff); w6692_mode() 636 WriteW6692B(wch, W_B_ADM2, 0xff); w6692_mode() 637 WriteW6692B(wch, W_B_EXIM, 0); w6692_mode() 638 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_RACT | w6692_mode() 640 test_and_set_bit(FLG_HDLC, &wch->bch.Flags); w6692_mode() 646 wch->bch.state = pr; w6692_mode() 651 send_next(struct w6692_ch *wch) send_next() argument 653 if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) { send_next() 654 W6692_fill_Bfifo(wch); send_next() 656 if (wch->bch.tx_skb) send_next() 657 dev_kfree_skb(wch->bch.tx_skb); send_next() 658 if (get_next_bframe(&wch->bch)) { send_next() 659 W6692_fill_Bfifo(wch); send_next() 660 test_and_clear_bit(FLG_TX_EMPTY, &wch->bch.Flags); send_next() 661 } else if (test_bit(FLG_TX_EMPTY, &wch->bch.Flags)) { send_next() 662 W6692_fill_Bfifo(wch); send_next() 670 struct w6692_ch *wch = &card->bc[ch]; W6692B_interrupt() local 674 stat = ReadW6692B(wch, W_B_EXIR); W6692B_interrupt() 675 pr_debug("%s: B%d EXIR %02x\n", card->name, wch->bch.nr, stat); W6692B_interrupt() 677 star = ReadW6692B(wch, W_B_STAR); W6692B_interrupt() 680 test_bit(FLG_ACTIVE, &wch->bch.Flags)) { W6692B_interrupt() 682 wch->bch.nr, wch->bch.state); W6692B_interrupt() 684 wch->bch.err_rdo++; W6692B_interrupt() 687 if (test_bit(FLG_HDLC, &wch->bch.Flags)) { W6692B_interrupt() 690 card->name, wch->bch.nr); W6692B_interrupt() 692 wch->bch.err_crc++; W6692B_interrupt() 697 card->name, wch->bch.nr); W6692B_interrupt() 699 wch->bch.err_inv++; W6692B_interrupt() 703 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W6692B_interrupt() 705 if (wch->bch.rx_skb) W6692B_interrupt() 706 skb_trim(wch->bch.rx_skb, 0); W6692B_interrupt() 708 count = ReadW6692B(wch, W_B_RBCL) & W6692B_interrupt() 712 W6692_empty_Bfifo(wch, count); W6692B_interrupt() 713 recv_Bchannel(&wch->bch, 0, false); W6692B_interrupt() 718 star = ReadW6692B(wch, W_B_STAR); W6692B_interrupt() 721 wch->bch.nr, wch->bch.state); W6692B_interrupt() 723 wch->bch.err_rdo++; W6692B_interrupt() 725 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W6692B_interrupt() 728 W6692_empty_Bfifo(wch, W_B_FIFO_THRESH); W6692B_interrupt() 729 if (test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) W6692B_interrupt() 730 recv_Bchannel(&wch->bch, 0, false); W6692B_interrupt() 737 wch->bch.nr, wch->bch.state); W6692B_interrupt() 739 wch->bch.err_rdo++; W6692B_interrupt() 741 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W6692B_interrupt() 747 star = ReadW6692B(wch, W_B_STAR); W6692B_interrupt() 749 wch->bch.nr, star); W6692B_interrupt() 753 wch->bch.nr, wch->bch.state); W6692B_interrupt() 755 wch->bch.err_xdu++; W6692B_interrupt() 757 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_XRST | W6692B_interrupt() 760 if (wch->bch.tx_skb) { W6692B_interrupt() 761 if (!test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) W6692B_interrupt() 762 wch->bch.tx_idx = 0; W6692B_interrupt() 765 send_next(wch); W6692B_interrupt() 771 wch->bch.nr, wch->bch.state); W6692B_interrupt() 773 wch->bch.err_xdu++; W6692B_interrupt() 776 if (wch->bch.tx_skb) { W6692B_interrupt() 777 if (!test_bit(FLG_TRANSPARENT, &wch->bch.Flags)) W6692B_interrupt() 778 wch->bch.tx_idx = 0; W6692B_interrupt() 779 } else if (test_bit(FLG_FILLEMPTY, &wch->bch.Flags)) { W6692B_interrupt() 780 test_and_set_bit(FLG_TX_EMPTY, &wch->bch.Flags); W6692B_interrupt() 782 send_next(wch); W6692B_interrupt()
|