diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 0510f020dcf5..82755cf8b73e 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -248,24 +248,6 @@ static void rt2800usb_toggle_rx(struct rt2x00_dev *rt2x00dev, | |||
248 | rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, reg); | 248 | rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, reg); |
249 | } | 249 | } |
250 | 250 | ||
251 | static int rt2800usb_wait_wpdma_ready(struct rt2x00_dev *rt2x00dev) | ||
252 | { | ||
253 | unsigned int i; | ||
254 | u32 reg; | ||
255 | |||
256 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { | ||
257 | rt2800_register_read(rt2x00dev, WPDMA_GLO_CFG, ®); | ||
258 | if (!rt2x00_get_field32(reg, WPDMA_GLO_CFG_TX_DMA_BUSY) && | ||
259 | !rt2x00_get_field32(reg, WPDMA_GLO_CFG_RX_DMA_BUSY)) | ||
260 | return 0; | ||
261 | |||
262 | msleep(1); | ||
263 | } | ||
264 | |||
265 | ERROR(rt2x00dev, "WPDMA TX/RX busy, aborting.\n"); | ||
266 | return -EACCES; | ||
267 | } | ||
268 | |||
269 | static int rt2800usb_enable_radio(struct rt2x00_dev *rt2x00dev) | 251 | static int rt2800usb_enable_radio(struct rt2x00_dev *rt2x00dev) |
270 | { | 252 | { |
271 | u32 reg; | 253 | u32 reg; |
@@ -274,7 +256,7 @@ static int rt2800usb_enable_radio(struct rt2x00_dev *rt2x00dev) | |||
274 | /* | 256 | /* |
275 | * Initialize all registers. | 257 | * Initialize all registers. |
276 | */ | 258 | */ |
277 | if (unlikely(rt2800usb_wait_wpdma_ready(rt2x00dev) || | 259 | if (unlikely(rt2800_wait_wpdma_ready(rt2x00dev) || |
278 | rt2800_init_registers(rt2x00dev) || | 260 | rt2800_init_registers(rt2x00dev) || |
279 | rt2800_init_bbp(rt2x00dev) || | 261 | rt2800_init_bbp(rt2x00dev) || |
280 | rt2800_init_rfcsr(rt2x00dev))) | 262 | rt2800_init_rfcsr(rt2x00dev))) |
@@ -344,7 +326,7 @@ static void rt2800usb_disable_radio(struct rt2x00_dev *rt2x00dev) | |||
344 | rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0); | 326 | rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0); |
345 | 327 | ||
346 | /* Wait for DMA, ignore error */ | 328 | /* Wait for DMA, ignore error */ |
347 | rt2800usb_wait_wpdma_ready(rt2x00dev); | 329 | rt2800_wait_wpdma_ready(rt2x00dev); |
348 | 330 | ||
349 | rt2x00usb_disable_radio(rt2x00dev); | 331 | rt2x00usb_disable_radio(rt2x00dev); |
350 | } | 332 | } |