diff options
author | Zhu Yi <yi.zhu@intel.com> | 2009-07-16 05:34:12 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-24 15:05:21 -0400 |
commit | b6c321718e1376b1a55afc63cce090a2c4573417 (patch) | |
tree | a9b37daf3ee6a1787ef879eecf50f0398ef0a22b /drivers/net/wireless/iwmc3200wifi/commands.c | |
parent | 0e371f1a0c0acd4abfa052b01e7b1f4a71ef6590 (diff) |
iwmc3200wifi: make iwm_send_wifi_if_cmd return 0 on success
We used to return the result of wait_event_interruptible_timeout()
which is the remaining timeout on success. But this information is
not used by any of its callers. So we just return 0 on success.
This fixed a erroneous return value bug for iwm_set_key().
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi/commands.c')
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/commands.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/commands.c b/drivers/net/wireless/iwmc3200wifi/commands.c index 0d35afefb61c..e6be29704a1d 100644 --- a/drivers/net/wireless/iwmc3200wifi/commands.c +++ b/drivers/net/wireless/iwmc3200wifi/commands.c | |||
@@ -87,8 +87,7 @@ int iwm_send_wifi_if_cmd(struct iwm_priv *iwm, void *payload, u16 payload_size, | |||
87 | test_and_clear_bit(oid, &iwm->wifi_ntfy[0]), | 87 | test_and_clear_bit(oid, &iwm->wifi_ntfy[0]), |
88 | 3 * HZ); | 88 | 3 * HZ); |
89 | 89 | ||
90 | if (!ret) | 90 | return ret ? 0 : -EBUSY; |
91 | ret = -EBUSY; | ||
92 | } | 91 | } |
93 | 92 | ||
94 | return ret; | 93 | return ret; |
@@ -480,8 +479,10 @@ static int iwm_target_read(struct iwm_priv *iwm, __le32 address, | |||
480 | target_cmd.eop = 1; | 479 | target_cmd.eop = 1; |
481 | 480 | ||
482 | ret = iwm_hal_send_target_cmd(iwm, &target_cmd, NULL); | 481 | ret = iwm_hal_send_target_cmd(iwm, &target_cmd, NULL); |
483 | if (ret < 0) | 482 | if (ret < 0) { |
484 | IWM_ERR(iwm, "Couldn't send READ command\n"); | 483 | IWM_ERR(iwm, "Couldn't send READ command\n"); |
484 | return ret; | ||
485 | } | ||
485 | 486 | ||
486 | /* When succeding, the send_target routine returns the seq number */ | 487 | /* When succeding, the send_target routine returns the seq number */ |
487 | seq_num = ret; | 488 | seq_num = ret; |
@@ -501,7 +502,7 @@ static int iwm_target_read(struct iwm_priv *iwm, __le32 address, | |||
501 | 502 | ||
502 | kfree(cmd); | 503 | kfree(cmd); |
503 | 504 | ||
504 | return ret; | 505 | return 0; |
505 | } | 506 | } |
506 | 507 | ||
507 | int iwm_read_mac(struct iwm_priv *iwm, u8 *mac) | 508 | int iwm_read_mac(struct iwm_priv *iwm, u8 *mac) |
@@ -511,7 +512,7 @@ int iwm_read_mac(struct iwm_priv *iwm, u8 *mac) | |||
511 | 512 | ||
512 | ret = iwm_target_read(iwm, cpu_to_le32(WICO_MAC_ADDRESS_ADDR), | 513 | ret = iwm_target_read(iwm, cpu_to_le32(WICO_MAC_ADDRESS_ADDR), |
513 | mac_align, sizeof(mac_align)); | 514 | mac_align, sizeof(mac_align)); |
514 | if (ret < 0) | 515 | if (ret) |
515 | return ret; | 516 | return ret; |
516 | 517 | ||
517 | if (is_valid_ether_addr(mac_align)) | 518 | if (is_valid_ether_addr(mac_align)) |
@@ -714,7 +715,7 @@ int iwm_set_key(struct iwm_priv *iwm, bool remove, struct iwm_key *key) | |||
714 | ret = iwm_send_wifi_if_cmd(iwm, &key_remove, | 715 | ret = iwm_send_wifi_if_cmd(iwm, &key_remove, |
715 | sizeof(struct iwm_umac_key_remove), | 716 | sizeof(struct iwm_umac_key_remove), |
716 | 1); | 717 | 1); |
717 | if (ret < 0) | 718 | if (ret) |
718 | return ret; | 719 | return ret; |
719 | 720 | ||
720 | iwm->keys[key_idx].key_len = 0; | 721 | iwm->keys[key_idx].key_len = 0; |
@@ -736,7 +737,7 @@ int iwm_send_mlme_profile(struct iwm_priv *iwm) | |||
736 | sizeof(struct iwm_umac_wifi_if)); | 737 | sizeof(struct iwm_umac_wifi_if)); |
737 | 738 | ||
738 | ret = iwm_send_wifi_if_cmd(iwm, &profile, sizeof(profile), 1); | 739 | ret = iwm_send_wifi_if_cmd(iwm, &profile, sizeof(profile), 1); |
739 | if (ret < 0) { | 740 | if (ret) { |
740 | IWM_ERR(iwm, "Send profile command failed\n"); | 741 | IWM_ERR(iwm, "Send profile command failed\n"); |
741 | return ret; | 742 | return ret; |
742 | } | 743 | } |
@@ -752,12 +753,12 @@ int iwm_send_mlme_profile(struct iwm_priv *iwm) | |||
752 | 3 * HZ); | 753 | 3 * HZ); |
753 | 754 | ||
754 | ret = iwm_set_key(iwm, 0, key); | 755 | ret = iwm_set_key(iwm, 0, key); |
755 | if (ret < 0) | 756 | if (ret) |
756 | return ret; | 757 | return ret; |
757 | 758 | ||
758 | if (iwm->default_key == i) { | 759 | if (iwm->default_key == i) { |
759 | ret = iwm_set_tx_key(iwm, i); | 760 | ret = iwm_set_tx_key(iwm, i); |
760 | if (ret < 0) | 761 | if (ret) |
761 | return ret; | 762 | return ret; |
762 | } | 763 | } |
763 | } | 764 | } |
@@ -778,15 +779,13 @@ int iwm_invalidate_mlme_profile(struct iwm_priv *iwm) | |||
778 | invalid.reason = WLAN_REASON_UNSPECIFIED; | 779 | invalid.reason = WLAN_REASON_UNSPECIFIED; |
779 | 780 | ||
780 | ret = iwm_send_wifi_if_cmd(iwm, &invalid, sizeof(invalid), 1); | 781 | ret = iwm_send_wifi_if_cmd(iwm, &invalid, sizeof(invalid), 1); |
781 | if (ret < 0) | 782 | if (ret) |
782 | return ret; | 783 | return ret; |
783 | 784 | ||
784 | ret = wait_event_interruptible_timeout(iwm->mlme_queue, | 785 | ret = wait_event_interruptible_timeout(iwm->mlme_queue, |
785 | (iwm->umac_profile_active == 0), 2 * HZ); | 786 | (iwm->umac_profile_active == 0), 2 * HZ); |
786 | if (!ret) | ||
787 | return -EBUSY; | ||
788 | 787 | ||
789 | return 0; | 788 | return ret ? 0 : -EBUSY; |
790 | } | 789 | } |
791 | 790 | ||
792 | int iwm_send_umac_stats_req(struct iwm_priv *iwm, u32 flags) | 791 | int iwm_send_umac_stats_req(struct iwm_priv *iwm, u32 flags) |
@@ -869,7 +868,7 @@ int iwm_scan_ssids(struct iwm_priv *iwm, struct cfg80211_ssid *ssids, | |||
869 | } | 868 | } |
870 | 869 | ||
871 | ret = iwm_send_wifi_if_cmd(iwm, &req, sizeof(req), 0); | 870 | ret = iwm_send_wifi_if_cmd(iwm, &req, sizeof(req), 0); |
872 | if (ret < 0) { | 871 | if (ret) { |
873 | IWM_ERR(iwm, "Couldn't send scan request\n"); | 872 | IWM_ERR(iwm, "Couldn't send scan request\n"); |
874 | return ret; | 873 | return ret; |
875 | } | 874 | } |