diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-10-17 03:42:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-10-18 14:06:59 -0400 |
commit | d5580ade2fec2a0d50ceee7a9ce44a35a4de133b (patch) | |
tree | 9b4e3ef9ad7ceac901174c27deb0b359b13d6238 /drivers/net/wireless/rt2x00/rt2800pci.c | |
parent | 51e62469eac296d39d57fb75f182e4ef8066f82f (diff) |
rt2x00: rt2800pci: move queue functions to the rt2800mmio module
Move the functions into a separate module, in order
to make those usable from other modules. Also move
the queue register offset macros from rt2800pci.h
into rt2800mmio.h.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 133 |
1 files changed, 0 insertions, 133 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 118f2d592a93..d0e4ec50caec 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -202,96 +202,6 @@ static inline int rt2800pci_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev) | |||
202 | #endif /* CONFIG_PCI */ | 202 | #endif /* CONFIG_PCI */ |
203 | 203 | ||
204 | /* | 204 | /* |
205 | * Queue handlers. | ||
206 | */ | ||
207 | static void rt2800mmio_start_queue(struct data_queue *queue) | ||
208 | { | ||
209 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | ||
210 | u32 reg; | ||
211 | |||
212 | switch (queue->qid) { | ||
213 | case QID_RX: | ||
214 | rt2x00mmio_register_read(rt2x00dev, MAC_SYS_CTRL, ®); | ||
215 | rt2x00_set_field32(®, MAC_SYS_CTRL_ENABLE_RX, 1); | ||
216 | rt2x00mmio_register_write(rt2x00dev, MAC_SYS_CTRL, reg); | ||
217 | break; | ||
218 | case QID_BEACON: | ||
219 | rt2x00mmio_register_read(rt2x00dev, BCN_TIME_CFG, ®); | ||
220 | rt2x00_set_field32(®, BCN_TIME_CFG_TSF_TICKING, 1); | ||
221 | rt2x00_set_field32(®, BCN_TIME_CFG_TBTT_ENABLE, 1); | ||
222 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 1); | ||
223 | rt2x00mmio_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
224 | |||
225 | rt2x00mmio_register_read(rt2x00dev, INT_TIMER_EN, ®); | ||
226 | rt2x00_set_field32(®, INT_TIMER_EN_PRE_TBTT_TIMER, 1); | ||
227 | rt2x00mmio_register_write(rt2x00dev, INT_TIMER_EN, reg); | ||
228 | break; | ||
229 | default: | ||
230 | break; | ||
231 | } | ||
232 | } | ||
233 | |||
234 | static void rt2800mmio_kick_queue(struct data_queue *queue) | ||
235 | { | ||
236 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | ||
237 | struct queue_entry *entry; | ||
238 | |||
239 | switch (queue->qid) { | ||
240 | case QID_AC_VO: | ||
241 | case QID_AC_VI: | ||
242 | case QID_AC_BE: | ||
243 | case QID_AC_BK: | ||
244 | entry = rt2x00queue_get_entry(queue, Q_INDEX); | ||
245 | rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX(queue->qid), | ||
246 | entry->entry_idx); | ||
247 | break; | ||
248 | case QID_MGMT: | ||
249 | entry = rt2x00queue_get_entry(queue, Q_INDEX); | ||
250 | rt2x00mmio_register_write(rt2x00dev, TX_CTX_IDX(5), | ||
251 | entry->entry_idx); | ||
252 | break; | ||
253 | default: | ||
254 | break; | ||
255 | } | ||
256 | } | ||
257 | |||
258 | static void rt2800mmio_stop_queue(struct data_queue *queue) | ||
259 | { | ||
260 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | ||
261 | u32 reg; | ||
262 | |||
263 | switch (queue->qid) { | ||
264 | case QID_RX: | ||
265 | rt2x00mmio_register_read(rt2x00dev, MAC_SYS_CTRL, ®); | ||
266 | rt2x00_set_field32(®, MAC_SYS_CTRL_ENABLE_RX, 0); | ||
267 | rt2x00mmio_register_write(rt2x00dev, MAC_SYS_CTRL, reg); | ||
268 | break; | ||
269 | case QID_BEACON: | ||
270 | rt2x00mmio_register_read(rt2x00dev, BCN_TIME_CFG, ®); | ||
271 | rt2x00_set_field32(®, BCN_TIME_CFG_TSF_TICKING, 0); | ||
272 | rt2x00_set_field32(®, BCN_TIME_CFG_TBTT_ENABLE, 0); | ||
273 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 0); | ||
274 | rt2x00mmio_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
275 | |||
276 | rt2x00mmio_register_read(rt2x00dev, INT_TIMER_EN, ®); | ||
277 | rt2x00_set_field32(®, INT_TIMER_EN_PRE_TBTT_TIMER, 0); | ||
278 | rt2x00mmio_register_write(rt2x00dev, INT_TIMER_EN, reg); | ||
279 | |||
280 | /* | ||
281 | * Wait for current invocation to finish. The tasklet | ||
282 | * won't be scheduled anymore afterwards since we disabled | ||
283 | * the TBTT and PRE TBTT timer. | ||
284 | */ | ||
285 | tasklet_kill(&rt2x00dev->tbtt_tasklet); | ||
286 | tasklet_kill(&rt2x00dev->pretbtt_tasklet); | ||
287 | |||
288 | break; | ||
289 | default: | ||
290 | break; | ||
291 | } | ||
292 | } | ||
293 | |||
294 | /* | ||
295 | * Firmware functions | 205 | * Firmware functions |
296 | */ | 206 | */ |
297 | static char *rt2800pci_get_firmware_name(struct rt2x00_dev *rt2x00dev) | 207 | static char *rt2800pci_get_firmware_name(struct rt2x00_dev *rt2x00dev) |
@@ -689,49 +599,6 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { | |||
689 | .sta_remove = rt2800_sta_remove, | 599 | .sta_remove = rt2800_sta_remove, |
690 | }; | 600 | }; |
691 | 601 | ||
692 | static void rt2800mmio_queue_init(struct data_queue *queue) | ||
693 | { | ||
694 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | ||
695 | unsigned short txwi_size, rxwi_size; | ||
696 | |||
697 | rt2800_get_txwi_rxwi_size(rt2x00dev, &txwi_size, &rxwi_size); | ||
698 | |||
699 | switch (queue->qid) { | ||
700 | case QID_RX: | ||
701 | queue->limit = 128; | ||
702 | queue->data_size = AGGREGATION_SIZE; | ||
703 | queue->desc_size = RXD_DESC_SIZE; | ||
704 | queue->winfo_size = rxwi_size; | ||
705 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); | ||
706 | break; | ||
707 | |||
708 | case QID_AC_VO: | ||
709 | case QID_AC_VI: | ||
710 | case QID_AC_BE: | ||
711 | case QID_AC_BK: | ||
712 | queue->limit = 64; | ||
713 | queue->data_size = AGGREGATION_SIZE; | ||
714 | queue->desc_size = TXD_DESC_SIZE; | ||
715 | queue->winfo_size = txwi_size; | ||
716 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); | ||
717 | break; | ||
718 | |||
719 | case QID_BEACON: | ||
720 | queue->limit = 8; | ||
721 | queue->data_size = 0; /* No DMA required for beacons */ | ||
722 | queue->desc_size = TXD_DESC_SIZE; | ||
723 | queue->winfo_size = txwi_size; | ||
724 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); | ||
725 | break; | ||
726 | |||
727 | case QID_ATIM: | ||
728 | /* fallthrough */ | ||
729 | default: | ||
730 | BUG(); | ||
731 | break; | ||
732 | } | ||
733 | } | ||
734 | |||
735 | static const struct rt2x00_ops rt2800pci_ops = { | 602 | static const struct rt2x00_ops rt2800pci_ops = { |
736 | .name = KBUILD_MODNAME, | 603 | .name = KBUILD_MODNAME, |
737 | .drv_data_size = sizeof(struct rt2800_drv_data), | 604 | .drv_data_size = sizeof(struct rt2800_drv_data), |