Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90165
b: refs/heads/master
c: 5f46c4d
h: refs/heads/master
i:
  90163: b943bb0
v: v3
  • Loading branch information
Ivo van Doorn authored and John W. Linville committed Mar 13, 2008
1 parent 66ec792 commit 8a8feab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 61191fb272dfa413763416ee828aae28bfd9746e
refs/heads/master: 5f46c4d0537a870f9d9c1fd998aa9d6dac682595
5 changes: 3 additions & 2 deletions trunk/drivers/net/wireless/rt2x00/rt2x00debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
{
struct rt2x00debug_intf *intf = file->private_data;
struct data_queue *queue;
unsigned long irqflags;
unsigned int lines = 1 + intf->rt2x00dev->data_queues;
size_t size;
char *data;
Expand All @@ -294,15 +295,15 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
sprintf(data, "qid\tcount\tlimit\tlength\tindex\tdone\tcrypto\n");

queue_for_each(intf->rt2x00dev, queue) {
spin_lock(&queue->lock);
spin_lock_irqsave(&queue->lock, irqflags);

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->index[Q_INDEX],
queue->index[Q_INDEX_DONE],
queue->index[Q_INDEX_CRYPTO]);

spin_unlock(&queue->lock);
spin_unlock_irqrestore(&queue->lock, irqflags);
}

size = strlen(data);
Expand Down
17 changes: 11 additions & 6 deletions trunk/drivers/net/wireless/rt2x00/rt2x00queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,35 @@ struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,
enum queue_index index)
{
struct queue_entry *entry;
unsigned long irqflags;

if (unlikely(index >= Q_INDEX_MAX)) {
ERROR(queue->rt2x00dev,
"Entry requested from invalid index type (%d)\n", index);
return NULL;
}

spin_lock(&queue->lock);
spin_lock_irqsave(&queue->lock, irqflags);

entry = &queue->entries[queue->index[index]];

spin_unlock(&queue->lock);
spin_unlock_irqrestore(&queue->lock, irqflags);

return entry;
}
EXPORT_SYMBOL_GPL(rt2x00queue_get_entry);

void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index)
{
unsigned long irqflags;

if (unlikely(index >= Q_INDEX_MAX)) {
ERROR(queue->rt2x00dev,
"Index change on invalid index type (%d)\n", index);
return;
}

spin_lock(&queue->lock);
spin_lock_irqsave(&queue->lock, irqflags);

queue->index[index]++;
if (queue->index[index] >= queue->limit)
Expand All @@ -91,19 +94,21 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index)
queue->count ++;
}

spin_unlock(&queue->lock);
spin_unlock_irqrestore(&queue->lock, irqflags);
}
EXPORT_SYMBOL_GPL(rt2x00queue_index_inc);

static void rt2x00queue_reset(struct data_queue *queue)
{
spin_lock(&queue->lock);
unsigned long irqflags;

spin_lock_irqsave(&queue->lock, irqflags);

queue->count = 0;
queue->length = 0;
memset(queue->index, 0, sizeof(queue->index));

spin_unlock(&queue->lock);
spin_unlock_irqrestore(&queue->lock, irqflags);
}

void rt2x00queue_init_rx(struct rt2x00_dev *rt2x00dev)
Expand Down

0 comments on commit 8a8feab

Please sign in to comment.