Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Gabor Juhos and committed by
John W. Linville
c29a32c8 7106d97b

+37 -28
+37 -28
drivers/net/wireless/rt2x00/rt2500usb.c
··· 1867 1867 .config = rt2500usb_config, 1868 1868 }; 1869 1869 1870 - static const struct data_queue_desc rt2500usb_queue_rx = { 1871 - .entry_num = 32, 1872 - .data_size = DATA_FRAME_SIZE, 1873 - .desc_size = RXD_DESC_SIZE, 1874 - .priv_size = sizeof(struct queue_entry_priv_usb), 1875 - }; 1870 + static void rt2500usb_queue_init(struct data_queue *queue) 1871 + { 1872 + switch (queue->qid) { 1873 + case QID_RX: 1874 + queue->limit = 32; 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 1877 - static const struct data_queue_desc rt2500usb_queue_tx = { 1878 - .entry_num = 32, 1879 - .data_size = DATA_FRAME_SIZE, 1880 - .desc_size = TXD_DESC_SIZE, 1881 - .priv_size = sizeof(struct queue_entry_priv_usb), 1882 - }; 1880 + case QID_AC_VO: 1881 + case QID_AC_VI: 1882 + case QID_AC_BE: 1883 + case QID_AC_BK: 1884 + queue->limit = 32; 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 1884 - static const struct data_queue_desc rt2500usb_queue_bcn = { 1885 - .entry_num = 1, 1886 - .data_size = MGMT_FRAME_SIZE, 1887 - .desc_size = TXD_DESC_SIZE, 1888 - .priv_size = sizeof(struct queue_entry_priv_usb_bcn), 1889 - }; 1890 + case QID_BEACON: 1891 + queue->limit = 1; 1892 + queue->data_size = MGMT_FRAME_SIZE; 1893 + queue->desc_size = TXD_DESC_SIZE; 1894 + queue->priv_size = sizeof(struct queue_entry_priv_usb_bcn); 1895 + break; 1890 1896 1891 - static const struct data_queue_desc rt2500usb_queue_atim = { 1892 - .entry_num = 8, 1893 - .data_size = DATA_FRAME_SIZE, 1894 - .desc_size = TXD_DESC_SIZE, 1895 - .priv_size = sizeof(struct queue_entry_priv_usb), 1896 - }; 1897 + case QID_ATIM: 1898 + queue->limit = 8; 1899 + queue->data_size = DATA_FRAME_SIZE; 1900 + queue->desc_size = TXD_DESC_SIZE; 1901 + queue->priv_size = sizeof(struct queue_entry_priv_usb); 1902 + break; 1903 + 1904 + default: 1905 + BUG(); 1906 + break; 1907 + } 1908 + } 1897 1909 1898 1910 static const struct rt2x00_ops rt2500usb_ops = { 1899 1911 .name = KBUILD_MODNAME, ··· 1914 1902 .rf_size = RF_SIZE, 1915 1903 .tx_queues = NUM_TX_QUEUES, 1916 1904 .extra_tx_headroom = TXD_DESC_SIZE, 1917 - .rx = &rt2500usb_queue_rx, 1918 - .tx = &rt2500usb_queue_tx, 1919 - .bcn = &rt2500usb_queue_bcn, 1920 - .atim = &rt2500usb_queue_atim, 1905 + .queue_init = rt2500usb_queue_init, 1921 1906 .lib = &rt2500usb_rt2x00_ops, 1922 1907 .hw = &rt2500usb_mac80211_ops, 1923 1908 #ifdef CONFIG_RT2X00_LIB_DEBUGFS