diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-06-04 07:40:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-12 14:59:37 -0400 |
commit | 7106d97bc475b2c0f2a134f804b245bf5eaebffc (patch) | |
tree | 362d4923ce563a962f4d9efda63a671221bf1225 | |
parent | 7c030821ede91bca94b425d27afd504842bb1865 (diff) |
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>
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 7e1759b3e49a..17507d12d5ee 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -3025,26 +3025,40 @@ static const struct rt2x00lib_ops rt61pci_rt2x00_ops = { | |||
3025 | .config = rt61pci_config, | 3025 | .config = rt61pci_config, |
3026 | }; | 3026 | }; |
3027 | 3027 | ||
3028 | static const struct data_queue_desc rt61pci_queue_rx = { | 3028 | static void rt61pci_queue_init(struct data_queue *queue) |
3029 | .entry_num = 32, | 3029 | { |
3030 | .data_size = DATA_FRAME_SIZE, | 3030 | switch (queue->qid) { |
3031 | .desc_size = RXD_DESC_SIZE, | 3031 | case QID_RX: |
3032 | .priv_size = sizeof(struct queue_entry_priv_mmio), | 3032 | queue->limit = 32; |
3033 | }; | 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 = { | 3038 | case QID_AC_VO: |
3036 | .entry_num = 32, | 3039 | case QID_AC_VI: |
3037 | .data_size = DATA_FRAME_SIZE, | 3040 | case QID_AC_BE: |
3038 | .desc_size = TXD_DESC_SIZE, | 3041 | case QID_AC_BK: |
3039 | .priv_size = sizeof(struct queue_entry_priv_mmio), | 3042 | queue->limit = 32; |
3040 | }; | 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 = { | 3048 | case QID_BEACON: |
3043 | .entry_num = 4, | 3049 | queue->limit = 4; |
3044 | .data_size = 0, /* No DMA required for beacons */ | 3050 | queue->data_size = 0; /* No DMA required for beacons */ |
3045 | .desc_size = TXINFO_SIZE, | 3051 | queue->desc_size = TXINFO_SIZE; |
3046 | .priv_size = sizeof(struct queue_entry_priv_mmio), | 3052 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); |
3047 | }; | 3053 | break; |
3054 | |||
3055 | case QID_ATIM: | ||
3056 | /* fallthrough */ | ||
3057 | default: | ||
3058 | BUG(); | ||
3059 | break; | ||
3060 | } | ||
3061 | } | ||
3048 | 3062 | ||
3049 | static const struct rt2x00_ops rt61pci_ops = { | 3063 | static const struct rt2x00_ops rt61pci_ops = { |
3050 | .name = KBUILD_MODNAME, | 3064 | .name = KBUILD_MODNAME, |
@@ -3053,9 +3067,7 @@ static const struct rt2x00_ops rt61pci_ops = { | |||
3053 | .rf_size = RF_SIZE, | 3067 | .rf_size = RF_SIZE, |
3054 | .tx_queues = NUM_TX_QUEUES, | 3068 | .tx_queues = NUM_TX_QUEUES, |
3055 | .extra_tx_headroom = 0, | 3069 | .extra_tx_headroom = 0, |
3056 | .rx = &rt61pci_queue_rx, | 3070 | .queue_init = rt61pci_queue_init, |
3057 | .tx = &rt61pci_queue_tx, | ||
3058 | .bcn = &rt61pci_queue_bcn, | ||
3059 | .lib = &rt61pci_rt2x00_ops, | 3071 | .lib = &rt61pci_rt2x00_ops, |
3060 | .hw = &rt61pci_mac80211_ops, | 3072 | .hw = &rt61pci_mac80211_ops, |
3061 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS | 3073 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS |