mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
rt2x00: rt2x00queue: add priv_size field to struct data_queue
Add a new field into struct data_queue and store the size of the per-queue_entry private data in that. Additionally, use the new field in the rt2x00queue_alloc_entries function to compute the size of the queue entries for a given queue. The patch does not change the current behaviour but makes it possible to remove the queue_desc parameter of the rt2x00queue_alloc_entries function. That will be done by a subsequent patch. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
057c1dd6cd
commit
568f7a438f
2 changed files with 5 additions and 2 deletions
|
@ -1173,7 +1173,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
|
|||
/*
|
||||
* Allocate all queue entries.
|
||||
*/
|
||||
entry_size = sizeof(*entries) + qdesc->priv_size;
|
||||
entry_size = sizeof(*entries) + queue->priv_size;
|
||||
entries = kcalloc(queue->limit, entry_size, GFP_KERNEL);
|
||||
if (!entries)
|
||||
return -ENOMEM;
|
||||
|
@ -1189,7 +1189,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
|
|||
entries[i].entry_idx = i;
|
||||
entries[i].priv_data =
|
||||
QUEUE_ENTRY_PRIV_OFFSET(entries, i, queue->limit,
|
||||
sizeof(*entries), qdesc->priv_size);
|
||||
sizeof(*entries), queue->priv_size);
|
||||
}
|
||||
|
||||
#undef QUEUE_ENTRY_PRIV_OFFSET
|
||||
|
@ -1329,6 +1329,7 @@ static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev,
|
|||
queue->data_size = qdesc->data_size;
|
||||
queue->desc_size = qdesc->desc_size;
|
||||
queue->winfo_size = qdesc->winfo_size;
|
||||
queue->priv_size = qdesc->priv_size;
|
||||
}
|
||||
|
||||
int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue