From 5d5387a52aa276ca6891e78271814ec21a6cc337 Mon Sep 17 00:00:00 2001 From: Sven Schnelle Date: Mon, 9 Nov 2015 14:21:38 +0100 Subject: [PATCH] bcwc_pcie: fix tx queue index reset --- bcwc_ringbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bcwc_ringbuf.c b/bcwc_ringbuf.c index 5e8896e..ac677c9 100644 --- a/bcwc_ringbuf.c +++ b/bcwc_ringbuf.c @@ -85,9 +85,9 @@ struct bcwc_ringbuf_entry *bcwc_channel_ringbuf_send(struct bcwc_private *dev_pr u32 data_offset, u32 request_size, u32 response_size) { struct bcwc_ringbuf_entry *entry; - + pr_debug("%s: TX pos %d\n", chan->name, chan->ringbuf.send_idx); entry = get_entry_addr(dev_priv, chan, chan->ringbuf.send_idx++); - if (chan->ringbuf.send_idx > chan->size) + if (chan->ringbuf.send_idx >= chan->size) { chan->ringbuf.send_idx = 0; pr_debug("send entry %p offset %08x\n", entry, data_offset); entry->request_size = request_size;