w6692.c (8bfddfbe2100862fd39b97001d0559ccd4c77f19) w6692.c (7206e659f689558b41aa058c3040b081cb281d03)
1/*
2 * w6692.c mISDN driver for Winbond w6692 based cards
3 *
4 * Author Karsten Keil <kkeil@suse.de>
5 * based on the w6692 I4L driver from Petr Novak <petr.novak@i.cz>
6 *
7 * Copyright 2009 by Karsten Keil <keil@isdn4linux.de>
8 *

--- 451 unchanged lines hidden (view full) ---

460 pr_debug("%s: spurious TEXP interrupt!\n", card->name);
461}
462
463static void
464W6692_empty_Bfifo(struct w6692_ch *wch, int count)
465{
466 struct w6692_hw *card = wch->bch.hw;
467 u8 *ptr;
1/*
2 * w6692.c mISDN driver for Winbond w6692 based cards
3 *
4 * Author Karsten Keil <kkeil@suse.de>
5 * based on the w6692 I4L driver from Petr Novak <petr.novak@i.cz>
6 *
7 * Copyright 2009 by Karsten Keil <keil@isdn4linux.de>
8 *

--- 451 unchanged lines hidden (view full) ---

460 pr_debug("%s: spurious TEXP interrupt!\n", card->name);
461}
462
463static void
464W6692_empty_Bfifo(struct w6692_ch *wch, int count)
465{
466 struct w6692_hw *card = wch->bch.hw;
467 u8 *ptr;
468 int maxlen;
468
469 pr_debug("%s: empty_Bfifo %d\n", card->name, count);
470 if (unlikely(wch->bch.state == ISDN_P_NONE)) {
471 pr_debug("%s: empty_Bfifo ISDN_P_NONE\n", card->name);
472 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT);
473 if (wch->bch.rx_skb)
474 skb_trim(wch->bch.rx_skb, 0);
475 return;
476 }
469
470 pr_debug("%s: empty_Bfifo %d\n", card->name, count);
471 if (unlikely(wch->bch.state == ISDN_P_NONE)) {
472 pr_debug("%s: empty_Bfifo ISDN_P_NONE\n", card->name);
473 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT);
474 if (wch->bch.rx_skb)
475 skb_trim(wch->bch.rx_skb, 0);
476 return;
477 }
477 if (!wch->bch.rx_skb) {
478 wch->bch.rx_skb = mI_alloc_skb(wch->bch.maxlen, GFP_ATOMIC);
479 if (unlikely(!wch->bch.rx_skb)) {
480 pr_info("%s: B receive out of memory\n", card->name);
481 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK |
482 W_B_CMDR_RACT);
483 return;
484 }
485 }
486 if (wch->bch.rx_skb->len + count > wch->bch.maxlen) {
487 pr_debug("%s: empty_Bfifo incoming packet too large\n",
488 card->name);
478 maxlen = bchannel_get_rxbuf(&wch->bch, count);
479 if (maxlen < 0) {
489 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT);
480 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT);
490 skb_trim(wch->bch.rx_skb, 0);
481 if (wch->bch.rx_skb)
482 skb_trim(wch->bch.rx_skb, 0);
483 pr_warning("%s.B%d: No bufferspace for %d bytes\n",
484 card->name, wch->bch.nr, count);
491 return;
492 }
493 ptr = skb_put(wch->bch.rx_skb, count);
494 insb(wch->addr + W_B_RFIFO, ptr, count);
495 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT);
496 if (debug & DEBUG_HW_DFIFO) {
497 snprintf(card->log, 63, "B%1d-recv %s %d ",
498 wch->bch.nr, card->name, count);

--- 935 unchanged lines hidden ---
485 return;
486 }
487 ptr = skb_put(wch->bch.rx_skb, count);
488 insb(wch->addr + W_B_RFIFO, ptr, count);
489 WriteW6692B(wch, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT);
490 if (debug & DEBUG_HW_DFIFO) {
491 snprintf(card->log, 63, "B%1d-recv %s %d ",
492 wch->bch.nr, card->name, count);

--- 935 unchanged lines hidden ---