Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194464
b: refs/heads/master
c: 6ce34ec
h: refs/heads/master
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Apr 16, 2010
1 parent 99fa618 commit 28a326e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eac8e385e9446e591aacbc9ef2c2a3b0836dd2d4
refs/heads/master: 6ce34ec11c6297562e70e27c57a24cd27d4cd2b1
13 changes: 13 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb,
return;
}

/* Check if there has been a timeout. */
spin_lock(&wmi->wmi_lock);
if (cmd_id != wmi->last_cmd_id) {
spin_unlock(&wmi->wmi_lock);
goto free_skb;
}
spin_unlock(&wmi->wmi_lock);

/* WMI command response */
ath9k_wmi_rsp_callback(wmi, skb);

Expand Down Expand Up @@ -266,6 +274,7 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
struct sk_buff *skb;
u8 *data;
int time_left, ret = 0;
unsigned long flags;

if (!wmi)
return -EINVAL;
Expand Down Expand Up @@ -297,6 +306,10 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
if (ret)
goto out;

spin_lock_irqsave(&wmi->wmi_lock, flags);
wmi->last_cmd_id = cmd_id;
spin_unlock_irqrestore(&wmi->wmi_lock, flags);

time_left = wait_for_completion_timeout(&wmi->cmd_wait, timeout);
if (!time_left) {
ath_print(common, ATH_DBG_WMI,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ struct wmi {
enum htc_endpoint_id ctrl_epid;
struct mutex op_mutex;
struct completion cmd_wait;
enum wmi_cmd_id last_cmd_id;
u16 tx_seq_id;
u8 *cmd_rsp_buf;
u32 cmd_rsp_len;
Expand Down

0 comments on commit 28a326e

Please sign in to comment.