Search Linux Wireless

[PATCH 4/4] ath6kl: Fix random reconnect failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sometimes connect events are received after disconnect
events from target, this puts host and target in different
states. When receiving a connect event in a wrong state,
make sure to send disconnect event to target to maintain
state consistency.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@xxxxxxxxxxxxxxxx>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 0ad458b..2e4bea3 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -460,6 +460,14 @@ void ath6kl_cfg80211_connect_event(struct ath6kl *ar, u16 channel,
 				   "%s: ath6k not in station mode\n", __func__);
 			return;
 		}
+
+		if ((ar->sme_state != SME_CONNECTING) &&
+		    (ar->sme_state != SME_CONNECTED)) {
+			ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
+				   "Connect event at inappropriate state, sending disconnect cmd\n");
+			ath6kl_wmi_disconnect_cmd(ar->wmi);
+			return;
+		}
 	}
 
 	/*
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux