From: Gabor Juhos <juhosg@openwrt.org>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com,
Gabor Juhos <juhosg@openwrt.org>
Subject: [PATCH 01/13] rt2x00: rt2x00queue: add priv_size field to struct data_queue
Date: Tue, 4 Jun 2013 13:40:38 +0200 [thread overview]
Message-ID: <1370346050-7047-2-git-send-email-juhosg@openwrt.org> (raw)
In-Reply-To: <1370346050-7047-1-git-send-email-juhosg@openwrt.org>
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>
---
drivers/net/wireless/rt2x00/rt2x00queue.c | 5 +++--
drivers/net/wireless/rt2x00/rt2x00queue.h | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 5efbbbd..7f938a5 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,
/*
* 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)
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index 4a7b34e..2cf4903 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -453,6 +453,7 @@ enum data_queue_flags {
* @cw_max: The cw max value for outgoing frames (field ignored in RX queue).
* @data_size: Maximum data size for the frames in this queue.
* @desc_size: Hardware descriptor size for the data in this queue.
+ * @priv_size: Size of per-queue_entry private data.
* @usb_endpoint: Device endpoint used for communication (USB only)
* @usb_maxpacket: Max packet size for given endpoint (USB only)
*/
@@ -481,6 +482,7 @@ struct data_queue {
unsigned short data_size;
unsigned char desc_size;
unsigned char winfo_size;
+ unsigned short priv_size;
unsigned short usb_endpoint;
unsigned short usb_maxpacket;
--
1.7.10
next prev parent reply other threads:[~2013-06-04 11:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 11:40 [PATCH 00/13] rt2x00: get rid of static data queue descriptors Gabor Juhos
2013-06-04 11:40 ` Gabor Juhos [this message]
2013-06-04 11:40 ` [PATCH 02/13] rt2x00: rt2x00queue: remove qdesc parameter of rt2x00queue_alloc_entries Gabor Juhos
2013-06-04 11:40 ` [PATCH 03/13] rt2x00: rt2x00dev: use rt2x00dev->bcn->limit Gabor Juhos
2013-06-04 11:40 ` [PATCH 04/13] rt2x00: rt2x00queue: setup queue->threshold from queue->limit Gabor Juhos
2013-06-04 11:40 ` [PATCH 05/13] rt2x00: add queue_init callback to rt2x00_ops Gabor Juhos
2013-06-04 11:40 ` [PATCH 06/13] rt2x00: rt2800usb: implement queue_init callback Gabor Juhos
2013-06-04 11:40 ` [PATCH 07/13] rt2x00: rt2800pci: " Gabor Juhos
2013-06-04 11:40 ` [PATCH 08/13] rt2x00: rt73usb: " Gabor Juhos
2013-06-04 11:40 ` [PATCH 09/13] rt2x00: rt2400pci: " Gabor Juhos
2013-06-04 11:40 ` [PATCH 10/13] rt2x00: rt2500pci: " Gabor Juhos
2013-06-04 11:40 ` [PATCH 11/13] rt2x00: rt61pci: " Gabor Juhos
2013-06-04 11:40 ` [PATCH 12/13] rt2x00: rt2500usb: " Gabor Juhos
2013-06-04 11:40 ` [PATCH 13/13] rt2x00: remove data_queue_desc struct Gabor Juhos
2013-06-04 13:57 ` [PATCH 00/13] rt2x00: get rid of static data queue descriptors Stanislaw Gruszka
2013-06-11 18:29 ` Gertjan van Wingerde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370346050-7047-2-git-send-email-juhosg@openwrt.org \
--to=juhosg@openwrt.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=users@rt2x00.serialmonkey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).