summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-03 15:55:21 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:29 -0500
commit10b6b80145cc93887dd8aab99bfffa375e9add31 (patch)
tree043f0e2393a42482574cc1a718054779caaf0c9d
parent5957da4c6e67a5447e75c2ad65252fdd5e22f9d0 (diff)
rt2x00: Fix queue index handling
When Q_INDEX is increased, the queue->length should be increased, only when Q_INDEX_DONE is increased should queue_length be descreased. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 52bb57ddc05..fde64ea3f4e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -84,8 +84,12 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index)
if (queue->index[index] >= queue->limit)
queue->index[index] = 0;
- queue->length--;
- queue->count += (index == Q_INDEX_DONE);
+ if (index == Q_INDEX) {
+ queue->length++;
+ } else if (index == Q_INDEX_DONE) {
+ queue->length--;
+ queue->count ++;
+ }
spin_unlock(&queue->lock);
}