aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-06-04 07:40:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-06-12 14:59:33 -0400
commit568f7a438f6d5f0f0909c94e66b7c5c8b96ebf7a (patch)
treef330758eea81a096684c146c5796af43de8db9b0 /drivers/net/wireless/rt2x00/rt2x00queue.c
parent057c1dd6cd5041e3b6a6fb65708ac5a4d9c12b36 (diff)
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>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 5efbbbdca701..7f938a513f3a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -1173,7 +1173,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
1173 /* 1173 /*
1174 * Allocate all queue entries. 1174 * Allocate all queue entries.
1175 */ 1175 */
1176 entry_size = sizeof(*entries) + qdesc->priv_size; 1176 entry_size = sizeof(*entries) + queue->priv_size;
1177 entries = kcalloc(queue->limit, entry_size, GFP_KERNEL); 1177 entries = kcalloc(queue->limit, entry_size, GFP_KERNEL);
1178 if (!entries) 1178 if (!entries)
1179 return -ENOMEM; 1179 return -ENOMEM;
@@ -1189,7 +1189,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
1189 entries[i].entry_idx = i; 1189 entries[i].entry_idx = i;
1190 entries[i].priv_data = 1190 entries[i].priv_data =
1191 QUEUE_ENTRY_PRIV_OFFSET(entries, i, queue->limit, 1191 QUEUE_ENTRY_PRIV_OFFSET(entries, i, queue->limit,
1192 sizeof(*entries), qdesc->priv_size); 1192 sizeof(*entries), queue->priv_size);
1193 } 1193 }
1194 1194
1195#undef QUEUE_ENTRY_PRIV_OFFSET 1195#undef QUEUE_ENTRY_PRIV_OFFSET
@@ -1329,6 +1329,7 @@ static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev,
1329 queue->data_size = qdesc->data_size; 1329 queue->data_size = qdesc->data_size;
1330 queue->desc_size = qdesc->desc_size; 1330 queue->desc_size = qdesc->desc_size;
1331 queue->winfo_size = qdesc->winfo_size; 1331 queue->winfo_size = qdesc->winfo_size;
1332 queue->priv_size = qdesc->priv_size;
1332} 1333}
1333 1334
1334int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev) 1335int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)