diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-06-04 07:40:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-12 14:59:36 -0400 |
commit | 3d8979ba7d873cd203bf98a17a2143a20eef488c (patch) | |
tree | f35f5c9d0544c7b1b27be09e7411674eabc5b8f6 /drivers/net/wireless/rt2x00/rt2400pci.c | |
parent | 0d7aada3bcbc0bde68379831d29c1a015f2fd613 (diff) |
rt2x00: rt2400pci: 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.
Compile tested only.
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/rt2400pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 65 |
1 files changed, 37 insertions, 28 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index f7143733d7e9..e1ec9a4517d1 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1767,33 +1767,45 @@ static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = { | |||
1767 | .config = rt2400pci_config, | 1767 | .config = rt2400pci_config, |
1768 | }; | 1768 | }; |
1769 | 1769 | ||
1770 | static const struct data_queue_desc rt2400pci_queue_rx = { | 1770 | static void rt2400pci_queue_init(struct data_queue *queue) |
1771 | .entry_num = 24, | 1771 | { |
1772 | .data_size = DATA_FRAME_SIZE, | 1772 | switch (queue->qid) { |
1773 | .desc_size = RXD_DESC_SIZE, | 1773 | case QID_RX: |
1774 | .priv_size = sizeof(struct queue_entry_priv_mmio), | 1774 | queue->limit = 24; |
1775 | }; | 1775 | queue->data_size = DATA_FRAME_SIZE; |
1776 | queue->desc_size = RXD_DESC_SIZE; | ||
1777 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); | ||
1778 | break; | ||
1776 | 1779 | ||
1777 | static const struct data_queue_desc rt2400pci_queue_tx = { | 1780 | case QID_AC_VO: |
1778 | .entry_num = 24, | 1781 | case QID_AC_VI: |
1779 | .data_size = DATA_FRAME_SIZE, | 1782 | case QID_AC_BE: |
1780 | .desc_size = TXD_DESC_SIZE, | 1783 | case QID_AC_BK: |
1781 | .priv_size = sizeof(struct queue_entry_priv_mmio), | 1784 | queue->limit = 24; |
1782 | }; | 1785 | queue->data_size = DATA_FRAME_SIZE; |
1786 | queue->desc_size = TXD_DESC_SIZE; | ||
1787 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); | ||
1788 | break; | ||
1783 | 1789 | ||
1784 | static const struct data_queue_desc rt2400pci_queue_bcn = { | 1790 | case QID_BEACON: |
1785 | .entry_num = 1, | 1791 | queue->limit = 1; |
1786 | .data_size = MGMT_FRAME_SIZE, | 1792 | queue->data_size = MGMT_FRAME_SIZE; |
1787 | .desc_size = TXD_DESC_SIZE, | 1793 | queue->desc_size = TXD_DESC_SIZE; |
1788 | .priv_size = sizeof(struct queue_entry_priv_mmio), | 1794 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); |
1789 | }; | 1795 | break; |
1790 | 1796 | ||
1791 | static const struct data_queue_desc rt2400pci_queue_atim = { | 1797 | case QID_ATIM: |
1792 | .entry_num = 8, | 1798 | queue->limit = 8; |
1793 | .data_size = DATA_FRAME_SIZE, | 1799 | queue->data_size = DATA_FRAME_SIZE; |
1794 | .desc_size = TXD_DESC_SIZE, | 1800 | queue->desc_size = TXD_DESC_SIZE; |
1795 | .priv_size = sizeof(struct queue_entry_priv_mmio), | 1801 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); |
1796 | }; | 1802 | break; |
1803 | |||
1804 | default: | ||
1805 | BUG(); | ||
1806 | break; | ||
1807 | } | ||
1808 | } | ||
1797 | 1809 | ||
1798 | static const struct rt2x00_ops rt2400pci_ops = { | 1810 | static const struct rt2x00_ops rt2400pci_ops = { |
1799 | .name = KBUILD_MODNAME, | 1811 | .name = KBUILD_MODNAME, |
@@ -1802,10 +1814,7 @@ static const struct rt2x00_ops rt2400pci_ops = { | |||
1802 | .rf_size = RF_SIZE, | 1814 | .rf_size = RF_SIZE, |
1803 | .tx_queues = NUM_TX_QUEUES, | 1815 | .tx_queues = NUM_TX_QUEUES, |
1804 | .extra_tx_headroom = 0, | 1816 | .extra_tx_headroom = 0, |
1805 | .rx = &rt2400pci_queue_rx, | 1817 | .queue_init = rt2400pci_queue_init, |
1806 | .tx = &rt2400pci_queue_tx, | ||
1807 | .bcn = &rt2400pci_queue_bcn, | ||
1808 | .atim = &rt2400pci_queue_atim, | ||
1809 | .lib = &rt2400pci_rt2x00_ops, | 1818 | .lib = &rt2400pci_rt2x00_ops, |
1810 | .hw = &rt2400pci_mac80211_ops, | 1819 | .hw = &rt2400pci_mac80211_ops, |
1811 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS | 1820 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS |