diff options
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi/commands.c')
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/commands.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/commands.c b/drivers/net/wireless/iwmc3200wifi/commands.c index 834a7f544e5d..337a884f52df 100644 --- a/drivers/net/wireless/iwmc3200wifi/commands.c +++ b/drivers/net/wireless/iwmc3200wifi/commands.c | |||
@@ -70,14 +70,28 @@ static int iwm_send_lmac_ptrough_cmd(struct iwm_priv *iwm, | |||
70 | int iwm_send_wifi_if_cmd(struct iwm_priv *iwm, void *payload, u16 payload_size, | 70 | int iwm_send_wifi_if_cmd(struct iwm_priv *iwm, void *payload, u16 payload_size, |
71 | bool resp) | 71 | bool resp) |
72 | { | 72 | { |
73 | struct iwm_umac_wifi_if *hdr = (struct iwm_umac_wifi_if *)payload; | ||
73 | struct iwm_udma_wifi_cmd udma_cmd = UDMA_UMAC_INIT; | 74 | struct iwm_udma_wifi_cmd udma_cmd = UDMA_UMAC_INIT; |
74 | struct iwm_umac_cmd umac_cmd; | 75 | struct iwm_umac_cmd umac_cmd; |
76 | int ret; | ||
77 | u8 oid = hdr->oid; | ||
75 | 78 | ||
76 | umac_cmd.id = UMAC_CMD_OPCODE_WIFI_IF_WRAPPER; | 79 | umac_cmd.id = UMAC_CMD_OPCODE_WIFI_IF_WRAPPER; |
77 | umac_cmd.resp = resp; | 80 | umac_cmd.resp = resp; |
78 | 81 | ||
79 | return iwm_hal_send_umac_cmd(iwm, &udma_cmd, &umac_cmd, | 82 | ret = iwm_hal_send_umac_cmd(iwm, &udma_cmd, &umac_cmd, |
80 | payload, payload_size); | 83 | payload, payload_size); |
84 | |||
85 | if (resp) { | ||
86 | ret = wait_event_interruptible_timeout(iwm->wifi_ntfy_queue, | ||
87 | test_and_clear_bit(oid, &iwm->wifi_ntfy[0]), | ||
88 | 3 * HZ); | ||
89 | |||
90 | if (!ret) | ||
91 | ret = -EBUSY; | ||
92 | } | ||
93 | |||
94 | return ret; | ||
81 | } | 95 | } |
82 | 96 | ||
83 | static struct coex_event iwm_sta_xor_prio_tbl[COEX_EVENTS_NUM] = | 97 | static struct coex_event iwm_sta_xor_prio_tbl[COEX_EVENTS_NUM] = |
@@ -746,14 +760,6 @@ int iwm_send_mlme_profile(struct iwm_priv *iwm) | |||
746 | return ret; | 760 | return ret; |
747 | } | 761 | } |
748 | 762 | ||
749 | /* Wait for the profile to be active */ | ||
750 | ret = wait_event_interruptible_timeout(iwm->mlme_queue, | ||
751 | iwm->umac_profile_active == 1, | ||
752 | 3 * HZ); | ||
753 | if (!ret) | ||
754 | return -EBUSY; | ||
755 | |||
756 | |||
757 | for (i = 0; i < IWM_NUM_KEYS; i++) | 763 | for (i = 0; i < IWM_NUM_KEYS; i++) |
758 | if (iwm->keys[i].in_use) { | 764 | if (iwm->keys[i].in_use) { |
759 | int default_key = 0; | 765 | int default_key = 0; |
@@ -778,8 +784,8 @@ int iwm_send_mlme_profile(struct iwm_priv *iwm) | |||
778 | 784 | ||
779 | int iwm_invalidate_mlme_profile(struct iwm_priv *iwm) | 785 | int iwm_invalidate_mlme_profile(struct iwm_priv *iwm) |
780 | { | 786 | { |
781 | int ret; | ||
782 | struct iwm_umac_invalidate_profile invalid; | 787 | struct iwm_umac_invalidate_profile invalid; |
788 | int ret; | ||
783 | 789 | ||
784 | invalid.hdr.oid = UMAC_WIFI_IF_CMD_INVALIDATE_PROFILE; | 790 | invalid.hdr.oid = UMAC_WIFI_IF_CMD_INVALIDATE_PROFILE; |
785 | invalid.hdr.buf_size = | 791 | invalid.hdr.buf_size = |
@@ -793,8 +799,7 @@ int iwm_invalidate_mlme_profile(struct iwm_priv *iwm) | |||
793 | return ret; | 799 | return ret; |
794 | 800 | ||
795 | ret = wait_event_interruptible_timeout(iwm->mlme_queue, | 801 | ret = wait_event_interruptible_timeout(iwm->mlme_queue, |
796 | (iwm->umac_profile_active == 0), | 802 | (iwm->umac_profile_active == 0), 2 * HZ); |
797 | 2 * HZ); | ||
798 | if (!ret) | 803 | if (!ret) |
799 | return -EBUSY; | 804 | return -EBUSY; |
800 | 805 | ||