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 07/13] rt2x00: rt2800pci: implement queue_init callback
Date: Tue, 4 Jun 2013 13:40:44 +0200 [thread overview]
Message-ID: <1370346050-7047-8-git-send-email-juhosg@openwrt.org> (raw)
In-Reply-To: <1370346050-7047-1-git-send-email-juhosg@openwrt.org>
The generic rt2x00 code has been changed to allow the
drivers toimplement dynamic data_queue initialization.
Remove the static data queue descriptor structures
and implement the queue_init callback instead.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 60 ++++++++++++++++++-------------
1 file changed, 36 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 330f1d2..260c8b4 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -1186,29 +1186,43 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
.sta_remove = rt2800_sta_remove,
};
-static const struct data_queue_desc rt2800pci_queue_rx = {
- .entry_num = 128,
- .data_size = AGGREGATION_SIZE,
- .desc_size = RXD_DESC_SIZE,
- .winfo_size = RXWI_DESC_SIZE,
- .priv_size = sizeof(struct queue_entry_priv_mmio),
-};
+static void rt2800pci_queue_init(struct data_queue *queue)
+{
+ switch (queue->qid) {
+ case QID_RX:
+ queue->limit = 128;
+ queue->data_size = AGGREGATION_SIZE;
+ queue->desc_size = RXD_DESC_SIZE;
+ queue->winfo_size = RXWI_DESC_SIZE;
+ queue->priv_size = sizeof(struct queue_entry_priv_mmio);
+ break;
-static const struct data_queue_desc rt2800pci_queue_tx = {
- .entry_num = 64,
- .data_size = AGGREGATION_SIZE,
- .desc_size = TXD_DESC_SIZE,
- .winfo_size = TXWI_DESC_SIZE,
- .priv_size = sizeof(struct queue_entry_priv_mmio),
-};
+ case QID_AC_VO:
+ case QID_AC_VI:
+ case QID_AC_BE:
+ case QID_AC_BK:
+ queue->limit = 64;
+ queue->data_size = AGGREGATION_SIZE;
+ queue->desc_size = TXD_DESC_SIZE;
+ queue->winfo_size = TXWI_DESC_SIZE;
+ queue->priv_size = sizeof(struct queue_entry_priv_mmio);
+ break;
-static const struct data_queue_desc rt2800pci_queue_bcn = {
- .entry_num = 8,
- .data_size = 0, /* No DMA required for beacons */
- .desc_size = TXD_DESC_SIZE,
- .winfo_size = TXWI_DESC_SIZE,
- .priv_size = sizeof(struct queue_entry_priv_mmio),
-};
+ case QID_BEACON:
+ queue->limit = 8;
+ queue->data_size = 0; /* No DMA required for beacons */
+ queue->desc_size = TXD_DESC_SIZE;
+ queue->winfo_size = TXWI_DESC_SIZE;
+ queue->priv_size = sizeof(struct queue_entry_priv_mmio);
+ break;
+
+ case QID_ATIM:
+ /* fallthrough */
+ default:
+ BUG();
+ break;
+ }
+}
static const struct rt2x00_ops rt2800pci_ops = {
.name = KBUILD_MODNAME,
@@ -1218,9 +1232,7 @@ static const struct rt2x00_ops rt2800pci_ops = {
.rf_size = RF_SIZE,
.tx_queues = NUM_TX_QUEUES,
.extra_tx_headroom = TXWI_DESC_SIZE,
- .rx = &rt2800pci_queue_rx,
- .tx = &rt2800pci_queue_tx,
- .bcn = &rt2800pci_queue_bcn,
+ .queue_init = rt2800pci_queue_init,
.lib = &rt2800pci_rt2x00_ops,
.drv = &rt2800pci_rt2800_ops,
.hw = &rt2800pci_mac80211_ops,
--
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 ` [PATCH 01/13] rt2x00: rt2x00queue: add priv_size field to struct data_queue Gabor Juhos
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 ` Gabor Juhos [this message]
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-8-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).