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

rt2x00: rt61pci: 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: Gabor Juhos <juhosg@openwrt.org>
Tested-by: Jakub Kicinski <kubakici@wp.pl>
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
7106d97b 7c030821

+33 -21
+33 -21
drivers/net/wireless/rt2x00/rt61pci.c
··· 3025 3025 .config = rt61pci_config, 3026 3026 }; 3027 3027 3028 - static const struct data_queue_desc rt61pci_queue_rx = { 3029 - .entry_num = 32, 3030 - .data_size = DATA_FRAME_SIZE, 3031 - .desc_size = RXD_DESC_SIZE, 3032 - .priv_size = sizeof(struct queue_entry_priv_mmio), 3033 - }; 3028 + static void rt61pci_queue_init(struct data_queue *queue) 3029 + { 3030 + switch (queue->qid) { 3031 + case QID_RX: 3032 + queue->limit = 32; 3033 + queue->data_size = DATA_FRAME_SIZE; 3034 + queue->desc_size = RXD_DESC_SIZE; 3035 + queue->priv_size = sizeof(struct queue_entry_priv_mmio); 3036 + break; 3034 3037 3035 - static const struct data_queue_desc rt61pci_queue_tx = { 3036 - .entry_num = 32, 3037 - .data_size = DATA_FRAME_SIZE, 3038 - .desc_size = TXD_DESC_SIZE, 3039 - .priv_size = sizeof(struct queue_entry_priv_mmio), 3040 - }; 3038 + case QID_AC_VO: 3039 + case QID_AC_VI: 3040 + case QID_AC_BE: 3041 + case QID_AC_BK: 3042 + queue->limit = 32; 3043 + queue->data_size = DATA_FRAME_SIZE; 3044 + queue->desc_size = TXD_DESC_SIZE; 3045 + queue->priv_size = sizeof(struct queue_entry_priv_mmio); 3046 + break; 3041 3047 3042 - static const struct data_queue_desc rt61pci_queue_bcn = { 3043 - .entry_num = 4, 3044 - .data_size = 0, /* No DMA required for beacons */ 3045 - .desc_size = TXINFO_SIZE, 3046 - .priv_size = sizeof(struct queue_entry_priv_mmio), 3047 - }; 3048 + case QID_BEACON: 3049 + queue->limit = 4; 3050 + queue->data_size = 0; /* No DMA required for beacons */ 3051 + queue->desc_size = TXINFO_SIZE; 3052 + queue->priv_size = sizeof(struct queue_entry_priv_mmio); 3053 + break; 3054 + 3055 + case QID_ATIM: 3056 + /* fallthrough */ 3057 + default: 3058 + BUG(); 3059 + break; 3060 + } 3061 + } 3048 3062 3049 3063 static const struct rt2x00_ops rt61pci_ops = { 3050 3064 .name = KBUILD_MODNAME, ··· 3067 3053 .rf_size = RF_SIZE, 3068 3054 .tx_queues = NUM_TX_QUEUES, 3069 3055 .extra_tx_headroom = 0, 3070 - .rx = &rt61pci_queue_rx, 3071 - .tx = &rt61pci_queue_tx, 3072 - .bcn = &rt61pci_queue_bcn, 3056 + .queue_init = rt61pci_queue_init, 3073 3057 .lib = &rt61pci_rt2x00_ops, 3074 3058 .hw = &rt61pci_mac80211_ops, 3075 3059 #ifdef CONFIG_RT2X00_LIB_DEBUGFS