aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-10-17 03:42:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-10-18 14:07:00 -0400
commit3ccdcd515d651943658e812eb8f8ff2a5b5113fc (patch)
tree5842785112436dd6ae3dcad4b89d7b005ec0d51f /drivers/net/wireless/rt2x00
parent1e7d30355d91c70e2557daf3dac633255202d2df (diff)
rt2x00: rt2800pci: move rt2800mmio_enable_radio function to another module
Move the function into the rt2800mmio module, in order to make it usable from other modules. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800mmio.c15
-rw-r--r--drivers/net/wireless/rt2x00/rt2800mmio.h3
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c13
3 files changed, 18 insertions, 13 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800mmio.c b/drivers/net/wireless/rt2x00/rt2800mmio.c
index 7e8c22445b7b..ae152280e071 100644
--- a/drivers/net/wireless/rt2x00/rt2800mmio.c
+++ b/drivers/net/wireless/rt2x00/rt2800mmio.c
@@ -852,6 +852,21 @@ int rt2800mmio_init_registers(struct rt2x00_dev *rt2x00dev)
852} 852}
853EXPORT_SYMBOL_GPL(rt2800mmio_init_registers); 853EXPORT_SYMBOL_GPL(rt2800mmio_init_registers);
854 854
855/*
856 * Device state switch handlers.
857 */
858int rt2800mmio_enable_radio(struct rt2x00_dev *rt2x00dev)
859{
860 /* Wait for DMA, ignore error until we initialize queues. */
861 rt2800_wait_wpdma_ready(rt2x00dev);
862
863 if (unlikely(rt2800mmio_init_queues(rt2x00dev)))
864 return -EIO;
865
866 return rt2800_enable_radio(rt2x00dev);
867}
868EXPORT_SYMBOL_GPL(rt2800mmio_enable_radio);
869
855MODULE_AUTHOR(DRV_PROJECT); 870MODULE_AUTHOR(DRV_PROJECT);
856MODULE_VERSION(DRV_VERSION); 871MODULE_VERSION(DRV_VERSION);
857MODULE_DESCRIPTION("rt2800 MMIO library"); 872MODULE_DESCRIPTION("rt2800 MMIO library");
diff --git a/drivers/net/wireless/rt2x00/rt2800mmio.h b/drivers/net/wireless/rt2x00/rt2800mmio.h
index 392895a3208e..6a10de3eee3e 100644
--- a/drivers/net/wireless/rt2x00/rt2800mmio.h
+++ b/drivers/net/wireless/rt2x00/rt2800mmio.h
@@ -159,4 +159,7 @@ void rt2800mmio_clear_entry(struct queue_entry *entry);
159int rt2800mmio_init_queues(struct rt2x00_dev *rt2x00dev); 159int rt2800mmio_init_queues(struct rt2x00_dev *rt2x00dev);
160int rt2800mmio_init_registers(struct rt2x00_dev *rt2x00dev); 160int rt2800mmio_init_registers(struct rt2x00_dev *rt2x00dev);
161 161
162/* Device state switch handlers. */
163int rt2800mmio_enable_radio(struct rt2x00_dev *rt2x00dev);
164
162#endif /* RT2800MMIO_H */ 165#endif /* RT2800MMIO_H */
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 88dd242ac1e3..77ddd1a97732 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -205,23 +205,10 @@ static int rt2800pci_write_firmware(struct rt2x00_dev *rt2x00dev,
205 205
206 return 0; 206 return 0;
207} 207}
208#endif /* CONFIG_PCI */
209 208
210/* 209/*
211 * Device state switch handlers. 210 * Device state switch handlers.
212 */ 211 */
213static int rt2800mmio_enable_radio(struct rt2x00_dev *rt2x00dev)
214{
215 /* Wait for DMA, ignore error until we initialize queues. */
216 rt2800_wait_wpdma_ready(rt2x00dev);
217
218 if (unlikely(rt2800mmio_init_queues(rt2x00dev)))
219 return -EIO;
220
221 return rt2800_enable_radio(rt2x00dev);
222}
223
224#ifdef CONFIG_PCI
225static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev) 212static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev)
226{ 213{
227 int retval; 214 int retval;