diff options
author | Karsten Keil <kkeil@linux-pingi.de> | 2012-05-15 23:51:08 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-16 15:24:36 -0400 |
commit | c27b46e7f1cbf3be95a4cf5840c76a7b7d54b26f (patch) | |
tree | db406c5ceb174b3b41a0085929fe85c5e6951bb6 /drivers/isdn/hardware/mISDN/avmfritz.c | |
parent | 6d1ee48fd0d8d2586aaeda24dacffc426c2be44a (diff) |
mISDN: Implement MISDN_CTRL_RX_OFF for more drivers
MISDN_CTRL_RX_OFF is a meachanism to discard RX data in the driver if
the data is not needed by the application. It can be used when playing
mesages, but not recording or with unidirectional protocols.
Signed-off-by: Karsten Keil <kkeil@linux-pingi.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/hardware/mISDN/avmfritz.c')
-rw-r--r-- | drivers/isdn/hardware/mISDN/avmfritz.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c b/drivers/isdn/hardware/mISDN/avmfritz.c index c6fa505a1d1..c08fc605e56 100644 --- a/drivers/isdn/hardware/mISDN/avmfritz.c +++ b/drivers/isdn/hardware/mISDN/avmfritz.c @@ -408,13 +408,18 @@ hdlc_empty_fifo(struct bchannel *bch, int count) struct fritzcard *fc = bch->hw; pr_debug("%s: %s %d\n", fc->name, __func__, count); - cnt = bchannel_get_rxbuf(bch, count); - if (cnt < 0) { - pr_warning("%s.B%d: No bufferspace for %d bytes\n", - fc->name, bch->nr, count); - return; + if (test_bit(FLG_RX_OFF, &bch->Flags)) { + p = NULL; + bch->dropcnt += count; + } else { + cnt = bchannel_get_rxbuf(bch, count); + if (cnt < 0) { + pr_warning("%s.B%d: No bufferspace for %d bytes\n", + fc->name, bch->nr, count); + return; + } + p = skb_put(bch->rx_skb, count); } - p = skb_put(bch->rx_skb, count); ptr = (u32 *)p; if (fc->type == AVM_FRITZ_PCIV2) addr = fc->addr + (bch->nr == 2 ? @@ -426,11 +431,13 @@ hdlc_empty_fifo(struct bchannel *bch, int count) cnt = 0; while (cnt < count) { val = le32_to_cpu(inl(addr)); - put_unaligned(val, ptr); - ptr++; + if (p) { + put_unaligned(val, ptr); + ptr++; + } cnt += 4; } - if (debug & DEBUG_HW_BFIFO) { + if (p && (debug & DEBUG_HW_BFIFO)) { snprintf(fc->log, LOG_SIZE, "B%1d-recv %s %d ", bch->nr, fc->name, count); print_hex_dump_bytes(fc->log, DUMP_PREFIX_OFFSET, p, count); |