Hi Samuel,

This patch is all related to auto auth modification
Please help to review it.

Subject: automatic to choose auth type in firmware V2

1. NL80211 will send NL80211_AUTHTYPE_AUTOMATIC for automatic auth type.
Previous version, this is handled in driver but it needs 10 seconds timeout
to try next auth type.

Since firmware supports automatic auth, so move the work to firmware to reduce 
connection time
during automatic auth process.

2. Remove related code segment and variables for auto auth in driver like 
"arPriv->arAutoAuthStage = AUTH_OPEN_IN_PROGRESS"

Signed-off-by: Samuel Chang <samu...@qca.qualcomm.com>


diff -ruN kernel-2.6.37.6-151.5/drivers/staging/ar6003/include/common/wmi.h 
kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/include/common/wmi.h
--- kernel-2.6.37.6-151.5/drivers/staging/ar6003/include/common/wmi.h   
2011-07-15 23:58:59.900741620 +0800
+++ 
kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/include/common/wmi.h
        2011-07-28 10:47:45.083273627 +0800
@@ -552,10 +552,6 @@
     LEAP_AUTH           = 0x04,  /* different from IEEE_AUTH_MODE definitions 
*/
 } DOT11_AUTH_MODE;
 
-enum {
-       AUTH_IDLE,
-       AUTH_OPEN_IN_PROGRESS,
-};
 typedef enum {
     NONE_AUTH           = 0x01,
     WPA_AUTH            = 0x02,
diff -ruN kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/ar6000_drv.c 
kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/ar6000_drv.c
--- kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/ar6000_drv.c  
2011-07-15 23:59:50.136990718 +0800
+++ 
kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/ar6000_drv.c
       2011-07-28 10:59:17.626707754 +0800
@@ -1947,7 +1947,6 @@
         wdev->netdev = dev;
         arPriv->arNetworkType = INFRA_NETWORK;
         ar->smeState = SME_DISCONNECTED;
-                arPriv->arAutoAuthStage = AUTH_IDLE;
 #endif /* ATH6K_CONFIG_CFG80211 */
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
diff -ruN kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/cfg80211.c 
kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/cfg80211.c
--- kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/cfg80211.c    
2011-07-16 00:01:40.781539388 +0800
+++ 
kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/cfg80211.c
 2011-07-28 10:49:41.555851176 +0800
@@ -170,8 +170,8 @@
         arPriv->arDot11AuthMode = LEAP_AUTH;
         break;
        case NL80211_AUTHTYPE_AUTOMATIC:
-        arPriv->arDot11AuthMode = OPEN_AUTH;
-        arPriv->arAutoAuthStage = AUTH_OPEN_IN_PROGRESS;
+        /*Let firmware to choose authtype*/
+        arPriv->arDot11AuthMode = OPEN_AUTH | SHARED_AUTH;
         break;
     default:
         arPriv->arDot11AuthMode = OPEN_AUTH;
@@ -475,7 +475,6 @@
 
     assocReqLen -= assocReqIeOffset;
     assocRespLen -= assocRespIeOffset;
-    arPriv->arAutoAuthStage = AUTH_IDLE;
 
     if((ADHOC_NETWORK & networkType)) {
         if(NL80211_IFTYPE_ADHOC != arPriv->wdev->iftype) {
@@ -687,50 +686,7 @@
             /* connect cmd failed */
             wmi_disconnect_cmd(arPriv->arWmi);
         } else if (reason == DISCONNECT_CMD) {
-               if (arPriv->arAutoAuthStage) {
-                       /*
-                        * If the current auth algorithm is open try shared
-                        * and make autoAuthStage idle. We do not make it
-                        * leap for now being.
-                        */
-                       if (arPriv->arDot11AuthMode == OPEN_AUTH) {
-                               struct ar_key *key = NULL;
-                               key = &arPriv->keys[arPriv->arDefTxKeyIndex];
-                               if (down_interruptible(&ar->arSem)) {
-                                       AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: 
busy, couldn't get access\n", __func__));
-                                       return;
-                               }
-
-                               arPriv->arDot11AuthMode = SHARED_AUTH;
-                               arPriv->arAutoAuthStage = AUTH_IDLE;
-
-                               wmi_addKey_cmd(arPriv->arWmi, 
arPriv->arDefTxKeyIndex,
-                                               arPriv->arPairwiseCrypto,
-                                               GROUP_USAGE | TX_USAGE,
-                                               key->key_len,
-                                               NULL,
-                                               key->key, KEY_OP_INIT_VAL, NULL,
-                                               NO_SYNC_WMIFLAG);
-
-                               status = wmi_connect_cmd(arPriv->arWmi,
-                                                        arPriv->arNetworkType,
-                                                        
arPriv->arDot11AuthMode,
-                                                        arPriv->arAuthMode,
-                                                        
arPriv->arPairwiseCrypto,
-                                                        
arPriv->arPairwiseCryptoLen,
-                                                        arPriv->arGroupCrypto,
-                                                        
arPriv->arGroupCryptoLen,
-                                                        arPriv->arSsidLen,
-                                                        arPriv->arSsid,
-                                                        arSta->arReqBssid,
-                                                        arPriv->arChannelHint,
-                                                        
arSta->arConnectCtrlFlags);
-                               up(&ar->arSem);
-
-                       } else if (arPriv->arDot11AuthMode == SHARED_AUTH) {
-                               /* should not reach here */
-                       }
-               } else {
+
                        arSta->arConnectPending = false;
                        if (ar->smeState == SME_CONNECTING) {
             cfg80211_connect_result(arPriv->arNetDev, bssid,
@@ -746,7 +702,6 @@
         }
                        ar->smeState = SME_DISCONNECTED;
                }
-       }
     } else {
            if (reason != DISCONNECT_CMD)
                    wmi_disconnect_cmd(arPriv->arWmi);
diff -ruN 
kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/include/ar6000_drv.h 
kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/include/ar6000_drv.h
--- kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/include/ar6000_drv.h  
2011-07-15 23:59:29.872890240 +0800
+++ 
kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/include/ar6000_drv.h
       2011-07-28 10:48:22.215457754 +0800
@@ -735,7 +735,6 @@
     AR_SOFTC_T              *arSoftc;
     A_UINT8                 arHoldConnection;
     A_UINT8                 num_sta;
-    A_UINT8                 arAutoAuthStage;
 }AR_SOFTC_DEV_T;
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)


Samuel Chang
Engineer
Qualcomm Atheros, Inc.
Taipei Office, Taiwan
12F., No.407, Ruiguang Rd., Neihu Dist.
Taipei City 11492, Taiwan (R.O.C.)
t + 886 2.8751.6385
f + 886 2.8751.6397

________________________________________
寄件者: Samuel Ortiz [sa...@linux.intel.com]
寄件日期: 2011年7月28日 上午 01:48
收件者: Chang, Samuel
副本: meego-kernel@lists.meego.com; kristen.c.acca...@intel.com; Wu, Ricky; 
Huang, Maggie; Yang, Jack
主旨: Re: [Meego-kernel] [PATCH] ar6003 : automatic to choose auth type in 
firmware

Hi Samuel,

On Wed, Jul 20, 2011 at 02:53:45AM +0000, Chang, Samuel wrote:
> Subject: automatic to choose auth type in firmware
>
> NL80211 will send NL80211_AUTHTYPE_AUTOMATIC for automatic auth type.
> Previous version, this is handled in driver but it needs 10 seconds timeout
> to try next auth type.
>
> Since firmware supports automatic auth, so move the work to firmware to 
> reduce connection time
> during automatic auth process.
>
> ps: correct struct type to AR_SOFTC_DEV_T in this patch too.
Both fixes makes sense to me, but I'd appreciate if you could split this patch
into 2 different ones.
The last chunk is a generic fix, unrelated to WEP authentication.

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/
Subject: automatic to choose auth type in firmware V2

1. NL80211 will send NL80211_AUTHTYPE_AUTOMATIC for automatic auth type.
Previous version, this is handled in driver but it needs 10 seconds timeout
to try next auth type.

Since firmware supports automatic auth, so move the work to firmware to reduce connection time
during automatic auth process.

2. Remove related code segment and variables for auto auth in driver like "arPriv->arAutoAuthStage = AUTH_OPEN_IN_PROGRESS"

Signed-off-by: Samuel Chang <samu...@qca.qualcomm.com>


diff -ruN kernel-2.6.37.6-151.5/drivers/staging/ar6003/include/common/wmi.h kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/include/common/wmi.h
--- kernel-2.6.37.6-151.5/drivers/staging/ar6003/include/common/wmi.h	2011-07-15 23:58:59.900741620 +0800
+++ kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/include/common/wmi.h	2011-07-28 10:47:45.083273627 +0800
@@ -552,10 +552,6 @@
     LEAP_AUTH           = 0x04,  /* different from IEEE_AUTH_MODE definitions */
 } DOT11_AUTH_MODE;
 
-enum {
-	AUTH_IDLE,
-	AUTH_OPEN_IN_PROGRESS,
-};
 typedef enum {
     NONE_AUTH           = 0x01,
     WPA_AUTH            = 0x02,
diff -ruN kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/ar6000_drv.c kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/ar6000_drv.c
--- kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/ar6000_drv.c	2011-07-15 23:59:50.136990718 +0800
+++ kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/ar6000_drv.c	2011-07-28 10:59:17.626707754 +0800
@@ -1947,7 +1947,6 @@
         wdev->netdev = dev;
         arPriv->arNetworkType = INFRA_NETWORK;
         ar->smeState = SME_DISCONNECTED;
-		 arPriv->arAutoAuthStage = AUTH_IDLE;
 #endif /* ATH6K_CONFIG_CFG80211 */
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
diff -ruN kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/cfg80211.c kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/cfg80211.c
--- kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/cfg80211.c	2011-07-16 00:01:40.781539388 +0800
+++ kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/cfg80211.c	2011-07-28 10:49:41.555851176 +0800
@@ -170,8 +170,8 @@
         arPriv->arDot11AuthMode = LEAP_AUTH;
         break;
 	case NL80211_AUTHTYPE_AUTOMATIC:
-        arPriv->arDot11AuthMode = OPEN_AUTH;
-        arPriv->arAutoAuthStage = AUTH_OPEN_IN_PROGRESS;
+        /*Let firmware to choose authtype*/
+        arPriv->arDot11AuthMode = OPEN_AUTH | SHARED_AUTH;
         break;
     default:
         arPriv->arDot11AuthMode = OPEN_AUTH;
@@ -475,7 +475,6 @@
 
     assocReqLen -= assocReqIeOffset;
     assocRespLen -= assocRespIeOffset;
-    arPriv->arAutoAuthStage = AUTH_IDLE;
 
     if((ADHOC_NETWORK & networkType)) {
         if(NL80211_IFTYPE_ADHOC != arPriv->wdev->iftype) {
@@ -687,50 +686,7 @@
             /* connect cmd failed */
             wmi_disconnect_cmd(arPriv->arWmi);
         } else if (reason == DISCONNECT_CMD) {
-		if (arPriv->arAutoAuthStage) {
-			/*
-			 * If the current auth algorithm is open try shared
-			 * and make autoAuthStage idle. We do not make it
-			 * leap for now being.
-			 */
-			if (arPriv->arDot11AuthMode == OPEN_AUTH) {
-				struct ar_key *key = NULL;
-				key = &arPriv->keys[arPriv->arDefTxKeyIndex];
-				if (down_interruptible(&ar->arSem)) {
-					AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: busy, couldn't get access\n", __func__));
-					return;
-				}
-
-				arPriv->arDot11AuthMode = SHARED_AUTH;
-				arPriv->arAutoAuthStage = AUTH_IDLE;
-
-				wmi_addKey_cmd(arPriv->arWmi, arPriv->arDefTxKeyIndex,
-						arPriv->arPairwiseCrypto,
-						GROUP_USAGE | TX_USAGE,
-						key->key_len,
-						NULL,
-						key->key, KEY_OP_INIT_VAL, NULL,
-						NO_SYNC_WMIFLAG);
-
-				status = wmi_connect_cmd(arPriv->arWmi,
-							 arPriv->arNetworkType,
-							 arPriv->arDot11AuthMode,
-							 arPriv->arAuthMode,
-							 arPriv->arPairwiseCrypto,
-							 arPriv->arPairwiseCryptoLen,
-							 arPriv->arGroupCrypto,
-							 arPriv->arGroupCryptoLen,
-							 arPriv->arSsidLen,
-							 arPriv->arSsid,
-							 arSta->arReqBssid,
-							 arPriv->arChannelHint,
-							 arSta->arConnectCtrlFlags);
-				up(&ar->arSem);
-
-			} else if (arPriv->arDot11AuthMode == SHARED_AUTH) {
-				/* should not reach here */
-			}
-		} else {
+
 			arSta->arConnectPending = false;
 			if (ar->smeState == SME_CONNECTING) {
             cfg80211_connect_result(arPriv->arNetDev, bssid,
@@ -746,7 +702,6 @@
         }
 			ar->smeState = SME_DISCONNECTED;
 		}
-	}
     } else {
 	    if (reason != DISCONNECT_CMD)
 		    wmi_disconnect_cmd(arPriv->arWmi);
diff -ruN kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/include/ar6000_drv.h kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/include/ar6000_drv.h
--- kernel-2.6.37.6-151.5/drivers/staging/ar6003/os/linux/include/ar6000_drv.h	2011-07-15 23:59:29.872890240 +0800
+++ kernel-2.6.37.6-151.5_automatic_auth_in_fw_patch/drivers/staging/ar6003/os/linux/include/ar6000_drv.h	2011-07-28 10:48:22.215457754 +0800
@@ -735,7 +735,6 @@
     AR_SOFTC_T              *arSoftc;
     A_UINT8                 arHoldConnection;
     A_UINT8                 num_sta;
-    A_UINT8                 arAutoAuthStage;
 }AR_SOFTC_DEV_T;
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
_______________________________________________
MeeGo-kernel mailing list
MeeGo-kernel@lists.meego.com
http://lists.meego.com/listinfo/meego-kernel

Reply via email to