diff options
-rw-r--r-- | drivers/net/wireless/wl12xx/debugfs.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 66 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_tx.c | 4 |
4 files changed, 59 insertions, 24 deletions
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c index 3cc5460c11f3..94ad99485651 100644 --- a/drivers/net/wireless/wl12xx/debugfs.c +++ b/drivers/net/wireless/wl12xx/debugfs.c | |||
@@ -95,9 +95,13 @@ static const struct file_operations sub## _ ##name## _ops = { \ | |||
95 | 95 | ||
96 | static void wl12xx_debugfs_update_stats(struct wl12xx *wl) | 96 | static void wl12xx_debugfs_update_stats(struct wl12xx *wl) |
97 | { | 97 | { |
98 | int ret; | ||
99 | |||
98 | mutex_lock(&wl->mutex); | 100 | mutex_lock(&wl->mutex); |
99 | 101 | ||
100 | wl12xx_ps_elp_wakeup(wl); | 102 | ret = wl12xx_ps_elp_wakeup(wl); |
103 | if (ret < 0) | ||
104 | goto out; | ||
101 | 105 | ||
102 | if (wl->state == WL12XX_STATE_ON && | 106 | if (wl->state == WL12XX_STATE_ON && |
103 | time_after(jiffies, wl->stats.fw_stats_update + | 107 | time_after(jiffies, wl->stats.fw_stats_update + |
@@ -108,6 +112,7 @@ static void wl12xx_debugfs_update_stats(struct wl12xx *wl) | |||
108 | 112 | ||
109 | wl12xx_ps_elp_sleep(wl); | 113 | wl12xx_ps_elp_sleep(wl); |
110 | 114 | ||
115 | out: | ||
111 | mutex_unlock(&wl->mutex); | 116 | mutex_unlock(&wl->mutex); |
112 | } | 117 | } |
113 | 118 | ||
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 894d5cc43d25..245544e6434c 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -239,14 +239,18 @@ static void wl12xx_filter_work(struct work_struct *work) | |||
239 | if (wl->state == WL12XX_STATE_OFF) | 239 | if (wl->state == WL12XX_STATE_OFF) |
240 | goto out; | 240 | goto out; |
241 | 241 | ||
242 | wl12xx_ps_elp_wakeup(wl); | 242 | ret = wl12xx_ps_elp_wakeup(wl); |
243 | if (ret < 0) | ||
244 | goto out; | ||
243 | 245 | ||
244 | ret = wl12xx_cmd_join(wl, wl->bss_type, 1, 100, 0); | 246 | ret = wl12xx_cmd_join(wl, wl->bss_type, 1, 100, 0); |
245 | if (ret < 0) | 247 | if (ret < 0) |
246 | goto out; | 248 | goto out_sleep; |
247 | 249 | ||
248 | out: | 250 | out_sleep: |
249 | wl12xx_ps_elp_sleep(wl); | 251 | wl12xx_ps_elp_sleep(wl); |
252 | |||
253 | out: | ||
250 | mutex_unlock(&wl->mutex); | 254 | mutex_unlock(&wl->mutex); |
251 | } | 255 | } |
252 | 256 | ||
@@ -524,20 +528,22 @@ static int wl12xx_op_config(struct ieee80211_hw *hw, u32 changed) | |||
524 | 528 | ||
525 | mutex_lock(&wl->mutex); | 529 | mutex_lock(&wl->mutex); |
526 | 530 | ||
527 | wl12xx_ps_elp_wakeup(wl); | 531 | ret = wl12xx_ps_elp_wakeup(wl); |
532 | if (ret < 0) | ||
533 | goto out; | ||
528 | 534 | ||
529 | if (channel != wl->channel) { | 535 | if (channel != wl->channel) { |
530 | /* FIXME: use beacon interval provided by mac80211 */ | 536 | /* FIXME: use beacon interval provided by mac80211 */ |
531 | ret = wl12xx_cmd_join(wl, wl->bss_type, 1, 100, 0); | 537 | ret = wl12xx_cmd_join(wl, wl->bss_type, 1, 100, 0); |
532 | if (ret < 0) | 538 | if (ret < 0) |
533 | goto out; | 539 | goto out_sleep; |
534 | 540 | ||
535 | wl->channel = channel; | 541 | wl->channel = channel; |
536 | } | 542 | } |
537 | 543 | ||
538 | ret = wl12xx_build_null_data(wl); | 544 | ret = wl12xx_build_null_data(wl); |
539 | if (ret < 0) | 545 | if (ret < 0) |
540 | goto out; | 546 | goto out_sleep; |
541 | 547 | ||
542 | if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) { | 548 | if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) { |
543 | wl12xx_info("psm enabled"); | 549 | wl12xx_info("psm enabled"); |
@@ -568,9 +574,12 @@ static int wl12xx_op_config(struct ieee80211_hw *hw, u32 changed) | |||
568 | wl->power_level = conf->power_level; | 574 | wl->power_level = conf->power_level; |
569 | } | 575 | } |
570 | 576 | ||
571 | out: | 577 | out_sleep: |
572 | wl12xx_ps_elp_sleep(wl); | 578 | wl12xx_ps_elp_sleep(wl); |
579 | |||
580 | out: | ||
573 | mutex_unlock(&wl->mutex); | 581 | mutex_unlock(&wl->mutex); |
582 | |||
574 | return ret; | 583 | return ret; |
575 | } | 584 | } |
576 | 585 | ||
@@ -708,7 +717,9 @@ static int wl12xx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
708 | 717 | ||
709 | mutex_lock(&wl->mutex); | 718 | mutex_lock(&wl->mutex); |
710 | 719 | ||
711 | wl12xx_ps_elp_wakeup(wl); | 720 | ret = wl12xx_ps_elp_wakeup(wl); |
721 | if (ret < 0) | ||
722 | goto out_unlock; | ||
712 | 723 | ||
713 | switch (cmd) { | 724 | switch (cmd) { |
714 | case SET_KEY: | 725 | case SET_KEY: |
@@ -725,7 +736,7 @@ static int wl12xx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
725 | ret = wl12xx_set_key_type(wl, wl_cmd, cmd, key, addr); | 736 | ret = wl12xx_set_key_type(wl, wl_cmd, cmd, key, addr); |
726 | if (ret < 0) { | 737 | if (ret < 0) { |
727 | wl12xx_error("Set KEY type failed"); | 738 | wl12xx_error("Set KEY type failed"); |
728 | goto out_unlock; | 739 | goto out_sleep; |
729 | } | 740 | } |
730 | 741 | ||
731 | if (wl_cmd->key_type != KEY_WEP_DEFAULT) | 742 | if (wl_cmd->key_type != KEY_WEP_DEFAULT) |
@@ -756,11 +767,13 @@ static int wl12xx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
756 | ret = wl12xx_cmd_send(wl, CMD_SET_KEYS, wl_cmd, sizeof(*wl_cmd)); | 767 | ret = wl12xx_cmd_send(wl, CMD_SET_KEYS, wl_cmd, sizeof(*wl_cmd)); |
757 | if (ret < 0) { | 768 | if (ret < 0) { |
758 | wl12xx_warning("could not set keys"); | 769 | wl12xx_warning("could not set keys"); |
759 | goto out_unlock; | 770 | goto out_sleep; |
760 | } | 771 | } |
761 | 772 | ||
762 | out_unlock: | 773 | out_sleep: |
763 | wl12xx_ps_elp_sleep(wl); | 774 | wl12xx_ps_elp_sleep(wl); |
775 | |||
776 | out_unlock: | ||
764 | mutex_unlock(&wl->mutex); | 777 | mutex_unlock(&wl->mutex); |
765 | 778 | ||
766 | out: | 779 | out: |
@@ -955,11 +968,16 @@ static int wl12xx_op_hw_scan(struct ieee80211_hw *hw, | |||
955 | } | 968 | } |
956 | 969 | ||
957 | mutex_lock(&wl->mutex); | 970 | mutex_lock(&wl->mutex); |
958 | wl12xx_ps_elp_wakeup(wl); | 971 | |
972 | ret = wl12xx_ps_elp_wakeup(wl); | ||
973 | if (ret < 0) | ||
974 | goto out; | ||
959 | 975 | ||
960 | ret = wl12xx_hw_scan(hw->priv, ssid, ssid_len, 1, 0, 13, 3); | 976 | ret = wl12xx_hw_scan(hw->priv, ssid, ssid_len, 1, 0, 13, 3); |
961 | 977 | ||
962 | wl12xx_ps_elp_sleep(wl); | 978 | wl12xx_ps_elp_sleep(wl); |
979 | |||
980 | out: | ||
963 | mutex_unlock(&wl->mutex); | 981 | mutex_unlock(&wl->mutex); |
964 | 982 | ||
965 | return ret; | 983 | return ret; |
@@ -972,15 +990,17 @@ static int wl12xx_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value) | |||
972 | 990 | ||
973 | mutex_lock(&wl->mutex); | 991 | mutex_lock(&wl->mutex); |
974 | 992 | ||
975 | wl12xx_ps_elp_wakeup(wl); | 993 | ret = wl12xx_ps_elp_wakeup(wl); |
994 | if (ret < 0) | ||
995 | goto out; | ||
976 | 996 | ||
977 | ret = wl12xx_acx_rts_threshold(wl, (u16) value); | 997 | ret = wl12xx_acx_rts_threshold(wl, (u16) value); |
978 | |||
979 | if (ret < 0) | 998 | if (ret < 0) |
980 | wl12xx_warning("wl12xx_op_set_rts_threshold failed: %d", ret); | 999 | wl12xx_warning("wl12xx_op_set_rts_threshold failed: %d", ret); |
981 | 1000 | ||
982 | wl12xx_ps_elp_sleep(wl); | 1001 | wl12xx_ps_elp_sleep(wl); |
983 | 1002 | ||
1003 | out: | ||
984 | mutex_unlock(&wl->mutex); | 1004 | mutex_unlock(&wl->mutex); |
985 | 1005 | ||
986 | return ret; | 1006 | return ret; |
@@ -1000,7 +1020,9 @@ static void wl12xx_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1000 | 1020 | ||
1001 | mutex_lock(&wl->mutex); | 1021 | mutex_lock(&wl->mutex); |
1002 | 1022 | ||
1003 | wl12xx_ps_elp_wakeup(wl); | 1023 | ret = wl12xx_ps_elp_wakeup(wl); |
1024 | if (ret < 0) | ||
1025 | goto out; | ||
1004 | 1026 | ||
1005 | if (changed & BSS_CHANGED_ASSOC) { | 1027 | if (changed & BSS_CHANGED_ASSOC) { |
1006 | if (bss_conf->assoc) { | 1028 | if (bss_conf->assoc) { |
@@ -1008,18 +1030,18 @@ static void wl12xx_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1008 | 1030 | ||
1009 | ret = wl12xx_build_ps_poll(wl, wl->aid); | 1031 | ret = wl12xx_build_ps_poll(wl, wl->aid); |
1010 | if (ret < 0) | 1032 | if (ret < 0) |
1011 | goto out; | 1033 | goto out_sleep; |
1012 | 1034 | ||
1013 | ret = wl12xx_acx_aid(wl, wl->aid); | 1035 | ret = wl12xx_acx_aid(wl, wl->aid); |
1014 | if (ret < 0) | 1036 | if (ret < 0) |
1015 | goto out; | 1037 | goto out_sleep; |
1016 | 1038 | ||
1017 | /* If we want to go in PSM but we're not there yet */ | 1039 | /* If we want to go in PSM but we're not there yet */ |
1018 | if (wl->psm_requested && !wl->psm) { | 1040 | if (wl->psm_requested && !wl->psm) { |
1019 | mode = STATION_POWER_SAVE_MODE; | 1041 | mode = STATION_POWER_SAVE_MODE; |
1020 | ret = wl12xx_ps_set_mode(wl, mode); | 1042 | ret = wl12xx_ps_set_mode(wl, mode); |
1021 | if (ret < 0) | 1043 | if (ret < 0) |
1022 | goto out; | 1044 | goto out_sleep; |
1023 | } | 1045 | } |
1024 | } | 1046 | } |
1025 | } | 1047 | } |
@@ -1030,7 +1052,7 @@ static void wl12xx_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1030 | ret = wl12xx_acx_slot(wl, SLOT_TIME_LONG); | 1052 | ret = wl12xx_acx_slot(wl, SLOT_TIME_LONG); |
1031 | if (ret < 0) { | 1053 | if (ret < 0) { |
1032 | wl12xx_warning("Set slot time failed %d", ret); | 1054 | wl12xx_warning("Set slot time failed %d", ret); |
1033 | goto out; | 1055 | goto out_sleep; |
1034 | } | 1056 | } |
1035 | } | 1057 | } |
1036 | 1058 | ||
@@ -1048,7 +1070,7 @@ static void wl12xx_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1048 | ret = wl12xx_acx_cts_protect(wl, CTSPROTECT_DISABLE); | 1070 | ret = wl12xx_acx_cts_protect(wl, CTSPROTECT_DISABLE); |
1049 | if (ret < 0) { | 1071 | if (ret < 0) { |
1050 | wl12xx_warning("Set ctsprotect failed %d", ret); | 1072 | wl12xx_warning("Set ctsprotect failed %d", ret); |
1051 | goto out; | 1073 | goto out_sleep; |
1052 | } | 1074 | } |
1053 | } | 1075 | } |
1054 | 1076 | ||
@@ -1090,8 +1112,10 @@ static void wl12xx_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1090 | goto out; | 1112 | goto out; |
1091 | } | 1113 | } |
1092 | 1114 | ||
1093 | out: | 1115 | out_sleep: |
1094 | wl12xx_ps_elp_sleep(wl); | 1116 | wl12xx_ps_elp_sleep(wl); |
1117 | |||
1118 | out: | ||
1095 | mutex_unlock(&wl->mutex); | 1119 | mutex_unlock(&wl->mutex); |
1096 | } | 1120 | } |
1097 | 1121 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1251.c b/drivers/net/wireless/wl12xx/wl1251.c index 903624a540a3..5f6e75c61128 100644 --- a/drivers/net/wireless/wl12xx/wl1251.c +++ b/drivers/net/wireless/wl12xx/wl1251.c | |||
@@ -401,6 +401,7 @@ static void wl1251_irq_work(struct work_struct *work) | |||
401 | u32 intr; | 401 | u32 intr; |
402 | struct wl12xx *wl = | 402 | struct wl12xx *wl = |
403 | container_of(work, struct wl12xx, irq_work); | 403 | container_of(work, struct wl12xx, irq_work); |
404 | int ret; | ||
404 | 405 | ||
405 | mutex_lock(&wl->mutex); | 406 | mutex_lock(&wl->mutex); |
406 | 407 | ||
@@ -409,7 +410,9 @@ static void wl1251_irq_work(struct work_struct *work) | |||
409 | if (wl->state == WL12XX_STATE_OFF) | 410 | if (wl->state == WL12XX_STATE_OFF) |
410 | goto out; | 411 | goto out; |
411 | 412 | ||
412 | wl12xx_ps_elp_wakeup(wl); | 413 | ret = wl12xx_ps_elp_wakeup(wl); |
414 | if (ret < 0) | ||
415 | goto out; | ||
413 | 416 | ||
414 | wl12xx_reg_write32(wl, ACX_REG_INTERRUPT_MASK, WL1251_ACX_INTR_ALL); | 417 | wl12xx_reg_write32(wl, ACX_REG_INTERRUPT_MASK, WL1251_ACX_INTR_ALL); |
415 | 418 | ||
@@ -489,6 +492,7 @@ static void wl1251_irq_work(struct work_struct *work) | |||
489 | 492 | ||
490 | out_sleep: | 493 | out_sleep: |
491 | wl12xx_ps_elp_sleep(wl); | 494 | wl12xx_ps_elp_sleep(wl); |
495 | |||
492 | out: | 496 | out: |
493 | mutex_unlock(&wl->mutex); | 497 | mutex_unlock(&wl->mutex); |
494 | } | 498 | } |
diff --git a/drivers/net/wireless/wl12xx/wl1251_tx.c b/drivers/net/wireless/wl12xx/wl1251_tx.c index c42c43de657e..10023fce1031 100644 --- a/drivers/net/wireless/wl12xx/wl1251_tx.c +++ b/drivers/net/wireless/wl12xx/wl1251_tx.c | |||
@@ -311,7 +311,9 @@ void wl1251_tx_work(struct work_struct *work) | |||
311 | 311 | ||
312 | while ((skb = skb_dequeue(&wl->tx_queue))) { | 312 | while ((skb = skb_dequeue(&wl->tx_queue))) { |
313 | if (!woken_up) { | 313 | if (!woken_up) { |
314 | wl12xx_ps_elp_wakeup(wl); | 314 | ret = wl12xx_ps_elp_wakeup(wl); |
315 | if (ret < 0) | ||
316 | goto out; | ||
315 | woken_up = true; | 317 | woken_up = true; |
316 | } | 318 | } |
317 | 319 | ||