|
@@ -227,7 +227,7 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb,
|
|
|
|
|
|
/* Check if there has been a timeout. */
|
|
/* Check if there has been a timeout. */
|
|
spin_lock(&wmi->wmi_lock);
|
|
spin_lock(&wmi->wmi_lock);
|
|
- if (cmd_id != wmi->last_cmd_id) {
|
|
|
|
|
|
+ if (be16_to_cpu(hdr->seq_no) != wmi->last_seq_id) {
|
|
spin_unlock(&wmi->wmi_lock);
|
|
spin_unlock(&wmi->wmi_lock);
|
|
goto free_skb;
|
|
goto free_skb;
|
|
}
|
|
}
|
|
@@ -275,11 +275,16 @@ static int ath9k_wmi_cmd_issue(struct wmi *wmi,
|
|
enum wmi_cmd_id cmd, u16 len)
|
|
enum wmi_cmd_id cmd, u16 len)
|
|
{
|
|
{
|
|
struct wmi_cmd_hdr *hdr;
|
|
struct wmi_cmd_hdr *hdr;
|
|
|
|
+ unsigned long flags;
|
|
|
|
|
|
hdr = (struct wmi_cmd_hdr *) skb_push(skb, sizeof(struct wmi_cmd_hdr));
|
|
hdr = (struct wmi_cmd_hdr *) skb_push(skb, sizeof(struct wmi_cmd_hdr));
|
|
hdr->command_id = cpu_to_be16(cmd);
|
|
hdr->command_id = cpu_to_be16(cmd);
|
|
hdr->seq_no = cpu_to_be16(++wmi->tx_seq_id);
|
|
hdr->seq_no = cpu_to_be16(++wmi->tx_seq_id);
|
|
|
|
|
|
|
|
+ spin_lock_irqsave(&wmi->wmi_lock, flags);
|
|
|
|
+ wmi->last_seq_id = wmi->tx_seq_id;
|
|
|
|
+ spin_unlock_irqrestore(&wmi->wmi_lock, flags);
|
|
|
|
+
|
|
return htc_send_epid(wmi->htc, skb, wmi->ctrl_epid);
|
|
return htc_send_epid(wmi->htc, skb, wmi->ctrl_epid);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -295,7 +300,6 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
|
|
struct sk_buff *skb;
|
|
struct sk_buff *skb;
|
|
u8 *data;
|
|
u8 *data;
|
|
int time_left, ret = 0;
|
|
int time_left, ret = 0;
|
|
- unsigned long flags;
|
|
|
|
|
|
|
|
if (ah->ah_flags & AH_UNPLUGGED)
|
|
if (ah->ah_flags & AH_UNPLUGGED)
|
|
return 0;
|
|
return 0;
|
|
@@ -323,10 +327,6 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
|
|
wmi->cmd_rsp_buf = rsp_buf;
|
|
wmi->cmd_rsp_buf = rsp_buf;
|
|
wmi->cmd_rsp_len = rsp_len;
|
|
wmi->cmd_rsp_len = rsp_len;
|
|
|
|
|
|
- spin_lock_irqsave(&wmi->wmi_lock, flags);
|
|
|
|
- wmi->last_cmd_id = cmd_id;
|
|
|
|
- spin_unlock_irqrestore(&wmi->wmi_lock, flags);
|
|
|
|
-
|
|
|
|
ret = ath9k_wmi_cmd_issue(wmi, skb, cmd_id, cmd_len);
|
|
ret = ath9k_wmi_cmd_issue(wmi, skb, cmd_id, cmd_len);
|
|
if (ret)
|
|
if (ret)
|
|
goto out;
|
|
goto out;
|