linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode
@ 2011-09-10  9:56 Vasanthakumar Thiagarajan
  2011-09-10  9:56 ` [PATCH 2/4] ath6kl: Set the sme_state to disconnected in disconnect() callback Vasanthakumar Thiagarajan
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Vasanthakumar Thiagarajan @ 2011-09-10  9:56 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

Target already tries with different authentication mechanism
when authentication type is configured to NL80211_AUTHTYPE_AUTOMATIC.
Remove this piece of code from driver. Having this code in driver
even affects auto + WEP authentication in some cases.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c |   74 +++++-----------------------
 drivers/net/wireless/ath/ath6kl/core.h     |    2 -
 drivers/net/wireless/ath/ath6kl/init.c     |    1 -
 drivers/net/wireless/ath/ath6kl/wmi.h      |    5 --
 4 files changed, 12 insertions(+), 70 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index a889bf4..fcef417 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -158,8 +158,7 @@ static int ath6kl_set_auth_type(struct ath6kl *ar,
 		break;
 
 	case NL80211_AUTHTYPE_AUTOMATIC:
-		ar->dot11_auth_mode = OPEN_AUTH;
-		ar->auto_auth_stage = AUTH_OPEN_IN_PROGRESS;
+		ar->dot11_auth_mode = OPEN_AUTH | SHARED_AUTH;
 		break;
 
 	default:
@@ -446,8 +445,6 @@ void ath6kl_cfg80211_connect_event(struct ath6kl *ar, u16 channel,
 	assoc_req_len -= assoc_req_ie_offset;
 	assoc_resp_len -= assoc_resp_ie_offset;
 
-	ar->auto_auth_stage = AUTH_IDLE;
-
 	if (nw_type & ADHOC_NETWORK) {
 		if (ar->wdev->iftype != NL80211_IFTYPE_ADHOC) {
 			ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
@@ -599,9 +596,6 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl *ar, u8 reason,
 				      u8 *bssid, u8 assoc_resp_len,
 				      u8 *assoc_info, u16 proto_reason)
 {
-	struct ath6kl_key *key = NULL;
-	u16 status;
-
 	if (ar->scan_req) {
 		cfg80211_scan_done(ar->scan_req, true);
 		ar->scan_req = NULL;
@@ -643,64 +637,20 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl *ar, u8 reason,
 	if (reason != DISCONNECT_CMD)
 		return;
 
-	if (!ar->auto_auth_stage) {
-		clear_bit(CONNECT_PEND, &ar->flag);
-
-		if (ar->sme_state == SME_CONNECTING) {
-			cfg80211_connect_result(ar->net_dev,
-						bssid, NULL, 0,
-						NULL, 0,
-						WLAN_STATUS_UNSPECIFIED_FAILURE,
-						GFP_KERNEL);
-		} else if (ar->sme_state == SME_CONNECTED) {
-			cfg80211_disconnected(ar->net_dev, reason,
-					      NULL, 0, GFP_KERNEL);
-		}
-
-		ar->sme_state = SME_DISCONNECTED;
-		return;
-	}
-
-	if (ar->dot11_auth_mode != OPEN_AUTH)
-		return;
+	clear_bit(CONNECT_PEND, &ar->flag);
 
-	/*
-	 * If the current auth algorithm is open, try shared and
-	 * make autoAuthStage idle. We do not make it leap for now
-	 * being.
-	 */
-	key = &ar->keys[ar->def_txkey_index];
-	if (down_interruptible(&ar->sem)) {
-		ath6kl_err("busy, couldn't get access\n");
-		return;
+	if (ar->sme_state == SME_CONNECTING) {
+		cfg80211_connect_result(ar->net_dev,
+				bssid, NULL, 0,
+				NULL, 0,
+				WLAN_STATUS_UNSPECIFIED_FAILURE,
+				GFP_KERNEL);
+	} else if (ar->sme_state == SME_CONNECTED) {
+		cfg80211_disconnected(ar->net_dev, reason,
+				NULL, 0, GFP_KERNEL);
 	}
 
-	ar->dot11_auth_mode = SHARED_AUTH;
-	ar->auto_auth_stage = AUTH_IDLE;
-
-	ath6kl_wmi_addkey_cmd(ar->wmi,
-			      ar->def_txkey_index,
-			      ar->prwise_crypto,
-			      GROUP_USAGE | TX_USAGE,
-			      key->key_len, NULL,
-			      key->key,
-			      KEY_OP_INIT_VAL, NULL,
-			      NO_SYNC_WMIFLAG);
-
-	status = ath6kl_wmi_connect_cmd(ar->wmi,
-					ar->nw_type,
-					ar->dot11_auth_mode,
-					ar->auth_mode,
-					ar->prwise_crypto,
-					ar->prwise_crypto_len,
-					ar->grp_crypto,
-					ar->grp_crypto_len,
-					ar->ssid_len,
-					ar->ssid,
-					ar->req_bssid,
-					ar->ch_hint,
-					ar->connect_ctrl_flags);
-	up(&ar->sem);
+	ar->sme_state = SME_DISCONNECTED;
 }
 
 static inline bool is_ch_11a(u16 ch)
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index c6ed1fc..b49e869 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -435,8 +435,6 @@ struct ath6kl {
 	enum wlan_low_pwr_state wlan_pwr_state;
 	struct wmi_scan_params_cmd sc_params;
 #define AR_MCAST_FILTER_MAC_ADDR_SIZE  4
-	u8 auto_auth_stage;
-
 	struct {
 		void *rx_report;
 		size_t rx_report_len;
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index eca34aa..23ab9c3 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -603,7 +603,6 @@ struct ath6kl *ath6kl_core_alloc(struct device *sdev)
 	SET_NETDEV_DEV(dev, wiphy_dev(wdev->wiphy));
 	wdev->netdev = dev;
 	ar->sme_state = SME_DISCONNECTED;
-	ar->auto_auth_stage = AUTH_IDLE;
 
 	init_netdev(dev);
 
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index dc49ef8..f036e78 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -566,11 +566,6 @@ enum dot11_auth_mode {
 	LEAP_AUTH = 0x04,
 };
 
-enum {
-	AUTH_IDLE,
-	AUTH_OPEN_IN_PROGRESS,
-};
-
 enum auth_mode {
 	NONE_AUTH = 0x01,
 	WPA_AUTH = 0x02,
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] ath6kl: Set the sme_state to disconnected in disconnect() callback
  2011-09-10  9:56 [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode Vasanthakumar Thiagarajan
@ 2011-09-10  9:56 ` Vasanthakumar Thiagarajan
  2011-09-10  9:56 ` [PATCH 3/4] ath6kl: Don't give disconnect command in disconnect event handler Vasanthakumar Thiagarajan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Vasanthakumar Thiagarajan @ 2011-09-10  9:56 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

After a successful completion of disconnect() driver needs to set
it's sme_state to SME_DISCONNECTED to be in sync with cfg80211
state.

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

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index fcef417..17bb8e2 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -589,6 +589,8 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy,
 
 	up(&ar->sem);
 
+	ar->sme_state = SME_DISCONNECTED;
+
 	return 0;
 }
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] ath6kl: Don't give disconnect command in disconnect event handler
  2011-09-10  9:56 [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode Vasanthakumar Thiagarajan
  2011-09-10  9:56 ` [PATCH 2/4] ath6kl: Set the sme_state to disconnected in disconnect() callback Vasanthakumar Thiagarajan
@ 2011-09-10  9:56 ` Vasanthakumar Thiagarajan
  2011-09-10  9:56 ` [PATCH 4/4] ath6kl: Fix random reconnect failures Vasanthakumar Thiagarajan
  2011-09-15 13:46 ` [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode Kalle Valo
  3 siblings, 0 replies; 8+ messages in thread
From: Vasanthakumar Thiagarajan @ 2011-09-10  9:56 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

It looks bogus to give disconnect command from the disconnect
event handler.

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

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 17bb8e2..0ad458b 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -623,22 +623,6 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl *ar, u8 reason,
 		}
 	}
 
-	if (!test_bit(CONNECT_PEND, &ar->flag)) {
-		if (reason != DISCONNECT_CMD)
-			ath6kl_wmi_disconnect_cmd(ar->wmi);
-
-		return;
-	}
-
-	if (reason == NO_NETWORK_AVAIL) {
-		/* connect cmd failed */
-		ath6kl_wmi_disconnect_cmd(ar->wmi);
-		return;
-	}
-
-	if (reason != DISCONNECT_CMD)
-		return;
-
 	clear_bit(CONNECT_PEND, &ar->flag);
 
 	if (ar->sme_state == SME_CONNECTING) {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] ath6kl: Fix random reconnect failures
  2011-09-10  9:56 [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode Vasanthakumar Thiagarajan
  2011-09-10  9:56 ` [PATCH 2/4] ath6kl: Set the sme_state to disconnected in disconnect() callback Vasanthakumar Thiagarajan
  2011-09-10  9:56 ` [PATCH 3/4] ath6kl: Don't give disconnect command in disconnect event handler Vasanthakumar Thiagarajan
@ 2011-09-10  9:56 ` Vasanthakumar Thiagarajan
  2011-09-13  9:44   ` Vasanthakumar Thiagarajan
  2011-09-15 13:46 ` [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode Kalle Valo
  3 siblings, 1 reply; 8+ messages in thread
From: Vasanthakumar Thiagarajan @ 2011-09-10  9:56 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

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@qca.qualcomm.com>
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] ath6kl: Fix random reconnect failures
  2011-09-10  9:56 ` [PATCH 4/4] ath6kl: Fix random reconnect failures Vasanthakumar Thiagarajan
@ 2011-09-13  9:44   ` Vasanthakumar Thiagarajan
  0 siblings, 0 replies; 8+ messages in thread
From: Vasanthakumar Thiagarajan @ 2011-09-13  9:44 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

On Sat, Sep 10, 2011 at 03:26:37PM +0530, Vasanthakumar Thiagarajan wrote:
> 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@qca.qualcomm.com>
> ---
>  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;
> +		}

Please hold on this patch, it seems to introduce regression when
testing with different APs.

Vasanth

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode
  2011-09-10  9:56 [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode Vasanthakumar Thiagarajan
                   ` (2 preceding siblings ...)
  2011-09-10  9:56 ` [PATCH 4/4] ath6kl: Fix random reconnect failures Vasanthakumar Thiagarajan
@ 2011-09-15 13:46 ` Kalle Valo
  2011-09-15 14:36   ` Vasanthakumar Thiagarajan
  3 siblings, 1 reply; 8+ messages in thread
From: Kalle Valo @ 2011-09-15 13:46 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: linux-wireless

On 09/10/2011 12:56 PM, Vasanthakumar Thiagarajan wrote:
> Target already tries with different authentication mechanism
> when authentication type is configured to NL80211_AUTHTYPE_AUTOMATIC.
> Remove this piece of code from driver. Having this code in driver
> even affects auto + WEP authentication in some cases.

Thanks, patches 1-3 applied. Patch 4 dropped per your request. Please
resend it once it's ready.

Kalle

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode
  2011-09-15 13:46 ` [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode Kalle Valo
@ 2011-09-15 14:36   ` Vasanthakumar Thiagarajan
  2011-09-19  6:48     ` Kalle Valo
  0 siblings, 1 reply; 8+ messages in thread
From: Vasanthakumar Thiagarajan @ 2011-09-15 14:36 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

On Thu, Sep 15, 2011 at 04:46:38PM +0300, Kalle Valo wrote:
> On 09/10/2011 12:56 PM, Vasanthakumar Thiagarajan wrote:
> > Target already tries with different authentication mechanism
> > when authentication type is configured to NL80211_AUTHTYPE_AUTOMATIC.
> > Remove this piece of code from driver. Having this code in driver
> > even affects auto + WEP authentication in some cases.
> 
> Thanks, patches 1-3 applied. Patch 4 dropped per your request. Please
> resend it once it's ready.

Sorry for the delay but the patch 3 also seems to be problematic
sometime. Can you please drop 3 as well?. The disconnect event 
still not clear to me.

Vasanth

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode
  2011-09-15 14:36   ` Vasanthakumar Thiagarajan
@ 2011-09-19  6:48     ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2011-09-19  6:48 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: linux-wireless

On 09/15/2011 05:36 PM, Vasanthakumar Thiagarajan wrote:
> On Thu, Sep 15, 2011 at 04:46:38PM +0300, Kalle Valo wrote:
>> On 09/10/2011 12:56 PM, Vasanthakumar Thiagarajan wrote:
>>> Target already tries with different authentication mechanism
>>> when authentication type is configured to NL80211_AUTHTYPE_AUTOMATIC.
>>> Remove this piece of code from driver. Having this code in driver
>>> even affects auto + WEP authentication in some cases.
>>
>> Thanks, patches 1-3 applied. Patch 4 dropped per your request. Please
>> resend it once it's ready.
> 
> Sorry for the delay but the patch 3 also seems to be problematic
> sometime. Can you please drop 3 as well?. The disconnect event 
> still not clear to me.

You got lucky, I forgot to push the patches :) So I was able to easily
drop patch 3.

Kalle

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-19  6:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-10  9:56 [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode Vasanthakumar Thiagarajan
2011-09-10  9:56 ` [PATCH 2/4] ath6kl: Set the sme_state to disconnected in disconnect() callback Vasanthakumar Thiagarajan
2011-09-10  9:56 ` [PATCH 3/4] ath6kl: Don't give disconnect command in disconnect event handler Vasanthakumar Thiagarajan
2011-09-10  9:56 ` [PATCH 4/4] ath6kl: Fix random reconnect failures Vasanthakumar Thiagarajan
2011-09-13  9:44   ` Vasanthakumar Thiagarajan
2011-09-15 13:46 ` [PATCH 1/4] ath6kl: Remove auth type fall back in auto authentication mode Kalle Valo
2011-09-15 14:36   ` Vasanthakumar Thiagarajan
2011-09-19  6:48     ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).