aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-06-04 07:40:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-06-12 14:59:38 -0400
commitc29a32c8f15c81470d16aee82f52432eb477aa9b (patch)
treeaa75b39fd75a92b04564a194c4887e82df295903 /drivers/net/wireless/rt2x00/rt2500usb.c
parent7106d97bc475b2c0f2a134f804b245bf5eaebffc (diff)
rt2x00: rt2500usb: 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/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c65
1 files changed, 37 insertions, 28 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index a7f7b365eff4..e5e5479bcf93 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1867,33 +1867,45 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = {
1867 .config = rt2500usb_config, 1867 .config = rt2500usb_config,
1868}; 1868};
1869 1869
1870static const struct data_queue_desc rt2500usb_queue_rx = { 1870static void rt2500usb_queue_init(struct data_queue *queue)
1871 .entry_num = 32, 1871{
1872 .data_size = DATA_FRAME_SIZE, 1872 switch (queue->qid) {
1873 .desc_size = RXD_DESC_SIZE, 1873 case QID_RX:
1874 .priv_size = sizeof(struct queue_entry_priv_usb), 1874 queue->limit = 32;
1875}; 1875 queue->data_size = DATA_FRAME_SIZE;
1876 queue->desc_size = RXD_DESC_SIZE;
1877 queue->priv_size = sizeof(struct queue_entry_priv_usb);
1878 break;
1876 1879
1877static const struct data_queue_desc rt2500usb_queue_tx = { 1880 case QID_AC_VO:
1878 .entry_num = 32, 1881 case QID_AC_VI:
1879 .data_size = DATA_FRAME_SIZE, 1882 case QID_AC_BE:
1880 .desc_size = TXD_DESC_SIZE, 1883 case QID_AC_BK:
1881 .priv_size = sizeof(struct queue_entry_priv_usb), 1884 queue->limit = 32;
1882}; 1885 queue->data_size = DATA_FRAME_SIZE;
1886 queue->desc_size = TXD_DESC_SIZE;
1887 queue->priv_size = sizeof(struct queue_entry_priv_usb);
1888 break;
1883 1889
1884static const struct data_queue_desc rt2500usb_queue_bcn = { 1890 case QID_BEACON:
1885 .entry_num = 1, 1891 queue->limit = 1;
1886 .data_size = MGMT_FRAME_SIZE, 1892 queue->data_size = MGMT_FRAME_SIZE;
1887 .desc_size = TXD_DESC_SIZE, 1893 queue->desc_size = TXD_DESC_SIZE;
1888 .priv_size = sizeof(struct queue_entry_priv_usb_bcn), 1894 queue->priv_size = sizeof(struct queue_entry_priv_usb_bcn);
1889}; 1895 break;
1890 1896
1891static const struct data_queue_desc rt2500usb_queue_atim = { 1897 case QID_ATIM:
1892 .entry_num = 8, 1898 queue->limit = 8;
1893 .data_size = DATA_FRAME_SIZE, 1899 queue->data_size = DATA_FRAME_SIZE;
1894 .desc_size = TXD_DESC_SIZE, 1900 queue->desc_size = TXD_DESC_SIZE;
1895 .priv_size = sizeof(struct queue_entry_priv_usb), 1901 queue->priv_size = sizeof(struct queue_entry_priv_usb);
1896}; 1902 break;
1903
1904 default:
1905 BUG();
1906 break;
1907 }
1908}
1897 1909
1898static const struct rt2x00_ops rt2500usb_ops = { 1910static const struct rt2x00_ops rt2500usb_ops = {
1899 .name = KBUILD_MODNAME, 1911 .name = KBUILD_MODNAME,
@@ -1902,10 +1914,7 @@ static const struct rt2x00_ops rt2500usb_ops = {
1902 .rf_size = RF_SIZE, 1914 .rf_size = RF_SIZE,
1903 .tx_queues = NUM_TX_QUEUES, 1915 .tx_queues = NUM_TX_QUEUES,
1904 .extra_tx_headroom = TXD_DESC_SIZE, 1916 .extra_tx_headroom = TXD_DESC_SIZE,
1905 .rx = &rt2500usb_queue_rx, 1917 .queue_init = rt2500usb_queue_init,
1906 .tx = &rt2500usb_queue_tx,
1907 .bcn = &rt2500usb_queue_bcn,
1908 .atim = &rt2500usb_queue_atim,
1909 .lib = &rt2500usb_rt2x00_ops, 1918 .lib = &rt2500usb_rt2x00_ops,
1910 .hw = &rt2500usb_mac80211_ops, 1919 .hw = &rt2500usb_mac80211_ops,
1911#ifdef CONFIG_RT2X00_LIB_DEBUGFS 1920#ifdef CONFIG_RT2X00_LIB_DEBUGFS