rt2x00: Fix queue index handling
authorIvo van Doorn <ivdoorn@gmail.com>
Sun, 3 Feb 2008 14:55:21 +0000 (15:55 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 29 Feb 2008 20:19:29 +0000 (15:19 -0500)
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>
drivers/net/wireless/rt2x00/rt2x00queue.c

index 52bb57ddc05f0d792bf958fa797717fc6c4d0ed7..fde64ea3f4ef56aaeaa6f70b6b4c5ef677cae452 100644 (file)
@@ -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);
 }