Commit 813f0339 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville

rt2x00: Rename queue->lock to queue->index_lock

The queue->lock is only used to protect the index
numbers. Rename the lock accordingly.
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 821cde63
...@@ -342,7 +342,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file, ...@@ -342,7 +342,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
sprintf(data, "qid\tcount\tlimit\tlength\tindex\tdma done\tdone\n"); sprintf(data, "qid\tcount\tlimit\tlength\tindex\tdma done\tdone\n");
queue_for_each(intf->rt2x00dev, queue) { queue_for_each(intf->rt2x00dev, queue) {
spin_lock_irqsave(&queue->lock, irqflags); spin_lock_irqsave(&queue->index_lock, irqflags);
temp += sprintf(temp, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", queue->qid, temp += sprintf(temp, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", queue->qid,
queue->count, queue->limit, queue->length, queue->count, queue->limit, queue->length,
...@@ -350,7 +350,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file, ...@@ -350,7 +350,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
queue->index[Q_INDEX_DMA_DONE], queue->index[Q_INDEX_DMA_DONE],
queue->index[Q_INDEX_DONE]); queue->index[Q_INDEX_DONE]);
spin_unlock_irqrestore(&queue->lock, irqflags); spin_unlock_irqrestore(&queue->index_lock, irqflags);
} }
size = strlen(data); size = strlen(data);
......
...@@ -641,10 +641,10 @@ void rt2x00queue_for_each_entry(struct data_queue *queue, ...@@ -641,10 +641,10 @@ void rt2x00queue_for_each_entry(struct data_queue *queue,
* it should not be kicked during this run, since it * it should not be kicked during this run, since it
* is part of another TX operation. * is part of another TX operation.
*/ */
spin_lock_irqsave(&queue->lock, irqflags); spin_lock_irqsave(&queue->index_lock, irqflags);
index_start = queue->index[start]; index_start = queue->index[start];
index_end = queue->index[end]; index_end = queue->index[end];
spin_unlock_irqrestore(&queue->lock, irqflags); spin_unlock_irqrestore(&queue->index_lock, irqflags);
/* /*
* Start from the TX done pointer, this guarentees that we will * Start from the TX done pointer, this guarentees that we will
...@@ -698,11 +698,11 @@ struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue, ...@@ -698,11 +698,11 @@ struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,
return NULL; return NULL;
} }
spin_lock_irqsave(&queue->lock, irqflags); spin_lock_irqsave(&queue->index_lock, irqflags);
entry = &queue->entries[queue->index[index]]; entry = &queue->entries[queue->index[index]];
spin_unlock_irqrestore(&queue->lock, irqflags); spin_unlock_irqrestore(&queue->index_lock, irqflags);
return entry; return entry;
} }
...@@ -718,7 +718,7 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index) ...@@ -718,7 +718,7 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index)
return; return;
} }
spin_lock_irqsave(&queue->lock, irqflags); spin_lock_irqsave(&queue->index_lock, irqflags);
queue->index[index]++; queue->index[index]++;
if (queue->index[index] >= queue->limit) if (queue->index[index] >= queue->limit)
...@@ -733,7 +733,7 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index) ...@@ -733,7 +733,7 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index)
queue->count++; queue->count++;
} }
spin_unlock_irqrestore(&queue->lock, irqflags); spin_unlock_irqrestore(&queue->index_lock, irqflags);
} }
static void rt2x00queue_reset(struct data_queue *queue) static void rt2x00queue_reset(struct data_queue *queue)
...@@ -741,7 +741,7 @@ static void rt2x00queue_reset(struct data_queue *queue) ...@@ -741,7 +741,7 @@ static void rt2x00queue_reset(struct data_queue *queue)
unsigned long irqflags; unsigned long irqflags;
unsigned int i; unsigned int i;
spin_lock_irqsave(&queue->lock, irqflags); spin_lock_irqsave(&queue->index_lock, irqflags);
queue->count = 0; queue->count = 0;
queue->length = 0; queue->length = 0;
...@@ -751,7 +751,7 @@ static void rt2x00queue_reset(struct data_queue *queue) ...@@ -751,7 +751,7 @@ static void rt2x00queue_reset(struct data_queue *queue)
queue->last_action[i] = jiffies; queue->last_action[i] = jiffies;
} }
spin_unlock_irqrestore(&queue->lock, irqflags); spin_unlock_irqrestore(&queue->index_lock, irqflags);
} }
void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev) void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev)
...@@ -903,7 +903,7 @@ void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev) ...@@ -903,7 +903,7 @@ void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev)
static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev, static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev,
struct data_queue *queue, enum data_queue_qid qid) struct data_queue *queue, enum data_queue_qid qid)
{ {
spin_lock_init(&queue->lock); spin_lock_init(&queue->index_lock);
queue->rt2x00dev = rt2x00dev; queue->rt2x00dev = rt2x00dev;
queue->qid = qid; queue->qid = qid;
......
...@@ -398,7 +398,7 @@ enum queue_index { ...@@ -398,7 +398,7 @@ enum queue_index {
* @entries: Base address of the &struct queue_entry which are * @entries: Base address of the &struct queue_entry which are
* part of this queue. * part of this queue.
* @qid: The queue identification, see &enum data_queue_qid. * @qid: The queue identification, see &enum data_queue_qid.
* @lock: Spinlock to protect index handling. Whenever @index, @index_done or * @index_lock: Spinlock to protect index handling. Whenever @index, @index_done or
* @index_crypt needs to be changed this lock should be grabbed to prevent * @index_crypt needs to be changed this lock should be grabbed to prevent
* index corruption due to concurrency. * index corruption due to concurrency.
* @count: Number of frames handled in the queue. * @count: Number of frames handled in the queue.
...@@ -422,7 +422,7 @@ struct data_queue { ...@@ -422,7 +422,7 @@ struct data_queue {
enum data_queue_qid qid; enum data_queue_qid qid;
spinlock_t lock; spinlock_t index_lock;
unsigned int count; unsigned int count;
unsigned short limit; unsigned short limit;
unsigned short threshold; unsigned short threshold;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment