Commit 1896b760 authored by Gabor Juhos's avatar Gabor Juhos Committed by John W. Linville

rt2x00: rt2800pci: implement queue_init callback

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: default avatarGabor Juhos <juhosg@openwrt.org>
Acked-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d36d13a3
...@@ -1186,29 +1186,43 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { ...@@ -1186,29 +1186,43 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
.sta_remove = rt2800_sta_remove, .sta_remove = rt2800_sta_remove,
}; };
static const struct data_queue_desc rt2800pci_queue_rx = { static void rt2800pci_queue_init(struct data_queue *queue)
.entry_num = 128, {
.data_size = AGGREGATION_SIZE, switch (queue->qid) {
.desc_size = RXD_DESC_SIZE, case QID_RX:
.winfo_size = RXWI_DESC_SIZE, queue->limit = 128;
.priv_size = sizeof(struct queue_entry_priv_mmio), 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 = { case QID_AC_VO:
.entry_num = 64, case QID_AC_VI:
.data_size = AGGREGATION_SIZE, case QID_AC_BE:
.desc_size = TXD_DESC_SIZE, case QID_AC_BK:
.winfo_size = TXWI_DESC_SIZE, queue->limit = 64;
.priv_size = sizeof(struct queue_entry_priv_mmio), 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 = { case QID_BEACON:
.entry_num = 8, queue->limit = 8;
.data_size = 0, /* No DMA required for beacons */ queue->data_size = 0; /* No DMA required for beacons */
.desc_size = TXD_DESC_SIZE, queue->desc_size = TXD_DESC_SIZE;
.winfo_size = TXWI_DESC_SIZE, queue->winfo_size = TXWI_DESC_SIZE;
.priv_size = sizeof(struct queue_entry_priv_mmio), queue->priv_size = sizeof(struct queue_entry_priv_mmio);
}; break;
case QID_ATIM:
/* fallthrough */
default:
BUG();
break;
}
}
static const struct rt2x00_ops rt2800pci_ops = { static const struct rt2x00_ops rt2800pci_ops = {
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
...@@ -1218,9 +1232,7 @@ static const struct rt2x00_ops rt2800pci_ops = { ...@@ -1218,9 +1232,7 @@ static const struct rt2x00_ops rt2800pci_ops = {
.rf_size = RF_SIZE, .rf_size = RF_SIZE,
.tx_queues = NUM_TX_QUEUES, .tx_queues = NUM_TX_QUEUES,
.extra_tx_headroom = TXWI_DESC_SIZE, .extra_tx_headroom = TXWI_DESC_SIZE,
.rx = &rt2800pci_queue_rx, .queue_init = rt2800pci_queue_init,
.tx = &rt2800pci_queue_tx,
.bcn = &rt2800pci_queue_bcn,
.lib = &rt2800pci_rt2x00_ops, .lib = &rt2800pci_rt2x00_ops,
.drv = &rt2800pci_rt2800_ops, .drv = &rt2800pci_rt2800_ops,
.hw = &rt2800pci_mac80211_ops, .hw = &rt2800pci_mac80211_ops,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment