diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-10-13 05:47:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:09 -0400 |
commit | eb5b28d021a1b96050f7af46e9140eb0051cc6d8 (patch) | |
tree | 41cc26ab8f47c7bf465be648e736702b7007eb1d /drivers/net | |
parent | 8a08048a3722a6b52c2b34e070c4e6a32ad19e0d (diff) |
wl1271: Fix IRQ enable handling on FW init failure
Disable IRQ's after FW initialization failure - originally this was not
done in all cases, and it resulted in a kernel warning if firmware
initialization was tried again without reboot.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_boot.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_init.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 42 |
3 files changed, 35 insertions, 17 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c index a27601dc9c0d..b8a37a84842f 100644 --- a/drivers/net/wireless/wl12xx/wl1271_boot.c +++ b/drivers/net/wireless/wl12xx/wl1271_boot.c | |||
@@ -400,9 +400,6 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl) | |||
400 | * ready to receive event from the command mailbox | 400 | * ready to receive event from the command mailbox |
401 | */ | 401 | */ |
402 | 402 | ||
403 | /* enable gpio interrupts */ | ||
404 | wl1271_boot_enable_interrupts(wl); | ||
405 | |||
406 | /* unmask required mbox events */ | 403 | /* unmask required mbox events */ |
407 | wl->event_mask = BSS_LOSE_EVENT_ID | | 404 | wl->event_mask = BSS_LOSE_EVENT_ID | |
408 | SCAN_COMPLETE_EVENT_ID; | 405 | SCAN_COMPLETE_EVENT_ID; |
@@ -540,6 +537,9 @@ int wl1271_boot(struct wl1271 *wl) | |||
540 | if (ret < 0) | 537 | if (ret < 0) |
541 | goto out; | 538 | goto out; |
542 | 539 | ||
540 | /* Enable firmware interrupts now */ | ||
541 | wl1271_boot_enable_interrupts(wl); | ||
542 | |||
543 | /* set the wl1271 default filters */ | 543 | /* set the wl1271 default filters */ |
544 | wl->rx_config = WL1271_DEFAULT_RX_CONFIG; | 544 | wl->rx_config = WL1271_DEFAULT_RX_CONFIG; |
545 | wl->rx_filter = WL1271_DEFAULT_RX_FILTER; | 545 | wl->rx_filter = WL1271_DEFAULT_RX_FILTER; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c index 5c2cf1e00ac7..6f21eeae5246 100644 --- a/drivers/net/wireless/wl12xx/wl1271_init.c +++ b/drivers/net/wireless/wl12xx/wl1271_init.c | |||
@@ -315,8 +315,8 @@ int wl1271_hw_init(struct wl1271 *wl) | |||
315 | 315 | ||
316 | /* RX config */ | 316 | /* RX config */ |
317 | ret = wl1271_init_rx_config(wl, | 317 | ret = wl1271_init_rx_config(wl, |
318 | RX_CFG_PROMISCUOUS | RX_CFG_TSF, | 318 | RX_CFG_PROMISCUOUS | RX_CFG_TSF, |
319 | RX_FILTER_OPTION_DEF); | 319 | RX_FILTER_OPTION_DEF); |
320 | /* RX_CONFIG_OPTION_ANY_DST_ANY_BSS, | 320 | /* RX_CONFIG_OPTION_ANY_DST_ANY_BSS, |
321 | RX_FILTER_OPTION_FILTER_ALL); */ | 321 | RX_FILTER_OPTION_FILTER_ALL); */ |
322 | if (ret < 0) | 322 | if (ret < 0) |
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index eba38dff871b..7f1093cd816c 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -625,7 +625,7 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) | |||
625 | 625 | ||
626 | ret = wl1271_setup(wl); | 626 | ret = wl1271_setup(wl); |
627 | if (ret < 0) | 627 | if (ret < 0) |
628 | goto out; | 628 | goto out_power_off; |
629 | break; | 629 | break; |
630 | case CHIP_ID_1271_PG20: | 630 | case CHIP_ID_1271_PG20: |
631 | wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", | 631 | wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", |
@@ -633,27 +633,32 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) | |||
633 | 633 | ||
634 | ret = wl1271_setup(wl); | 634 | ret = wl1271_setup(wl); |
635 | if (ret < 0) | 635 | if (ret < 0) |
636 | goto out; | 636 | goto out_power_off; |
637 | break; | 637 | break; |
638 | default: | 638 | default: |
639 | wl1271_error("unsupported chip id: 0x%x", wl->chip.id); | 639 | wl1271_error("unsupported chip id: 0x%x", wl->chip.id); |
640 | ret = -ENODEV; | 640 | ret = -ENODEV; |
641 | goto out; | 641 | goto out_power_off; |
642 | } | 642 | } |
643 | 643 | ||
644 | if (wl->fw == NULL) { | 644 | if (wl->fw == NULL) { |
645 | ret = wl1271_fetch_firmware(wl); | 645 | ret = wl1271_fetch_firmware(wl); |
646 | if (ret < 0) | 646 | if (ret < 0) |
647 | goto out; | 647 | goto out_power_off; |
648 | } | 648 | } |
649 | 649 | ||
650 | /* No NVS from netlink, try to get it from the filesystem */ | 650 | /* No NVS from netlink, try to get it from the filesystem */ |
651 | if (wl->nvs == NULL) { | 651 | if (wl->nvs == NULL) { |
652 | ret = wl1271_fetch_nvs(wl); | 652 | ret = wl1271_fetch_nvs(wl); |
653 | if (ret < 0) | 653 | if (ret < 0) |
654 | goto out; | 654 | goto out_power_off; |
655 | } | 655 | } |
656 | 656 | ||
657 | goto out; | ||
658 | |||
659 | out_power_off: | ||
660 | wl1271_power_off(wl); | ||
661 | |||
657 | out: | 662 | out: |
658 | return ret; | 663 | return ret; |
659 | } | 664 | } |
@@ -749,13 +754,21 @@ int wl1271_plt_start(struct wl1271 *wl) | |||
749 | 754 | ||
750 | ret = wl1271_boot(wl); | 755 | ret = wl1271_boot(wl); |
751 | if (ret < 0) | 756 | if (ret < 0) |
752 | goto out; | 757 | goto out_power_off; |
753 | 758 | ||
754 | wl1271_notice("firmware booted in PLT mode (%s)", wl->chip.fw_ver); | 759 | wl1271_notice("firmware booted in PLT mode (%s)", wl->chip.fw_ver); |
755 | 760 | ||
756 | ret = wl1271_plt_init(wl); | 761 | ret = wl1271_plt_init(wl); |
757 | if (ret < 0) | 762 | if (ret < 0) |
758 | goto out; | 763 | goto out_irq_disable; |
764 | |||
765 | goto out; | ||
766 | |||
767 | out_irq_disable: | ||
768 | wl1271_disable_interrupts(wl); | ||
769 | |||
770 | out_power_off: | ||
771 | wl1271_power_off(wl); | ||
759 | 772 | ||
760 | out: | 773 | out: |
761 | mutex_unlock(&wl->mutex); | 774 | mutex_unlock(&wl->mutex); |
@@ -843,20 +856,25 @@ static int wl1271_op_start(struct ieee80211_hw *hw) | |||
843 | 856 | ||
844 | ret = wl1271_boot(wl); | 857 | ret = wl1271_boot(wl); |
845 | if (ret < 0) | 858 | if (ret < 0) |
846 | goto out; | 859 | goto out_power_off; |
847 | 860 | ||
848 | ret = wl1271_hw_init(wl); | 861 | ret = wl1271_hw_init(wl); |
849 | if (ret < 0) | 862 | if (ret < 0) |
850 | goto out; | 863 | goto out_irq_disable; |
851 | 864 | ||
852 | wl->state = WL1271_STATE_ON; | 865 | wl->state = WL1271_STATE_ON; |
853 | 866 | ||
854 | wl1271_info("firmware booted (%s)", wl->chip.fw_ver); | 867 | wl1271_info("firmware booted (%s)", wl->chip.fw_ver); |
855 | 868 | ||
856 | out: | 869 | goto out; |
857 | if (ret < 0) | 870 | |
858 | wl1271_power_off(wl); | 871 | out_irq_disable: |
872 | wl1271_disable_interrupts(wl); | ||
859 | 873 | ||
874 | out_power_off: | ||
875 | wl1271_power_off(wl); | ||
876 | |||
877 | out: | ||
860 | mutex_unlock(&wl->mutex); | 878 | mutex_unlock(&wl->mutex); |
861 | 879 | ||
862 | return ret; | 880 | return ret; |