diff options
author | Ivo van Doorn <IvDoorn@gmail.com> | 2010-11-06 10:48:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-15 13:26:32 -0500 |
commit | 813f0339dd739c48607f12dac79ec26c61874226 (patch) | |
tree | f758f461c71bdc176627af20692b9369ddb11f96 /drivers | |
parent | 821cde63b5bd04bc3ca0f95e2abf17b04e640488 (diff) |
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: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00debug.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.h | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c index 8296a9d47bb..64dfb1f6823 100644 --- a/drivers/net/wireless/rt2x00/rt2x00debug.c +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c | |||
@@ -342,7 +342,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file, | |||
342 | sprintf(data, "qid\tcount\tlimit\tlength\tindex\tdma done\tdone\n"); | 342 | sprintf(data, "qid\tcount\tlimit\tlength\tindex\tdma done\tdone\n"); |
343 | 343 | ||
344 | queue_for_each(intf->rt2x00dev, queue) { | 344 | queue_for_each(intf->rt2x00dev, queue) { |
345 | spin_lock_irqsave(&queue->lock, irqflags); | 345 | spin_lock_irqsave(&queue->index_lock, irqflags); |
346 | 346 | ||
347 | temp += sprintf(temp, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", queue->qid, | 347 | temp += sprintf(temp, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", queue->qid, |
348 | queue->count, queue->limit, queue->length, | 348 | queue->count, queue->limit, queue->length, |
@@ -350,7 +350,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file, | |||
350 | queue->index[Q_INDEX_DMA_DONE], | 350 | queue->index[Q_INDEX_DMA_DONE], |
351 | queue->index[Q_INDEX_DONE]); | 351 | queue->index[Q_INDEX_DONE]); |
352 | 352 | ||
353 | spin_unlock_irqrestore(&queue->lock, irqflags); | 353 | spin_unlock_irqrestore(&queue->index_lock, irqflags); |
354 | } | 354 | } |
355 | 355 | ||
356 | size = strlen(data); | 356 | size = strlen(data); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 32d6a17d5aa..aa4c8f2dc7d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -641,10 +641,10 @@ void rt2x00queue_for_each_entry(struct data_queue *queue, | |||
641 | * it should not be kicked during this run, since it | 641 | * it should not be kicked during this run, since it |
642 | * is part of another TX operation. | 642 | * is part of another TX operation. |
643 | */ | 643 | */ |
644 | spin_lock_irqsave(&queue->lock, irqflags); | 644 | spin_lock_irqsave(&queue->index_lock, irqflags); |
645 | index_start = queue->index[start]; | 645 | index_start = queue->index[start]; |
646 | index_end = queue->index[end]; | 646 | index_end = queue->index[end]; |
647 | spin_unlock_irqrestore(&queue->lock, irqflags); | 647 | spin_unlock_irqrestore(&queue->index_lock, irqflags); |
648 | 648 | ||
649 | /* | 649 | /* |
650 | * Start from the TX done pointer, this guarentees that we will | 650 | * 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 | return NULL; | 698 | return NULL; |
699 | } | 699 | } |
700 | 700 | ||
701 | spin_lock_irqsave(&queue->lock, irqflags); | 701 | spin_lock_irqsave(&queue->index_lock, irqflags); |
702 | 702 | ||
703 | entry = &queue->entries[queue->index[index]]; | 703 | entry = &queue->entries[queue->index[index]]; |
704 | 704 | ||
705 | spin_unlock_irqrestore(&queue->lock, irqflags); | 705 | spin_unlock_irqrestore(&queue->index_lock, irqflags); |
706 | 706 | ||
707 | return entry; | 707 | return entry; |
708 | } | 708 | } |
@@ -718,7 +718,7 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index) | |||
718 | return; | 718 | return; |
719 | } | 719 | } |
720 | 720 | ||
721 | spin_lock_irqsave(&queue->lock, irqflags); | 721 | spin_lock_irqsave(&queue->index_lock, irqflags); |
722 | 722 | ||
723 | queue->index[index]++; | 723 | queue->index[index]++; |
724 | if (queue->index[index] >= queue->limit) | 724 | if (queue->index[index] >= queue->limit) |
@@ -733,7 +733,7 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index) | |||
733 | queue->count++; | 733 | queue->count++; |
734 | } | 734 | } |
735 | 735 | ||
736 | spin_unlock_irqrestore(&queue->lock, irqflags); | 736 | spin_unlock_irqrestore(&queue->index_lock, irqflags); |
737 | } | 737 | } |
738 | 738 | ||
739 | static void rt2x00queue_reset(struct data_queue *queue) | 739 | static void rt2x00queue_reset(struct data_queue *queue) |
@@ -741,7 +741,7 @@ static void rt2x00queue_reset(struct data_queue *queue) | |||
741 | unsigned long irqflags; | 741 | unsigned long irqflags; |
742 | unsigned int i; | 742 | unsigned int i; |
743 | 743 | ||
744 | spin_lock_irqsave(&queue->lock, irqflags); | 744 | spin_lock_irqsave(&queue->index_lock, irqflags); |
745 | 745 | ||
746 | queue->count = 0; | 746 | queue->count = 0; |
747 | queue->length = 0; | 747 | queue->length = 0; |
@@ -751,7 +751,7 @@ static void rt2x00queue_reset(struct data_queue *queue) | |||
751 | queue->last_action[i] = jiffies; | 751 | queue->last_action[i] = jiffies; |
752 | } | 752 | } |
753 | 753 | ||
754 | spin_unlock_irqrestore(&queue->lock, irqflags); | 754 | spin_unlock_irqrestore(&queue->index_lock, irqflags); |
755 | } | 755 | } |
756 | 756 | ||
757 | void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev) | 757 | void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev) |
@@ -903,7 +903,7 @@ void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev) | |||
903 | static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev, | 903 | static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev, |
904 | struct data_queue *queue, enum data_queue_qid qid) | 904 | struct data_queue *queue, enum data_queue_qid qid) |
905 | { | 905 | { |
906 | spin_lock_init(&queue->lock); | 906 | spin_lock_init(&queue->index_lock); |
907 | 907 | ||
908 | queue->rt2x00dev = rt2x00dev; | 908 | queue->rt2x00dev = rt2x00dev; |
909 | queue->qid = qid; | 909 | queue->qid = qid; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index 64c00e2ab71..29b051ac640 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h | |||
@@ -398,7 +398,7 @@ enum queue_index { | |||
398 | * @entries: Base address of the &struct queue_entry which are | 398 | * @entries: Base address of the &struct queue_entry which are |
399 | * part of this queue. | 399 | * part of this queue. |
400 | * @qid: The queue identification, see &enum data_queue_qid. | 400 | * @qid: The queue identification, see &enum data_queue_qid. |
401 | * @lock: Spinlock to protect index handling. Whenever @index, @index_done or | 401 | * @index_lock: Spinlock to protect index handling. Whenever @index, @index_done or |
402 | * @index_crypt needs to be changed this lock should be grabbed to prevent | 402 | * @index_crypt needs to be changed this lock should be grabbed to prevent |
403 | * index corruption due to concurrency. | 403 | * index corruption due to concurrency. |
404 | * @count: Number of frames handled in the queue. | 404 | * @count: Number of frames handled in the queue. |
@@ -422,7 +422,7 @@ struct data_queue { | |||
422 | 422 | ||
423 | enum data_queue_qid qid; | 423 | enum data_queue_qid qid; |
424 | 424 | ||
425 | spinlock_t lock; | 425 | spinlock_t index_lock; |
426 | unsigned int count; | 426 | unsigned int count; |
427 | unsigned short limit; | 427 | unsigned short limit; |
428 | unsigned short threshold; | 428 | unsigned short threshold; |