diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 9188323f067b..659e9f44c40c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -53,6 +53,7 @@ struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue, | |||
53 | enum queue_index index) | 53 | enum queue_index index) |
54 | { | 54 | { |
55 | struct queue_entry *entry; | 55 | struct queue_entry *entry; |
56 | unsigned long irqflags; | ||
56 | 57 | ||
57 | if (unlikely(index >= Q_INDEX_MAX)) { | 58 | if (unlikely(index >= Q_INDEX_MAX)) { |
58 | ERROR(queue->rt2x00dev, | 59 | ERROR(queue->rt2x00dev, |
@@ -60,11 +61,11 @@ struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue, | |||
60 | return NULL; | 61 | return NULL; |
61 | } | 62 | } |
62 | 63 | ||
63 | spin_lock(&queue->lock); | 64 | spin_lock_irqsave(&queue->lock, irqflags); |
64 | 65 | ||
65 | entry = &queue->entries[queue->index[index]]; | 66 | entry = &queue->entries[queue->index[index]]; |
66 | 67 | ||
67 | spin_unlock(&queue->lock); | 68 | spin_unlock_irqrestore(&queue->lock, irqflags); |
68 | 69 | ||
69 | return entry; | 70 | return entry; |
70 | } | 71 | } |
@@ -72,13 +73,15 @@ EXPORT_SYMBOL_GPL(rt2x00queue_get_entry); | |||
72 | 73 | ||
73 | void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index) | 74 | void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index) |
74 | { | 75 | { |
76 | unsigned long irqflags; | ||
77 | |||
75 | if (unlikely(index >= Q_INDEX_MAX)) { | 78 | if (unlikely(index >= Q_INDEX_MAX)) { |
76 | ERROR(queue->rt2x00dev, | 79 | ERROR(queue->rt2x00dev, |
77 | "Index change on invalid index type (%d)\n", index); | 80 | "Index change on invalid index type (%d)\n", index); |
78 | return; | 81 | return; |
79 | } | 82 | } |
80 | 83 | ||
81 | spin_lock(&queue->lock); | 84 | spin_lock_irqsave(&queue->lock, irqflags); |
82 | 85 | ||
83 | queue->index[index]++; | 86 | queue->index[index]++; |
84 | if (queue->index[index] >= queue->limit) | 87 | if (queue->index[index] >= queue->limit) |
@@ -91,19 +94,21 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index) | |||
91 | queue->count ++; | 94 | queue->count ++; |
92 | } | 95 | } |
93 | 96 | ||
94 | spin_unlock(&queue->lock); | 97 | spin_unlock_irqrestore(&queue->lock, irqflags); |
95 | } | 98 | } |
96 | EXPORT_SYMBOL_GPL(rt2x00queue_index_inc); | 99 | EXPORT_SYMBOL_GPL(rt2x00queue_index_inc); |
97 | 100 | ||
98 | static void rt2x00queue_reset(struct data_queue *queue) | 101 | static void rt2x00queue_reset(struct data_queue *queue) |
99 | { | 102 | { |
100 | spin_lock(&queue->lock); | 103 | unsigned long irqflags; |
104 | |||
105 | spin_lock_irqsave(&queue->lock, irqflags); | ||
101 | 106 | ||
102 | queue->count = 0; | 107 | queue->count = 0; |
103 | queue->length = 0; | 108 | queue->length = 0; |
104 | memset(queue->index, 0, sizeof(queue->index)); | 109 | memset(queue->index, 0, sizeof(queue->index)); |
105 | 110 | ||
106 | spin_unlock(&queue->lock); | 111 | spin_unlock_irqrestore(&queue->lock, irqflags); |
107 | } | 112 | } |
108 | 113 | ||
109 | void rt2x00queue_init_rx(struct rt2x00_dev *rt2x00dev) | 114 | void rt2x00queue_init_rx(struct rt2x00_dev *rt2x00dev) |