aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Kicinski <kubakici@wp.pl>2012-02-22 15:58:58 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-27 14:06:44 -0500
commite8b461c37717d6b5c071c4924845884a86c20752 (patch)
tree108c704c217eb547ea5cae98c610963651437c4e
parent09a3311c1a061bda809ff78c512855f3b71dcd6b (diff)
rt2800pci: Fix 'Error - MCU request failed' during initialization
Bring MCU operations during device initialization to sync with legacy driver. This should fix following error: phy0 -> rt2800pci_mcu_status: Error - MCU request failed, no response from hardware Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 627fc2214cd3..9375db455456 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -502,11 +502,27 @@ static int rt2800pci_init_registers(struct rt2x00_dev *rt2x00dev)
502 502
503static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev) 503static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev)
504{ 504{
505 int retval;
506
505 if (unlikely(rt2800_wait_wpdma_ready(rt2x00dev) || 507 if (unlikely(rt2800_wait_wpdma_ready(rt2x00dev) ||
506 rt2800pci_init_queues(rt2x00dev))) 508 rt2800pci_init_queues(rt2x00dev)))
507 return -EIO; 509 return -EIO;
508 510
509 return rt2800_enable_radio(rt2x00dev); 511 retval = rt2800_enable_radio(rt2x00dev);
512 if (retval)
513 return retval;
514
515 /* After resume MCU_BOOT_SIGNAL will trash these. */
516 rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
517 rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
518
519 rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_RADIO_OFF, 0xff, 0x02);
520 rt2800pci_mcu_status(rt2x00dev, TOKEN_RADIO_OFF);
521
522 rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKEUP, 0, 0);
523 rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKEUP);
524
525 return retval;
510} 526}
511 527
512static void rt2800pci_disable_radio(struct rt2x00_dev *rt2x00dev) 528static void rt2800pci_disable_radio(struct rt2x00_dev *rt2x00dev)
@@ -544,13 +560,6 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
544 560
545 switch (state) { 561 switch (state) {
546 case STATE_RADIO_ON: 562 case STATE_RADIO_ON:
547 /*
548 * Before the radio can be enabled, the device first has
549 * to be woken up. After that it needs a bit of time
550 * to be fully awake and then the radio can be enabled.
551 */
552 rt2800pci_set_state(rt2x00dev, STATE_AWAKE);
553 msleep(1);
554 retval = rt2800pci_enable_radio(rt2x00dev); 563 retval = rt2800pci_enable_radio(rt2x00dev);
555 break; 564 break;
556 case STATE_RADIO_OFF: 565 case STATE_RADIO_OFF: