Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | /**======================================================================== |
| 29 | |
| 30 | \file wlan_hdd_assoc.c |
| 31 | \brief WLAN Host Device Driver implementation |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 32 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 33 | ========================================================================*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 34 | /**========================================================================= |
| 35 | EDIT HISTORY FOR FILE |
| 36 | |
| 37 | |
| 38 | This section contains comments describing changes made to the module. |
| 39 | Notice that changes are listed in reverse chronological order. |
| 40 | |
| 41 | |
| 42 | $Header:$ $DateTime: $ $Author: $ |
| 43 | |
| 44 | |
| 45 | when who what, where, why |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 46 | -------- --- -------------------------------------------------------- |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 47 | 05/06/09 Shailender Created module. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 48 | ==========================================================================*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 49 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 50 | #include "wlan_hdd_includes.h" |
| 51 | #include <aniGlobal.h> |
| 52 | #include "dot11f.h" |
| 53 | #include "wlan_nlink_common.h" |
| 54 | #include "wlan_btc_svc.h" |
| 55 | #include "wlan_hdd_power.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 56 | #include <linux/ieee80211.h> |
| 57 | #include <linux/wireless.h> |
| 58 | #include <net/cfg80211.h> |
| 59 | #include "wlan_hdd_cfg80211.h" |
| 60 | #include "csrInsideApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 61 | #include "wlan_hdd_p2p.h" |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 62 | #ifdef FEATURE_WLAN_TDLS |
| 63 | #include "wlan_hdd_tdls.h" |
| 64 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 65 | #include "sme_Api.h" |
Sushant Kaushik | ba6764e | 2014-06-30 19:52:09 +0530 | [diff] [blame] | 66 | #include "wlan_hdd_hostapd.h" |
Mukul Sharma | 84f2725 | 2014-07-14 18:11:42 +0530 | [diff] [blame] | 67 | #ifdef DEBUG_ROAM_DELAY |
| 68 | #include "vos_utils.h" |
| 69 | #endif |
| 70 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 71 | v_BOOL_t mibIsDot11DesiredBssTypeInfrastructure( hdd_adapter_t *pAdapter ); |
| 72 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 73 | struct ether_addr |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 74 | { |
| 75 | u_char ether_addr_octet[6]; |
| 76 | }; |
| 77 | // These are needed to recognize WPA and RSN suite types |
| 78 | #define HDD_WPA_OUI_SIZE 4 |
| 79 | v_U8_t ccpWpaOui00[ HDD_WPA_OUI_SIZE ] = { 0x00, 0x50, 0xf2, 0x00 }; |
| 80 | v_U8_t ccpWpaOui01[ HDD_WPA_OUI_SIZE ] = { 0x00, 0x50, 0xf2, 0x01 }; |
| 81 | v_U8_t ccpWpaOui02[ HDD_WPA_OUI_SIZE ] = { 0x00, 0x50, 0xf2, 0x02 }; |
| 82 | v_U8_t ccpWpaOui03[ HDD_WPA_OUI_SIZE ] = { 0x00, 0x50, 0xf2, 0x03 }; |
| 83 | v_U8_t ccpWpaOui04[ HDD_WPA_OUI_SIZE ] = { 0x00, 0x50, 0xf2, 0x04 }; |
| 84 | v_U8_t ccpWpaOui05[ HDD_WPA_OUI_SIZE ] = { 0x00, 0x50, 0xf2, 0x05 }; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 85 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 86 | v_U8_t ccpWpaOui06[ HDD_WPA_OUI_SIZE ] = { 0x00, 0x40, 0x96, 0x00 }; // CCKM |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 87 | #endif /* FEATURE_WLAN_ESE */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 88 | #define HDD_RSN_OUI_SIZE 4 |
| 89 | v_U8_t ccpRSNOui00[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x00 }; // group cipher |
| 90 | v_U8_t ccpRSNOui01[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x01 }; // WEP-40 or RSN |
| 91 | v_U8_t ccpRSNOui02[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x02 }; // TKIP or RSN-PSK |
| 92 | v_U8_t ccpRSNOui03[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x03 }; // Reserved |
| 93 | v_U8_t ccpRSNOui04[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x04 }; // AES-CCMP |
| 94 | v_U8_t ccpRSNOui05[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x05 }; // WEP-104 |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 95 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 96 | v_U8_t ccpRSNOui06[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x40, 0x96, 0x00 }; // CCKM |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 97 | #endif /* FEATURE_WLAN_ESE */ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 98 | #ifdef WLAN_FEATURE_11W |
| 99 | v_U8_t ccpRSNOui07[ HDD_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x06 }; // RSN-PSK-SHA256 |
| 100 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 101 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 102 | #if defined(WLAN_FEATURE_VOWIFI_11R) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 103 | // Offset where the EID-Len-IE, start. |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 104 | #define FT_ASSOC_RSP_IES_OFFSET 6 /* Capability(2) + AID(2) + Status Code(2)*/ |
| 105 | #define FT_ASSOC_REQ_IES_OFFSET 4 /* Capability(2) + LI(2) */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 106 | #endif |
| 107 | |
| 108 | #define BEACON_FRAME_IES_OFFSET 12 |
| 109 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 110 | #ifdef WLAN_FEATURE_11W |
| 111 | void hdd_indicateUnprotMgmtFrame(hdd_adapter_t *pAdapter, |
| 112 | tANI_U32 nFrameLength, |
| 113 | tANI_U8* pbFrames, |
| 114 | tANI_U8 frameType ); |
| 115 | #endif |
| 116 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 117 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 118 | static void hdd_indicateTsmIe(hdd_adapter_t *pAdapter, tANI_U8 tid, |
| 119 | tANI_U8 state, |
| 120 | tANI_U16 measInterval ); |
| 121 | static void hdd_indicateCckmPreAuth(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 122 | static void hdd_indicateEseAdjApRepInd(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo); |
| 123 | static void hdd_indicateEseBcnReportInd(const hdd_adapter_t *pAdapter, const tCsrRoamInfo *pRoamInfo); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 124 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 125 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 126 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 127 | static eHalStatus hdd_RoamSetKeyCompleteHandler( hdd_adapter_t *pAdapter, |
| 128 | tCsrRoamInfo *pRoamInfo, |
| 129 | tANI_U32 roamId, |
| 130 | eRoamCmdStatus roamStatus, |
| 131 | eCsrRoamResult roamResult ); |
| 132 | |
Madan Mohan Koyyalamudi | d5acbf5 | 2012-11-28 01:45:08 +0530 | [diff] [blame] | 133 | v_VOID_t hdd_connSetConnectionState( hdd_station_ctx_t *pHddStaCtx, |
| 134 | eConnectionState connState ) |
| 135 | { |
| 136 | // save the new connection state |
Arun Kumar Khandavalli | 94a2bb0 | 2013-12-28 19:17:25 +0530 | [diff] [blame] | 137 | hddLog(LOG1, FL("ConnectionState Changed from oldState:%d to State:%d"), |
| 138 | pHddStaCtx->conn_info.connState,connState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 139 | pHddStaCtx->conn_info.connState = connState; |
| 140 | } |
| 141 | |
| 142 | // returns FALSE if not connected. |
| 143 | // returns TRUE for the two 'connected' states (Infra Associated or IBSS Connected ). |
| 144 | // returns the connection state. Can specify NULL if you dont' want to get the actual state. |
| 145 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 146 | static inline v_BOOL_t hdd_connGetConnectionState( hdd_station_ctx_t *pHddStaCtx, |
| 147 | eConnectionState *pConnState ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 148 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 149 | v_BOOL_t fConnected; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 150 | eConnectionState connState; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 151 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 152 | // get the connection state. |
| 153 | connState = pHddStaCtx->conn_info.connState; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 154 | // Set the fConnected return variable based on the Connected State. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 155 | if ( eConnectionState_Associated == connState || |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 156 | eConnectionState_IbssConnected == connState || |
| 157 | eConnectionState_IbssDisconnected == connState) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 158 | { |
| 159 | fConnected = VOS_TRUE; |
| 160 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 161 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 162 | { |
| 163 | fConnected = VOS_FALSE; |
| 164 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 165 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 166 | if ( pConnState ) |
| 167 | { |
| 168 | *pConnState = connState; |
| 169 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 170 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 171 | return( fConnected ); |
| 172 | } |
| 173 | |
| 174 | v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx ) |
| 175 | { |
| 176 | return( hdd_connGetConnectionState( pHddStaCtx, NULL ) ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 177 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 178 | |
Agarwal Ashish | 450ffde | 2014-04-08 19:53:00 +0530 | [diff] [blame] | 179 | eCsrBand hdd_connGetConnectedBand( hdd_station_ctx_t *pHddStaCtx ) |
| 180 | { |
| 181 | v_U8_t staChannel = 0; |
| 182 | |
| 183 | if ( eConnectionState_Associated == pHddStaCtx->conn_info.connState ) |
| 184 | { |
| 185 | staChannel = pHddStaCtx->conn_info.operationChannel; |
| 186 | } |
| 187 | |
| 188 | if ( staChannel > 0 && staChannel < 14 ) |
| 189 | return eCSR_BAND_24; |
| 190 | else if (staChannel >= 36 && staChannel <= 165 ) |
| 191 | return eCSR_BAND_5G; |
| 192 | else /* If station is not connected return as eCSR_BAND_ALL */ |
| 193 | return eCSR_BAND_ALL; |
| 194 | } |
| 195 | |
| 196 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 197 | //TODO - Not used anyhwere. Can be removed. |
| 198 | #if 0 |
| 199 | // |
| 200 | v_BOOL_t hdd_connIsConnectedInfra( hdd_adapter_t *pAdapter ) |
| 201 | { |
| 202 | v_BOOL_t fConnectedInfra = FALSE; |
| 203 | eConnectionState connState; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 204 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 205 | if ( hdd_connGetConnectionState( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), &connState ) ) |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 206 | { |
| 207 | if ( eConnectionState_Associated == connState ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 208 | { |
| 209 | fConnectedInfra = TRUE; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 210 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 211 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 212 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 213 | return( fConnectedInfra ); |
| 214 | } |
| 215 | #endif |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 217 | static inline v_BOOL_t hdd_connGetConnectedCipherAlgo( hdd_station_ctx_t *pHddStaCtx, eCsrEncryptionType *pConnectedCipherAlgo ) |
| 218 | { |
| 219 | v_BOOL_t fConnected = VOS_FALSE; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 220 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 221 | fConnected = hdd_connGetConnectionState( pHddStaCtx, NULL ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 222 | |
| 223 | if ( pConnectedCipherAlgo ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 224 | { |
| 225 | *pConnectedCipherAlgo = pHddStaCtx->conn_info.ucEncryptionType; |
| 226 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 227 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 228 | return( fConnected ); |
| 229 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 230 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 231 | inline v_BOOL_t hdd_connGetConnectedBssType( hdd_station_ctx_t *pHddStaCtx, eMib_dot11DesiredBssType *pConnectedBssType ) |
| 232 | { |
| 233 | v_BOOL_t fConnected = VOS_FALSE; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 234 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 235 | fConnected = hdd_connGetConnectionState( pHddStaCtx, NULL ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 236 | |
| 237 | if ( pConnectedBssType ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 238 | { |
| 239 | *pConnectedBssType = pHddStaCtx->conn_info.connDot11DesiredBssType; |
| 240 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 241 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 242 | return( fConnected ); |
| 243 | } |
| 244 | |
| 245 | static inline void hdd_connSaveConnectedBssType( hdd_station_ctx_t *pHddStaCtx, eCsrRoamBssType csrRoamBssType ) |
| 246 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 247 | switch( csrRoamBssType ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 248 | { |
| 249 | case eCSR_BSS_TYPE_INFRASTRUCTURE: |
| 250 | pHddStaCtx->conn_info.connDot11DesiredBssType = eMib_dot11DesiredBssType_infrastructure; |
| 251 | break; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 252 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 253 | case eCSR_BSS_TYPE_IBSS: |
| 254 | case eCSR_BSS_TYPE_START_IBSS: |
| 255 | pHddStaCtx->conn_info.connDot11DesiredBssType = eMib_dot11DesiredBssType_independent; |
| 256 | break; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 257 | |
| 258 | /** We will never set the BssType to 'any' when attempting a connection |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 259 | so CSR should never send this back to us.*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 260 | case eCSR_BSS_TYPE_ANY: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 261 | default: |
| 262 | VOS_ASSERT( 0 ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 263 | break; |
| 264 | } |
| 265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | void hdd_connSaveConnectInfo( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, eCsrRoamBssType eBssType ) |
| 269 | { |
| 270 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 271 | eCsrEncryptionType encryptType = eCSR_ENCRYPT_TYPE_NONE; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 272 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 273 | VOS_ASSERT( pRoamInfo ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 274 | |
| 275 | if ( pRoamInfo ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 276 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 277 | // Save the BSSID for the connection... |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | if ( eCSR_BSS_TYPE_INFRASTRUCTURE == eBssType ) |
| 279 | { |
| 280 | VOS_ASSERT( pRoamInfo->pBssDesc ); |
| 281 | vos_mem_copy(pHddStaCtx->conn_info.bssId, pRoamInfo->bssid,6 ); |
| 282 | |
| 283 | // Save the Station ID for this station from the 'Roam Info'. |
| 284 | //For IBSS mode, staId is assigned in NEW_PEER_IND |
| 285 | //For reassoc, the staID doesn't change and it may be invalid in this structure |
| 286 | //so no change here. |
| 287 | if( !pRoamInfo->fReassocReq ) |
| 288 | { |
| 289 | pHddStaCtx->conn_info.staId [0]= pRoamInfo->staId; |
| 290 | } |
| 291 | } |
| 292 | else if ( eCSR_BSS_TYPE_IBSS == eBssType ) |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 293 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 294 | vos_mem_copy(pHddStaCtx->conn_info.bssId, pRoamInfo->bssid,sizeof(pRoamInfo->bssid) ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 295 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 296 | else |
| 297 | { |
| 298 | // can't happen. We need a valid IBSS or Infra setting in the BSSDescription |
| 299 | // or we can't function. |
| 300 | VOS_ASSERT( 0 ); |
| 301 | } |
| 302 | |
| 303 | // notify WMM |
| 304 | hdd_wmm_connect(pAdapter, pRoamInfo, eBssType); |
| 305 | |
| 306 | if( !pRoamInfo->u.pConnectedProfile ) |
| 307 | { |
| 308 | VOS_ASSERT( pRoamInfo->u.pConnectedProfile ); |
| 309 | } |
| 310 | else |
| 311 | { |
| 312 | // Get Multicast Encryption Type |
| 313 | encryptType = pRoamInfo->u.pConnectedProfile->mcEncryptionType; |
| 314 | pHddStaCtx->conn_info.mcEncryptionType = encryptType; |
| 315 | // Get Unicast Encrytion Type |
| 316 | encryptType = pRoamInfo->u.pConnectedProfile->EncryptionType; |
| 317 | pHddStaCtx->conn_info.ucEncryptionType = encryptType; |
| 318 | |
| 319 | pHddStaCtx->conn_info.authType = pRoamInfo->u.pConnectedProfile->AuthType; |
| 320 | |
| 321 | pHddStaCtx->conn_info.operationChannel = pRoamInfo->u.pConnectedProfile->operationChannel; |
| 322 | |
| 323 | // Save the ssid for the connection |
| 324 | vos_mem_copy( &pHddStaCtx->conn_info.SSID.SSID, &pRoamInfo->u.pConnectedProfile->SSID, sizeof( tSirMacSSid ) ); |
Gopichand Nakkala | dacbcb5 | 2013-04-18 16:41:54 +0530 | [diff] [blame] | 325 | |
| 326 | // Save dot11mode in which STA associated to AP |
| 327 | pHddStaCtx->conn_info.dot11Mode = pRoamInfo->u.pConnectedProfile->dot11Mode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 328 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 329 | } |
| 330 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 331 | // save the connected BssType |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 332 | hdd_connSaveConnectedBssType( pHddStaCtx, eBssType ); |
| 333 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 334 | } |
| 335 | |
| 336 | #if defined(WLAN_FEATURE_VOWIFI_11R) |
| 337 | /* |
| 338 | * Send the 11R key information to the supplicant. |
| 339 | * Only then can the supplicant generate the PMK-R1. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 340 | * (BTW, the ESE supplicant also needs the Assoc Resp IEs |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 341 | * for the same purpose.) |
| 342 | * |
| 343 | * Mainly the Assoc Rsp IEs are passed here. For the IMDA |
| 344 | * this contains the R1KHID, R0KHID and the MDID. |
| 345 | * For FT, this consists of the Reassoc Rsp FTIEs. |
| 346 | * This is the Assoc Response. |
| 347 | */ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 348 | static void hdd_SendFTAssocResponse(struct net_device *dev, hdd_adapter_t *pAdapter, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 349 | tCsrRoamInfo *pCsrRoamInfo) |
| 350 | { |
| 351 | union iwreq_data wrqu; |
| 352 | char *buff; |
| 353 | unsigned int len = 0; |
| 354 | u8 *pFTAssocRsp = NULL; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 355 | |
| 356 | if (pCsrRoamInfo->nAssocRspLength == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | { |
| 358 | hddLog(LOGE, |
| 359 | "%s: pCsrRoamInfo->nAssocRspLength=%d", |
| 360 | __func__, (int)pCsrRoamInfo->nAssocRspLength); |
| 361 | return; |
| 362 | } |
| 363 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 364 | pFTAssocRsp = (u8 *)(pCsrRoamInfo->pbFrames + pCsrRoamInfo->nBeaconLength + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 365 | pCsrRoamInfo->nAssocReqLength); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 366 | if (pFTAssocRsp == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 367 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 368 | hddLog(LOGE, "%s: AssocReq or AssocRsp is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 369 | return; |
| 370 | } |
| 371 | |
| 372 | // pFTAssocRsp needs to point to the IEs |
| 373 | pFTAssocRsp += FT_ASSOC_RSP_IES_OFFSET; |
| 374 | hddLog(LOG1, "%s: AssocRsp is now at %02x%02x", __func__, |
| 375 | (unsigned int)pFTAssocRsp[0], |
| 376 | (unsigned int)pFTAssocRsp[1]); |
| 377 | |
| 378 | // We need to send the IEs to the supplicant. |
| 379 | buff = kmalloc(IW_GENERIC_IE_MAX, GFP_ATOMIC); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 380 | if (buff == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 381 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 382 | hddLog(LOGE, "%s: kmalloc unable to allocate memory", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 383 | return; |
| 384 | } |
| 385 | |
| 386 | // Send the Assoc Resp, the supplicant needs this for initial Auth. |
| 387 | len = pCsrRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 388 | wrqu.data.length = len; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 389 | memset(buff, 0, IW_GENERIC_IE_MAX); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 390 | memcpy(buff, pFTAssocRsp, len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 391 | wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, buff); |
| 392 | |
| 393 | kfree(buff); |
| 394 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 395 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 396 | |
| 397 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 398 | |
| 399 | /*--------------------------------------------------- |
| 400 | * |
| 401 | * Send the FTIEs, RIC IEs during FT. This is eventually |
| 402 | * used to send the FT events to the supplicant |
| 403 | * |
| 404 | * At the reception of Auth2 we send the RIC followed |
| 405 | * by the auth response IEs to the supplicant. |
| 406 | * Once both are received in the supplicant, an FT |
| 407 | * event is generated to the supplicant. |
| 408 | * |
| 409 | *--------------------------------------------------- |
| 410 | */ |
| 411 | void hdd_SendFTEvent(hdd_adapter_t *pAdapter) |
| 412 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 413 | tANI_U16 auth_resp_len = 0; |
| 414 | tANI_U32 ric_ies_length = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 415 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
| 416 | |
Gopichand Nakkala | 66923aa | 2013-03-06 23:17:24 +0530 | [diff] [blame] | 417 | #if defined(KERNEL_SUPPORT_11R_CFG80211) |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 418 | struct cfg80211_ft_event_params ftEvent; |
| 419 | v_U8_t ftIe[DOT11F_IE_FTINFO_MAX_LEN]; |
| 420 | v_U8_t ricIe[DOT11F_IE_RICDESCRIPTOR_MAX_LEN]; |
| 421 | struct net_device *dev = pAdapter->dev; |
| 422 | #else |
| 423 | char *buff; |
| 424 | union iwreq_data wrqu; |
| 425 | tANI_U16 str_len; |
| 426 | #endif |
| 427 | |
Gopichand Nakkala | 66923aa | 2013-03-06 23:17:24 +0530 | [diff] [blame] | 428 | #if defined(KERNEL_SUPPORT_11R_CFG80211) |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 429 | vos_mem_zero(ftIe, DOT11F_IE_FTINFO_MAX_LEN); |
| 430 | vos_mem_zero(ricIe, DOT11F_IE_RICDESCRIPTOR_MAX_LEN); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 431 | |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 432 | sme_GetRICIEs( pHddCtx->hHal, (u8 *)ricIe, |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 433 | DOT11F_IE_FTINFO_MAX_LEN, &ric_ies_length ); |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 434 | if (ric_ies_length == 0) |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 435 | { |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 436 | hddLog(LOGW, |
| 437 | "%s: RIC IEs is of length 0 not sending RIC Information for now", |
| 438 | __func__); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 439 | } |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 440 | |
| 441 | ftEvent.ric_ies = ricIe; |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 442 | ftEvent.ric_ies_len = ric_ies_length; |
| 443 | hddLog(LOG1, "%s: RIC IEs is of length %d", __func__, (int)ric_ies_length); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 444 | |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 445 | sme_GetFTPreAuthResponse(pHddCtx->hHal, (u8 *)ftIe, |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 446 | DOT11F_IE_FTINFO_MAX_LEN, &auth_resp_len); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 447 | |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 448 | if (auth_resp_len == 0) |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 449 | { |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 450 | hddLog(LOGE, "%s: AuthRsp FTIES is of length 0", __func__); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 451 | return; |
| 452 | } |
| 453 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 454 | sme_SetFTPreAuthState(pHddCtx->hHal, TRUE); |
Gopichand Nakkala | 356fb10 | 2013-03-06 12:34:04 +0530 | [diff] [blame] | 455 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 456 | ftEvent.target_ap = ftIe; |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 457 | |
| 458 | ftEvent.ies = (u8 *)(ftIe + SIR_MAC_ADDR_LENGTH); |
| 459 | ftEvent.ies_len = auth_resp_len - SIR_MAC_ADDR_LENGTH; |
| 460 | |
Jeff Johnson | 59a121e | 2013-11-30 09:46:08 -0800 | [diff] [blame] | 461 | hddLog(LOG1, "%s ftEvent.ies_len %zu", __FUNCTION__, ftEvent.ies_len); |
| 462 | hddLog(LOG1, "%s ftEvent.ric_ies_len %zu", |
| 463 | __FUNCTION__, ftEvent.ric_ies_len ); |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 464 | hddLog(LOG1, "%s ftEvent.target_ap %2x-%2x-%2x-%2x-%2x-%2x ", |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 465 | __FUNCTION__, ftEvent.target_ap[0], ftEvent.target_ap[1], |
| 466 | ftEvent.target_ap[2], ftEvent.target_ap[3], ftEvent.target_ap[4], |
| 467 | ftEvent.target_ap[5]); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 468 | |
Gopichand Nakkala | 356fb10 | 2013-03-06 12:34:04 +0530 | [diff] [blame] | 469 | (void)cfg80211_ft_event(dev, &ftEvent); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 470 | |
| 471 | #else |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 472 | // We need to send the IEs to the supplicant |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | buff = kmalloc(IW_CUSTOM_MAX, GFP_ATOMIC); |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 474 | if (buff == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 475 | { |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 476 | hddLog(LOGE, "%s: kmalloc unable to allocate memory", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 477 | return; |
| 478 | } |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 479 | vos_mem_zero(buff, IW_CUSTOM_MAX); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 480 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 481 | // Sme needs to send the RIC IEs first |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | str_len = strlcpy(buff, "RIC=", IW_CUSTOM_MAX); |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 483 | sme_GetRICIEs( pHddCtx->hHal, (u8 *)&(buff[str_len]), |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 484 | (IW_CUSTOM_MAX - str_len), &ric_ies_length ); |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 485 | if (ric_ies_length == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 486 | { |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 487 | hddLog(LOGW, |
| 488 | "%s: RIC IEs is of length 0 not sending RIC Information for now", |
| 489 | __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 490 | } |
| 491 | else |
| 492 | { |
| 493 | wrqu.data.length = str_len + ric_ies_length; |
| 494 | wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buff); |
| 495 | } |
| 496 | |
| 497 | // Sme needs to provide the Auth Resp |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 498 | vos_mem_zero(buff, IW_CUSTOM_MAX); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 499 | str_len = strlcpy(buff, "AUTH=", IW_CUSTOM_MAX); |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 500 | sme_GetFTPreAuthResponse(pHddCtx->hHal, (u8 *)&buff[str_len], |
| 501 | (IW_CUSTOM_MAX - str_len), &auth_resp_len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 502 | |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 503 | if (auth_resp_len == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 504 | { |
Gopichand Nakkala | d7d1365 | 2013-02-15 01:48:00 +0530 | [diff] [blame] | 505 | hddLog(LOGE, "%s: AuthRsp FTIES is of length 0", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 506 | return; |
| 507 | } |
| 508 | |
| 509 | wrqu.data.length = str_len + auth_resp_len; |
| 510 | wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buff); |
| 511 | |
| 512 | kfree(buff); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 513 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 514 | } |
| 515 | |
| 516 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 517 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 518 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 519 | |
| 520 | /* |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 521 | * Send the ESE required "new AP Channel info" to the supplicant. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 522 | * (This keeps the supplicant "up to date" on the current channel.) |
| 523 | * |
| 524 | * The current (new AP) channel information is passed in. |
| 525 | */ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 526 | static void hdd_SendNewAPChannelInfo(struct net_device *dev, hdd_adapter_t *pAdapter, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 527 | tCsrRoamInfo *pCsrRoamInfo) |
| 528 | { |
| 529 | union iwreq_data wrqu; |
| 530 | tSirBssDescription *descriptor = pCsrRoamInfo->pBssDesc; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 531 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 532 | |
| 533 | if (descriptor == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 534 | { |
| 535 | hddLog(LOGE, |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 536 | "%s: pCsrRoamInfo->pBssDesc=%p", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 537 | __func__, descriptor); |
| 538 | return; |
| 539 | } |
| 540 | |
| 541 | // Send the Channel event, the supplicant needs this to generate the Adjacent AP report. |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 542 | hddLog(LOGW, "%s: Sending up an SIOCGIWFREQ, channelId=%d", __func__, descriptor->channelId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 543 | memset(&wrqu, '\0', sizeof(wrqu)); |
| 544 | wrqu.freq.m = descriptor->channelId; |
| 545 | wrqu.freq.e = 0; |
| 546 | wrqu.freq.i = 0; |
| 547 | wireless_send_event(pAdapter->dev, SIOCGIWFREQ, &wrqu, NULL); |
| 548 | } |
| 549 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 550 | #endif /* FEATURE_WLAN_ESE */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 551 | |
| 552 | void hdd_SendUpdateBeaconIEsEvent(hdd_adapter_t *pAdapter, tCsrRoamInfo *pCsrRoamInfo) |
| 553 | { |
| 554 | union iwreq_data wrqu; |
| 555 | u8 *pBeaconIes; |
| 556 | u8 currentLen = 0; |
| 557 | char *buff; |
| 558 | int totalIeLen = 0, currentOffset = 0, strLen; |
| 559 | |
| 560 | memset(&wrqu, '\0', sizeof(wrqu)); |
| 561 | |
| 562 | if (0 == pCsrRoamInfo->nBeaconLength) |
| 563 | { |
| 564 | hddLog(LOGE, "%s: pCsrRoamInfo->nBeaconFrameLength = 0", __func__); |
| 565 | return; |
| 566 | } |
| 567 | pBeaconIes = (u8 *)(pCsrRoamInfo->pbFrames + BEACON_FRAME_IES_OFFSET); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 568 | if (pBeaconIes == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 569 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 570 | hddLog(LOGE, "%s: Beacon IEs is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 571 | return; |
| 572 | } |
| 573 | |
| 574 | // pBeaconIes needs to point to the IEs |
| 575 | hddLog(LOG1, "%s: Beacon IEs is now at %02x%02x", __func__, |
| 576 | (unsigned int)pBeaconIes[0], |
| 577 | (unsigned int)pBeaconIes[1]); |
| 578 | hddLog(LOG1, "%s: Beacon IEs length = %d", __func__, pCsrRoamInfo->nBeaconLength - BEACON_FRAME_IES_OFFSET); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 579 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 580 | // We need to send the IEs to the supplicant. |
| 581 | buff = kmalloc(IW_CUSTOM_MAX, GFP_ATOMIC); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 582 | if (buff == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 583 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 584 | hddLog(LOGE, "%s: kmalloc unable to allocate memory", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 585 | return; |
| 586 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 587 | vos_mem_zero(buff, IW_CUSTOM_MAX); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 588 | |
| 589 | strLen = strlcpy(buff,"BEACONIEs=", IW_CUSTOM_MAX); |
| 590 | currentLen = strLen + 1; |
| 591 | |
| 592 | totalIeLen = pCsrRoamInfo->nBeaconLength - BEACON_FRAME_IES_OFFSET; |
| 593 | do |
| 594 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 595 | /* If the beacon size exceeds max CUSTOM event size, break it into chunks of CUSTOM event |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 596 | * max size and send it to supplicant. Changes are done in supplicant to handle this */ |
| 597 | vos_mem_zero(&buff[strLen + 1], IW_CUSTOM_MAX - (strLen + 1)); |
| 598 | currentLen = VOS_MIN(totalIeLen, IW_CUSTOM_MAX - (strLen + 1) - 1); |
| 599 | vos_mem_copy(&buff[strLen + 1], pBeaconIes+currentOffset, currentLen); |
| 600 | currentOffset += currentLen; |
| 601 | totalIeLen -= currentLen; |
| 602 | wrqu.data.length = strLen + 1 + currentLen; |
| 603 | if (totalIeLen) |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 604 | buff[strLen] = 1; // This tells supplicant more chunks are pending |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 605 | else |
| 606 | buff[strLen] = 0; // For last chunk of beacon IE to supplicant |
| 607 | |
| 608 | hddLog(LOG1, "%s: Beacon IEs length to supplicant = %d", __func__, currentLen); |
| 609 | wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buff); |
| 610 | } while (totalIeLen > 0); |
| 611 | |
| 612 | kfree(buff); |
| 613 | } |
| 614 | |
| 615 | static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRoamInfo) |
| 616 | { |
| 617 | hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 618 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
| 619 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 620 | union iwreq_data wrqu; |
| 621 | int we_event; |
| 622 | char *msg; |
| 623 | int type = -1; |
| 624 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 625 | #if defined (WLAN_FEATURE_VOWIFI_11R) |
| 626 | // Added to find the auth type on the fly at run time |
| 627 | // rather than with cfg to see if FT is enabled |
| 628 | hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 629 | tCsrRoamProfile* pRoamProfile = &(pWextState->roamProfile); |
| 630 | #endif |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 631 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 632 | memset(&wrqu, '\0', sizeof(wrqu)); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 633 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 634 | we_event = SIOCGIWAP; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 635 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 636 | if(eConnectionState_Associated == pHddStaCtx->conn_info.connState)/* Associated */ |
| 637 | { |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 638 | /* In case of roaming ; We are not doing disconnect. |
| 639 | * If disconnect is not being done for roam; We will not |
| 640 | * decrease count for Active sessions. We should not increase active |
| 641 | * active session in case of roaming. |
| 642 | */ |
| 643 | if(pHddStaCtx->ft_carrier_on == FALSE) |
| 644 | { |
| 645 | wlan_hdd_incr_active_session(pHddCtx, pAdapter->device_mode); |
| 646 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 647 | memcpy(wrqu.ap_addr.sa_data, pCsrRoamInfo->pBssDesc->bssId, sizeof(pCsrRoamInfo->pBssDesc->bssId)); |
| 648 | type = WLAN_STA_ASSOC_DONE_IND; |
| 649 | |
Madan Mohan Koyyalamudi | 26bd714 | 2012-10-30 18:14:19 -0700 | [diff] [blame] | 650 | #ifdef WLAN_FEATURE_P2P_DEBUG |
| 651 | if(pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) |
| 652 | { |
| 653 | if(globalP2PConnectionStatus == P2P_CLIENT_CONNECTING_STATE_1) |
| 654 | { |
| 655 | globalP2PConnectionStatus = P2P_CLIENT_CONNECTED_STATE_1; |
| 656 | hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P State] Changing state from " |
| 657 | "Connecting state to Connected State for 8-way " |
| 658 | "Handshake"); |
| 659 | } |
| 660 | else if(globalP2PConnectionStatus == P2P_CLIENT_CONNECTING_STATE_2) |
| 661 | { |
| 662 | globalP2PConnectionStatus = P2P_CLIENT_COMPLETED_STATE; |
| 663 | hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P State] Changing state from " |
| 664 | "Connecting state to P2P Client Connection Completed"); |
| 665 | } |
| 666 | } |
| 667 | #endif |
Arif Hussain | 77d044f | 2014-01-03 19:56:04 -0800 | [diff] [blame] | 668 | pr_info("wlan: " MAC_ADDRESS_STR " connected to " MAC_ADDRESS_STR "\n", |
| 669 | MAC_ADDR_ARRAY(pAdapter->macAddressCurrent.bytes), |
Kiet Lam | 3494745 | 2014-01-21 23:23:40 -0800 | [diff] [blame] | 670 | MAC_ADDR_ARRAY(wrqu.ap_addr.sa_data)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 671 | hdd_SendUpdateBeaconIEsEvent(pAdapter, pCsrRoamInfo); |
| 672 | |
| 673 | /* Send IWEVASSOCRESPIE Event if WLAN_FEATURE_CIQ_METRICS is Enabled Or |
| 674 | * Send IWEVASSOCRESPIE Event if WLAN_FEATURE_VOWIFI_11R is Enabled |
| 675 | * and fFTEnable is TRUE */ |
| 676 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 677 | // Send FT Keys to the supplicant when FT is enabled |
| 678 | if ((pRoamProfile->AuthType.authType[0] == eCSR_AUTH_TYPE_FT_RSN_PSK) || |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 679 | (pRoamProfile->AuthType.authType[0] == eCSR_AUTH_TYPE_FT_RSN) |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 680 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 681 | || (pRoamProfile->AuthType.authType[0] == eCSR_AUTH_TYPE_CCKM_RSN) || |
| 682 | (pRoamProfile->AuthType.authType[0] == eCSR_AUTH_TYPE_CCKM_WPA) |
| 683 | #endif |
| 684 | ) |
| 685 | { |
| 686 | hdd_SendFTAssocResponse(dev, pAdapter, pCsrRoamInfo); |
| 687 | } |
| 688 | #endif |
| 689 | } |
| 690 | else if (eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState) // IBss Associated |
| 691 | { |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 692 | wlan_hdd_incr_active_session(pHddCtx, pAdapter->device_mode); |
Jeff Johnson | 4416a78 | 2013-03-25 14:17:50 -0700 | [diff] [blame] | 693 | memcpy(wrqu.ap_addr.sa_data, pHddStaCtx->conn_info.bssId, ETH_ALEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 694 | type = WLAN_STA_ASSOC_DONE_IND; |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 695 | pr_info("wlan: new IBSS connection to " MAC_ADDRESS_STR"\n", |
| 696 | MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 697 | } |
| 698 | else /* Not Associated */ |
| 699 | { |
| 700 | pr_info("wlan: disconnected\n"); |
| 701 | type = WLAN_STA_DISASSOC_DONE_IND; |
| 702 | memset(wrqu.ap_addr.sa_data,'\0',ETH_ALEN); |
| 703 | } |
Sudhir Sattayappa Kohalli | 90e4c75 | 2013-03-21 14:25:04 -0700 | [diff] [blame] | 704 | hdd_dump_concurrency_info(pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 705 | |
| 706 | msg = NULL; |
| 707 | /*During the WLAN uninitialization,supplicant is stopped before the |
| 708 | driver so not sending the status of the connection to supplicant*/ |
Mihir Shete | 1815629 | 2014-03-11 15:38:30 +0530 | [diff] [blame] | 709 | if(pHddCtx->isLoadUnloadInProgress == WLAN_HDD_NO_LOAD_UNLOAD_IN_PROGRESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 710 | { |
| 711 | wireless_send_event(dev, we_event, &wrqu, msg); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 712 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 713 | if(eConnectionState_Associated == pHddStaCtx->conn_info.connState)/* Associated */ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 714 | { |
| 715 | if ( (pRoamProfile->AuthType.authType[0] == eCSR_AUTH_TYPE_CCKM_RSN) || |
| 716 | (pRoamProfile->AuthType.authType[0] == eCSR_AUTH_TYPE_CCKM_WPA) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 717 | hdd_SendNewAPChannelInfo(dev, pAdapter, pCsrRoamInfo); |
| 718 | } |
| 719 | #endif |
| 720 | } |
| 721 | send_btc_nlink_msg(type, 0); |
| 722 | } |
| 723 | |
| 724 | void hdd_connRemoveConnectInfo( hdd_station_ctx_t *pHddStaCtx ) |
| 725 | { |
| 726 | // Remove staId, bssId and peerMacAddress |
| 727 | pHddStaCtx->conn_info.staId [ 0 ] = 0; |
| 728 | vos_mem_zero( &pHddStaCtx->conn_info.bssId, sizeof( v_MACADDR_t ) ); |
| 729 | vos_mem_zero( &pHddStaCtx->conn_info.peerMacAddress[ 0 ], sizeof( v_MACADDR_t ) ); |
| 730 | |
| 731 | // Clear all security settings |
| 732 | pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM; |
| 733 | pHddStaCtx->conn_info.mcEncryptionType = eCSR_ENCRYPT_TYPE_NONE; |
| 734 | pHddStaCtx->conn_info.ucEncryptionType = eCSR_ENCRYPT_TYPE_NONE; |
| 735 | |
| 736 | vos_mem_zero( &pHddStaCtx->conn_info.Keys, sizeof( tCsrKeys ) ); |
Ravi Joshi | b58ca0d | 2013-10-29 09:50:23 -0700 | [diff] [blame] | 737 | vos_mem_zero( &pHddStaCtx->ibss_enc_key, sizeof(tCsrRoamSetKey) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | |
| 739 | // Set not-connected state |
| 740 | pHddStaCtx->conn_info.connDot11DesiredBssType = eCSR_BSS_TYPE_ANY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 741 | |
| 742 | vos_mem_zero( &pHddStaCtx->conn_info.SSID, sizeof( tCsrSSIDInfo ) ); |
| 743 | } |
| 744 | /* TODO Revist this function. and data path */ |
| 745 | static VOS_STATUS hdd_roamDeregisterSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) |
| 746 | { |
| 747 | VOS_STATUS vosStatus; |
Ravi Joshi | f9520d6 | 2013-10-18 04:11:46 -0700 | [diff] [blame] | 748 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 749 | |
| 750 | if (WLAN_HDD_IBSS != pAdapter->device_mode) |
| 751 | { |
| 752 | hdd_disconnect_tx_rx(pAdapter); |
| 753 | } |
| 754 | else |
| 755 | { |
| 756 | // Need to cleanup all queues only if the last peer leaves |
| 757 | if (eConnectionState_IbssDisconnected == pHddStaCtx->conn_info.connState) |
| 758 | { |
| 759 | netif_tx_disable(pAdapter->dev); |
| 760 | netif_carrier_off(pAdapter->dev); |
| 761 | hdd_disconnect_tx_rx(pAdapter); |
| 762 | } |
| 763 | else |
| 764 | { |
| 765 | // There is atleast one more peer, do not cleanup all queues |
| 766 | hdd_flush_ibss_tx_queues(pAdapter, staId); |
| 767 | } |
| 768 | } |
| 769 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 770 | vosStatus = WLANTL_ClearSTAClient( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, staId ); |
| 771 | if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) |
| 772 | { |
Gopichand Nakkala | d786fa3 | 2013-03-20 23:48:19 +0530 | [diff] [blame] | 773 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 774 | "%s: WLANTL_ClearSTAClient() failed to for staID %d. " |
Jeff Johnson | 0299d0a | 2013-10-30 12:37:43 -0700 | [diff] [blame] | 775 | "Status= %d [0x%08X]", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 776 | __func__, staId, vosStatus, vosStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 777 | } |
| 778 | return( vosStatus ); |
| 779 | } |
| 780 | |
| 781 | |
| 782 | static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, |
| 783 | tANI_U32 roamId, eRoamCmdStatus roamStatus, |
| 784 | eCsrRoamResult roamResult ) |
| 785 | { |
| 786 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 787 | VOS_STATUS vstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 788 | struct net_device *dev = pAdapter->dev; |
| 789 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
| 790 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
krunal soni | 3fc2664 | 2013-10-08 22:41:42 -0700 | [diff] [blame] | 791 | v_U8_t sta_id; |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 792 | v_BOOL_t sendDisconInd = TRUE; |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 793 | |
| 794 | // Sanity check |
| 795 | if(dev == NULL) |
| 796 | { |
Agarwal Ashish | 971c288 | 2013-10-30 20:11:12 +0530 | [diff] [blame] | 797 | hddLog(VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 798 | "%s: net_dev is released return", __func__); |
| 799 | return eHAL_STATUS_FAILURE; |
| 800 | } |
| 801 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 802 | // notify apps that we can't pass traffic anymore |
| 803 | netif_tx_disable(dev); |
| 804 | netif_carrier_off(dev); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 805 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 806 | INIT_COMPLETION(pAdapter->disconnect_comp_var); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 807 | /* HDD has initiated disconnect, do not send disconnect indication |
| 808 | * to kernel as it will be handled by __cfg80211_disconnect. |
| 809 | */ |
Agarwal Ashish | c65b5ca | 2014-07-28 21:02:57 +0530 | [diff] [blame] | 810 | /* If only STA mode is on */ |
| 811 | if((pHddCtx->concurrency_mode <= 1) && |
| 812 | (pHddCtx->no_of_open_sessions[WLAN_HDD_INFRA_STATION] <= 1)) |
| 813 | { |
| 814 | pHddCtx->isAmpAllowed = VOS_TRUE; |
| 815 | } |
| 816 | |
Agarwal Ashish | 47d1811 | 2014-08-04 19:55:07 +0530 | [diff] [blame] | 817 | /* Need to apply spin lock before decreasing active sessions |
| 818 | * as there can be chance for double decrement if context switch |
| 819 | * Calls wlan_hdd_disconnect. |
| 820 | */ |
| 821 | |
| 822 | spin_lock_bh(&pAdapter->lock_for_active_session); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 823 | if ( eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState ) |
| 824 | { |
| 825 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 826 | FL(" HDD has initiated a disconnect, no need to send" |
| 827 | " disconnect indication to kernel")); |
| 828 | sendDisconInd = FALSE; |
| 829 | } |
Agarwal Ashish | c65b5ca | 2014-07-28 21:02:57 +0530 | [diff] [blame] | 830 | else if (eConnectionState_Associated == pHddStaCtx->conn_info.connState) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 831 | { |
Agarwal Ashish | c65b5ca | 2014-07-28 21:02:57 +0530 | [diff] [blame] | 832 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
Agarwal Ashish | 47d1811 | 2014-08-04 19:55:07 +0530 | [diff] [blame] | 833 | FL(" Set HDD connState to eConnectionState_Disconnecting from %d "), |
| 834 | pHddStaCtx->conn_info.connState); |
Agarwal Ashish | c65b5ca | 2014-07-28 21:02:57 +0530 | [diff] [blame] | 835 | hdd_connSetConnectionState( pHddStaCtx, eConnectionState_Disconnecting ); |
| 836 | wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 837 | } |
Agarwal Ashish | 47d1811 | 2014-08-04 19:55:07 +0530 | [diff] [blame] | 838 | spin_unlock_bh(&pAdapter->lock_for_active_session); |
| 839 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 840 | hdd_clearRoamProfileIe( pAdapter ); |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 841 | |
| 842 | hdd_wmm_init( pAdapter ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 843 | |
| 844 | // indicate 'disconnect' status to wpa_supplicant... |
| 845 | hdd_SendAssociationEvent(dev,pRoamInfo); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 846 | /* indicate disconnected event to nl80211 */ |
| 847 | if(roamStatus != eCSR_ROAM_IBSS_LEAVE) |
| 848 | { |
| 849 | /*During the WLAN uninitialization,supplicant is stopped before the |
| 850 | driver so not sending the status of the connection to supplicant*/ |
Mihir Shete | 1815629 | 2014-03-11 15:38:30 +0530 | [diff] [blame] | 851 | if(pHddCtx->isLoadUnloadInProgress == WLAN_HDD_NO_LOAD_UNLOAD_IN_PROGRESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 852 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 853 | hddLog(VOS_TRACE_LEVEL_INFO_HIGH, |
| 854 | "%s: sent disconnected event to nl80211", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 855 | __func__); |
Madan Mohan Koyyalamudi | 26bd714 | 2012-10-30 18:14:19 -0700 | [diff] [blame] | 856 | #ifdef WLAN_FEATURE_P2P_DEBUG |
| 857 | if(pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) |
| 858 | { |
| 859 | if(globalP2PConnectionStatus == P2P_CLIENT_CONNECTED_STATE_1) |
| 860 | { |
| 861 | globalP2PConnectionStatus = P2P_CLIENT_DISCONNECTED_STATE; |
| 862 | hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P State] 8 way Handshake completed " |
| 863 | "and moved to disconnected state"); |
| 864 | } |
| 865 | else if(globalP2PConnectionStatus == P2P_CLIENT_COMPLETED_STATE) |
| 866 | { |
| 867 | globalP2PConnectionStatus = P2P_NOT_ACTIVE; |
| 868 | hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P State] P2P Client is removed " |
| 869 | "and moved to inactive state"); |
| 870 | } |
| 871 | } |
| 872 | #endif |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 873 | /*Only send indication to kernel if not initiated by kernel*/ |
| 874 | if ( sendDisconInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 875 | { |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 876 | /* To avoid wpa_supplicant sending "HANGED" CMD to ICS UI */ |
| 877 | if ( eCSR_ROAM_LOSTLINK == roamStatus ) |
| 878 | { |
| 879 | cfg80211_disconnected(dev, pRoamInfo->reasonCode, NULL, 0, GFP_KERNEL); |
| 880 | } |
| 881 | else |
| 882 | { |
| 883 | cfg80211_disconnected(dev, WLAN_REASON_UNSPECIFIED, NULL, 0, GFP_KERNEL); |
| 884 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 885 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 886 | //If the Device Mode is Station |
| 887 | // and the P2P Client is Connected |
| 888 | //Enable BMPS |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 889 | |
| 890 | // In case of JB, as Change-Iface may or maynot be called for p2p0 |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 891 | // Enable BMPS/IMPS in case P2P_CLIENT disconnected |
Sudhir Sattayappa Kohalli | b1d8c3a | 2013-06-18 14:47:20 -0700 | [diff] [blame] | 892 | if(VOS_STATUS_SUCCESS == hdd_issta_p2p_clientconnected(pHddCtx)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 893 | { |
| 894 | //Enable BMPS only of other Session is P2P Client |
| 895 | hdd_context_t *pHddCtx = NULL; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 896 | v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 897 | |
| 898 | if (NULL != pVosContext) |
| 899 | { |
| 900 | pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); |
| 901 | |
| 902 | if(NULL != pHddCtx) |
| 903 | { |
| 904 | //Only P2P Client is there Enable Bmps back |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 905 | if((0 == pHddCtx->no_of_open_sessions[VOS_STA_SAP_MODE]) && |
| 906 | (0 == pHddCtx->no_of_open_sessions[VOS_P2P_GO_MODE])) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 907 | { |
Gopichand Nakkala | a2fe5b0 | 2013-06-06 16:32:28 +0530 | [diff] [blame] | 908 | if (pHddCtx->hdd_wlan_suspended) |
| 909 | { |
| 910 | hdd_set_pwrparams(pHddCtx); |
| 911 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 912 | hdd_enable_bmps_imps(pHddCtx); |
Gopichand Nakkala | a2fe5b0 | 2013-06-06 16:32:28 +0530 | [diff] [blame] | 913 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 914 | } |
| 915 | } |
| 916 | } |
| 917 | } |
| 918 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 919 | |
krunal soni | 3fc2664 | 2013-10-08 22:41:42 -0700 | [diff] [blame] | 920 | if (eCSR_ROAM_IBSS_LEAVE == roamStatus) |
| 921 | { |
| 922 | sta_id = IBSS_BROADCAST_STAID; |
| 923 | } |
| 924 | else |
| 925 | { |
| 926 | sta_id = pHddStaCtx->conn_info.staId[0]; |
| 927 | } |
Madan Mohan Koyyalamudi | 70c52d3 | 2013-08-07 14:42:16 +0530 | [diff] [blame] | 928 | hdd_wmm_adapter_clear(pAdapter); |
Mukul Sharma | c159c43 | 2014-01-15 15:42:46 +0530 | [diff] [blame] | 929 | #if defined(WLAN_FEATURE_VOWIFI_11R) |
| 930 | sme_FTReset(WLAN_HDD_GET_HAL_CTX(pAdapter)); |
| 931 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 932 | //We should clear all sta register with TL, for now, only one. |
krunal soni | 3fc2664 | 2013-10-08 22:41:42 -0700 | [diff] [blame] | 933 | vstatus = hdd_roamDeregisterSTA( pAdapter, sta_id ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 934 | if ( !VOS_IS_STATUS_SUCCESS(vstatus ) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 935 | { |
Gopichand Nakkala | d786fa3 | 2013-03-20 23:48:19 +0530 | [diff] [blame] | 936 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 937 | "hdd_roamDeregisterSTA() failed to for staID %d. " |
| 938 | "Status= %d [0x%x]", |
krunal soni | 3fc2664 | 2013-10-08 22:41:42 -0700 | [diff] [blame] | 939 | sta_id, status, status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 940 | |
| 941 | status = eHAL_STATUS_FAILURE; |
| 942 | } |
| 943 | |
krunal soni | 3fc2664 | 2013-10-08 22:41:42 -0700 | [diff] [blame] | 944 | pHddCtx->sta_to_adapter[sta_id] = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 945 | // Clear saved connection information in HDD |
| 946 | hdd_connRemoveConnectInfo( pHddStaCtx ); |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 947 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 948 | "%s: Set HDD connState to eConnectionState_NotConnected", |
| 949 | __func__); |
| 950 | hdd_connSetConnectionState( pHddStaCtx, eConnectionState_NotConnected ); |
Gopichand Nakkala | 870cbae | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 951 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 952 | if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) || |
| 953 | (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) |
| 954 | { |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 955 | memset(&pHddStaCtx->gtkOffloadReqParams, 0, |
| 956 | sizeof (tSirGtkOffloadParams)); |
| 957 | pHddStaCtx->gtkOffloadReqParams.ulFlags = GTK_OFFLOAD_DISABLE; |
Gopichand Nakkala | 870cbae | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 958 | } |
| 959 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 960 | |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 961 | #ifdef FEATURE_WLAN_TDLS |
krunal soni | 3fc2664 | 2013-10-08 22:41:42 -0700 | [diff] [blame] | 962 | if (eCSR_ROAM_IBSS_LEAVE != roamStatus) |
| 963 | { |
| 964 | wlan_hdd_tdls_disconnection_callback(pAdapter); |
| 965 | } |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 966 | #endif |
| 967 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 968 | //Unblock anyone waiting for disconnect to complete |
| 969 | complete(&pAdapter->disconnect_comp_var); |
| 970 | return( status ); |
| 971 | } |
| 972 | static VOS_STATUS hdd_roamRegisterSTA( hdd_adapter_t *pAdapter, |
| 973 | tCsrRoamInfo *pRoamInfo, |
| 974 | v_U8_t staId, |
| 975 | v_MACADDR_t *pPeerMacAddress, |
| 976 | tSirBssDescription *pBssDesc ) |
| 977 | { |
| 978 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 979 | WLAN_STADescType staDesc = {0}; |
| 980 | eCsrEncryptionType connectedCipherAlgo; |
| 981 | v_BOOL_t fConnected; |
| 982 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 983 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 984 | hdd_config_t *cfg_param = pHddCtx->cfg_ini; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 985 | |
| 986 | if ( NULL == pBssDesc) |
| 987 | { |
| 988 | return VOS_STATUS_E_FAILURE; |
| 989 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 990 | // Get the Station ID from the one saved during the assocation. |
| 991 | staDesc.ucSTAId = staId; |
| 992 | |
| 993 | if ( pHddStaCtx->conn_info.connDot11DesiredBssType == eMib_dot11DesiredBssType_infrastructure) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 994 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 995 | staDesc.wSTAType = WLAN_STA_INFRA; |
| 996 | |
| 997 | // grab the bssid from the connection info in the adapter structure and hand that |
| 998 | // over to TL when registering. |
| 999 | vos_mem_copy( staDesc.vSTAMACAddress.bytes, pHddStaCtx->conn_info.bssId,sizeof(pHddStaCtx->conn_info.bssId) ); |
| 1000 | } |
| 1001 | else |
| 1002 | { |
| 1003 | // for an IBSS 'connect', setup the Station Descriptor for TL. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1004 | staDesc.wSTAType = WLAN_STA_IBSS; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1005 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1006 | // Note that for IBSS, the STA MAC address and BSSID are goign to be different where |
| 1007 | // in infrastructure, they are the same (BSSID is the MAC address of the AP). So, |
| 1008 | // for IBSS we have a second field to pass to TL in the STA descriptor that we don't |
| 1009 | // pass when making an Infrastructure connection. |
| 1010 | vos_mem_copy( staDesc.vSTAMACAddress.bytes, pPeerMacAddress->bytes,sizeof(pPeerMacAddress->bytes) ); |
| 1011 | vos_mem_copy( staDesc.vBSSIDforIBSS.bytes, pHddStaCtx->conn_info.bssId,6 ); |
| 1012 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1013 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1014 | vos_copy_macaddr( &staDesc.vSelfMACAddress, &pAdapter->macAddressCurrent ); |
| 1015 | |
| 1016 | // set the QoS field appropriately |
| 1017 | if (hdd_wmm_is_active(pAdapter)) |
| 1018 | { |
| 1019 | staDesc.ucQosEnabled = 1; |
| 1020 | } |
| 1021 | else |
| 1022 | { |
| 1023 | staDesc.ucQosEnabled = 0; |
| 1024 | } |
| 1025 | |
| 1026 | fConnected = hdd_connGetConnectedCipherAlgo( pHddStaCtx, &connectedCipherAlgo ); |
| 1027 | if ( connectedCipherAlgo != eCSR_ENCRYPT_TYPE_NONE ) |
| 1028 | { |
| 1029 | staDesc.ucProtectedFrame = 1; |
| 1030 | } |
| 1031 | else |
| 1032 | { |
| 1033 | staDesc.ucProtectedFrame = 0; |
| 1034 | |
| 1035 | } |
| 1036 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1037 | #ifdef FEATURE_WLAN_ESE |
| 1038 | staDesc.ucIsEseSta = pRoamInfo->isESEAssoc; |
| 1039 | #endif //FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1040 | |
| 1041 | #ifdef VOLANS_ENABLE_SW_REPLAY_CHECK |
| 1042 | /* check whether replay check is valid for the station or not */ |
| 1043 | if( (eCSR_ENCRYPT_TYPE_TKIP == connectedCipherAlgo) || (eCSR_ENCRYPT_TYPE_AES == connectedCipherAlgo)) |
| 1044 | { |
| 1045 | /* Encryption mode is either TKIP or AES |
| 1046 | and replay check is valid for only these |
| 1047 | two encryption modes */ |
| 1048 | staDesc.ucIsReplayCheckValid = VOS_TRUE; |
| 1049 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 1050 | "HDD register TL ucIsReplayCheckValid %d: Replay check is needed for station", staDesc.ucIsReplayCheckValid); |
| 1051 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1052 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1053 | else |
| 1054 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1055 | /* For other encryption modes replay check is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1056 | not needed */ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1057 | staDesc.ucIsReplayCheckValid = VOS_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1058 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 1059 | "HDD register TL ucIsReplayCheckValid %d", staDesc.ucIsReplayCheckValid); |
| 1060 | } |
| 1061 | #endif |
| 1062 | |
| 1063 | #ifdef FEATURE_WLAN_WAPI |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1064 | hddLog(LOG1, "%s: WAPI STA Registered: %d", __func__, pAdapter->wapi_info.fIsWapiSta); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1065 | if (pAdapter->wapi_info.fIsWapiSta) |
| 1066 | { |
| 1067 | staDesc.ucIsWapiSta = 1; |
| 1068 | } |
| 1069 | else |
| 1070 | { |
| 1071 | staDesc.ucIsWapiSta = 0; |
| 1072 | } |
| 1073 | #endif /* FEATURE_WLAN_WAPI */ |
| 1074 | |
| 1075 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, |
| 1076 | "HDD register TL Sec_enabled= %d.", staDesc.ucProtectedFrame ); |
| 1077 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1078 | // UMA is Not ready yet, Xlation will be done by TL |
| 1079 | staDesc.ucSwFrameTXXlation = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1080 | staDesc.ucSwFrameRXXlation = 1; |
| 1081 | staDesc.ucAddRmvLLC = 1; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1082 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "HDD register TL QoS_enabled=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1083 | staDesc.ucQosEnabled ); |
| 1084 | // Initialize signatures and state |
| 1085 | staDesc.ucUcastSig = pRoamInfo->ucastSig; |
| 1086 | staDesc.ucBcastSig = pRoamInfo->bcastSig; |
| 1087 | staDesc.ucInitState = pRoamInfo->fAuthRequired ? |
| 1088 | WLANTL_STA_CONNECTED : WLANTL_STA_AUTHENTICATED; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1089 | // Register the Station with TL... |
Tushnim Bhattacharyya | 39a8f18 | 2013-02-20 18:10:30 -0800 | [diff] [blame] | 1090 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "%s: HDD register TL ucInitState=%d", __func__, staDesc.ucInitState ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1091 | vosStatus = WLANTL_RegisterSTAClient( pHddCtx->pvosContext, |
| 1092 | hdd_rx_packet_cbk, |
| 1093 | hdd_tx_complete_cbk, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1094 | hdd_tx_fetch_packet_cbk, &staDesc, |
| 1095 | pBssDesc->rssi ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1096 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1097 | if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) |
| 1098 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1099 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
Jeff Johnson | 0299d0a | 2013-10-30 12:37:43 -0700 | [diff] [blame] | 1100 | "WLANTL_RegisterSTAClient() failed to register. Status= %d [0x%08X]", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1101 | vosStatus, vosStatus ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1102 | return vosStatus; |
| 1103 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1104 | |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 1105 | if ( cfg_param->dynSplitscan && |
| 1106 | ( VOS_TIMER_STATE_RUNNING != |
| 1107 | vos_timer_getCurrentState(&pHddCtx->tx_rx_trafficTmr))) |
| 1108 | { |
| 1109 | vos_timer_start(&pHddCtx->tx_rx_trafficTmr, |
| 1110 | cfg_param->trafficMntrTmrForSplitScan); |
| 1111 | } |
| 1112 | |
Gopichand Nakkala | ecdebab | 2013-06-04 18:44:34 +0530 | [diff] [blame] | 1113 | // if (WPA), tell TL to go to 'connected' and after keys come to the driver, |
| 1114 | // then go to 'authenticated'. For all other authentication types |
| 1115 | // (those that donot require upper layer authentication) we can put |
| 1116 | // TL directly into 'authenticated' state. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1117 | if (staDesc.wSTAType != WLAN_STA_IBSS) |
| 1118 | VOS_ASSERT( fConnected ); |
| 1119 | |
Gopichand Nakkala | ecdebab | 2013-06-04 18:44:34 +0530 | [diff] [blame] | 1120 | if ( !pRoamInfo->fAuthRequired ) |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 1121 | { |
| 1122 | // Connections that do not need Upper layer auth, transition TL directly |
| 1123 | // to 'Authenticated' state. |
| 1124 | vosStatus = WLANTL_ChangeSTAState( pHddCtx->pvosContext, staDesc.ucSTAId, |
| 1125 | WLANTL_STA_AUTHENTICATED ); |
| 1126 | |
| 1127 | pHddStaCtx->conn_info.uIsAuthenticated = VOS_TRUE; |
| 1128 | } |
| 1129 | else |
| 1130 | { |
| 1131 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, |
Gopichand Nakkala | ecdebab | 2013-06-04 18:44:34 +0530 | [diff] [blame] | 1132 | "ULA auth StaId= %d. Changing TL state to CONNECTED" |
| 1133 | "at Join time", pHddStaCtx->conn_info.staId[0] ); |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 1134 | vosStatus = WLANTL_ChangeSTAState( pHddCtx->pvosContext, staDesc.ucSTAId, |
Gopichand Nakkala | 2914956 | 2013-05-10 21:43:41 +0530 | [diff] [blame] | 1135 | WLANTL_STA_CONNECTED ); |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 1136 | pHddStaCtx->conn_info.uIsAuthenticated = VOS_FALSE; |
| 1137 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1138 | return( vosStatus ); |
| 1139 | } |
| 1140 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1141 | static void hdd_SendReAssocEvent(struct net_device *dev, hdd_adapter_t *pAdapter, |
| 1142 | tCsrRoamInfo *pCsrRoamInfo, v_U8_t *reqRsnIe, tANI_U32 reqRsnLength) |
| 1143 | { |
| 1144 | unsigned int len = 0; |
| 1145 | u8 *pFTAssocRsp = NULL; |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1146 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 1147 | v_U8_t *rspRsnIe = kmalloc(IW_GENERIC_IE_MAX, GFP_KERNEL); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1148 | tANI_U32 rspRsnLength = 0; |
| 1149 | struct ieee80211_channel *chan; |
| 1150 | |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1151 | if (!rspRsnIe) { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 1152 | hddLog(LOGE, "%s: Unable to allocate RSN IE", __func__); |
Madan Mohan Koyyalamudi | eeb56b1 | 2012-10-31 15:10:04 -0700 | [diff] [blame] | 1153 | return; |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 1154 | } |
| 1155 | |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1156 | if (pCsrRoamInfo == NULL) { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 1157 | hddLog(LOGE, "%s: Invalid CSR roam info", __func__); |
| 1158 | goto done; |
| 1159 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1160 | |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1161 | if (pCsrRoamInfo->nAssocRspLength == 0) { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 1162 | hddLog(LOGE, "%s: Invalid assoc response length", __func__); |
| 1163 | goto done; |
| 1164 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1165 | |
| 1166 | pFTAssocRsp = (u8 *)(pCsrRoamInfo->pbFrames + pCsrRoamInfo->nBeaconLength + |
| 1167 | pCsrRoamInfo->nAssocReqLength); |
| 1168 | if (pFTAssocRsp == NULL) |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 1169 | goto done; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1170 | |
| 1171 | //pFTAssocRsp needs to point to the IEs |
| 1172 | pFTAssocRsp += FT_ASSOC_RSP_IES_OFFSET; |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 1173 | hddLog(LOG1, "%s: AssocRsp is now at %02x%02x", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1174 | (unsigned int)pFTAssocRsp[0], |
| 1175 | (unsigned int)pFTAssocRsp[1]); |
| 1176 | |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1177 | /* Active session count is decremented upon disconnection, but during |
| 1178 | * roaming, there is no disconnect indication and hence active session |
| 1179 | * count is not decremented. |
| 1180 | * After roaming is completed, active session count is incremented |
| 1181 | * as a part of connect indication but effectively after roaming the |
| 1182 | * active session count should still be the same and hence upon |
| 1183 | * successful reassoc decrement the active session count here */ |
| 1184 | |
| 1185 | wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); |
| 1186 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1187 | // Send the Assoc Resp, the supplicant needs this for initial Auth. |
Madan Mohan Koyyalamudi | 1bed23d | 2012-11-13 10:59:48 -0800 | [diff] [blame] | 1188 | len = pCsrRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1189 | rspRsnLength = len; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1190 | memcpy(rspRsnIe, pFTAssocRsp, len); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 1191 | memset(rspRsnIe + len, 0, IW_GENERIC_IE_MAX - len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1192 | |
| 1193 | chan = ieee80211_get_channel(pAdapter->wdev.wiphy, (int) pCsrRoamInfo->pBssDesc->channelId); |
| 1194 | cfg80211_roamed(dev,chan,pCsrRoamInfo->bssid, |
| 1195 | reqRsnIe, reqRsnLength, |
| 1196 | rspRsnIe, rspRsnLength,GFP_KERNEL); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 1197 | |
| 1198 | done: |
| 1199 | kfree(rspRsnIe); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1200 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1201 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1202 | void hdd_PerformRoamSetKeyComplete(hdd_adapter_t *pAdapter) |
| 1203 | { |
| 1204 | eHalStatus halStatus = eHAL_STATUS_SUCCESS; |
| 1205 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 1206 | tCsrRoamInfo roamInfo; |
| 1207 | roamInfo.fAuthRequired = FALSE; |
| 1208 | vos_mem_copy(roamInfo.bssid, |
| 1209 | pHddStaCtx->roam_info.bssid, |
| 1210 | WNI_CFG_BSSID_LEN); |
| 1211 | vos_mem_copy(roamInfo.peerMac, |
| 1212 | pHddStaCtx->roam_info.peerMac, |
| 1213 | WNI_CFG_BSSID_LEN); |
| 1214 | |
| 1215 | halStatus = hdd_RoamSetKeyCompleteHandler(pAdapter, |
| 1216 | &roamInfo, |
| 1217 | pHddStaCtx->roam_info.roamId, |
| 1218 | pHddStaCtx->roam_info.roamStatus, |
| 1219 | eCSR_ROAM_RESULT_AUTHENTICATED); |
| 1220 | if (halStatus != eHAL_STATUS_SUCCESS) |
| 1221 | { |
| 1222 | hddLog(LOGE, "%s: Set Key complete failure", __func__); |
| 1223 | } |
| 1224 | pHddStaCtx->roam_info.deferKeyComplete = FALSE; |
| 1225 | } |
| 1226 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1227 | static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, |
| 1228 | tANI_U32 roamId, eRoamCmdStatus roamStatus, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1229 | eCsrRoamResult roamResult ) |
| 1230 | { |
| 1231 | struct net_device *dev = pAdapter->dev; |
| 1232 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
| 1233 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
Sushant Kaushik | ba6764e | 2014-06-30 19:52:09 +0530 | [diff] [blame] | 1234 | hdd_adapter_t *pHostapdAdapter = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1235 | VOS_STATUS vosStatus; |
Madan Mohan Koyyalamudi | 2dd4c8d | 2012-11-08 14:44:14 -0800 | [diff] [blame] | 1236 | v_U8_t reqRsnIe[DOT11F_IE_RSN_MAX_LEN]; |
| 1237 | tANI_U32 reqRsnLength = DOT11F_IE_RSN_MAX_LEN; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1238 | #if defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) || defined (WLAN_FEATURE_VOWIFI_11R) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1239 | int ft_carrier_on = FALSE; |
| 1240 | #endif |
| 1241 | int status; |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1242 | v_BOOL_t hddDisconInProgress = FALSE; |
| 1243 | |
| 1244 | /* HDD has initiated disconnect, do not send connect result indication |
| 1245 | * to kernel as it will be handled by __cfg80211_disconnect. |
| 1246 | */ |
| 1247 | if(( eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState) && |
| 1248 | (( eCSR_ROAM_RESULT_ASSOCIATED == roamResult) || |
| 1249 | ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus)) ) |
| 1250 | { |
| 1251 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 1252 | FL(" Disconnect from HDD in progress ")); |
| 1253 | hddDisconInProgress = TRUE; |
| 1254 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1256 | if ( eCSR_ROAM_RESULT_ASSOCIATED == roamResult ) |
| 1257 | { |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1258 | if ( !hddDisconInProgress ) |
| 1259 | { |
| 1260 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 1261 | "%s: Set HDD connState to eConnectionState_Associated", |
| 1262 | __func__); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1263 | hdd_connSetConnectionState( pHddStaCtx, eConnectionState_Associated ); |
| 1264 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1265 | |
c_hpothu | 44ff4e0 | 2014-05-08 00:13:57 +0530 | [diff] [blame] | 1266 | pAdapter->maxRateFlags = pRoamInfo->maxRateFlags; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1267 | // Save the connection info from CSR... |
| 1268 | hdd_connSaveConnectInfo( pAdapter, pRoamInfo, eCSR_BSS_TYPE_INFRASTRUCTURE ); |
| 1269 | #ifdef FEATURE_WLAN_WAPI |
| 1270 | if ( pRoamInfo->u.pConnectedProfile->AuthType == eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE || |
| 1271 | pRoamInfo->u.pConnectedProfile->AuthType == eCSR_AUTH_TYPE_WAPI_WAI_PSK ) |
| 1272 | { |
| 1273 | pAdapter->wapi_info.fIsWapiSta = 1; |
| 1274 | } |
| 1275 | else |
| 1276 | { |
| 1277 | pAdapter->wapi_info.fIsWapiSta = 0; |
| 1278 | } |
| 1279 | #endif /* FEATURE_WLAN_WAPI */ |
| 1280 | |
| 1281 | // indicate 'connect' status to userspace |
| 1282 | hdd_SendAssociationEvent(dev,pRoamInfo); |
| 1283 | |
| 1284 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1285 | // Initialize the Linkup event completion variable |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1286 | INIT_COMPLETION(pAdapter->linkup_event_var); |
| 1287 | |
| 1288 | /* |
| 1289 | Sometimes Switching ON the Carrier is taking time to activate the device properly. Before allowing any |
| 1290 | packet to go up to the application, device activation has to be ensured for proper queue mapping by the |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1291 | kernel. we have registered net device notifier for device change notification. With this we will come to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1292 | know that the device is getting activated properly. |
| 1293 | */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1294 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1295 | if (pHddStaCtx->ft_carrier_on == FALSE) |
| 1296 | { |
| 1297 | #endif |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1298 | // Enable Linkup Event Servicing which allows the net device notifier to set the linkup event variable |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1299 | pAdapter->isLinkUpSvcNeeded = TRUE; |
| 1300 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1301 | // Enable Linkup Event Servicing which allows the net device notifier to set the linkup event variable |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1302 | pAdapter->isLinkUpSvcNeeded = TRUE; |
| 1303 | |
| 1304 | // Switch on the Carrier to activate the device |
| 1305 | netif_carrier_on(dev); |
| 1306 | |
| 1307 | // Wait for the Link to up to ensure all the queues are set properly by the kernel |
| 1308 | status = wait_for_completion_interruptible_timeout(&pAdapter->linkup_event_var, |
| 1309 | msecs_to_jiffies(ASSOC_LINKUP_TIMEOUT)); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1310 | if(!status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1311 | { |
| 1312 | hddLog(VOS_TRACE_LEVEL_WARN, "%s: Warning:ASSOC_LINKUP_TIMEOUT", __func__); |
| 1313 | } |
| 1314 | |
| 1315 | // Disable Linkup Event Servicing - no more service required from the net device notifier call |
| 1316 | pAdapter->isLinkUpSvcNeeded = FALSE; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1317 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1318 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1319 | else { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1320 | pHddStaCtx->ft_carrier_on = FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1321 | ft_carrier_on = TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1322 | } |
| 1323 | #endif |
Sandeep Puligilla | d91dccb | 2014-06-18 11:51:48 +0530 | [diff] [blame] | 1324 | /* Check for STAID */ |
| 1325 | if( (WLAN_MAX_STA_COUNT + 3) > pRoamInfo->staId ) |
| 1326 | pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter; |
| 1327 | else |
| 1328 | hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Wrong Staid: %d", __func__, pRoamInfo->staId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1329 | |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 1330 | #ifdef FEATURE_WLAN_TDLS |
| 1331 | wlan_hdd_tdls_connection_callback(pAdapter); |
| 1332 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1333 | //For reassoc, the station is already registered, all we need is to change the state |
| 1334 | //of the STA in TL. |
| 1335 | //If authentication is required (WPA/WPA2/DWEP), change TL to CONNECTED instead of AUTHENTICATED |
| 1336 | if( !pRoamInfo->fReassocReq ) |
| 1337 | { |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1338 | struct cfg80211_bss *bss; |
| 1339 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1340 | u8 *pFTAssocRsp = NULL; |
| 1341 | unsigned int assocRsplen = 0; |
| 1342 | u8 *pFTAssocReq = NULL; |
| 1343 | unsigned int assocReqlen = 0; |
| 1344 | struct ieee80211_channel *chan; |
| 1345 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1346 | v_U8_t rspRsnIe[DOT11F_IE_RSN_MAX_LEN]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1347 | tANI_U32 rspRsnLength = DOT11F_IE_RSN_MAX_LEN; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1348 | |
| 1349 | /* add bss_id to cfg80211 data base */ |
| 1350 | bss = wlan_hdd_cfg80211_update_bss_db(pAdapter, pRoamInfo); |
| 1351 | if (NULL == bss) |
| 1352 | { |
| 1353 | pr_err("wlan: Not able to create BSS entry\n"); |
| 1354 | return eHAL_STATUS_FAILURE; |
| 1355 | } |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1356 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1357 | if(pRoamInfo->u.pConnectedProfile->AuthType == eCSR_AUTH_TYPE_FT_RSN || |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1358 | pRoamInfo->u.pConnectedProfile->AuthType == eCSR_AUTH_TYPE_FT_RSN_PSK ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1359 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1360 | |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1361 | //Association Response |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1362 | pFTAssocRsp = (u8 *)(pRoamInfo->pbFrames + pRoamInfo->nBeaconLength + |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1363 | pRoamInfo->nAssocReqLength); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1364 | if (pFTAssocRsp != NULL) |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1365 | { |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1366 | // pFTAssocRsp needs to point to the IEs |
| 1367 | pFTAssocRsp += FT_ASSOC_RSP_IES_OFFSET; |
| 1368 | hddLog(LOG1, "%s: AssocRsp is now at %02x%02x", __func__, |
| 1369 | (unsigned int)pFTAssocRsp[0], |
| 1370 | (unsigned int)pFTAssocRsp[1]); |
| 1371 | assocRsplen = pRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET; |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1372 | } |
| 1373 | else |
| 1374 | { |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1375 | hddLog(LOGE, "%s:AssocRsp is NULL", __func__); |
| 1376 | assocRsplen = 0; |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1377 | } |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1378 | |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1379 | //Association Request |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1380 | pFTAssocReq = (u8 *)(pRoamInfo->pbFrames + |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1381 | pRoamInfo->nBeaconLength); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1382 | if (pFTAssocReq != NULL) |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1383 | { |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1384 | if(!ft_carrier_on) |
| 1385 | { |
| 1386 | // pFTAssocReq needs to point to the IEs |
| 1387 | pFTAssocReq += FT_ASSOC_REQ_IES_OFFSET; |
| 1388 | hddLog(LOG1, "%s: pFTAssocReq is now at %02x%02x", __func__, |
| 1389 | (unsigned int)pFTAssocReq[0], |
| 1390 | (unsigned int)pFTAssocReq[1]); |
| 1391 | assocReqlen = pRoamInfo->nAssocReqLength - FT_ASSOC_REQ_IES_OFFSET; |
| 1392 | } |
| 1393 | else |
| 1394 | { |
| 1395 | /* This should contain only the FTIEs */ |
| 1396 | assocReqlen = pRoamInfo->nAssocReqLength; |
| 1397 | } |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1398 | } |
| 1399 | else |
| 1400 | { |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1401 | hddLog(LOGE, "%s:AssocReq is NULL", __func__); |
| 1402 | assocReqlen = 0; |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1403 | } |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1404 | |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1405 | if(ft_carrier_on) |
| 1406 | { |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1407 | if ( !hddDisconInProgress ) |
| 1408 | { |
| 1409 | hddLog(LOG1, "%s ft_carrier_on is %d, sending roamed " |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 1410 | "indication", __FUNCTION__, ft_carrier_on); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1411 | chan = ieee80211_get_channel(pAdapter->wdev.wiphy, |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1412 | (int)pRoamInfo->pBssDesc->channelId); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1413 | hddLog(LOG1, "assocReqlen %d assocRsplen %d", assocReqlen, |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1414 | assocRsplen); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1415 | cfg80211_roamed(dev,chan, pRoamInfo->bssid, |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1416 | pFTAssocReq, assocReqlen, pFTAssocRsp, assocRsplen, |
| 1417 | GFP_KERNEL); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1418 | } |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 1419 | if (sme_GetFTPTKState(WLAN_HDD_GET_HAL_CTX(pAdapter))) |
| 1420 | { |
| 1421 | sme_SetFTPTKState(WLAN_HDD_GET_HAL_CTX(pAdapter), FALSE); |
| 1422 | pRoamInfo->fAuthRequired = FALSE; |
| 1423 | |
| 1424 | vos_mem_copy(pHddStaCtx->roam_info.bssid, |
| 1425 | pRoamInfo->bssid, |
| 1426 | HDD_MAC_ADDR_LEN); |
| 1427 | vos_mem_copy(pHddStaCtx->roam_info.peerMac, |
| 1428 | pRoamInfo->peerMac, |
| 1429 | HDD_MAC_ADDR_LEN); |
| 1430 | pHddStaCtx->roam_info.roamId = roamId; |
| 1431 | pHddStaCtx->roam_info.roamStatus = roamStatus; |
| 1432 | pHddStaCtx->roam_info.deferKeyComplete = TRUE; |
| 1433 | } |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1434 | } |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1435 | else if ( !hddDisconInProgress ) |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1436 | { |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1437 | hddLog(LOG1, "%s ft_carrier_on is %d, sending connect " |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 1438 | "indication", __FUNCTION__, ft_carrier_on); |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1439 | cfg80211_connect_result(dev, pRoamInfo->bssid, |
| 1440 | pFTAssocReq, assocReqlen, |
| 1441 | pFTAssocRsp, assocRsplen, |
| 1442 | WLAN_STATUS_SUCCESS, |
| 1443 | GFP_KERNEL); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1444 | } |
| 1445 | } |
| 1446 | else |
| 1447 | #endif |
| 1448 | { |
| 1449 | /* wpa supplicant expecting WPA/RSN IE in connect result */ |
| 1450 | csrRoamGetWpaRsnReqIE(WLAN_HDD_GET_HAL_CTX(pAdapter), |
| 1451 | pAdapter->sessionId, |
| 1452 | &reqRsnLength, |
| 1453 | reqRsnIe); |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1454 | |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1455 | csrRoamGetWpaRsnRspIE(WLAN_HDD_GET_HAL_CTX(pAdapter), |
| 1456 | pAdapter->sessionId, |
| 1457 | &rspRsnLength, |
| 1458 | rspRsnIe); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1459 | if ( !hddDisconInProgress ) |
| 1460 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1461 | #if defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1462 | if(ft_carrier_on) |
Mukul Sharma | 84f2725 | 2014-07-14 18:11:42 +0530 | [diff] [blame] | 1463 | { |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1464 | hdd_SendReAssocEvent(dev, pAdapter, pRoamInfo, reqRsnIe, reqRsnLength); |
Mukul Sharma | 84f2725 | 2014-07-14 18:11:42 +0530 | [diff] [blame] | 1465 | #ifdef DEBUG_ROAM_DELAY |
| 1466 | //HACK we are using the buff len as Auth Type |
| 1467 | vos_record_roam_event(e_HDD_SEND_REASSOC_RSP, NULL, 0); |
| 1468 | #endif |
| 1469 | } |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1470 | else |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1471 | #endif /* FEATURE_WLAN_ESE */ |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1472 | |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1473 | { |
| 1474 | hddLog(VOS_TRACE_LEVEL_INFO, |
Deepthi Gowri | 6649f6a | 2014-02-18 17:31:23 +0530 | [diff] [blame] | 1475 | "%s: sending connect indication to nl80211:" |
| 1476 | " for bssid " MAC_ADDRESS_STR |
| 1477 | " reason:%d and Status:%d\n", |
| 1478 | __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), |
| 1479 | roamResult, roamStatus); |
| 1480 | |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1481 | /* inform connect result to nl80211 */ |
| 1482 | cfg80211_connect_result(dev, pRoamInfo->bssid, |
Madan Mohan Koyyalamudi | f146b38 | 2012-11-06 18:53:10 -0800 | [diff] [blame] | 1483 | reqRsnIe, reqRsnLength, |
| 1484 | rspRsnIe, rspRsnLength, |
| 1485 | WLAN_STATUS_SUCCESS, |
| 1486 | GFP_KERNEL); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1487 | } |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 1488 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1489 | } |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1490 | if ( !hddDisconInProgress ) |
| 1491 | { |
| 1492 | cfg80211_put_bss( |
Yue Ma | f49ba87 | 2013-08-19 12:04:25 -0700 | [diff] [blame] | 1493 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1494 | pHddCtx->wiphy, |
Yue Ma | f49ba87 | 2013-08-19 12:04:25 -0700 | [diff] [blame] | 1495 | #endif |
| 1496 | bss); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1497 | // Register the Station with TL after associated... |
| 1498 | vosStatus = hdd_roamRegisterSTA( pAdapter, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1499 | pRoamInfo, |
| 1500 | pHddStaCtx->conn_info.staId[ 0 ], |
| 1501 | NULL, |
| 1502 | pRoamInfo->pBssDesc ); |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1503 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1504 | } |
| 1505 | else |
| 1506 | { |
Madan Mohan Koyyalamudi | 2dd4c8d | 2012-11-08 14:44:14 -0800 | [diff] [blame] | 1507 | /* wpa supplicant expecting WPA/RSN IE in connect result */ |
| 1508 | /* in case of reassociation also need to indicate it to supplicant */ |
| 1509 | csrRoamGetWpaRsnReqIE(WLAN_HDD_GET_HAL_CTX(pAdapter), |
| 1510 | pAdapter->sessionId, |
| 1511 | &reqRsnLength, |
| 1512 | reqRsnIe); |
| 1513 | |
| 1514 | hdd_SendReAssocEvent(dev, pAdapter, pRoamInfo, reqRsnIe, reqRsnLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1515 | //Reassoc successfully |
Gopichand Nakkala | ecdebab | 2013-06-04 18:44:34 +0530 | [diff] [blame] | 1516 | if( pRoamInfo->fAuthRequired ) |
| 1517 | { |
| 1518 | vosStatus = WLANTL_ChangeSTAState( pHddCtx->pvosContext, |
| 1519 | pHddStaCtx->conn_info.staId[ 0 ], |
| 1520 | WLANTL_STA_CONNECTED ); |
| 1521 | pHddStaCtx->conn_info.uIsAuthenticated = VOS_FALSE; |
| 1522 | } |
| 1523 | else |
| 1524 | { |
| 1525 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, |
| 1526 | "%s: staId: %d Changing TL state to AUTHENTICATED", |
| 1527 | __func__, pHddStaCtx->conn_info.staId[ 0 ] ); |
| 1528 | vosStatus = WLANTL_ChangeSTAState( pHddCtx->pvosContext, |
| 1529 | pHddStaCtx->conn_info.staId[ 0 ], |
| 1530 | WLANTL_STA_AUTHENTICATED ); |
| 1531 | pHddStaCtx->conn_info.uIsAuthenticated = VOS_TRUE; |
| 1532 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1533 | } |
| 1534 | |
| 1535 | if ( VOS_IS_STATUS_SUCCESS( vosStatus ) ) |
| 1536 | { |
| 1537 | // perform any WMM-related association processing |
| 1538 | hdd_wmm_assoc(pAdapter, pRoamInfo, eCSR_BSS_TYPE_INFRASTRUCTURE); |
| 1539 | } |
| 1540 | else |
| 1541 | { |
| 1542 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
Jeff Johnson | 0299d0a | 2013-10-30 12:37:43 -0700 | [diff] [blame] | 1543 | "Cannot register STA with TL. Failed with vosStatus = %d [%08X]", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1544 | vosStatus, vosStatus ); |
| 1545 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1546 | #ifdef WLAN_FEATURE_11W |
| 1547 | vos_mem_zero( &pAdapter->hdd_stats.hddPmfStats, |
| 1548 | sizeof(pAdapter->hdd_stats.hddPmfStats) ); |
| 1549 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1550 | // Start the Queue |
| 1551 | netif_tx_wake_all_queues(dev); |
Mukul Sharma | 84f2725 | 2014-07-14 18:11:42 +0530 | [diff] [blame] | 1552 | #ifdef DEBUG_ROAM_DELAY |
| 1553 | vos_record_roam_event(e_HDD_ENABLE_TX_QUEUE, NULL, 0); |
| 1554 | #endif |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1555 | } |
| 1556 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1557 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1558 | hdd_context_t* pHddCtx = (hdd_context_t*)pAdapter->pHddCtx; |
| 1559 | |
| 1560 | hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); |
Kiran Kumar Lokere | c8550fa | 2013-04-15 22:23:00 -0700 | [diff] [blame] | 1561 | if (pRoamInfo) |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 1562 | pr_info("wlan: connection failed with " MAC_ADDRESS_STR |
| 1563 | " reason:%d and Status:%d\n", |
| 1564 | MAC_ADDR_ARRAY(pRoamInfo->bssid), |
| 1565 | roamResult, roamStatus); |
Kiran Kumar Lokere | c8550fa | 2013-04-15 22:23:00 -0700 | [diff] [blame] | 1566 | else |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 1567 | pr_info("wlan: connection failed with " MAC_ADDRESS_STR |
| 1568 | " reason:%d and Status:%d\n", |
| 1569 | MAC_ADDR_ARRAY(pWextState->req_bssId), |
| 1570 | roamResult, roamStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1571 | |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 1572 | /* Set connection state to eConnectionState_NotConnected only when CSR |
| 1573 | * has completed operation - with a ASSOCIATION_FAILURE status |
| 1574 | */ |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1575 | if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus && !hddDisconInProgress ) |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 1576 | { |
| 1577 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 1578 | "%s: Set HDD connState to eConnectionState_NotConnected", |
| 1579 | __func__); |
| 1580 | hdd_connSetConnectionState( pHddStaCtx, eConnectionState_NotConnected); |
| 1581 | } |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1582 | if((pHddCtx->concurrency_mode <= 1) && |
| 1583 | (pHddCtx->no_of_open_sessions[WLAN_HDD_INFRA_STATION] <=1)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1584 | { |
| 1585 | pHddCtx->isAmpAllowed = VOS_TRUE; |
| 1586 | } |
| 1587 | |
| 1588 | //If the Device Mode is Station |
| 1589 | // and the P2P Client is Connected |
| 1590 | //Enable BMPS |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1591 | |
| 1592 | // In case of JB, as Change-Iface may or maynot be called for p2p0 |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1593 | // Enable BMPS/IMPS in case P2P_CLIENT disconnected |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1594 | if(((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) || |
| 1595 | (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) && |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1596 | (vos_concurrent_open_sessions_running())) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1597 | { |
| 1598 | //Enable BMPS only of other Session is P2P Client |
| 1599 | hdd_context_t *pHddCtx = NULL; |
| 1600 | v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); |
| 1601 | |
| 1602 | if (NULL != pVosContext) |
| 1603 | { |
| 1604 | pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext); |
| 1605 | |
| 1606 | if(NULL != pHddCtx) |
| 1607 | { |
Gopichand Nakkala | a2fe5b0 | 2013-06-06 16:32:28 +0530 | [diff] [blame] | 1608 | //Only P2P Client is there Enable Bmps back |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1609 | if((0 == pHddCtx->no_of_open_sessions[VOS_STA_SAP_MODE]) && |
| 1610 | (0 == pHddCtx->no_of_open_sessions[VOS_P2P_GO_MODE])) |
Gopichand Nakkala | a2fe5b0 | 2013-06-06 16:32:28 +0530 | [diff] [blame] | 1611 | { |
| 1612 | if (pHddCtx->hdd_wlan_suspended) |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 1613 | { |
Gopichand Nakkala | a2fe5b0 | 2013-06-06 16:32:28 +0530 | [diff] [blame] | 1614 | hdd_set_pwrparams(pHddCtx); |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 1615 | } |
Gopichand Nakkala | a2fe5b0 | 2013-06-06 16:32:28 +0530 | [diff] [blame] | 1616 | hdd_enable_bmps_imps(pHddCtx); |
| 1617 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1618 | } |
| 1619 | } |
| 1620 | } |
| 1621 | |
James Zmuda | fbf5ffc | 2013-03-25 12:45:35 -0700 | [diff] [blame] | 1622 | /* CR465478: Only send up a connection failure result when CSR has |
Varun Reddy Yeturu | da7f0d5 | 2013-12-20 11:16:57 -0800 | [diff] [blame] | 1623 | * completed operation - with a ASSOCIATION_FAILURE status.*/ |
Abhishek Singh | a6cfaa4 | 2014-06-23 13:11:07 +0530 | [diff] [blame] | 1624 | if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus && !hddDisconInProgress ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1625 | { |
Deepthi Gowri | 6649f6a | 2014-02-18 17:31:23 +0530 | [diff] [blame] | 1626 | if (pRoamInfo) |
| 1627 | hddLog(VOS_TRACE_LEVEL_ERROR, |
| 1628 | "%s: send connect failure to nl80211:" |
| 1629 | " for bssid " MAC_ADDRESS_STR |
| 1630 | " reason:%d and Status:%d\n" , |
| 1631 | __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), |
| 1632 | roamResult, roamStatus); |
| 1633 | else |
| 1634 | hddLog(VOS_TRACE_LEVEL_ERROR, |
| 1635 | "%s: connect failed:" |
| 1636 | " for bssid " MAC_ADDRESS_STR |
| 1637 | " reason:%d and Status:%d\n" , |
| 1638 | __func__, MAC_ADDR_ARRAY(pWextState->req_bssId), |
| 1639 | roamResult, roamStatus); |
| 1640 | |
c_hpothu | daa90e2 | 2014-06-24 17:23:43 +0530 | [diff] [blame] | 1641 | /*Clear the roam profile*/ |
| 1642 | hdd_clearRoamProfileIe( pAdapter ); |
| 1643 | |
James Zmuda | fbf5ffc | 2013-03-25 12:45:35 -0700 | [diff] [blame] | 1644 | /* inform association failure event to nl80211 */ |
| 1645 | if ( eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL == roamResult ) |
| 1646 | { |
Kiran Kumar Lokere | c8550fa | 2013-04-15 22:23:00 -0700 | [diff] [blame] | 1647 | if (pRoamInfo) |
| 1648 | cfg80211_connect_result ( dev, pRoamInfo->bssid, |
| 1649 | NULL, 0, NULL, 0, |
| 1650 | WLAN_STATUS_ASSOC_DENIED_UNSPEC, |
| 1651 | GFP_KERNEL ); |
| 1652 | else |
| 1653 | cfg80211_connect_result ( dev, pWextState->req_bssId, |
| 1654 | NULL, 0, NULL, 0, |
| 1655 | WLAN_STATUS_ASSOC_DENIED_UNSPEC, |
| 1656 | GFP_KERNEL ); |
James Zmuda | fbf5ffc | 2013-03-25 12:45:35 -0700 | [diff] [blame] | 1657 | } |
| 1658 | else |
| 1659 | { |
Kiran Kumar Lokere | c8550fa | 2013-04-15 22:23:00 -0700 | [diff] [blame] | 1660 | if (pRoamInfo) |
| 1661 | cfg80211_connect_result ( dev, pRoamInfo->bssid, |
| 1662 | NULL, 0, NULL, 0, |
| 1663 | WLAN_STATUS_UNSPECIFIED_FAILURE, |
| 1664 | GFP_KERNEL ); |
| 1665 | else |
| 1666 | cfg80211_connect_result ( dev, pWextState->req_bssId, |
| 1667 | NULL, 0, NULL, 0, |
| 1668 | WLAN_STATUS_UNSPECIFIED_FAILURE, |
| 1669 | GFP_KERNEL ); |
James Zmuda | fbf5ffc | 2013-03-25 12:45:35 -0700 | [diff] [blame] | 1670 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1671 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1672 | |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 1673 | hdd_wmm_init( pAdapter ); |
Madan Mohan Koyyalamudi | ee255f1 | 2012-09-28 15:41:19 -0700 | [diff] [blame] | 1674 | |
c_hpothu | 24f4098 | 2014-04-18 18:00:36 +0530 | [diff] [blame] | 1675 | if (pRoamInfo) |
| 1676 | { |
| 1677 | WLANTL_AssocFailed(pRoamInfo->staId); |
| 1678 | } |
Mihir Shete | b733727 | 2014-04-11 15:53:08 +0530 | [diff] [blame] | 1679 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1680 | netif_tx_disable(dev); |
| 1681 | netif_carrier_off(dev); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1682 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1683 | } |
| 1684 | |
Sushant Kaushik | bf584e9 | 2014-08-06 17:59:20 +0530 | [diff] [blame^] | 1685 | if (eCSR_ROAM_RESULT_ASSOCIATED == roamResult) |
Sushant Kaushik | ba6764e | 2014-06-30 19:52:09 +0530 | [diff] [blame] | 1686 | { |
| 1687 | pHostapdAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_SOFTAP); |
| 1688 | if (pHostapdAdapter != NULL) |
| 1689 | { |
Sushant Kaushik | bf584e9 | 2014-08-06 17:59:20 +0530 | [diff] [blame^] | 1690 | /* Restart SAP if its operating channel is different |
| 1691 | * from AP channel. |
| 1692 | */ |
| 1693 | if (pHostapdAdapter->sessionCtx.ap.operatingChannel != |
| 1694 | (int)pRoamInfo->pBssDesc->channelId) |
| 1695 | { |
| 1696 | hddLog(VOS_TRACE_LEVEL_INFO,"Restart Sap as SAP channel is %d " |
| 1697 | "and STA channel is %d", pHostapdAdapter->sessionCtx.ap.operatingChannel, |
| 1698 | (int)pRoamInfo->pBssDesc->channelId); |
| 1699 | hdd_restart_softap(pHddCtx, pHostapdAdapter); |
| 1700 | } |
Sushant Kaushik | ba6764e | 2014-06-30 19:52:09 +0530 | [diff] [blame] | 1701 | } |
| 1702 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1703 | return eHAL_STATUS_SUCCESS; |
| 1704 | } |
| 1705 | |
| 1706 | /**============================================================================ |
| 1707 | * |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1708 | @brief hdd_RoamIbssIndicationHandler() - Here we update the status of the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1709 | Ibss when we receive information that we have started/joined an ibss session |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1710 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1711 | ===========================================================================*/ |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1712 | static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, |
| 1713 | tCsrRoamInfo *pRoamInfo, |
| 1714 | tANI_U32 roamId, |
| 1715 | eRoamCmdStatus roamStatus, |
| 1716 | eCsrRoamResult roamResult ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1717 | { |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1718 | hddLog(VOS_TRACE_LEVEL_INFO, "%s: %s: id %d, status %d, result %d", |
| 1719 | __func__, pAdapter->dev->name, roamId, roamStatus, roamResult); |
| 1720 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1721 | switch( roamResult ) |
| 1722 | { |
| 1723 | // both IBSS Started and IBSS Join should come in here. |
| 1724 | case eCSR_ROAM_RESULT_IBSS_STARTED: |
| 1725 | case eCSR_ROAM_RESULT_IBSS_JOIN_SUCCESS: |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 1726 | case eCSR_ROAM_RESULT_IBSS_COALESCED: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1727 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1728 | hdd_context_t *pHddCtx = (hdd_context_t*)pAdapter->pHddCtx; |
| 1729 | v_MACADDR_t broadcastMacAddr = VOS_MAC_ADDR_BROADCAST_INITIALIZER; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1730 | |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1731 | if (NULL == pRoamInfo) |
| 1732 | { |
| 1733 | VOS_ASSERT(0); |
| 1734 | return; |
| 1735 | } |
| 1736 | |
| 1737 | /* When IBSS Started comes from CSR, we need to move |
| 1738 | * connection state to IBSS Disconnected (meaning no peers |
| 1739 | * are in the IBSS). |
| 1740 | */ |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 1741 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 1742 | "%s: Set HDD connState to eConnectionState_IbssDisconnected", |
| 1743 | __func__); |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1744 | hdd_connSetConnectionState( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), |
| 1745 | eConnectionState_IbssDisconnected ); |
Abhishek Singh | 1c21c4d | 2014-04-25 16:40:19 +0530 | [diff] [blame] | 1746 | /*notify wmm */ |
| 1747 | hdd_wmm_connect(pAdapter, pRoamInfo, eCSR_BSS_TYPE_IBSS); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1748 | pHddCtx->sta_to_adapter[IBSS_BROADCAST_STAID] = pAdapter; |
| 1749 | hdd_roamRegisterSTA (pAdapter, pRoamInfo, |
| 1750 | IBSS_BROADCAST_STAID, |
| 1751 | &broadcastMacAddr, pRoamInfo->pBssDesc); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1752 | |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1753 | if (pRoamInfo->pBssDesc) |
| 1754 | { |
| 1755 | struct cfg80211_bss *bss; |
| 1756 | |
| 1757 | /* we created the IBSS, notify supplicant */ |
| 1758 | hddLog(VOS_TRACE_LEVEL_INFO, "%s: %s: created ibss " |
| 1759 | MAC_ADDRESS_STR, |
| 1760 | __func__, pAdapter->dev->name, |
| 1761 | MAC_ADDR_ARRAY(pRoamInfo->pBssDesc->bssId)); |
| 1762 | |
| 1763 | /* we must first give cfg80211 the BSS information */ |
| 1764 | bss = wlan_hdd_cfg80211_update_bss_db(pAdapter, pRoamInfo); |
| 1765 | if (NULL == bss) |
| 1766 | { |
| 1767 | hddLog(VOS_TRACE_LEVEL_ERROR, |
| 1768 | "%s: %s: unable to create IBSS entry", |
| 1769 | __func__, pAdapter->dev->name); |
| 1770 | return; |
| 1771 | } |
| 1772 | |
| 1773 | cfg80211_ibss_joined(pAdapter->dev, bss->bssid, GFP_KERNEL); |
Yue Ma | f49ba87 | 2013-08-19 12:04:25 -0700 | [diff] [blame] | 1774 | cfg80211_put_bss( |
| 1775 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
| 1776 | pHddCtx->wiphy, |
| 1777 | #endif |
| 1778 | bss); |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1779 | } |
| 1780 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1781 | break; |
| 1782 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1783 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1784 | case eCSR_ROAM_RESULT_IBSS_START_FAILED: |
| 1785 | { |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1786 | hddLog(VOS_TRACE_LEVEL_ERROR, "%s: %s: unable to create IBSS", |
| 1787 | __func__, pAdapter->dev->name); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1788 | break; |
| 1789 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1790 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1791 | default: |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1792 | hddLog(VOS_TRACE_LEVEL_ERROR, "%s: %s: unexpected result %d", |
| 1793 | __func__, pAdapter->dev->name, (int)roamResult); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1794 | break; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1795 | } |
| 1796 | |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 1797 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1798 | } |
| 1799 | |
| 1800 | /**============================================================================ |
| 1801 | * |
| 1802 | @brief roamSaveIbssStation() - Save the IBSS peer MAC address in the adapter. |
| 1803 | This information is passed to iwconfig later. The peer that joined |
| 1804 | last is passed as information to iwconfig. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1805 | If we add HDD_MAX_NUM_IBSS_STA or less STA we return success else we |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1806 | return FALSE. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1807 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1808 | ===========================================================================*/ |
| 1809 | static int roamSaveIbssStation( hdd_station_ctx_t *pHddStaCtx, v_U8_t staId, v_MACADDR_t *peerMacAddress ) |
| 1810 | { |
| 1811 | int fSuccess = FALSE; |
| 1812 | int idx = 0; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1813 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1814 | for ( idx = 0; idx < HDD_MAX_NUM_IBSS_STA; idx++ ) |
| 1815 | { |
| 1816 | if ( 0 == pHddStaCtx->conn_info.staId[ idx ] ) |
| 1817 | { |
| 1818 | pHddStaCtx->conn_info.staId[ idx ] = staId; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1819 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1820 | vos_copy_macaddr( &pHddStaCtx->conn_info.peerMacAddress[ idx ], peerMacAddress ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1821 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1822 | fSuccess = TRUE; |
| 1823 | break; |
| 1824 | } |
| 1825 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1826 | |
| 1827 | return( fSuccess ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1828 | } |
| 1829 | /**============================================================================ |
| 1830 | * |
| 1831 | @brief roamRemoveIbssStation() - Remove the IBSS peer MAC address in the adapter. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1832 | If we remove HDD_MAX_NUM_IBSS_STA or less STA we return success else we |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1833 | return FALSE. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1834 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1835 | ===========================================================================*/ |
Ravi Joshi | cc57ed4 | 2013-10-12 16:31:25 -0700 | [diff] [blame] | 1836 | static int roamRemoveIbssStation( hdd_adapter_t *pAdapter, v_U8_t staId ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1837 | { |
| 1838 | int fSuccess = FALSE; |
| 1839 | int idx = 0; |
| 1840 | v_U8_t valid_idx = 0; |
| 1841 | v_U8_t del_idx = 0; |
Ravi Joshi | 8a93435 | 2013-09-25 16:46:58 -0700 | [diff] [blame] | 1842 | v_U8_t empty_slots = 0; |
Ravi Joshi | cc57ed4 | 2013-10-12 16:31:25 -0700 | [diff] [blame] | 1843 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1844 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1845 | for ( idx = 0; idx < HDD_MAX_NUM_IBSS_STA; idx++ ) |
| 1846 | { |
| 1847 | if ( staId == pHddStaCtx->conn_info.staId[ idx ] ) |
| 1848 | { |
| 1849 | pHddStaCtx->conn_info.staId[ idx ] = 0; |
| 1850 | |
| 1851 | vos_zero_macaddr( &pHddStaCtx->conn_info.peerMacAddress[ idx ] ); |
| 1852 | |
| 1853 | fSuccess = TRUE; |
Ravi Joshi | 8a93435 | 2013-09-25 16:46:58 -0700 | [diff] [blame] | 1854 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1855 | // Note the deleted Index, if its 0 we need special handling |
| 1856 | del_idx = idx; |
Ravi Joshi | 8a93435 | 2013-09-25 16:46:58 -0700 | [diff] [blame] | 1857 | |
| 1858 | empty_slots++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1859 | } |
| 1860 | else |
| 1861 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1862 | if (pHddStaCtx->conn_info.staId[idx] != 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1863 | { |
| 1864 | valid_idx = idx; |
| 1865 | } |
Ravi Joshi | 8a93435 | 2013-09-25 16:46:58 -0700 | [diff] [blame] | 1866 | else |
| 1867 | { |
| 1868 | // Found an empty slot |
| 1869 | empty_slots++; |
| 1870 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1871 | } |
| 1872 | } |
| 1873 | |
Ravi Joshi | 8a93435 | 2013-09-25 16:46:58 -0700 | [diff] [blame] | 1874 | if (HDD_MAX_NUM_IBSS_STA == empty_slots) |
| 1875 | { |
| 1876 | // Last peer departed, set the IBSS state appropriately |
| 1877 | pHddStaCtx->conn_info.connState = eConnectionState_IbssDisconnected; |
Ravi Joshi | cc57ed4 | 2013-10-12 16:31:25 -0700 | [diff] [blame] | 1878 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Ravi Joshi | 8a93435 | 2013-09-25 16:46:58 -0700 | [diff] [blame] | 1879 | "Last IBSS Peer Departed!!!" ); |
| 1880 | } |
| 1881 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1882 | // Find next active staId, to have a valid sta trigger for TL. |
| 1883 | if (fSuccess == TRUE) |
| 1884 | { |
| 1885 | if (del_idx == 0) |
| 1886 | { |
| 1887 | if (pHddStaCtx->conn_info.staId[valid_idx] != 0) |
| 1888 | { |
| 1889 | pHddStaCtx->conn_info.staId[0] = pHddStaCtx->conn_info.staId[valid_idx]; |
| 1890 | vos_copy_macaddr( &pHddStaCtx->conn_info.peerMacAddress[ 0 ], |
| 1891 | &pHddStaCtx->conn_info.peerMacAddress[ valid_idx ]); |
| 1892 | |
| 1893 | pHddStaCtx->conn_info.staId[valid_idx] = 0; |
| 1894 | vos_zero_macaddr( &pHddStaCtx->conn_info.peerMacAddress[ valid_idx ] ); |
| 1895 | } |
| 1896 | } |
| 1897 | } |
| 1898 | return( fSuccess ); |
| 1899 | } |
| 1900 | |
| 1901 | /**============================================================================ |
| 1902 | * |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1903 | @brief roamIbssConnectHandler() : We update the status of the IBSS to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1904 | connected in this function. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 1905 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1906 | ===========================================================================*/ |
| 1907 | static eHalStatus roamIbssConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo ) |
| 1908 | { |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 1909 | struct cfg80211_bss *bss; |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 1910 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 1911 | "%s: IBSS Connect Indication from SME!!! " |
| 1912 | "Set HDD connState to eConnectionState_IbssConnected", |
| 1913 | __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1914 | // Set the internal connection state to show 'IBSS Connected' (IBSS with a partner stations)... |
| 1915 | hdd_connSetConnectionState( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), eConnectionState_IbssConnected ); |
| 1916 | |
| 1917 | // Save the connection info from CSR... |
| 1918 | hdd_connSaveConnectInfo( pAdapter, pRoamInfo, eCSR_BSS_TYPE_IBSS ); |
| 1919 | |
| 1920 | // Send the bssid address to the wext. |
| 1921 | hdd_SendAssociationEvent(pAdapter->dev, pRoamInfo); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1922 | /* add bss_id to cfg80211 data base */ |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 1923 | bss = wlan_hdd_cfg80211_update_bss_db(pAdapter, pRoamInfo); |
| 1924 | if (NULL == bss) |
| 1925 | { |
| 1926 | hddLog(VOS_TRACE_LEVEL_ERROR, |
| 1927 | "%s: %s: unable to create IBSS entry", |
| 1928 | __func__, pAdapter->dev->name); |
| 1929 | return eHAL_STATUS_FAILURE; |
| 1930 | } |
Yue Ma | f49ba87 | 2013-08-19 12:04:25 -0700 | [diff] [blame] | 1931 | cfg80211_put_bss( |
| 1932 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
| 1933 | WLAN_HDD_GET_CTX(pAdapter)->wiphy, |
| 1934 | #endif |
| 1935 | bss); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1936 | |
| 1937 | return( eHAL_STATUS_SUCCESS ); |
| 1938 | } |
| 1939 | /**============================================================================ |
| 1940 | * |
Mukul Sharma | d2589a5 | 2014-04-23 21:06:25 +0530 | [diff] [blame] | 1941 | @brief hdd_ReConfigSuspendDataClearedDuringRoaming() - Reconfigure the |
| 1942 | suspend related data which was cleared during roaming in FWR. |
| 1943 | |
| 1944 | ===========================================================================*/ |
| 1945 | static void hdd_ReConfigSuspendDataClearedDuringRoaming(hdd_context_t *pHddCtx) |
| 1946 | { |
| 1947 | VOS_STATUS vstatus = VOS_STATUS_E_FAILURE; |
| 1948 | hdd_adapter_t *pAdapter; |
| 1949 | hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; |
| 1950 | ENTER(); |
| 1951 | |
| 1952 | spin_lock(&pHddCtx->filter_lock); |
| 1953 | if (VOS_FALSE == pHddCtx->sus_res_mcastbcast_filter_valid) |
| 1954 | { |
| 1955 | pHddCtx->sus_res_mcastbcast_filter = |
| 1956 | pHddCtx->configuredMcastBcastFilter; |
| 1957 | pHddCtx->sus_res_mcastbcast_filter_valid = VOS_TRUE; |
| 1958 | hddLog(VOS_TRACE_LEVEL_INFO, FL("offload: callback to associated")); |
| 1959 | hddLog(VOS_TRACE_LEVEL_INFO, |
| 1960 | FL("saving configuredMcastBcastFilter = %d"), |
| 1961 | pHddCtx->configuredMcastBcastFilter); |
| 1962 | hddLog(VOS_TRACE_LEVEL_INFO, |
| 1963 | FL("offload: calling hdd_conf_mcastbcast_filter")); |
| 1964 | } |
| 1965 | spin_unlock(&pHddCtx->filter_lock); |
| 1966 | |
| 1967 | hdd_conf_mcastbcast_filter(pHddCtx, TRUE); |
| 1968 | if(pHddCtx->hdd_mcastbcast_filter_set != TRUE) |
| 1969 | hddLog(VOS_TRACE_LEVEL_ERROR, FL("Not able to set mcast/bcast filter ")); |
| 1970 | |
| 1971 | vstatus = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); |
| 1972 | //No need to configure GTK Offload from here because it might possible |
| 1973 | //cfg80211_set_rekey_data might not yet came, anyway GTK offload will |
| 1974 | //be handled as part of cfg80211_set_rekey_data processing. |
| 1975 | while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == vstatus ) |
| 1976 | { |
| 1977 | pAdapter = pAdapterNode->pAdapter; |
| 1978 | if( pAdapter && |
| 1979 | (( pAdapter->device_mode == WLAN_HDD_INFRA_STATION) || |
| 1980 | (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT))) |
| 1981 | { |
| 1982 | if (pHddCtx->cfg_ini->fhostArpOffload) |
| 1983 | { |
| 1984 | //Configure ARPOFFLOAD |
| 1985 | vstatus = hdd_conf_arp_offload(pAdapter, TRUE); |
| 1986 | if (!VOS_IS_STATUS_SUCCESS(vstatus)) |
| 1987 | { |
| 1988 | hddLog(VOS_TRACE_LEVEL_ERROR, |
| 1989 | FL("Failed to disable ARPOffload Feature %d"), vstatus); |
| 1990 | } |
| 1991 | } |
| 1992 | #ifdef WLAN_NS_OFFLOAD |
| 1993 | //Configure NSOFFLOAD |
| 1994 | if (pHddCtx->cfg_ini->fhostNSOffload) |
| 1995 | { |
| 1996 | hdd_conf_ns_offload(pAdapter, TRUE); |
| 1997 | } |
| 1998 | #endif |
Mukul Sharma | 25e70c3 | 2014-05-22 12:50:24 +0530 | [diff] [blame] | 1999 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2000 | /* During suspend, configure MC Addr list filter to the firmware |
| 2001 | * function takes care of checking necessary conditions before |
| 2002 | * configuring. |
| 2003 | */ |
| 2004 | wlan_hdd_set_mc_addr_list(pAdapter, TRUE); |
| 2005 | #endif |
Mukul Sharma | d2589a5 | 2014-04-23 21:06:25 +0530 | [diff] [blame] | 2006 | } |
| 2007 | vstatus = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); |
| 2008 | pAdapterNode = pNext; |
| 2009 | } |
| 2010 | EXIT(); |
| 2011 | } |
| 2012 | |
| 2013 | /**============================================================================ |
| 2014 | * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2015 | @brief hdd_RoamSetKeyCompleteHandler() - Update the security parameters. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2016 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2017 | ===========================================================================*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2018 | static eHalStatus hdd_RoamSetKeyCompleteHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, |
| 2019 | tANI_U32 roamId, eRoamCmdStatus roamStatus, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2020 | eCsrRoamResult roamResult ) |
| 2021 | { |
| 2022 | eCsrEncryptionType connectedCipherAlgo; |
| 2023 | v_BOOL_t fConnected = FALSE; |
| 2024 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 2025 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
| 2026 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 2027 | ENTER(); |
Srinivas Girigowda | 5a737f2 | 2013-06-28 15:21:48 -0700 | [diff] [blame] | 2028 | |
| 2029 | if (NULL == pRoamInfo) |
| 2030 | { |
| 2031 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "pRoamInfo is NULL"); |
| 2032 | return eHAL_STATUS_FAILURE; |
| 2033 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2034 | // if ( WPA ), tell TL to go to 'authenticated' after the keys are set. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2035 | // then go to 'authenticated'. For all other authentication types (those that do |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2036 | // not require upper layer authentication) we can put TL directly into 'authenticated' |
| 2037 | // state. |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 2038 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, |
| 2039 | "Set Key completion roamStatus =%d roamResult=%d " MAC_ADDRESS_STR, |
| 2040 | roamStatus, roamResult, MAC_ADDR_ARRAY(pRoamInfo->peerMac)); |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2041 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2042 | fConnected = hdd_connGetConnectedCipherAlgo( pHddStaCtx, &connectedCipherAlgo ); |
| 2043 | if( fConnected ) |
| 2044 | { |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 2045 | if ( WLAN_HDD_IBSS == pAdapter->device_mode ) |
| 2046 | { |
| 2047 | v_U8_t staId; |
| 2048 | |
| 2049 | v_MACADDR_t broadcastMacAddr = VOS_MAC_ADDR_BROADCAST_INITIALIZER; |
| 2050 | |
| 2051 | if ( 0 == memcmp( pRoamInfo->peerMac, |
| 2052 | &broadcastMacAddr, VOS_MAC_ADDR_SIZE ) ) |
| 2053 | { |
| 2054 | vosStatus = WLANTL_STAPtkInstalled( pHddCtx->pvosContext, |
| 2055 | IBSS_BROADCAST_STAID); |
| 2056 | pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE; |
| 2057 | } |
| 2058 | else |
| 2059 | { |
| 2060 | vosStatus = hdd_Ibss_GetStaId(pHddStaCtx, |
| 2061 | (v_MACADDR_t*)pRoamInfo->peerMac, |
| 2062 | &staId); |
| 2063 | if ( VOS_STATUS_SUCCESS == vosStatus ) |
| 2064 | { |
| 2065 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, |
| 2066 | "WLAN TL STA Ptk Installed for STAID=%d", staId); |
| 2067 | vosStatus = WLANTL_STAPtkInstalled( pHddCtx->pvosContext, |
| 2068 | staId); |
| 2069 | pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE; |
| 2070 | } |
| 2071 | } |
| 2072 | } |
| 2073 | else |
| 2074 | { |
Gopichand Nakkala | ecdebab | 2013-06-04 18:44:34 +0530 | [diff] [blame] | 2075 | // TODO: Considering getting a state machine in HDD later. |
| 2076 | // This routine is invoked twice. 1)set PTK 2)set GTK. |
| 2077 | // The folloing if statement will be TRUE when setting GTK. |
| 2078 | // At this time we don't handle the state in detail. |
| 2079 | // Related CR: 174048 - TL not in authenticated state |
| 2080 | if ( ( eCSR_ROAM_RESULT_AUTHENTICATED == roamResult ) && |
| 2081 | (pRoamInfo != NULL) && !pRoamInfo->fAuthRequired ) |
| 2082 | { |
| 2083 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, "Key set " |
| 2084 | "for StaId= %d. Changing TL state to AUTHENTICATED", |
| 2085 | pHddStaCtx->conn_info.staId[ 0 ] ); |
| 2086 | |
| 2087 | // Connections that do not need Upper layer authentication, |
| 2088 | // transition TL to 'Authenticated' state after the keys are set. |
| 2089 | vosStatus = WLANTL_ChangeSTAState( pHddCtx->pvosContext, |
| 2090 | pHddStaCtx->conn_info.staId[ 0 ], |
| 2091 | WLANTL_STA_AUTHENTICATED ); |
| 2092 | |
| 2093 | pHddStaCtx->conn_info.uIsAuthenticated = VOS_TRUE; |
Mukul Sharma | d2589a5 | 2014-04-23 21:06:25 +0530 | [diff] [blame] | 2094 | //Need to call offload because when roaming happen at that time fwr |
| 2095 | //clean offload info as part of the DelBss |
| 2096 | // No need to configure offload if host was not suspended |
| 2097 | spin_lock(&pHddCtx->filter_lock); |
| 2098 | if(pHddCtx->hdd_wlan_suspended) |
| 2099 | { |
| 2100 | spin_unlock(&pHddCtx->filter_lock); |
| 2101 | hdd_ReConfigSuspendDataClearedDuringRoaming(pHddCtx); |
| 2102 | } |
| 2103 | else |
| 2104 | { |
| 2105 | spin_unlock(&pHddCtx->filter_lock); |
| 2106 | } |
Mukul Sharma | 84f2725 | 2014-07-14 18:11:42 +0530 | [diff] [blame] | 2107 | #ifdef DEBUG_ROAM_DELAY |
| 2108 | vos_record_roam_event(e_HDD_SET_GTK_RSP, NULL, 0); |
| 2109 | #endif |
Gopichand Nakkala | ecdebab | 2013-06-04 18:44:34 +0530 | [diff] [blame] | 2110 | } |
| 2111 | else |
| 2112 | { |
| 2113 | vosStatus = WLANTL_STAPtkInstalled( pHddCtx->pvosContext, |
| 2114 | pHddStaCtx->conn_info.staId[ 0 ]); |
Mukul Sharma | 84f2725 | 2014-07-14 18:11:42 +0530 | [diff] [blame] | 2115 | #ifdef DEBUG_ROAM_DELAY |
| 2116 | vos_record_roam_event(e_HDD_SET_PTK_RSP, (void *)pRoamInfo->peerMac, 6); |
| 2117 | #endif |
Gopichand Nakkala | ecdebab | 2013-06-04 18:44:34 +0530 | [diff] [blame] | 2118 | } |
| 2119 | |
| 2120 | pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE; |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 2121 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2122 | } |
Gopichand Nakkala | ecdebab | 2013-06-04 18:44:34 +0530 | [diff] [blame] | 2123 | else |
| 2124 | { |
| 2125 | // possible disassoc after issuing set key and waiting set key complete |
| 2126 | pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE; |
| 2127 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2128 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2129 | EXIT(); |
| 2130 | return( eHAL_STATUS_SUCCESS ); |
| 2131 | } |
| 2132 | /**============================================================================ |
| 2133 | * |
| 2134 | @brief hdd_RoamMicErrorIndicationHandler() - This function indicates the Mic failure to the supplicant. |
| 2135 | ===========================================================================*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2136 | static eHalStatus hdd_RoamMicErrorIndicationHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2137 | tANI_U32 roamId, eRoamCmdStatus roamStatus, eCsrRoamResult roamResult ) |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2138 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2139 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 2140 | |
| 2141 | if( eConnectionState_Associated == pHddStaCtx->conn_info.connState && |
| 2142 | TKIP_COUNTER_MEASURE_STOPED == pHddStaCtx->WextState.mTKIPCounterMeasures ) |
| 2143 | { |
| 2144 | struct iw_michaelmicfailure msg; |
| 2145 | union iwreq_data wreq; |
| 2146 | memset(&msg, '\0', sizeof(msg)); |
| 2147 | msg.src_addr.sa_family = ARPHRD_ETHER; |
| 2148 | memcpy(msg.src_addr.sa_data, pRoamInfo->u.pMICFailureInfo->taMacAddr, sizeof(pRoamInfo->u.pMICFailureInfo->taMacAddr)); |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 2149 | hddLog(LOG1, "MIC MAC " MAC_ADDRESS_STR, |
| 2150 | MAC_ADDR_ARRAY(msg.src_addr.sa_data)); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2151 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2152 | if(pRoamInfo->u.pMICFailureInfo->multicast == eSIR_TRUE) |
| 2153 | msg.flags = IW_MICFAILURE_GROUP; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2154 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2155 | msg.flags = IW_MICFAILURE_PAIRWISE; |
| 2156 | memset(&wreq, 0, sizeof(wreq)); |
| 2157 | wreq.data.length = sizeof(msg); |
| 2158 | wireless_send_event(pAdapter->dev, IWEVMICHAELMICFAILURE, &wreq, (char *)&msg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2159 | /* inform mic failure to nl80211 */ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2160 | cfg80211_michael_mic_failure(pAdapter->dev, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2161 | pRoamInfo->u.pMICFailureInfo->taMacAddr, |
| 2162 | ((pRoamInfo->u.pMICFailureInfo->multicast == eSIR_TRUE) ? |
| 2163 | NL80211_KEYTYPE_GROUP : |
| 2164 | NL80211_KEYTYPE_PAIRWISE), |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2165 | pRoamInfo->u.pMICFailureInfo->keyId, |
| 2166 | pRoamInfo->u.pMICFailureInfo->TSC, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2167 | GFP_KERNEL); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2168 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2169 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2170 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2171 | return( eHAL_STATUS_SUCCESS ); |
| 2172 | } |
| 2173 | |
| 2174 | /**============================================================================ |
| 2175 | * |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2176 | @brief roamRoamConnectStatusUpdateHandler() - The Ibss connection status is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2177 | updated regularly here in this function. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2178 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2179 | ===========================================================================*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2180 | static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, |
| 2181 | tANI_U32 roamId, eRoamCmdStatus roamStatus, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2182 | eCsrRoamResult roamResult ) |
| 2183 | { |
| 2184 | VOS_STATUS vosStatus; |
| 2185 | |
| 2186 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
| 2187 | switch( roamResult ) |
| 2188 | { |
| 2189 | case eCSR_ROAM_RESULT_IBSS_NEW_PEER: |
| 2190 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2191 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 2192 | struct station_info staInfo; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2193 | |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 2194 | pr_info ( "IBSS New Peer indication from SME " |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2195 | "with peerMac " MAC_ADDRESS_STR " BSSID: " MAC_ADDRESS_STR " and stationID= %d", |
| 2196 | MAC_ADDR_ARRAY(pRoamInfo->peerMac), |
| 2197 | MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2198 | pRoamInfo->staId ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2199 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2200 | if ( !roamSaveIbssStation( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), pRoamInfo->staId, (v_MACADDR_t *)pRoamInfo->peerMac ) ) |
| 2201 | { |
| 2202 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
| 2203 | "New IBSS peer but we already have the max we can handle. Can't register this one" ); |
| 2204 | break; |
| 2205 | } |
| 2206 | |
| 2207 | pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter; |
| 2208 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2209 | pHddCtx->sta_to_adapter[IBSS_BROADCAST_STAID] = pAdapter; |
| 2210 | WLANTL_UpdateSTABssIdforIBSS(pHddCtx->pvosContext, |
| 2211 | IBSS_BROADCAST_STAID,pHddStaCtx->conn_info.bssId); |
| 2212 | |
| 2213 | // Register the Station with TL for the new peer. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2214 | vosStatus = hdd_roamRegisterSTA( pAdapter, |
| 2215 | pRoamInfo, |
| 2216 | pRoamInfo->staId, |
| 2217 | (v_MACADDR_t *)pRoamInfo->peerMac, |
| 2218 | pRoamInfo->pBssDesc ); |
| 2219 | if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) |
| 2220 | { |
| 2221 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 0299d0a | 2013-10-30 12:37:43 -0700 | [diff] [blame] | 2222 | "Cannot register STA with TL for IBSS. Failed with vosStatus = %d [%08X]", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2223 | vosStatus, vosStatus ); |
| 2224 | } |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 2225 | pHddStaCtx->ibss_sta_generation++; |
| 2226 | memset(&staInfo, 0, sizeof(staInfo)); |
| 2227 | staInfo.filled = 0; |
| 2228 | staInfo.generation = pHddStaCtx->ibss_sta_generation; |
| 2229 | |
| 2230 | cfg80211_new_sta(pAdapter->dev, |
| 2231 | (const u8 *)pRoamInfo->peerMac, |
| 2232 | &staInfo, GFP_KERNEL); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2233 | |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 2234 | if ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == pHddStaCtx->ibss_enc_key.encType |
| 2235 | ||eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == pHddStaCtx->ibss_enc_key.encType |
| 2236 | ||eCSR_ENCRYPT_TYPE_TKIP == pHddStaCtx->ibss_enc_key.encType |
| 2237 | ||eCSR_ENCRYPT_TYPE_AES == pHddStaCtx->ibss_enc_key.encType ) |
| 2238 | { |
| 2239 | pHddStaCtx->ibss_enc_key.keyDirection = eSIR_TX_RX; |
| 2240 | memcpy(&pHddStaCtx->ibss_enc_key.peerMac, |
| 2241 | pRoamInfo->peerMac, WNI_CFG_BSSID_LEN); |
| 2242 | |
| 2243 | VOS_TRACE( VOS_MODULE_ID_HDD, |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 2244 | VOS_TRACE_LEVEL_INFO_HIGH, "New peer joined set PTK encType=%d", |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 2245 | pHddStaCtx->ibss_enc_key.encType); |
| 2246 | |
| 2247 | vosStatus = sme_RoamSetKey( WLAN_HDD_GET_HAL_CTX(pAdapter), |
| 2248 | pAdapter->sessionId, &pHddStaCtx->ibss_enc_key, &roamId ); |
| 2249 | |
| 2250 | if ( VOS_STATUS_SUCCESS != vosStatus ) |
| 2251 | { |
| 2252 | hddLog(VOS_TRACE_LEVEL_ERROR, |
| 2253 | "%s: sme_RoamSetKey failed, returned %d", |
| 2254 | __func__, vosStatus); |
| 2255 | return VOS_STATUS_E_FAILURE; |
| 2256 | } |
| 2257 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2258 | netif_carrier_on(pAdapter->dev); |
| 2259 | netif_tx_start_all_queues(pAdapter->dev); |
| 2260 | break; |
| 2261 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2262 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2263 | case eCSR_ROAM_RESULT_IBSS_CONNECT: |
| 2264 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2266 | roamIbssConnectHandler( pAdapter, pRoamInfo ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2267 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2268 | break; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2269 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2270 | case eCSR_ROAM_RESULT_IBSS_PEER_DEPARTED: |
| 2271 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2272 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2273 | |
Ravi Joshi | cc57ed4 | 2013-10-12 16:31:25 -0700 | [diff] [blame] | 2274 | if ( !roamRemoveIbssStation(pAdapter, pRoamInfo->staId ) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2275 | { |
| 2276 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
| 2277 | "IBSS peer departed by cannot find peer in our registration table with TL" ); |
| 2278 | } |
| 2279 | |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 2280 | pr_info ( "IBSS Peer Departed from SME " |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2281 | "with peerMac " MAC_ADDRESS_STR " BSSID: " MAC_ADDRESS_STR " and stationID= %d", |
| 2282 | MAC_ADDR_ARRAY(pRoamInfo->peerMac), |
| 2283 | MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId), |
| 2284 | pRoamInfo->staId ); |
| 2285 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2286 | hdd_roamDeregisterSTA( pAdapter, pRoamInfo->staId ); |
| 2287 | |
| 2288 | pHddCtx->sta_to_adapter[pRoamInfo->staId] = NULL; |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 2289 | pHddStaCtx->ibss_sta_generation++; |
Ravi Joshi | cc57ed4 | 2013-10-12 16:31:25 -0700 | [diff] [blame] | 2290 | |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 2291 | cfg80211_del_sta(pAdapter->dev, |
| 2292 | (const u8 *)&pRoamInfo->peerMac, |
| 2293 | GFP_KERNEL); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2294 | break; |
| 2295 | } |
| 2296 | case eCSR_ROAM_RESULT_IBSS_INACTIVE: |
| 2297 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2298 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, |
| 2299 | "Received eCSR_ROAM_RESULT_IBSS_INACTIVE from SME"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2300 | // Stop only when we are inactive |
| 2301 | netif_tx_disable(pAdapter->dev); |
| 2302 | netif_carrier_off(pAdapter->dev); |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 2303 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 2304 | "%s: Set HDD connState to eConnectionState_NotConnected", |
| 2305 | __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2306 | hdd_connSetConnectionState( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), eConnectionState_NotConnected ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2307 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2308 | // Send the bssid address to the wext. |
| 2309 | hdd_SendAssociationEvent(pAdapter->dev, pRoamInfo); |
| 2310 | // clean up data path |
| 2311 | hdd_disconnect_tx_rx(pAdapter); |
| 2312 | break; |
| 2313 | } |
| 2314 | default: |
| 2315 | break; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2316 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2317 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2318 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2319 | return( eHAL_STATUS_SUCCESS ); |
| 2320 | } |
| 2321 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2322 | #ifdef FEATURE_WLAN_TDLS |
| 2323 | /**============================================================================ |
| 2324 | * |
| 2325 | @brief hdd_roamRegisterTDLSSTA() - Construct the staDesc and register with |
| 2326 | TL the new STA. This is called as part of ADD_STA in the TDLS setup |
| 2327 | Return: VOS_STATUS |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2328 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2329 | ===========================================================================*/ |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2330 | VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter, |
| 2331 | tANI_U8 *peerMac, tANI_U16 staId, tANI_U8 ucastSig) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2332 | { |
| 2333 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2334 | v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pAdapter))->pvosContext; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2335 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 2336 | WLAN_STADescType staDesc = {0}; |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2337 | eCsrEncryptionType connectedCipherAlgo = eCSR_ENCRYPT_TYPE_UNKNOWN; |
| 2338 | v_BOOL_t fConnected = FALSE; |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 2339 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
| 2340 | hdd_config_t *cfg_param = pHddCtx->cfg_ini; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2341 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2342 | fConnected = hdd_connGetConnectedCipherAlgo( pHddStaCtx, &connectedCipherAlgo ); |
| 2343 | if (!fConnected) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2344 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2345 | "%s not connected. ignored", __func__); |
| 2346 | return VOS_FALSE; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2347 | } |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2348 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2349 | /* |
| 2350 | * TDLS sta in BSS should be set as STA type TDLS and STA MAC should |
| 2351 | * be peer MAC, here we are wokrking on direct Link |
| 2352 | */ |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2353 | staDesc.ucSTAId = staId ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2354 | |
| 2355 | staDesc.wSTAType = WLAN_STA_TDLS ; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2356 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2357 | vos_mem_copy( staDesc.vSTAMACAddress.bytes, peerMac, |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2358 | sizeof(tSirMacAddr) ); |
| 2359 | |
| 2360 | vos_mem_copy(staDesc.vBSSIDforIBSS.bytes, pHddStaCtx->conn_info.bssId,6 ); |
| 2361 | vos_copy_macaddr( &staDesc.vSelfMACAddress, &pAdapter->macAddressCurrent ); |
| 2362 | |
| 2363 | /* set the QoS field appropriately ..*/ |
| 2364 | (hdd_wmm_is_active(pAdapter)) ? (staDesc.ucQosEnabled = 1) |
| 2365 | : (staDesc.ucQosEnabled = 0) ; |
| 2366 | |
| 2367 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "HDD register \ |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 2368 | TL QoS_enabled=%d", staDesc.ucQosEnabled ); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2369 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2370 | staDesc.ucProtectedFrame = (connectedCipherAlgo != eCSR_ENCRYPT_TYPE_NONE) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2371 | |
| 2372 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 2373 | "HDD register TL Sec_enabled= %d.", staDesc.ucProtectedFrame ); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2374 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2375 | /* |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2376 | * UMA is ready we inform TL to do frame translation. |
| 2377 | */ |
| 2378 | staDesc.ucSwFrameTXXlation = 1; |
| 2379 | staDesc.ucSwFrameRXXlation = 1; |
| 2380 | staDesc.ucAddRmvLLC = 1; |
| 2381 | |
| 2382 | /* Initialize signatures and state */ |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2383 | staDesc.ucUcastSig = ucastSig ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2384 | |
| 2385 | /* tdls Direct Link do not need bcastSig */ |
| 2386 | staDesc.ucBcastSig = 0 ; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2387 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2388 | #ifdef VOLANS_ENABLE_SW_REPLAY_CHECK |
| 2389 | if(staDesc.ucProtectedFrame) |
| 2390 | staDesc.ucIsReplayCheckValid = VOS_TRUE; |
| 2391 | else |
| 2392 | staDesc.ucIsReplayCheckValid = VOS_FALSE; |
| 2393 | #endif |
| 2394 | |
Gopichand Nakkala | 471708b | 2013-06-04 20:03:01 +0530 | [diff] [blame] | 2395 | staDesc.ucInitState = WLANTL_STA_CONNECTED ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2396 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2397 | /* Register the Station with TL... */ |
| 2398 | vosStatus = WLANTL_RegisterSTAClient( pVosContext, |
| 2399 | hdd_rx_packet_cbk, |
| 2400 | hdd_tx_complete_cbk, |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2401 | hdd_tx_fetch_packet_cbk, &staDesc, 0 ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2402 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2403 | if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) |
| 2404 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2405 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 0299d0a | 2013-10-30 12:37:43 -0700 | [diff] [blame] | 2406 | "%s: WLANTL_RegisterSTAClient() failed to register. " |
| 2407 | "Status= %d [0x%08X]", __func__, vosStatus, vosStatus ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2408 | return vosStatus; |
| 2409 | } |
| 2410 | |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 2411 | if ( cfg_param->dynSplitscan && |
| 2412 | ( VOS_TIMER_STATE_RUNNING != |
| 2413 | vos_timer_getCurrentState(&pHddCtx->tx_rx_trafficTmr)) ) |
| 2414 | { |
| 2415 | vos_timer_start(&pHddCtx->tx_rx_trafficTmr, |
| 2416 | cfg_param->trafficMntrTmrForSplitScan); |
| 2417 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2418 | return( vosStatus ); |
| 2419 | } |
| 2420 | |
Chauhan Rajesh | b48f96d | 2013-01-24 21:00:15 -0800 | [diff] [blame] | 2421 | static VOS_STATUS hdd_roamDeregisterTDLSSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) |
| 2422 | { |
| 2423 | VOS_STATUS vosStatus; |
| 2424 | vosStatus = WLANTL_ClearSTAClient( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, staId ); |
| 2425 | if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) |
| 2426 | { |
| 2427 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
| 2428 | "%s: WLANTL_ClearSTAClient() failed to for staID %d. " |
Jeff Johnson | 0299d0a | 2013-10-30 12:37:43 -0700 | [diff] [blame] | 2429 | "Status= %d [0x%08X]", |
Chauhan Rajesh | b48f96d | 2013-01-24 21:00:15 -0800 | [diff] [blame] | 2430 | __func__, staId, vosStatus, vosStatus ); |
| 2431 | } |
| 2432 | return( vosStatus ); |
| 2433 | } |
| 2434 | |
| 2435 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2436 | /* |
| 2437 | * HDD interface between SME and TL to ensure TDLS client registration with |
| 2438 | * TL in case of new TDLS client is added and deregistration at the time |
| 2439 | * TDLS client is deleted. |
| 2440 | */ |
| 2441 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2442 | eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, |
| 2443 | tCsrRoamInfo *pRoamInfo, |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2444 | tANI_U32 roamId, |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2445 | eRoamCmdStatus roamStatus, |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2446 | eCsrRoamResult roamResult) |
| 2447 | { |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2448 | hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2449 | eHalStatus status = eHAL_STATUS_FAILURE ; |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2450 | tANI_U8 staIdx; |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 2451 | |
| 2452 | #ifdef WLAN_FEATURE_TDLS_DEBUG |
Kaushik, Sushant | 8489f47 | 2014-01-27 11:41:22 +0530 | [diff] [blame] | 2453 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 2454 | ("hdd_tdlsStatusUpdate: %s staIdx %d " MAC_ADDRESS_STR), |
| 2455 | roamResult == eCSR_ROAM_RESULT_ADD_TDLS_PEER ? |
| 2456 | "ADD_TDLS_PEER" : |
| 2457 | roamResult == eCSR_ROAM_RESULT_DELETE_TDLS_PEER ? |
| 2458 | "DEL_TDLS_PEER" : |
| 2459 | roamResult == eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND ? |
| 2460 | "DEL_TDLS_PEER_IND" : |
| 2461 | roamResult == eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND ? |
| 2462 | "DEL_ALL_TDLS_PEER_IND" : |
| 2463 | roamResult == eCSR_ROAM_RESULT_UPDATE_TDLS_PEER ? |
| 2464 | "UPDATE_TDLS_PEER" : |
| 2465 | roamResult == eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP ? |
| 2466 | "LINK_ESTABLISH_REQ_RSP" : "UNKNOWN", |
| 2467 | pRoamInfo->staId, MAC_ADDR_ARRAY(pRoamInfo->peerMac)); |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 2468 | #endif |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2469 | switch( roamResult ) |
| 2470 | { |
| 2471 | case eCSR_ROAM_RESULT_ADD_TDLS_PEER: |
| 2472 | { |
Lee Hoonki | f987a0b | 2013-01-29 02:07:07 -0800 | [diff] [blame] | 2473 | if(eSIR_SME_SUCCESS != pRoamInfo->statusCode) |
| 2474 | { |
| 2475 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2476 | ("%s: Add Sta is failed. %d"),__func__, pRoamInfo->statusCode); |
Lee Hoonki | f987a0b | 2013-01-29 02:07:07 -0800 | [diff] [blame] | 2477 | } |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2478 | else |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2479 | { |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2480 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2481 | /* check if there is available index for this new TDLS STA */ |
| 2482 | for ( staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++ ) |
| 2483 | { |
| 2484 | if (0 == pHddCtx->tdlsConnInfo[staIdx].staId ) |
| 2485 | { |
| 2486 | pHddCtx->tdlsConnInfo[staIdx].sessionId = pRoamInfo->sessionId; |
| 2487 | pHddCtx->tdlsConnInfo[staIdx].staId = pRoamInfo->staId; |
| 2488 | |
| 2489 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 2490 | ("TDLS: STA IDX at %d is %d " |
| 2491 | "of mac " MAC_ADDRESS_STR), |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2492 | staIdx, pHddCtx->tdlsConnInfo[staIdx].staId, |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 2493 | MAC_ADDR_ARRAY(pRoamInfo->peerMac)); |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2494 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2495 | vos_copy_macaddr(&pHddCtx->tdlsConnInfo[staIdx].peerMac, |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2496 | (v_MACADDR_t *)pRoamInfo->peerMac) ; |
| 2497 | status = eHAL_STATUS_SUCCESS ; |
| 2498 | break ; |
| 2499 | } |
| 2500 | } |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2501 | if (staIdx < HDD_MAX_NUM_TDLS_STA) |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2502 | { |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2503 | if (-1 == wlan_hdd_tdls_set_sta_id(pAdapter, pRoamInfo->peerMac, pRoamInfo->staId)) { |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2504 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
| 2505 | "wlan_hdd_tdls_set_sta_id() failed"); |
| 2506 | return VOS_FALSE; |
| 2507 | } |
| 2508 | |
| 2509 | (WLAN_HDD_GET_CTX(pAdapter))->sta_to_adapter[pRoamInfo->staId] = pAdapter; |
Gopichand Nakkala | 471708b | 2013-06-04 20:03:01 +0530 | [diff] [blame] | 2510 | /* store the ucast signature , if required for further reference. */ |
| 2511 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2512 | wlan_hdd_tdls_set_signature( pAdapter, pRoamInfo->peerMac, pRoamInfo->ucastSig ); |
Gopichand Nakkala | 471708b | 2013-06-04 20:03:01 +0530 | [diff] [blame] | 2513 | /* start TDLS client registration with TL */ |
| 2514 | status = hdd_roamRegisterTDLSSTA( pAdapter, |
| 2515 | pRoamInfo->peerMac, |
| 2516 | pRoamInfo->staId, |
| 2517 | pRoamInfo->ucastSig); |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2518 | } |
| 2519 | else |
| 2520 | { |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2521 | status = eHAL_STATUS_FAILURE; |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2522 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Hoonki Lee | 66b75f3 | 2013-04-16 18:30:07 -0700 | [diff] [blame] | 2523 | "%s: no available slot in conn_info. staId %d cannot be stored", __func__, pRoamInfo->staId); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2524 | } |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2525 | pAdapter->tdlsAddStaStatus = status; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2526 | } |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 2527 | complete(&pAdapter->tdls_add_station_comp); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2528 | break ; |
| 2529 | } |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2530 | case eCSR_ROAM_RESULT_UPDATE_TDLS_PEER: |
| 2531 | { |
| 2532 | if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) |
| 2533 | { |
| 2534 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
| 2535 | "%s: Add Sta is failed. %d", __func__, pRoamInfo->statusCode); |
| 2536 | } |
| 2537 | /* store the ucast signature which will be used later when |
| 2538 | * registering to TL |
| 2539 | */ |
| 2540 | pAdapter->tdlsAddStaStatus = pRoamInfo->statusCode; |
| 2541 | complete(&pAdapter->tdls_add_station_comp); |
| 2542 | break; |
| 2543 | } |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2544 | case eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP: |
| 2545 | { |
| 2546 | if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) |
| 2547 | { |
| 2548 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
| 2549 | "%s: Link Establish Request failed. %d", __func__, pRoamInfo->statusCode); |
| 2550 | } |
| 2551 | complete(&pAdapter->tdls_link_establish_req_comp); |
| 2552 | break; |
| 2553 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2554 | case eCSR_ROAM_RESULT_DELETE_TDLS_PEER: |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2555 | { |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 2556 | hddTdlsPeer_t *curr_peer; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2557 | for ( staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++ ) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2558 | { |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2559 | if ((pHddCtx->tdlsConnInfo[staIdx].sessionId == pRoamInfo->sessionId) && |
| 2560 | pRoamInfo->staId == pHddCtx->tdlsConnInfo[staIdx].staId) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2561 | { |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2562 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2563 | ("HDD: del STA IDX = %x"), pRoamInfo->staId) ; |
| 2564 | |
Madan Mohan Koyyalamudi | 9679744 | 2013-10-08 16:04:42 +0530 | [diff] [blame] | 2565 | curr_peer = wlan_hdd_tdls_find_peer(pAdapter, pRoamInfo->peerMac, TRUE); |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 2566 | if (NULL != curr_peer && TDLS_IS_CONNECTED(curr_peer)) |
| 2567 | { |
| 2568 | hdd_roamDeregisterTDLSSTA ( pAdapter, pRoamInfo->staId ); |
| 2569 | wlan_hdd_tdls_decrement_peer_count(pAdapter); |
| 2570 | } |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2571 | wlan_hdd_tdls_reset_peer(pAdapter, pRoamInfo->peerMac); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2572 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2573 | pHddCtx->tdlsConnInfo[staIdx].staId = 0 ; |
| 2574 | pHddCtx->tdlsConnInfo[staIdx].sessionId = 255; |
| 2575 | vos_mem_zero(&pHddCtx->tdlsConnInfo[staIdx].peerMac, |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2576 | sizeof(v_MACADDR_t)) ; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2577 | wlan_hdd_tdls_check_bmps(pAdapter); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2578 | status = eHAL_STATUS_SUCCESS ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2579 | break ; |
| 2580 | } |
| 2581 | } |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 2582 | complete(&pAdapter->tdls_del_station_comp); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2583 | } |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2584 | break ; |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2585 | case eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND: |
| 2586 | { |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 2587 | hddTdlsPeer_t *curr_peer; |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2588 | VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
| 2589 | "%s: Sending teardown to supplicant with reason code %u", |
| 2590 | __func__, pRoamInfo->reasonCode); |
| 2591 | |
| 2592 | #ifdef CONFIG_TDLS_IMPLICIT |
Madan Mohan Koyyalamudi | 9679744 | 2013-10-08 16:04:42 +0530 | [diff] [blame] | 2593 | curr_peer = wlan_hdd_tdls_find_peer(pAdapter, pRoamInfo->peerMac, TRUE); |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 2594 | wlan_hdd_tdls_indicate_teardown(pAdapter, curr_peer, pRoamInfo->reasonCode); |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2595 | #endif |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2596 | status = eHAL_STATUS_SUCCESS ; |
| 2597 | break ; |
| 2598 | } |
| 2599 | case eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND: |
| 2600 | { |
| 2601 | /* 0 staIdx is assigned to AP we dont want to touch that */ |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2602 | for ( staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++ ) |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2603 | { |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2604 | if ((pHddCtx->tdlsConnInfo[staIdx].sessionId == pRoamInfo->sessionId) && |
| 2605 | pHddCtx->tdlsConnInfo[staIdx].staId) |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2606 | { |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2607 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 2608 | ("hdd_tdlsStatusUpdate: staIdx %d " MAC_ADDRESS_STR), |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2609 | pHddCtx->tdlsConnInfo[staIdx].staId, |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 2610 | MAC_ADDR_ARRAY(pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes)); |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2611 | wlan_hdd_tdls_reset_peer(pAdapter, pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes); |
| 2612 | hdd_roamDeregisterTDLSSTA ( pAdapter, pHddCtx->tdlsConnInfo[staIdx].staId ); |
| 2613 | wlan_hdd_tdls_decrement_peer_count(pAdapter); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2614 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2615 | vos_mem_zero(&pHddCtx->tdlsConnInfo[staIdx].peerMac, |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2616 | sizeof(v_MACADDR_t)) ; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 2617 | pHddCtx->tdlsConnInfo[staIdx].staId = 0 ; |
| 2618 | pHddCtx->tdlsConnInfo[staIdx].sessionId = 255; |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2619 | |
| 2620 | status = eHAL_STATUS_SUCCESS ; |
| 2621 | } |
| 2622 | } |
Gopichand Nakkala | 40ab275 | 2013-04-04 20:11:36 +0530 | [diff] [blame] | 2623 | wlan_hdd_tdls_check_bmps(pAdapter); |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2624 | break ; |
| 2625 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2626 | default: |
| 2627 | { |
| 2628 | break ; |
| 2629 | } |
| 2630 | } |
| 2631 | |
| 2632 | return status ; |
| 2633 | } |
| 2634 | #endif |
| 2635 | |
Srinivas Girigowda | 1c3f72e | 2013-12-18 16:07:00 -0800 | [diff] [blame] | 2636 | static void iw_full_power_cbfn (void *pContext, eHalStatus status) |
| 2637 | { |
| 2638 | hdd_adapter_t *pAdapter = (hdd_adapter_t *)pContext; |
| 2639 | hdd_context_t *pHddCtx = NULL; |
| 2640 | int ret; |
| 2641 | |
| 2642 | if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) |
| 2643 | { |
| 2644 | hddLog(VOS_TRACE_LEVEL_ERROR, |
| 2645 | "%s: Bad param, pAdapter [%p]", |
| 2646 | __func__, pAdapter); |
| 2647 | return; |
| 2648 | } |
| 2649 | |
| 2650 | pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
| 2651 | ret = wlan_hdd_validate_context(pHddCtx); |
| 2652 | if (0 != ret) |
| 2653 | { |
| 2654 | hddLog(VOS_TRACE_LEVEL_ERROR, |
| 2655 | "%s: HDD context is not valid (%d)", __func__, ret); |
| 2656 | return; |
| 2657 | } |
| 2658 | |
| 2659 | if (pHddCtx->cfg_ini->fIsBmpsEnabled) |
| 2660 | { |
| 2661 | sme_RequestBmps(WLAN_HDD_GET_HAL_CTX(pAdapter), NULL, NULL); |
| 2662 | } |
| 2663 | } |
| 2664 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2665 | eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U32 roamId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2666 | eRoamCmdStatus roamStatus, eCsrRoamResult roamResult ) |
| 2667 | { |
| 2668 | eHalStatus halStatus = eHAL_STATUS_SUCCESS; |
| 2669 | hdd_adapter_t *pAdapter = (hdd_adapter_t *)pContext; |
Pratik Bhalgat | ec625f7 | 2012-11-22 17:17:38 +0530 | [diff] [blame] | 2670 | hdd_wext_state_t *pWextState = NULL; |
| 2671 | hdd_station_ctx_t *pHddStaCtx = NULL; |
Madan Mohan Koyyalamudi | 2d8cc89 | 2012-09-18 16:24:34 -0700 | [diff] [blame] | 2672 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Amar Singhal | 49fdfd5 | 2013-08-13 13:25:12 -0700 | [diff] [blame] | 2673 | hdd_context_t *pHddCtx = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2674 | |
| 2675 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, |
Jeff Johnson | 0299d0a | 2013-10-30 12:37:43 -0700 | [diff] [blame] | 2676 | "CSR Callback: status= %d result= %d roamID=%d", |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2677 | roamStatus, roamResult, roamId ); |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2678 | |
| 2679 | /*Sanity check*/ |
Pratik Bhalgat | ec625f7 | 2012-11-22 17:17:38 +0530 | [diff] [blame] | 2680 | if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2681 | { |
| 2682 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, |
Pratik Bhalgat | ec625f7 | 2012-11-22 17:17:38 +0530 | [diff] [blame] | 2683 | "invalid adapter or adapter has invalid magic"); |
| 2684 | return eHAL_STATUS_FAILURE; |
| 2685 | } |
| 2686 | |
| 2687 | pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); |
| 2688 | pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 2689 | |
| 2690 | if ((NULL == pWextState) || (NULL == pHddStaCtx)) |
| 2691 | { |
| 2692 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, |
| 2693 | "invalid WEXT state or HDD station context"); |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2694 | return eHAL_STATUS_FAILURE; |
| 2695 | } |
| 2696 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2697 | switch( roamStatus ) |
| 2698 | { |
| 2699 | case eCSR_ROAM_SESSION_OPENED: |
| 2700 | if(pAdapter != NULL) |
| 2701 | { |
| 2702 | set_bit(SME_SESSION_OPENED, &pAdapter->event_flags); |
| 2703 | complete(&pAdapter->session_open_comp_var); |
| 2704 | } |
| 2705 | break; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2706 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2707 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
| 2708 | /* We did pre-auth,then we attempted a 11r or ese reassoc. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2709 | * reassoc failed due to failure, timeout, reject from ap |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2710 | * in any case tell the OS, our carrier is off and mark |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2711 | * interface down */ |
| 2712 | case eCSR_ROAM_FT_REASSOC_FAILED: |
Agarwal Ashish | 971c288 | 2013-10-30 20:11:12 +0530 | [diff] [blame] | 2713 | hddLog(LOGE, FL("Reassoc Failed with roamStatus: %d roamResult: %d SessionID: %d"), |
| 2714 | roamStatus, roamResult, pAdapter->sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2715 | halStatus = hdd_DisConnectHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); |
| 2716 | /* Check if Mcast/Bcast Filters are set, if yes clear the filters here */ |
| 2717 | if ((WLAN_HDD_GET_CTX(pAdapter))->hdd_mcastbcast_filter_set == TRUE) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2718 | (WLAN_HDD_GET_CTX(pAdapter))->hdd_mcastbcast_filter_set = FALSE; |
| 2719 | } |
| 2720 | pHddStaCtx->ft_carrier_on = FALSE; |
Kanchanapally, Vidyullatha | d883c65 | 2014-05-09 21:17:04 +0530 | [diff] [blame] | 2721 | pHddStaCtx->hdd_ReassocScenario = FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2722 | break; |
| 2723 | |
| 2724 | case eCSR_ROAM_FT_START: |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2725 | // When we roam for EsE and 11r, we dont want the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2726 | // OS to be informed that the link is down. So mark |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2727 | // the link ready for ft_start. After this the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2728 | // eCSR_ROAM_SHOULD_ROAM will be received. |
| 2729 | // Where in we will not mark the link down |
| 2730 | // Also we want to stop tx at this point when we will be |
| 2731 | // doing disassoc at this time. This saves 30-60 msec |
Madan Mohan Koyyalamudi | 2d8cc89 | 2012-09-18 16:24:34 -0700 | [diff] [blame] | 2732 | // after reassoc. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2733 | { |
| 2734 | struct net_device *dev = pAdapter->dev; |
| 2735 | netif_tx_disable(dev); |
Mukul Sharma | 84f2725 | 2014-07-14 18:11:42 +0530 | [diff] [blame] | 2736 | #ifdef DEBUG_ROAM_DELAY |
| 2737 | vos_record_roam_event(e_HDD_DISABLE_TX_QUEUE, NULL, 0); |
| 2738 | #endif |
Madan Mohan Koyyalamudi | 2d8cc89 | 2012-09-18 16:24:34 -0700 | [diff] [blame] | 2739 | /* |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 2740 | * Deregister for this STA with TL with the objective to flush |
| 2741 | * all the packets for this STA from wmm_tx_queue. If not done here, |
| 2742 | * we would run into a race condition (CR390567) wherein TX |
| 2743 | * thread would schedule packets from wmm_tx_queue AFTER peer STA has |
| 2744 | * been deleted. And, these packets get assigned with a STA idx of |
| 2745 | * self-sta (since the peer STA has been deleted) and get transmitted |
| 2746 | * on the new channel before the reassoc request. Since there will be |
| 2747 | * no ACK on the new channel, each packet gets retransmitted which |
| 2748 | * takes several seconds before the transmission of reassoc request. |
| 2749 | * This leads to reassoc-timeout and roam failure. |
| 2750 | */ |
Madan Mohan Koyyalamudi | 2d8cc89 | 2012-09-18 16:24:34 -0700 | [diff] [blame] | 2751 | status = hdd_roamDeregisterSTA( pAdapter, pHddStaCtx->conn_info.staId [0] ); |
| 2752 | if ( !VOS_IS_STATUS_SUCCESS(status ) ) |
| 2753 | { |
| 2754 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
| 2755 | FL("hdd_roamDeregisterSTA() failed to for staID %d. Status= %d [0x%x]"), |
| 2756 | pHddStaCtx->conn_info.staId[0], status, status ); |
| 2757 | halStatus = eHAL_STATUS_FAILURE; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 2758 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2759 | } |
| 2760 | pHddStaCtx->ft_carrier_on = TRUE; |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 2761 | pHddStaCtx->hdd_ReassocScenario = VOS_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2762 | break; |
| 2763 | #endif |
| 2764 | |
| 2765 | case eCSR_ROAM_SHOULD_ROAM: |
| 2766 | // Dont need to do anything |
| 2767 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2768 | struct net_device *dev = pAdapter->dev; |
| 2769 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 2770 | // notify apps that we can't pass traffic anymore |
| 2771 | netif_tx_disable(dev); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2772 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2773 | if (pHddStaCtx->ft_carrier_on == FALSE) |
| 2774 | { |
| 2775 | #endif |
| 2776 | netif_carrier_off(dev); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2777 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2778 | } |
| 2779 | #endif |
| 2780 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2781 | #if !(defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2782 | //We should clear all sta register with TL, for now, only one. |
| 2783 | status = hdd_roamDeregisterSTA( pAdapter, pHddStaCtx->conn_info.staId [0] ); |
| 2784 | if ( !VOS_IS_STATUS_SUCCESS(status ) ) |
| 2785 | { |
| 2786 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, |
| 2787 | FL("hdd_roamDeregisterSTA() failed to for staID %d. Status= %d [0x%x]"), |
| 2788 | pHddStaCtx->conn_info.staId[0], status, status ); |
Madan Mohan Koyyalamudi | 2d8cc89 | 2012-09-18 16:24:34 -0700 | [diff] [blame] | 2789 | halStatus = eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2790 | } |
Madan Mohan Koyyalamudi | 2d8cc89 | 2012-09-18 16:24:34 -0700 | [diff] [blame] | 2791 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2792 | } |
| 2793 | break; |
| 2794 | case eCSR_ROAM_LOSTLINK: |
| 2795 | case eCSR_ROAM_DISASSOCIATED: |
| 2796 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2797 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 2798 | "****eCSR_ROAM_DISASSOCIATED****"); |
| 2799 | halStatus = hdd_DisConnectHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); |
| 2800 | /* Check if Mcast/Bcast Filters are set, if yes clear the filters here */ |
Amar Singhal | 49fdfd5 | 2013-08-13 13:25:12 -0700 | [diff] [blame] | 2801 | pHddCtx = WLAN_HDD_GET_CTX(pAdapter); |
| 2802 | if (pHddCtx->hdd_mcastbcast_filter_set == TRUE) |
madan mohan koyyalamudi | bfd9cef | 2013-07-01 18:39:37 +0530 | [diff] [blame] | 2803 | { |
Amar Singhal | 49fdfd5 | 2013-08-13 13:25:12 -0700 | [diff] [blame] | 2804 | hdd_conf_mcastbcast_filter(pHddCtx, FALSE); |
Amar Singhal | f8ba2b8 | 2013-12-02 12:54:38 -0800 | [diff] [blame] | 2805 | |
| 2806 | if (VOS_TRUE == pHddCtx->sus_res_mcastbcast_filter_valid) { |
| 2807 | pHddCtx->configuredMcastBcastFilter = |
| 2808 | pHddCtx->sus_res_mcastbcast_filter; |
| 2809 | pHddCtx->sus_res_mcastbcast_filter_valid = VOS_FALSE; |
| 2810 | } |
madan mohan koyyalamudi | bfd9cef | 2013-07-01 18:39:37 +0530 | [diff] [blame] | 2811 | |
Amar Singhal | d53568e | 2013-09-26 11:03:45 -0700 | [diff] [blame] | 2812 | hddLog(VOS_TRACE_LEVEL_INFO, |
| 2813 | "offload: disassociation happening, restoring configuredMcastBcastFilter"); |
| 2814 | hddLog(VOS_TRACE_LEVEL_INFO,"McastBcastFilter = %d", |
| 2815 | pHddCtx->configuredMcastBcastFilter); |
| 2816 | hddLog(VOS_TRACE_LEVEL_INFO, |
| 2817 | "offload: already called mcastbcast filter"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2818 | (WLAN_HDD_GET_CTX(pAdapter))->hdd_mcastbcast_filter_set = FALSE; |
| 2819 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2820 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
madan mohan koyyalamudi | bfd9cef | 2013-07-01 18:39:37 +0530 | [diff] [blame] | 2821 | /* Call to clear any MC Addr List filter applied after |
| 2822 | * successful connection. |
| 2823 | */ |
| 2824 | wlan_hdd_set_mc_addr_list(pAdapter, FALSE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2825 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2826 | } |
| 2827 | break; |
| 2828 | case eCSR_ROAM_IBSS_LEAVE: |
| 2829 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 2830 | "****eCSR_ROAM_IBSS_LEAVE****"); |
| 2831 | halStatus = hdd_DisConnectHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); |
| 2832 | break; |
| 2833 | case eCSR_ROAM_ASSOCIATION_COMPLETION: |
| 2834 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
| 2835 | "****eCSR_ROAM_ASSOCIATION_COMPLETION****"); |
Abhishek Singh | 57a0bd9 | 2014-06-13 11:17:27 +0530 | [diff] [blame] | 2836 | // To Do - address probable memory leak with WEP encryption upon successful association |
| 2837 | if (eCSR_ROAM_RESULT_ASSOCIATED != roamResult) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2838 | { |
Abhishek Singh | 57a0bd9 | 2014-06-13 11:17:27 +0530 | [diff] [blame] | 2839 | //Clear saved connection information in HDD |
| 2840 | hdd_connRemoveConnectInfo( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2841 | } |
Abhishek Singh | 57a0bd9 | 2014-06-13 11:17:27 +0530 | [diff] [blame] | 2842 | halStatus = hdd_AssociationCompletionHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2843 | |
| 2844 | break; |
| 2845 | case eCSR_ROAM_ASSOCIATION_FAILURE: |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2846 | halStatus = hdd_AssociationCompletionHandler( pAdapter, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2847 | pRoamInfo, roamId, roamStatus, roamResult ); |
| 2848 | break; |
| 2849 | case eCSR_ROAM_IBSS_IND: |
Jeff Johnson | 81c1788 | 2013-05-03 09:53:35 -0700 | [diff] [blame] | 2850 | hdd_RoamIbssIndicationHandler( pAdapter, pRoamInfo, roamId, |
| 2851 | roamStatus, roamResult ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2852 | break; |
| 2853 | |
| 2854 | case eCSR_ROAM_CONNECT_STATUS_UPDATE: |
| 2855 | halStatus = roamRoamConnectStatusUpdateHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2856 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2857 | |
| 2858 | case eCSR_ROAM_MIC_ERROR_IND: |
| 2859 | halStatus = hdd_RoamMicErrorIndicationHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); |
| 2860 | break; |
| 2861 | |
| 2862 | case eCSR_ROAM_SET_KEY_COMPLETE: |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 2863 | { |
| 2864 | hdd_context_t* pHddCtx = (hdd_context_t*)pAdapter->pHddCtx; |
| 2865 | |
| 2866 | if((pHddCtx) && |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 2867 | (VOS_TRUE == pHddStaCtx->hdd_ReassocScenario) && |
| 2868 | (TRUE == pHddCtx->hdd_wlan_suspended) && |
| 2869 | (eCSR_ROAM_RESULT_NONE == roamResult)) |
| 2870 | { |
Srinivas Girigowda | eb03ee3 | 2013-07-16 11:48:41 -0700 | [diff] [blame] | 2871 | /* Send DTIM period to the FW; only if the wlan is already |
| 2872 | in suspend. This is the case with roaming (reassoc), |
| 2873 | DELETE_BSS_REQ zeroes out Modulated/Dynamic DTIM sent in |
| 2874 | previous suspend_wlan. Sending SET_POWER_PARAMS_REQ |
| 2875 | before the ENTER_BMPS_REQ ensures Listen Interval is |
| 2876 | regained back to LI * Modulated DTIM */ |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 2877 | hdd_set_pwrparams(pHddCtx); |
| 2878 | pHddStaCtx->hdd_ReassocScenario = VOS_FALSE; |
| 2879 | |
| 2880 | /* At this point, device should not be in BMPS; |
Srinivas Girigowda | eb03ee3 | 2013-07-16 11:48:41 -0700 | [diff] [blame] | 2881 | if due to unexpected scenario, if we are in BMPS, |
| 2882 | then trigger Exit and Enter BMPS to take DTIM period |
| 2883 | effective */ |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 2884 | if (BMPS == pmcGetPmcState(pHddCtx->hHal)) |
| 2885 | { |
| 2886 | hddLog( LOGE, FL("Not expected: device is already in BMPS mode, Exit & Enter BMPS again!")); |
| 2887 | |
Srinivas Girigowda | 1c3f72e | 2013-12-18 16:07:00 -0800 | [diff] [blame] | 2888 | sme_RequestFullPower(WLAN_HDD_GET_HAL_CTX(pAdapter), |
| 2889 | iw_full_power_cbfn, pAdapter, |
| 2890 | eSME_FULL_PWR_NEEDED_BY_HDD); |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 2891 | } |
| 2892 | } |
| 2893 | halStatus = hdd_RoamSetKeyCompleteHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); |
Kanchanapally, Vidyullatha | d883c65 | 2014-05-09 21:17:04 +0530 | [diff] [blame] | 2894 | pHddStaCtx->hdd_ReassocScenario = FALSE; |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 2895 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2896 | break; |
| 2897 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2898 | case eCSR_ROAM_FT_RESPONSE: |
| 2899 | hdd_SendFTEvent(pAdapter); |
| 2900 | break; |
| 2901 | #endif |
Madan Mohan Koyyalamudi | 1b4afb0 | 2012-10-22 15:25:16 -0700 | [diff] [blame] | 2902 | #if defined(FEATURE_WLAN_LFR) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2903 | case eCSR_ROAM_PMK_NOTIFY: |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2904 | if (eCSR_AUTH_TYPE_RSN == pHddStaCtx->conn_info.authType) |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2905 | { |
| 2906 | /* Notify the supplicant of a new candidate */ |
| 2907 | halStatus = wlan_hdd_cfg80211_pmksa_candidate_notify(pAdapter, pRoamInfo, 1, false); |
| 2908 | } |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2909 | break; |
| 2910 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2911 | |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 2912 | #ifdef FEATURE_WLAN_LFR_METRICS |
| 2913 | case eCSR_ROAM_PREAUTH_INIT_NOTIFY: |
| 2914 | /* This event is to notify pre-auth initiation */ |
| 2915 | if (VOS_STATUS_SUCCESS != |
| 2916 | wlan_hdd_cfg80211_roam_metrics_preauth(pAdapter, pRoamInfo)) |
| 2917 | { |
| 2918 | halStatus = eHAL_STATUS_FAILURE; |
| 2919 | } |
| 2920 | break; |
| 2921 | case eCSR_ROAM_PREAUTH_STATUS_SUCCESS: |
| 2922 | /* This event will notify pre-auth completion in case of success */ |
| 2923 | if (VOS_STATUS_SUCCESS != |
| 2924 | wlan_hdd_cfg80211_roam_metrics_preauth_status(pAdapter, |
| 2925 | pRoamInfo, 1)) |
| 2926 | { |
| 2927 | halStatus = eHAL_STATUS_FAILURE; |
| 2928 | } |
| 2929 | break; |
| 2930 | case eCSR_ROAM_PREAUTH_STATUS_FAILURE: |
| 2931 | /* This event will notify pre-auth completion in case of failure. */ |
| 2932 | if (VOS_STATUS_SUCCESS != |
| 2933 | wlan_hdd_cfg80211_roam_metrics_preauth_status(pAdapter, |
| 2934 | pRoamInfo, 0)) |
| 2935 | { |
| 2936 | halStatus = eHAL_STATUS_FAILURE; |
| 2937 | } |
| 2938 | break; |
| 2939 | case eCSR_ROAM_HANDOVER_SUCCESS: |
| 2940 | /* This event is to notify handover success. |
| 2941 | It will be only invoked on success */ |
| 2942 | if (VOS_STATUS_SUCCESS != |
| 2943 | wlan_hdd_cfg80211_roam_metrics_handover(pAdapter, pRoamInfo)) |
| 2944 | { |
| 2945 | halStatus = eHAL_STATUS_FAILURE; |
| 2946 | } |
| 2947 | break; |
| 2948 | #endif |
| 2949 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2950 | case eCSR_ROAM_INDICATE_MGMT_FRAME: |
| 2951 | hdd_indicateMgmtFrame( pAdapter, |
| 2952 | pRoamInfo->nFrameLength, |
| 2953 | pRoamInfo->pbFrames, |
| 2954 | pRoamInfo->frameType, |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 2955 | pRoamInfo->rxChan, |
| 2956 | pRoamInfo->rxRssi ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2957 | break; |
| 2958 | case eCSR_ROAM_REMAIN_CHAN_READY: |
| 2959 | hdd_remainChanReadyHandler( pAdapter ); |
| 2960 | break; |
| 2961 | case eCSR_ROAM_SEND_ACTION_CNF: |
| 2962 | hdd_sendActionCnf( pAdapter, |
| 2963 | (roamResult == eCSR_ROAM_RESULT_NONE) ? TRUE : FALSE ); |
| 2964 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2965 | #ifdef FEATURE_WLAN_TDLS |
Ng Chilam | fc41646 | 2012-12-27 17:26:52 -0800 | [diff] [blame] | 2966 | case eCSR_ROAM_TDLS_STATUS_UPDATE: |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2967 | halStatus = hdd_RoamTdlsStatusUpdateHandler( pAdapter, pRoamInfo, |
Ng Chilam | fc41646 | 2012-12-27 17:26:52 -0800 | [diff] [blame] | 2968 | roamId, roamStatus, roamResult ); |
| 2969 | break ; |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2970 | case eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND: |
| 2971 | wlan_hdd_tdls_mgmt_completion_callback(pAdapter, pRoamInfo->reasonCode); |
| 2972 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2973 | #endif |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2974 | #ifdef WLAN_FEATURE_11W |
| 2975 | case eCSR_ROAM_UNPROT_MGMT_FRAME_IND: |
| 2976 | hdd_indicateUnprotMgmtFrame(pAdapter, pRoamInfo->nFrameLength, |
| 2977 | pRoamInfo->pbFrames, |
| 2978 | pRoamInfo->frameType); |
| 2979 | break; |
| 2980 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2981 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2982 | case eCSR_ROAM_TSM_IE_IND: |
| 2983 | hdd_indicateTsmIe(pAdapter, pRoamInfo->tsmIe.tsid, |
| 2984 | pRoamInfo->tsmIe.state, pRoamInfo->tsmIe.msmt_interval); |
| 2985 | break; |
| 2986 | |
| 2987 | case eCSR_ROAM_CCKM_PREAUTH_NOTIFY: |
| 2988 | { |
| 2989 | if (eCSR_AUTH_TYPE_CCKM_WPA == pHddStaCtx->conn_info.authType || |
| 2990 | eCSR_AUTH_TYPE_CCKM_RSN == pHddStaCtx->conn_info.authType) |
| 2991 | { |
| 2992 | hdd_indicateCckmPreAuth(pAdapter, pRoamInfo); |
| 2993 | } |
| 2994 | break; |
| 2995 | } |
| 2996 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2997 | case eCSR_ROAM_ESE_ADJ_AP_REPORT_IND: |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2998 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2999 | hdd_indicateEseAdjApRepInd(pAdapter, pRoamInfo); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3000 | break; |
| 3001 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3002 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3003 | case eCSR_ROAM_ESE_BCN_REPORT_IND: |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3004 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3005 | hdd_indicateEseBcnReportInd(pAdapter, pRoamInfo); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3006 | break; |
| 3007 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3008 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3009 | default: |
| 3010 | break; |
| 3011 | } |
| 3012 | return( halStatus ); |
| 3013 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3014 | eCsrAuthType hdd_TranslateRSNToCsrAuthType( u_int8_t auth_suite[4]) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3015 | { |
| 3016 | eCsrAuthType auth_type; |
| 3017 | // is the auth type supported? |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3018 | if ( memcmp(auth_suite , ccpRSNOui01, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3019 | { |
| 3020 | auth_type = eCSR_AUTH_TYPE_RSN; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3021 | } else |
| 3022 | if (memcmp(auth_suite , ccpRSNOui02, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3023 | { |
| 3024 | auth_type = eCSR_AUTH_TYPE_RSN_PSK; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3025 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3026 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3027 | if (memcmp(auth_suite , ccpRSNOui04, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3028 | { |
| 3029 | // Check for 11r FT Authentication with PSK |
| 3030 | auth_type = eCSR_AUTH_TYPE_FT_RSN_PSK; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3031 | } else |
| 3032 | if (memcmp(auth_suite , ccpRSNOui03, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3033 | { |
| 3034 | // Check for 11R FT Authentication with 802.1X |
| 3035 | auth_type = eCSR_AUTH_TYPE_FT_RSN; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3036 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3037 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3038 | #ifdef FEATURE_WLAN_ESE |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3039 | if (memcmp(auth_suite , ccpRSNOui06, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3040 | { |
| 3041 | auth_type = eCSR_AUTH_TYPE_CCKM_RSN; |
| 3042 | } else |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3043 | #endif /* FEATURE_WLAN_ESE */ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3044 | #ifdef WLAN_FEATURE_11W |
| 3045 | if (memcmp(auth_suite , ccpRSNOui07, 4) == 0) |
| 3046 | { |
| 3047 | auth_type = eCSR_AUTH_TYPE_RSN_PSK_SHA256; |
| 3048 | } else |
| 3049 | #endif |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3050 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3051 | auth_type = eCSR_AUTH_TYPE_UNKNOWN; |
| 3052 | } |
| 3053 | return auth_type; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3054 | } |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 3055 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3056 | eCsrAuthType |
| 3057 | hdd_TranslateWPAToCsrAuthType(u_int8_t auth_suite[4]) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3058 | { |
| 3059 | eCsrAuthType auth_type; |
| 3060 | // is the auth type supported? |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3061 | if ( memcmp(auth_suite , ccpWpaOui01, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3062 | { |
| 3063 | auth_type = eCSR_AUTH_TYPE_WPA; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3064 | } else |
| 3065 | if (memcmp(auth_suite , ccpWpaOui02, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3066 | { |
| 3067 | auth_type = eCSR_AUTH_TYPE_WPA_PSK; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3068 | } else |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3069 | #ifdef FEATURE_WLAN_ESE |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3070 | if (memcmp(auth_suite , ccpWpaOui06, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3071 | { |
| 3072 | auth_type = eCSR_AUTH_TYPE_CCKM_WPA; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3073 | } else |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3074 | #endif /* FEATURE_WLAN_ESE */ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3075 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3076 | auth_type = eCSR_AUTH_TYPE_UNKNOWN; |
| 3077 | } |
| 3078 | hddLog(LOG1, FL("auth_type: %d"), auth_type); |
| 3079 | return auth_type; |
| 3080 | } |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 3081 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3082 | eCsrEncryptionType |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3083 | hdd_TranslateRSNToCsrEncryptionType(u_int8_t cipher_suite[4]) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3084 | { |
| 3085 | eCsrEncryptionType cipher_type; |
| 3086 | // is the cipher type supported? |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3087 | if ( memcmp(cipher_suite , ccpRSNOui04, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3088 | { |
| 3089 | cipher_type = eCSR_ENCRYPT_TYPE_AES; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3090 | } |
| 3091 | else if (memcmp(cipher_suite , ccpRSNOui02, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3092 | { |
| 3093 | cipher_type = eCSR_ENCRYPT_TYPE_TKIP; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3094 | } |
| 3095 | else if (memcmp(cipher_suite , ccpRSNOui00, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3096 | { |
| 3097 | cipher_type = eCSR_ENCRYPT_TYPE_NONE; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3098 | } |
| 3099 | else if (memcmp(cipher_suite , ccpRSNOui01, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3100 | { |
| 3101 | cipher_type = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3102 | } |
| 3103 | else if (memcmp(cipher_suite , ccpRSNOui05, 4) == 0) |
| 3104 | { |
| 3105 | cipher_type = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
| 3106 | } |
| 3107 | else |
| 3108 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3109 | cipher_type = eCSR_ENCRYPT_TYPE_FAILED; |
| 3110 | } |
| 3111 | hddLog(LOG1, FL("cipher_type: %d"), cipher_type); |
| 3112 | return cipher_type; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3113 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3114 | /* To find if the MAC address is NULL */ |
| 3115 | static tANI_U8 hdd_IsMACAddrNULL (tANI_U8 *macAddr, tANI_U8 length) |
| 3116 | { |
| 3117 | int i; |
| 3118 | for (i = 0; i < length; i++) |
| 3119 | { |
| 3120 | if (0x00 != (macAddr[i])) |
| 3121 | { |
| 3122 | return FALSE; |
| 3123 | } |
| 3124 | } |
| 3125 | return TRUE; |
| 3126 | } /****** end hdd_IsMACAddrNULL() ******/ |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 3127 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3128 | eCsrEncryptionType |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3129 | hdd_TranslateWPAToCsrEncryptionType(u_int8_t cipher_suite[4]) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3130 | { |
| 3131 | eCsrEncryptionType cipher_type; |
| 3132 | // is the cipher type supported? |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3133 | if ( memcmp(cipher_suite , ccpWpaOui04, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3134 | { |
| 3135 | cipher_type = eCSR_ENCRYPT_TYPE_AES; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3136 | } else |
| 3137 | if (memcmp(cipher_suite , ccpWpaOui02, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3138 | { |
| 3139 | cipher_type = eCSR_ENCRYPT_TYPE_TKIP; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3140 | } else |
| 3141 | if (memcmp(cipher_suite , ccpWpaOui00, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3142 | { |
| 3143 | cipher_type = eCSR_ENCRYPT_TYPE_NONE; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3144 | } else |
| 3145 | if (memcmp(cipher_suite , ccpWpaOui01, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3146 | { |
| 3147 | cipher_type = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3148 | } else |
| 3149 | if (memcmp(cipher_suite , ccpWpaOui05, 4) == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3150 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3151 | cipher_type = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
| 3152 | } else |
| 3153 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3154 | cipher_type = eCSR_ENCRYPT_TYPE_FAILED; |
| 3155 | } |
| 3156 | hddLog(LOG1, FL("cipher_type: %d"), cipher_type); |
| 3157 | return cipher_type; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3158 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3159 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3160 | static tANI_S32 hdd_ProcessGENIE(hdd_adapter_t *pAdapter, |
| 3161 | struct ether_addr *pBssid, |
| 3162 | eCsrEncryptionType *pEncryptType, |
| 3163 | eCsrEncryptionType *mcEncryptType, |
| 3164 | eCsrAuthType *pAuthType, |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3165 | #ifdef WLAN_FEATURE_11W |
| 3166 | u_int8_t *pMfpRequired, |
| 3167 | u_int8_t *pMfpCapable, |
| 3168 | #endif |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3169 | u_int16_t gen_ie_len, |
| 3170 | u_int8_t *gen_ie) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3171 | { |
| 3172 | tHalHandle halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3173 | eHalStatus result; |
| 3174 | tDot11fIERSN dot11RSNIE; |
| 3175 | tDot11fIEWPA dot11WPAIE; |
| 3176 | tANI_U32 i; |
| 3177 | tANI_U8 *pRsnIe; |
| 3178 | tANI_U16 RSNIeLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3179 | tPmkidCacheInfo PMKIDCache[4]; // Local transfer memory |
Dhanashri Atre | 51981c6 | 2013-06-13 11:47:57 -0700 | [diff] [blame] | 3180 | v_BOOL_t updatePMKCache = FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3181 | |
| 3182 | /* Clear struct of tDot11fIERSN and tDot11fIEWPA specifically setting present |
| 3183 | flag to 0 */ |
| 3184 | memset( &dot11WPAIE, 0 , sizeof(tDot11fIEWPA) ); |
| 3185 | memset( &dot11RSNIE, 0 , sizeof(tDot11fIERSN) ); |
| 3186 | |
| 3187 | // Validity checks |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3188 | if ((gen_ie_len < VOS_MIN(DOT11F_IE_RSN_MIN_LEN, DOT11F_IE_WPA_MIN_LEN)) || |
| 3189 | (gen_ie_len > VOS_MAX(DOT11F_IE_RSN_MAX_LEN, DOT11F_IE_WPA_MAX_LEN)) ) |
Arun Kumar Khandavalli | 138f3c1 | 2013-12-13 16:24:33 +0530 | [diff] [blame] | 3190 | { |
| 3191 | hddLog(LOGE, "%s: Invalid DOT11F IE Length passed :%d", |
| 3192 | __func__, gen_ie_len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3193 | return -EINVAL; |
Arun Kumar Khandavalli | 138f3c1 | 2013-12-13 16:24:33 +0530 | [diff] [blame] | 3194 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3195 | // Type check |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3196 | if ( gen_ie[0] == DOT11F_EID_RSN) |
| 3197 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3198 | // Validity checks |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3199 | if ((gen_ie_len < DOT11F_IE_RSN_MIN_LEN ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3200 | (gen_ie_len > DOT11F_IE_RSN_MAX_LEN) ) |
| 3201 | { |
Arun Kumar Khandavalli | 138f3c1 | 2013-12-13 16:24:33 +0530 | [diff] [blame] | 3202 | hddLog(LOGE, "%s: Invalid DOT11F RSN IE length :%d\n", |
| 3203 | __func__, gen_ie_len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3204 | return -EINVAL; |
| 3205 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3206 | // Skip past the EID byte and length byte |
| 3207 | pRsnIe = gen_ie + 2; |
| 3208 | RSNIeLen = gen_ie_len - 2; |
| 3209 | // Unpack the RSN IE |
| 3210 | dot11fUnpackIeRSN((tpAniSirGlobal) halHandle, |
| 3211 | pRsnIe, |
| 3212 | RSNIeLen, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3213 | &dot11RSNIE); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3214 | // Copy out the encryption and authentication types |
| 3215 | hddLog(LOG1, FL("%s: pairwise cipher suite count: %d"), |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3216 | __func__, dot11RSNIE.pwise_cipher_suite_count ); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3217 | hddLog(LOG1, FL("%s: authentication suite count: %d"), |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3218 | __func__, dot11RSNIE.akm_suite_count); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3219 | /*Here we have followed the apple base code, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3220 | but probably I suspect we can do something different*/ |
| 3221 | //dot11RSNIE.akm_suite_count |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3222 | // Just translate the FIRST one |
| 3223 | *pAuthType = hdd_TranslateRSNToCsrAuthType(dot11RSNIE.akm_suites[0]); |
| 3224 | //dot11RSNIE.pwise_cipher_suite_count |
| 3225 | *pEncryptType = hdd_TranslateRSNToCsrEncryptionType(dot11RSNIE.pwise_cipher_suites[0]); |
| 3226 | //dot11RSNIE.gp_cipher_suite_count |
| 3227 | *mcEncryptType = hdd_TranslateRSNToCsrEncryptionType(dot11RSNIE.gp_cipher_suite); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3228 | #ifdef WLAN_FEATURE_11W |
| 3229 | *pMfpRequired = (dot11RSNIE.RSN_Cap[0] >> 6) & 0x1 ; |
| 3230 | *pMfpCapable = (dot11RSNIE.RSN_Cap[0] >> 7) & 0x1 ; |
| 3231 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3232 | // Set the PMKSA ID Cache for this interface |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3233 | for (i=0; i<dot11RSNIE.pmkid_count; i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3234 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3235 | if ( pBssid == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3236 | { |
Arun Kumar Khandavalli | 138f3c1 | 2013-12-13 16:24:33 +0530 | [diff] [blame] | 3237 | hddLog(LOGE, "%s: pBssid passed is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3238 | break; |
| 3239 | } |
Dhanashri Atre | 51981c6 | 2013-06-13 11:47:57 -0700 | [diff] [blame] | 3240 | if ( hdd_IsMACAddrNULL( (u_char *) pBssid->ether_addr_octet , 6)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3241 | { |
Arun Kumar Khandavalli | 138f3c1 | 2013-12-13 16:24:33 +0530 | [diff] [blame] | 3242 | hddLog(LOGE, "%s: Invalid MAC adrr", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3243 | break; |
| 3244 | } |
Dhanashri Atre | 51981c6 | 2013-06-13 11:47:57 -0700 | [diff] [blame] | 3245 | updatePMKCache = TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3246 | // For right now, I assume setASSOCIATE() has passed in the bssid. |
| 3247 | vos_mem_copy(PMKIDCache[i].BSSID, |
| 3248 | pBssid, ETHER_ADDR_LEN); |
| 3249 | vos_mem_copy(PMKIDCache[i].PMKID, |
| 3250 | dot11RSNIE.pmkid[i], |
| 3251 | CSR_RSN_PMKID_SIZE); |
| 3252 | } |
Dhanashri Atre | 51981c6 | 2013-06-13 11:47:57 -0700 | [diff] [blame] | 3253 | |
| 3254 | if (updatePMKCache) |
| 3255 | { |
| 3256 | // Calling csrRoamSetPMKIDCache to configure the PMKIDs into the cache |
Jeff Johnson | 0299d0a | 2013-10-30 12:37:43 -0700 | [diff] [blame] | 3257 | hddLog(LOG1, FL("%s: Calling csrRoamSetPMKIDCache with cache entry %d."), |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3258 | __func__, i ); |
Dhanashri Atre | 51981c6 | 2013-06-13 11:47:57 -0700 | [diff] [blame] | 3259 | // Finally set the PMKSA ID Cache in CSR |
| 3260 | result = sme_RoamSetPMKIDCache(halHandle,pAdapter->sessionId, |
| 3261 | PMKIDCache, |
| 3262 | dot11RSNIE.pmkid_count ); |
| 3263 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3264 | } |
| 3265 | else if (gen_ie[0] == DOT11F_EID_WPA) |
| 3266 | { |
| 3267 | // Validity checks |
| 3268 | if ((gen_ie_len < DOT11F_IE_WPA_MIN_LEN ) || |
| 3269 | (gen_ie_len > DOT11F_IE_WPA_MAX_LEN)) |
| 3270 | { |
Arun Kumar Khandavalli | 138f3c1 | 2013-12-13 16:24:33 +0530 | [diff] [blame] | 3271 | hddLog(LOGE, "%s: Invalid DOT11F WPA IE length :%d\n", |
| 3272 | __func__, gen_ie_len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3273 | return -EINVAL; |
| 3274 | } |
| 3275 | // Skip past the EID byte and length byte - and four byte WiFi OUI |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3276 | pRsnIe = gen_ie + 2 + 4; |
| 3277 | RSNIeLen = gen_ie_len - (2 + 4); |
| 3278 | // Unpack the WPA IE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3279 | dot11fUnpackIeWPA((tpAniSirGlobal) halHandle, |
| 3280 | pRsnIe, |
| 3281 | RSNIeLen, |
| 3282 | &dot11WPAIE); |
| 3283 | // Copy out the encryption and authentication types |
| 3284 | hddLog(LOG1, FL("%s: WPA unicast cipher suite count: %d"), |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3285 | __func__, dot11WPAIE.unicast_cipher_count ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3286 | hddLog(LOG1, FL("%s: WPA authentication suite count: %d"), |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3287 | __func__, dot11WPAIE.auth_suite_count); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3288 | //dot11WPAIE.auth_suite_count |
| 3289 | // Just translate the FIRST one |
| 3290 | *pAuthType = hdd_TranslateWPAToCsrAuthType(dot11WPAIE.auth_suites[0]); |
| 3291 | //dot11WPAIE.unicast_cipher_count |
| 3292 | *pEncryptType = hdd_TranslateWPAToCsrEncryptionType(dot11WPAIE.unicast_ciphers[0]); |
| 3293 | //dot11WPAIE.unicast_cipher_count |
| 3294 | *mcEncryptType = hdd_TranslateWPAToCsrEncryptionType(dot11WPAIE.multicast_cipher); |
| 3295 | } |
| 3296 | else |
| 3297 | { |
| 3298 | hddLog(LOGW, FL("gen_ie[0]: %d"), gen_ie[0]); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3299 | return -EINVAL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3300 | } |
| 3301 | return 0; |
| 3302 | } |
| 3303 | int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType) |
| 3304 | { |
| 3305 | hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); |
| 3306 | v_U32_t status = 0; |
| 3307 | eCsrEncryptionType RSNEncryptType; |
| 3308 | eCsrEncryptionType mcRSNEncryptType; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3309 | #ifdef WLAN_FEATURE_11W |
| 3310 | u_int8_t RSNMfpRequired; |
| 3311 | u_int8_t RSNMfpCapable; |
| 3312 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3313 | struct ether_addr bSsid; // MAC address of assoc peer |
| 3314 | // MAC address of assoc peer |
| 3315 | // But, this routine is only called when we are NOT associated. |
| 3316 | vos_mem_copy(bSsid.ether_addr_octet, |
| 3317 | pWextState->roamProfile.BSSIDs.bssid, |
| 3318 | sizeof(bSsid.ether_addr_octet)); |
| 3319 | if (pWextState->WPARSNIE[0] == DOT11F_EID_RSN || pWextState->WPARSNIE[0] == DOT11F_EID_WPA) |
| 3320 | { |
| 3321 | //continue |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3322 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3323 | else |
| 3324 | { |
| 3325 | return 0; |
| 3326 | } |
| 3327 | // The actual processing may eventually be more extensive than this. |
| 3328 | // Right now, just consume any PMKIDs that are sent in by the app. |
| 3329 | status = hdd_ProcessGENIE(pAdapter, |
| 3330 | &bSsid, // MAC address of assoc peer |
| 3331 | &RSNEncryptType, |
| 3332 | &mcRSNEncryptType, |
| 3333 | RSNAuthType, |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3334 | #ifdef WLAN_FEATURE_11W |
| 3335 | &RSNMfpRequired, |
| 3336 | &RSNMfpCapable, |
| 3337 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3338 | pWextState->WPARSNIE[1]+2, |
| 3339 | pWextState->WPARSNIE); |
| 3340 | if (status == 0) |
| 3341 | { |
| 3342 | // Now copy over all the security attributes you have parsed out |
| 3343 | pWextState->roamProfile.EncryptionType.numEntries = 1; |
| 3344 | pWextState->roamProfile.mcEncryptionType.numEntries = 1; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3345 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3346 | pWextState->roamProfile.EncryptionType.encryptionType[0] = RSNEncryptType; // Use the cipher type in the RSN IE |
| 3347 | pWextState->roamProfile.mcEncryptionType.encryptionType[0] = mcRSNEncryptType; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3348 | |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 3349 | if ( (WLAN_HDD_IBSS == pAdapter->device_mode) && |
| 3350 | ((eCSR_ENCRYPT_TYPE_AES == mcRSNEncryptType) || |
| 3351 | (eCSR_ENCRYPT_TYPE_TKIP == mcRSNEncryptType))) |
| 3352 | { |
| 3353 | /*For wpa none supplicant sends the WPA IE with unicast cipher as |
| 3354 | eCSR_ENCRYPT_TYPE_NONE ,where as the multicast cipher as |
| 3355 | either AES/TKIP based on group cipher configuration |
| 3356 | mentioned in the wpa_supplicant.conf.*/ |
| 3357 | |
| 3358 | /*Set the unicast cipher same as multicast cipher*/ |
| 3359 | pWextState->roamProfile.EncryptionType.encryptionType[0] |
| 3360 | = mcRSNEncryptType; |
| 3361 | } |
| 3362 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3363 | #ifdef WLAN_FEATURE_11W |
| 3364 | pWextState->roamProfile.MFPRequired = RSNMfpRequired; |
| 3365 | pWextState->roamProfile.MFPCapable = RSNMfpCapable; |
| 3366 | #endif |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3367 | hddLog( LOG1, "%s: CSR AuthType = %d, EncryptionType = %d mcEncryptionType = %d", __func__, *RSNAuthType, RSNEncryptType, mcRSNEncryptType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3368 | } |
| 3369 | return 0; |
| 3370 | } |
| 3371 | int hdd_set_csr_auth_type ( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType) |
| 3372 | { |
| 3373 | hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); |
| 3374 | tCsrRoamProfile* pRoamProfile = &(pWextState->roamProfile); |
| 3375 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 3376 | ENTER(); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3377 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3378 | pRoamProfile->AuthType.numEntries = 1; |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 3379 | hddLog( LOG1, "%s: pHddStaCtx->conn_info.authType = %d", __func__, pHddStaCtx->conn_info.authType); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3380 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3381 | switch( pHddStaCtx->conn_info.authType) |
| 3382 | { |
| 3383 | case eCSR_AUTH_TYPE_OPEN_SYSTEM: |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3384 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3385 | case eCSR_AUTH_TYPE_CCKM_WPA: |
| 3386 | case eCSR_AUTH_TYPE_CCKM_RSN: |
| 3387 | #endif |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3388 | if (pWextState->wpaVersion & IW_AUTH_WPA_VERSION_DISABLED) { |
| 3389 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3390 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_OPEN_SYSTEM ; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3391 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3392 | if (pWextState->wpaVersion & IW_AUTH_WPA_VERSION_WPA) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3393 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3394 | #ifdef FEATURE_WLAN_ESE |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3395 | if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_WPA) && |
| 3396 | ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) |
| 3397 | == IW_AUTH_KEY_MGMT_802_1X)) { |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 3398 | hddLog( LOG1, "%s: set authType to CCKM WPA. AKM also 802.1X.", __func__); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3399 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_CCKM_WPA; |
| 3400 | } else |
| 3401 | if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_WPA)) { |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 3402 | hddLog( LOG1, "%s: Last chance to set authType to CCKM WPA.", __func__); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3403 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_CCKM_WPA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3404 | } else |
| 3405 | #endif |
| 3406 | if((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) |
| 3407 | == IW_AUTH_KEY_MGMT_802_1X) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3408 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_WPA; |
| 3409 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3410 | if ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_PSK) |
| 3411 | == IW_AUTH_KEY_MGMT_PSK) { |
| 3412 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_WPA_PSK; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3413 | } else { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3414 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_WPA_NONE; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3415 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3416 | } |
| 3417 | if (pWextState->wpaVersion & IW_AUTH_WPA_VERSION_WPA2) { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3418 | #ifdef FEATURE_WLAN_ESE |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3419 | if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_RSN) && |
| 3420 | ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) |
| 3421 | == IW_AUTH_KEY_MGMT_802_1X)) { |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 3422 | hddLog( LOG1, "%s: set authType to CCKM RSN. AKM also 802.1X.", __func__); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3423 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_CCKM_RSN; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3424 | } else |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3425 | if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_RSN)) { |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 3426 | hddLog( LOG1, "%s: Last chance to set authType to CCKM RSN.", __func__); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3427 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_CCKM_RSN; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3428 | } else |
| 3429 | #endif |
| 3430 | |
| 3431 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3432 | if ((RSNAuthType == eCSR_AUTH_TYPE_FT_RSN) && |
| 3433 | ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3434 | == IW_AUTH_KEY_MGMT_802_1X)) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3435 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_FT_RSN; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3436 | }else |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3437 | if ((RSNAuthType == eCSR_AUTH_TYPE_FT_RSN_PSK) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3438 | ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_PSK) |
| 3439 | == IW_AUTH_KEY_MGMT_PSK)) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3440 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_FT_RSN_PSK; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3441 | } else |
| 3442 | #endif |
| 3443 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3444 | #ifdef WLAN_FEATURE_11W |
| 3445 | if (RSNAuthType == eCSR_AUTH_TYPE_RSN_PSK_SHA256) { |
| 3446 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_RSN_PSK_SHA256; |
| 3447 | } else |
| 3448 | #endif |
| 3449 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3450 | if( (pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3451 | == IW_AUTH_KEY_MGMT_802_1X) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3452 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_RSN; |
| 3453 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3454 | if ( (pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_PSK) |
| 3455 | == IW_AUTH_KEY_MGMT_PSK) { |
| 3456 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_RSN_PSK; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3457 | } else { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3458 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_UNKNOWN; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3459 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3460 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3461 | break; |
| 3462 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3463 | case eCSR_AUTH_TYPE_SHARED_KEY: |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3464 | |
| 3465 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_SHARED_KEY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3466 | break; |
| 3467 | default: |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3468 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3469 | #ifdef FEATURE_WLAN_ESE |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 3470 | hddLog( LOG1, "%s: In default, unknown auth type.", __func__); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3471 | #endif /* FEATURE_WLAN_ESE */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3472 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_UNKNOWN; |
| 3473 | break; |
| 3474 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3475 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3476 | hddLog( LOG1, "%s Set roam Authtype to %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3477 | __func__, pWextState->roamProfile.AuthType.authType[0]); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3478 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3479 | EXIT(); |
| 3480 | return 0; |
| 3481 | } |
| 3482 | |
| 3483 | /**--------------------------------------------------------------------------- |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3484 | |
| 3485 | \brief iw_set_essid() - |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3486 | This function sets the ssid received from wpa_supplicant |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3487 | to the CSR roam profile. |
| 3488 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3489 | \param - dev - Pointer to the net device. |
| 3490 | - info - Pointer to the iw_request_info. |
| 3491 | - wrqu - Pointer to the iwreq_data. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3492 | - extra - Pointer to the data. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3493 | \return - 0 for success, non zero for failure |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3494 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3495 | --------------------------------------------------------------------------*/ |
| 3496 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3497 | int iw_set_essid(struct net_device *dev, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3498 | struct iw_request_info *info, |
| 3499 | union iwreq_data *wrqu, char *extra) |
| 3500 | { |
| 3501 | v_U32_t status = 0; |
| 3502 | hdd_wext_state_t *pWextState; |
| 3503 | hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 3504 | v_U32_t roamId; |
| 3505 | tCsrRoamProfile *pRoamProfile; |
| 3506 | eMib_dot11DesiredBssType connectedBssType; |
| 3507 | eCsrAuthType RSNAuthType; |
| 3508 | tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); |
| 3509 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3510 | |
| 3511 | pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); |
| 3512 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3513 | ENTER(); |
| 3514 | |
| 3515 | if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) |
| 3516 | { |
Agarwal Ashish | 971c288 | 2013-10-30 20:11:12 +0530 | [diff] [blame] | 3517 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3518 | "%s:LOGP in Progress. Ignore!!!",__func__); |
| 3519 | return 0; |
| 3520 | } |
| 3521 | |
| 3522 | if(pWextState->mTKIPCounterMeasures == TKIP_COUNTER_MEASURE_STARTED) { |
| 3523 | hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s :Counter measure is in progress", __func__); |
| 3524 | return -EBUSY; |
| 3525 | } |
| 3526 | if( SIR_MAC_MAX_SSID_LENGTH < wrqu->essid.length ) |
| 3527 | return -EINVAL; |
| 3528 | pRoamProfile = &pWextState->roamProfile; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3529 | if (pRoamProfile) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3530 | { |
| 3531 | if ( hdd_connGetConnectedBssType( pHddStaCtx, &connectedBssType ) || |
| 3532 | ( eMib_dot11DesiredBssType_independent == pHddStaCtx->conn_info.connDot11DesiredBssType )) |
| 3533 | { |
| 3534 | VOS_STATUS vosStatus; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3535 | // need to issue a disconnect to CSR. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3536 | INIT_COMPLETION(pAdapter->disconnect_comp_var); |
| 3537 | vosStatus = sme_RoamDisconnect( hHal, pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED ); |
| 3538 | |
| 3539 | if(VOS_STATUS_SUCCESS == vosStatus) |
| 3540 | wait_for_completion_interruptible_timeout(&pAdapter->disconnect_comp_var, |
| 3541 | msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); |
| 3542 | } |
| 3543 | } |
| 3544 | /** wpa_supplicant 0.8.x, wext driver uses */ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3545 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3546 | { |
| 3547 | return -EINVAL; |
| 3548 | } |
| 3549 | /** wpa_supplicant 0.8.x, wext driver uses */ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3550 | /** when cfg80211 defined, wpa_supplicant wext driver uses |
| 3551 | zero-length, null-string ssid for force disconnection. |
| 3552 | after disconnection (if previously connected) and cleaning ssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3553 | driver MUST return success */ |
| 3554 | if ( 0 == wrqu->essid.length ) { |
| 3555 | return 0; |
| 3556 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3557 | |
| 3558 | status = hdd_wmm_get_uapsd_mask(pAdapter, |
| 3559 | &pWextState->roamProfile.uapsd_mask); |
| 3560 | if (VOS_STATUS_SUCCESS != status) |
| 3561 | { |
| 3562 | pWextState->roamProfile.uapsd_mask = 0; |
| 3563 | } |
| 3564 | pWextState->roamProfile.SSIDs.numOfSSIDs = 1; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3565 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3566 | pWextState->roamProfile.SSIDs.SSIDList->SSID.length = wrqu->essid.length; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3567 | |
| 3568 | vos_mem_zero(pWextState->roamProfile.SSIDs.SSIDList->SSID.ssId, sizeof(pWextState->roamProfile.SSIDs.SSIDList->SSID.ssId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3569 | vos_mem_copy((void *)(pWextState->roamProfile.SSIDs.SSIDList->SSID.ssId), extra, wrqu->essid.length); |
| 3570 | if (IW_AUTH_WPA_VERSION_WPA == pWextState->wpaVersion || |
| 3571 | IW_AUTH_WPA_VERSION_WPA2 == pWextState->wpaVersion ) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3572 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3573 | //set gen ie |
| 3574 | hdd_SetGENIEToCsr(pAdapter, &RSNAuthType); |
| 3575 | |
| 3576 | //set auth |
| 3577 | hdd_set_csr_auth_type(pAdapter, RSNAuthType); |
| 3578 | } |
| 3579 | #ifdef FEATURE_WLAN_WAPI |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3580 | hddLog(LOG1, "%s: Setting WAPI AUTH Type and Encryption Mode values", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3581 | if (pAdapter->wapi_info.nWapiMode) |
| 3582 | { |
| 3583 | switch (pAdapter->wapi_info.wapiAuthMode) |
| 3584 | { |
| 3585 | case WAPI_AUTH_MODE_PSK: |
| 3586 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3587 | hddLog(LOG1, "%s: WAPI AUTH TYPE: PSK: %d", __func__, pAdapter->wapi_info.wapiAuthMode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3588 | pRoamProfile->AuthType.numEntries = 1; |
| 3589 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_WAPI_WAI_PSK; |
| 3590 | break; |
| 3591 | } |
| 3592 | case WAPI_AUTH_MODE_CERT: |
| 3593 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3594 | hddLog(LOG1, "%s: WAPI AUTH TYPE: CERT: %d", __func__, pAdapter->wapi_info.wapiAuthMode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3595 | pRoamProfile->AuthType.numEntries = 1; |
| 3596 | pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE; |
| 3597 | break; |
| 3598 | } |
| 3599 | } // End of switch |
| 3600 | if ( pAdapter->wapi_info.wapiAuthMode == WAPI_AUTH_MODE_PSK || |
| 3601 | pAdapter->wapi_info.wapiAuthMode == WAPI_AUTH_MODE_CERT) |
| 3602 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3603 | hddLog(LOG1, "%s: WAPI PAIRWISE/GROUP ENCRYPTION: WPI", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3604 | pRoamProfile->EncryptionType.numEntries = 1; |
| 3605 | pRoamProfile->EncryptionType.encryptionType[0] = eCSR_ENCRYPT_TYPE_WPI; |
| 3606 | pRoamProfile->mcEncryptionType.numEntries = 1; |
| 3607 | pRoamProfile->mcEncryptionType.encryptionType[0] = eCSR_ENCRYPT_TYPE_WPI; |
| 3608 | } |
| 3609 | } |
| 3610 | #endif /* FEATURE_WLAN_WAPI */ |
| 3611 | /* if previous genIE is not NULL, update AssocIE */ |
| 3612 | if (0 != pWextState->genIE.length) |
| 3613 | { |
| 3614 | memset( &pWextState->assocAddIE, 0, sizeof(pWextState->assocAddIE) ); |
| 3615 | memcpy( pWextState->assocAddIE.addIEdata, pWextState->genIE.addIEdata, |
| 3616 | pWextState->genIE.length); |
| 3617 | pWextState->assocAddIE.length = pWextState->genIE.length; |
| 3618 | pWextState->roamProfile.pAddIEAssoc = pWextState->assocAddIE.addIEdata; |
| 3619 | pWextState->roamProfile.nAddIEAssocLength = pWextState->assocAddIE.length; |
| 3620 | |
| 3621 | /* clear previous genIE after use it */ |
| 3622 | memset( &pWextState->genIE, 0, sizeof(pWextState->genIE) ); |
| 3623 | } |
| 3624 | |
| 3625 | /* assumes it is not WPS Association by default, except when pAddIEAssoc has WPS IE */ |
| 3626 | pWextState->roamProfile.bWPSAssociation = FALSE; |
| 3627 | |
| 3628 | if (NULL != wlan_hdd_get_wps_ie_ptr(pWextState->roamProfile.pAddIEAssoc, |
| 3629 | pWextState->roamProfile.nAddIEAssocLength)) |
| 3630 | pWextState->roamProfile.bWPSAssociation = TRUE; |
| 3631 | |
| 3632 | |
| 3633 | // Disable auto BMPS entry by PMC until DHCP is done |
| 3634 | sme_SetDHCPTillPowerActiveFlag(WLAN_HDD_GET_HAL_CTX(pAdapter), TRUE); |
| 3635 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3636 | pWextState->roamProfile.csrPersona = pAdapter->device_mode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3637 | (WLAN_HDD_GET_CTX(pAdapter))->isAmpAllowed = VOS_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3638 | |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 3639 | if ( eCSR_BSS_TYPE_START_IBSS == pRoamProfile->BSSType ) |
| 3640 | { |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 3641 | hdd_select_cbmode(pAdapter, |
| 3642 | (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->AdHocChannel5G); |
| 3643 | } |
| 3644 | status = sme_RoamConnect( hHal,pAdapter->sessionId, |
| 3645 | &(pWextState->roamProfile), &roamId); |
| 3646 | pRoamProfile->ChannelInfo.ChannelList = NULL; |
| 3647 | pRoamProfile->ChannelInfo.numOfChannels = 0; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 3648 | |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 3649 | EXIT(); |
| 3650 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3651 | } |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 3652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3653 | /**--------------------------------------------------------------------------- |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3654 | |
| 3655 | \brief iw_get_essid() - |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3656 | This function returns the essid to the wpa_supplicant. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3657 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3658 | \param - dev - Pointer to the net device. |
| 3659 | - info - Pointer to the iw_request_info. |
| 3660 | - wrqu - Pointer to the iwreq_data. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3661 | - extra - Pointer to the data. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3662 | \return - 0 for success, non zero for failure |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3663 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3664 | --------------------------------------------------------------------------*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3665 | int iw_get_essid(struct net_device *dev, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3666 | struct iw_request_info *info, |
| 3667 | struct iw_point *dwrq, char *extra) |
| 3668 | { |
| 3669 | hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3670 | hdd_wext_state_t *wextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3671 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 3672 | ENTER(); |
| 3673 | |
| 3674 | if((pHddStaCtx->conn_info.connState == eConnectionState_Associated && |
| 3675 | wextBuf->roamProfile.SSIDs.SSIDList->SSID.length > 0) || |
| 3676 | ((pHddStaCtx->conn_info.connState == eConnectionState_IbssConnected || |
| 3677 | pHddStaCtx->conn_info.connState == eConnectionState_IbssDisconnected) && |
| 3678 | wextBuf->roamProfile.SSIDs.SSIDList->SSID.length > 0)) |
| 3679 | { |
| 3680 | dwrq->length = pHddStaCtx->conn_info.SSID.SSID.length; |
| 3681 | memcpy(extra, pHddStaCtx->conn_info.SSID.SSID.ssId, dwrq->length); |
| 3682 | dwrq->flags = 1; |
| 3683 | } else { |
| 3684 | memset(extra, 0, dwrq->length); |
| 3685 | dwrq->length = 0; |
| 3686 | dwrq->flags = 0; |
| 3687 | } |
| 3688 | EXIT(); |
| 3689 | return 0; |
| 3690 | } |
| 3691 | /**--------------------------------------------------------------------------- |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3692 | |
| 3693 | \brief iw_set_auth() - |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3694 | This function sets the auth type received from the wpa_supplicant. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3695 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3696 | \param - dev - Pointer to the net device. |
| 3697 | - info - Pointer to the iw_request_info. |
| 3698 | - wrqu - Pointer to the iwreq_data. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3699 | - extra - Pointer to the data. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3700 | \return - 0 for success, non zero for failure |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3701 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3702 | --------------------------------------------------------------------------*/ |
| 3703 | int iw_set_auth(struct net_device *dev,struct iw_request_info *info, |
| 3704 | union iwreq_data *wrqu,char *extra) |
| 3705 | { |
| 3706 | hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3707 | hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3708 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); |
| 3709 | tCsrRoamProfile *pRoamProfile = &pWextState->roamProfile; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3710 | eCsrEncryptionType mcEncryptionType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3711 | eCsrEncryptionType ucEncryptionType; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3712 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3713 | ENTER(); |
Sameer Thalappil | 75ea31a | 2013-02-21 19:38:16 -0800 | [diff] [blame] | 3714 | |
| 3715 | if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) |
| 3716 | { |
| 3717 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, |
| 3718 | "%s:LOGP in Progress. Ignore!!!", __func__); |
| 3719 | return -EBUSY; |
| 3720 | } |
| 3721 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3722 | switch(wrqu->param.flags & IW_AUTH_INDEX) |
| 3723 | { |
| 3724 | case IW_AUTH_WPA_VERSION: |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3725 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3726 | pWextState->wpaVersion = wrqu->param.value; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3727 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3728 | break; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3730 | case IW_AUTH_CIPHER_PAIRWISE: |
| 3731 | { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3732 | if(wrqu->param.value & IW_AUTH_CIPHER_NONE) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3733 | ucEncryptionType = eCSR_ENCRYPT_TYPE_NONE; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3734 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3735 | else if(wrqu->param.value & IW_AUTH_CIPHER_TKIP) { |
| 3736 | ucEncryptionType = eCSR_ENCRYPT_TYPE_TKIP; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3737 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3738 | else if(wrqu->param.value & IW_AUTH_CIPHER_CCMP) { |
| 3739 | ucEncryptionType = eCSR_ENCRYPT_TYPE_AES; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3740 | } |
| 3741 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3742 | else if(wrqu->param.value & IW_AUTH_CIPHER_WEP40) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3743 | |
| 3744 | if( (IW_AUTH_KEY_MGMT_802_1X |
| 3745 | == (pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3746 | && (eCSR_AUTH_TYPE_OPEN_SYSTEM == pHddStaCtx->conn_info.authType) ) |
| 3747 | /*Dynamic WEP key*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3748 | ucEncryptionType = eCSR_ENCRYPT_TYPE_WEP40; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3749 | else |
| 3750 | /*Static WEP key*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3751 | ucEncryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
| 3752 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3753 | else if(wrqu->param.value & IW_AUTH_CIPHER_WEP104) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3754 | |
| 3755 | if( ( IW_AUTH_KEY_MGMT_802_1X |
| 3756 | == (pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3757 | && (eCSR_AUTH_TYPE_OPEN_SYSTEM == pHddStaCtx->conn_info.authType)) |
| 3758 | /*Dynamic WEP key*/ |
| 3759 | ucEncryptionType = eCSR_ENCRYPT_TYPE_WEP104; |
| 3760 | else |
| 3761 | /*Static WEP key*/ |
| 3762 | ucEncryptionType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3763 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3764 | } |
| 3765 | else { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3766 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3767 | hddLog(LOGW, "%s value %d UNKNOWN IW_AUTH_CIPHER", |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3768 | __func__, wrqu->param.value); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3769 | return -EINVAL; |
| 3770 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3771 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3772 | pRoamProfile->EncryptionType.numEntries = 1; |
| 3773 | pRoamProfile->EncryptionType.encryptionType[0] = ucEncryptionType; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3774 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3775 | break; |
| 3776 | case IW_AUTH_CIPHER_GROUP: |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3777 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3778 | if(wrqu->param.value & IW_AUTH_CIPHER_NONE) { |
| 3779 | mcEncryptionType = eCSR_ENCRYPT_TYPE_NONE; |
| 3780 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3781 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3782 | else if(wrqu->param.value & IW_AUTH_CIPHER_TKIP) { |
| 3783 | mcEncryptionType = eCSR_ENCRYPT_TYPE_TKIP; |
| 3784 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3785 | |
| 3786 | else if(wrqu->param.value & IW_AUTH_CIPHER_CCMP) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3787 | mcEncryptionType = eCSR_ENCRYPT_TYPE_AES; |
| 3788 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3789 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3790 | else if(wrqu->param.value & IW_AUTH_CIPHER_WEP40) { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3791 | |
| 3792 | if( ( IW_AUTH_KEY_MGMT_802_1X |
| 3793 | == (pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X )) |
| 3794 | && (eCSR_AUTH_TYPE_OPEN_SYSTEM == pHddStaCtx->conn_info.authType)) |
| 3795 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3796 | mcEncryptionType = eCSR_ENCRYPT_TYPE_WEP40; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3797 | |
| 3798 | else |
| 3799 | mcEncryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3800 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3801 | |
| 3802 | else if(wrqu->param.value & IW_AUTH_CIPHER_WEP104) |
| 3803 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3804 | /*Dynamic WEP keys won't work with shared keys*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3805 | if( ( IW_AUTH_KEY_MGMT_802_1X |
| 3806 | == (pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3807 | && (eCSR_AUTH_TYPE_OPEN_SYSTEM == pHddStaCtx->conn_info.authType)) |
| 3808 | { |
| 3809 | mcEncryptionType = eCSR_ENCRYPT_TYPE_WEP104; |
| 3810 | } |
| 3811 | else |
| 3812 | { |
| 3813 | mcEncryptionType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
| 3814 | } |
| 3815 | } |
| 3816 | else { |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3817 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3818 | hddLog(LOGW, "%s value %d UNKNOWN IW_AUTH_CIPHER", |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3819 | __func__, wrqu->param.value); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3820 | return -EINVAL; |
| 3821 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3822 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3823 | pRoamProfile->mcEncryptionType.numEntries = 1; |
| 3824 | pRoamProfile->mcEncryptionType.encryptionType[0] = mcEncryptionType; |
| 3825 | } |
| 3826 | break; |
| 3827 | |
| 3828 | case IW_AUTH_80211_AUTH_ALG: |
| 3829 | { |
| 3830 | /*Save the auth algo here and set auth type to SME Roam profile |
| 3831 | in the iw_set_ap_address*/ |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3832 | if( wrqu->param.value & IW_AUTH_ALG_OPEN_SYSTEM) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3833 | pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM; |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3834 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3835 | else if(wrqu->param.value & IW_AUTH_ALG_SHARED_KEY) |
| 3836 | pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_SHARED_KEY; |
| 3837 | |
| 3838 | else if(wrqu->param.value & IW_AUTH_ALG_LEAP) |
| 3839 | /*Not supported*/ |
| 3840 | pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM; |
| 3841 | pWextState->roamProfile.AuthType.authType[0] = pHddStaCtx->conn_info.authType; |
| 3842 | } |
| 3843 | break; |
| 3844 | |
| 3845 | case IW_AUTH_KEY_MGMT: |
| 3846 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3847 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3848 | #define IW_AUTH_KEY_MGMT_CCKM 8 /* Should be in linux/wireless.h */ |
| 3849 | /*Check for CCKM AKM type */ |
| 3850 | if ( wrqu->param.value & IW_AUTH_KEY_MGMT_CCKM) { |
Arif Hussain | 6d2a332 | 2013-11-17 19:50:10 -0800 | [diff] [blame] | 3851 | hddLog(VOS_TRACE_LEVEL_INFO,"%s: CCKM AKM Set %d", |
| 3852 | __func__, wrqu->param.value); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3853 | /* Set the CCKM bit in authKeyMgmt */ |
| 3854 | /* Right now, this breaks all ref to authKeyMgmt because our |
| 3855 | * code doesn't realize it is a "bitfield" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3856 | */ |
| 3857 | pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_CCKM; |
| 3858 | /*Set the key management to 802.1X*/ |
| 3859 | //pWextState->authKeyMgmt = IW_AUTH_KEY_MGMT_802_1X; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3860 | pWextState->isESEConnection = eANI_BOOLEAN_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3861 | //This is test code. I need to actually KNOW whether this is an RSN Assoc or WPA. |
| 3862 | pWextState->collectedAuthType = eCSR_AUTH_TYPE_CCKM_RSN; |
| 3863 | } else if ( wrqu->param.value & IW_AUTH_KEY_MGMT_PSK) { |
| 3864 | /*Save the key management*/ |
| 3865 | pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_PSK; |
| 3866 | //pWextState->authKeyMgmt = wrqu->param.value; |
| 3867 | //This is test code. I need to actually KNOW whether this is an RSN Assoc or WPA. |
| 3868 | pWextState->collectedAuthType = eCSR_AUTH_TYPE_RSN; |
| 3869 | } else if (!( wrqu->param.value & IW_AUTH_KEY_MGMT_802_1X)) { |
| 3870 | pWextState->collectedAuthType = eCSR_AUTH_TYPE_NONE; //eCSR_AUTH_TYPE_WPA_NONE |
| 3871 | /*Save the key management anyway*/ |
| 3872 | pWextState->authKeyMgmt = wrqu->param.value; |
| 3873 | } else { // It must be IW_AUTH_KEY_MGMT_802_1X |
| 3874 | /*Save the key management*/ |
| 3875 | pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X; |
| 3876 | //pWextState->authKeyMgmt = wrqu->param.value; |
| 3877 | //This is test code. I need to actually KNOW whether this is an RSN Assoc or WPA. |
| 3878 | pWextState->collectedAuthType = eCSR_AUTH_TYPE_RSN; |
| 3879 | } |
| 3880 | #else |
| 3881 | /*Save the key management*/ |
| 3882 | pWextState->authKeyMgmt = wrqu->param.value; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3883 | #endif /* FEATURE_WLAN_ESE */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3884 | } |
| 3885 | break; |
| 3886 | |
| 3887 | case IW_AUTH_TKIP_COUNTERMEASURES: |
| 3888 | { |
| 3889 | if(wrqu->param.value) { |
| 3890 | hddLog(VOS_TRACE_LEVEL_INFO_HIGH, |
| 3891 | "Counter Measure started %d", wrqu->param.value); |
| 3892 | pWextState->mTKIPCounterMeasures = TKIP_COUNTER_MEASURE_STARTED; |
| 3893 | } |
| 3894 | else { |
| 3895 | hddLog(VOS_TRACE_LEVEL_INFO_HIGH, |
| 3896 | "Counter Measure stopped=%d", wrqu->param.value); |
| 3897 | pWextState->mTKIPCounterMeasures = TKIP_COUNTER_MEASURE_STOPED; |
| 3898 | } |
| 3899 | } |
| 3900 | break; |
| 3901 | case IW_AUTH_DROP_UNENCRYPTED: |
| 3902 | case IW_AUTH_WPA_ENABLED: |
| 3903 | case IW_AUTH_RX_UNENCRYPTED_EAPOL: |
| 3904 | case IW_AUTH_ROAMING_CONTROL: |
| 3905 | case IW_AUTH_PRIVACY_INVOKED: |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3906 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3907 | default: |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3908 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3909 | hddLog(LOGW, "%s called with unsupported auth type %d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3910 | wrqu->param.flags & IW_AUTH_INDEX); |
| 3911 | break; |
| 3912 | } |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3913 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3914 | EXIT(); |
| 3915 | return 0; |
| 3916 | } |
| 3917 | /**--------------------------------------------------------------------------- |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3918 | |
| 3919 | \brief iw_get_auth() - |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3920 | This function returns the auth type to the wpa_supplicant. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3921 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3922 | \param - dev - Pointer to the net device. |
| 3923 | - info - Pointer to the iw_request_info. |
| 3924 | - wrqu - Pointer to the iwreq_data. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3925 | - extra - Pointer to the data. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3926 | \return - 0 for success, non zero for failure |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3927 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3928 | --------------------------------------------------------------------------*/ |
| 3929 | int iw_get_auth(struct net_device *dev,struct iw_request_info *info, |
| 3930 | union iwreq_data *wrqu,char *extra) |
| 3931 | { |
| 3932 | hdd_adapter_t* pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 3933 | hdd_wext_state_t *pWextState= WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3934 | tCsrRoamProfile *pRoamProfile = &pWextState->roamProfile; |
| 3935 | ENTER(); |
Sameer Thalappil | 75ea31a | 2013-02-21 19:38:16 -0800 | [diff] [blame] | 3936 | |
| 3937 | if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) |
| 3938 | { |
| 3939 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, |
| 3940 | "%s:LOGP in Progress. Ignore!!!", __func__); |
| 3941 | return -EBUSY; |
| 3942 | } |
| 3943 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3944 | switch(pRoamProfile->negotiatedAuthType) |
| 3945 | { |
| 3946 | case eCSR_AUTH_TYPE_WPA_NONE: |
| 3947 | wrqu->param.flags = IW_AUTH_WPA_VERSION; |
| 3948 | wrqu->param.value = IW_AUTH_WPA_VERSION_DISABLED; |
| 3949 | break; |
| 3950 | case eCSR_AUTH_TYPE_WPA: |
| 3951 | wrqu->param.flags = IW_AUTH_WPA_VERSION; |
| 3952 | wrqu->param.value = IW_AUTH_WPA_VERSION_WPA; |
| 3953 | break; |
| 3954 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 3955 | case eCSR_AUTH_TYPE_FT_RSN: |
| 3956 | #endif |
| 3957 | case eCSR_AUTH_TYPE_RSN: |
| 3958 | wrqu->param.flags = IW_AUTH_WPA_VERSION; |
| 3959 | wrqu->param.value = IW_AUTH_WPA_VERSION_WPA2; |
| 3960 | break; |
| 3961 | case eCSR_AUTH_TYPE_OPEN_SYSTEM: |
| 3962 | wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; |
| 3963 | break; |
| 3964 | case eCSR_AUTH_TYPE_SHARED_KEY: |
| 3965 | wrqu->param.value = IW_AUTH_ALG_SHARED_KEY; |
| 3966 | break; |
| 3967 | case eCSR_AUTH_TYPE_UNKNOWN: |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3968 | hddLog(LOG1,"%s called with unknown auth type", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3969 | wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; |
| 3970 | break; |
| 3971 | case eCSR_AUTH_TYPE_AUTOSWITCH: |
| 3972 | wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; |
| 3973 | break; |
| 3974 | case eCSR_AUTH_TYPE_WPA_PSK: |
Agarwal Ashish | 971c288 | 2013-10-30 20:11:12 +0530 | [diff] [blame] | 3975 | hddLog(LOG1,"%s called with WPA PSK auth type", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3976 | wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; |
| 3977 | return -EIO; |
| 3978 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 3979 | case eCSR_AUTH_TYPE_FT_RSN_PSK: |
| 3980 | #endif |
| 3981 | case eCSR_AUTH_TYPE_RSN_PSK: |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3982 | #ifdef WLAN_FEATURE_11W |
| 3983 | case eCSR_AUTH_TYPE_RSN_PSK_SHA256: |
| 3984 | #endif |
Agarwal Ashish | 971c288 | 2013-10-30 20:11:12 +0530 | [diff] [blame] | 3985 | hddLog(LOG1,"%s called with RSN PSK auth type", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3986 | wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; |
| 3987 | return -EIO; |
| 3988 | default: |
Agarwal Ashish | 971c288 | 2013-10-30 20:11:12 +0530 | [diff] [blame] | 3989 | hddLog(LOGE,"%s called with unknown auth type", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3990 | wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; |
| 3991 | return -EIO; |
| 3992 | } |
| 3993 | if(((wrqu->param.flags & IW_AUTH_INDEX) == IW_AUTH_CIPHER_PAIRWISE)) |
| 3994 | { |
| 3995 | switch(pRoamProfile->negotiatedUCEncryptionType) |
| 3996 | { |
| 3997 | case eCSR_ENCRYPT_TYPE_NONE: |
| 3998 | wrqu->param.value = IW_AUTH_CIPHER_NONE; |
| 3999 | break; |
| 4000 | case eCSR_ENCRYPT_TYPE_WEP40: |
| 4001 | case eCSR_ENCRYPT_TYPE_WEP40_STATICKEY: |
| 4002 | wrqu->param.value = IW_AUTH_CIPHER_WEP40; |
| 4003 | break; |
| 4004 | case eCSR_ENCRYPT_TYPE_TKIP: |
| 4005 | wrqu->param.value = IW_AUTH_CIPHER_TKIP; |
| 4006 | break; |
| 4007 | case eCSR_ENCRYPT_TYPE_WEP104: |
| 4008 | case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY: |
| 4009 | wrqu->param.value = IW_AUTH_CIPHER_WEP104; |
| 4010 | break; |
| 4011 | case eCSR_ENCRYPT_TYPE_AES: |
| 4012 | wrqu->param.value = IW_AUTH_CIPHER_CCMP; |
| 4013 | break; |
| 4014 | default: |
Agarwal Ashish | 971c288 | 2013-10-30 20:11:12 +0530 | [diff] [blame] | 4015 | hddLog(LOG1, "%s called with unknown auth type %d ", |
| 4016 | __func__, pRoamProfile->negotiatedUCEncryptionType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4017 | return -EIO; |
| 4018 | } |
| 4019 | } |
| 4020 | |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 4021 | if(((wrqu->param.flags & IW_AUTH_INDEX) == IW_AUTH_CIPHER_GROUP)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4022 | { |
| 4023 | switch(pRoamProfile->negotiatedMCEncryptionType) |
| 4024 | { |
| 4025 | case eCSR_ENCRYPT_TYPE_NONE: |
| 4026 | wrqu->param.value = IW_AUTH_CIPHER_NONE; |
| 4027 | break; |
| 4028 | case eCSR_ENCRYPT_TYPE_WEP40: |
| 4029 | case eCSR_ENCRYPT_TYPE_WEP40_STATICKEY: |
| 4030 | wrqu->param.value = IW_AUTH_CIPHER_WEP40; |
| 4031 | break; |
| 4032 | case eCSR_ENCRYPT_TYPE_TKIP: |
| 4033 | wrqu->param.value = IW_AUTH_CIPHER_TKIP; |
| 4034 | break; |
| 4035 | case eCSR_ENCRYPT_TYPE_WEP104: |
| 4036 | case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY: |
| 4037 | wrqu->param.value = IW_AUTH_CIPHER_WEP104; |
| 4038 | break; |
| 4039 | case eCSR_ENCRYPT_TYPE_AES: |
| 4040 | wrqu->param.value = IW_AUTH_CIPHER_CCMP; |
| 4041 | break; |
| 4042 | default: |
Agarwal Ashish | 971c288 | 2013-10-30 20:11:12 +0530 | [diff] [blame] | 4043 | hddLog(LOG1, "%s called with unknown auth type %d ", |
| 4044 | __func__, pRoamProfile->negotiatedMCEncryptionType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4045 | return -EIO; |
| 4046 | } |
| 4047 | } |
| 4048 | |
| 4049 | hddLog(LOG1, "%s called with auth type %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4050 | __func__, pRoamProfile->AuthType.authType[0]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4051 | EXIT(); |
| 4052 | return 0; |
| 4053 | } |
| 4054 | /**--------------------------------------------------------------------------- |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 4055 | |
| 4056 | \brief iw_set_ap_address() - |
| 4057 | This function calls the sme_RoamConnect function to associate |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4058 | to the AP with the specified BSSID received from the wpa_supplicant. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 4059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4060 | \param - dev - Pointer to the net device. |
| 4061 | - info - Pointer to the iw_request_info. |
| 4062 | - wrqu - Pointer to the iwreq_data. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 4063 | - extra - Pointer to the data. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4064 | \return - 0 for success, non zero for failure |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 4065 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4066 | --------------------------------------------------------------------------*/ |
| 4067 | int iw_set_ap_address(struct net_device *dev, |
| 4068 | struct iw_request_info *info, |
| 4069 | union iwreq_data *wrqu, char *extra) |
| 4070 | { |
| 4071 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(WLAN_HDD_GET_PRIV_PTR(dev)); |
| 4072 | v_U8_t *pMacAddress=NULL; |
| 4073 | ENTER(); |
| 4074 | pMacAddress = (v_U8_t*) wrqu->ap_addr.sa_data; |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 4075 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s "MAC_ADDRESS_STR, |
| 4076 | __func__, MAC_ADDR_ARRAY(pMacAddress)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4077 | vos_mem_copy( pHddStaCtx->conn_info.bssId, pMacAddress, sizeof( tCsrBssid )); |
| 4078 | EXIT(); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 4079 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4080 | return 0; |
| 4081 | } |
| 4082 | /**--------------------------------------------------------------------------- |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 4083 | |
| 4084 | \brief iw_get_ap_address() - |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4085 | This function returns the BSSID to the wpa_supplicant |
| 4086 | \param - dev - Pointer to the net device. |
| 4087 | - info - Pointer to the iw_request_info. |
| 4088 | - wrqu - Pointer to the iwreq_data. |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 4089 | - extra - Pointer to the data. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4090 | \return - 0 for success, non zero for failure |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 4091 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4092 | --------------------------------------------------------------------------*/ |
| 4093 | int iw_get_ap_address(struct net_device *dev, |
| 4094 | struct iw_request_info *info, |
| 4095 | union iwreq_data *wrqu, char *extra) |
| 4096 | { |
| 4097 | //hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 4098 | hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(WLAN_HDD_GET_PRIV_PTR(dev)); |
| 4099 | |
| 4100 | ENTER(); |
| 4101 | |
| 4102 | if ((pHddStaCtx->conn_info.connState == eConnectionState_Associated) || |
| 4103 | (eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState)) |
| 4104 | { |
Jeff Johnson | 4416a78 | 2013-03-25 14:17:50 -0700 | [diff] [blame] | 4105 | memcpy(wrqu->ap_addr.sa_data,pHddStaCtx->conn_info.bssId,ETH_ALEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4106 | } |
| 4107 | else |
| 4108 | { |
| 4109 | memset(wrqu->ap_addr.sa_data,0,sizeof(wrqu->ap_addr.sa_data)); |
| 4110 | } |
| 4111 | EXIT(); |
| 4112 | return 0; |
| 4113 | } |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 4114 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4115 | #ifdef WLAN_FEATURE_11W |
| 4116 | /**--------------------------------------------------------------------------- |
| 4117 | |
| 4118 | \brief hdd_indicateUnprotMgmtFrame - |
| 4119 | This function forwards the unprotected management frame to the supplicant |
| 4120 | \param - pAdapter - Pointer to HDD adapter |
| 4121 | - nFrameLength - Length of the unprotected frame being passed |
| 4122 | - pbFrames - Pointer to the frame buffer |
| 4123 | - frameType - 802.11 frame type |
| 4124 | \return - nothing |
| 4125 | |
| 4126 | --------------------------------------------------------------------------*/ |
| 4127 | void hdd_indicateUnprotMgmtFrame( hdd_adapter_t *pAdapter, |
| 4128 | tANI_U32 nFrameLength, |
| 4129 | tANI_U8* pbFrames, |
| 4130 | tANI_U8 frameType ) |
| 4131 | { |
| 4132 | tANI_U8 type = 0; |
| 4133 | tANI_U8 subType = 0; |
| 4134 | |
| 4135 | hddLog(VOS_TRACE_LEVEL_INFO, "%s: Frame Type = %d Frame Length = %d", |
| 4136 | __func__, frameType, nFrameLength); |
| 4137 | |
| 4138 | /* Sanity Checks */ |
| 4139 | if (NULL == pAdapter) |
| 4140 | { |
| 4141 | hddLog( LOGE, FL("pAdapter is NULL")); |
| 4142 | return; |
| 4143 | } |
| 4144 | |
| 4145 | if (NULL == pAdapter->dev) |
| 4146 | { |
| 4147 | hddLog( LOGE, FL("pAdapter->dev is NULL")); |
| 4148 | return; |
| 4149 | } |
| 4150 | |
| 4151 | if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) |
| 4152 | { |
| 4153 | hddLog( LOGE, FL("pAdapter has invalid magic")); |
| 4154 | return; |
| 4155 | } |
| 4156 | |
| 4157 | if( !nFrameLength ) |
| 4158 | { |
| 4159 | hddLog( LOGE, FL("Frame Length is Invalid ZERO")); |
| 4160 | return; |
| 4161 | } |
| 4162 | |
| 4163 | if (NULL == pbFrames) { |
| 4164 | hddLog( LOGE, FL("pbFrames is NULL")); |
| 4165 | return; |
| 4166 | } |
| 4167 | |
| 4168 | type = WLAN_HDD_GET_TYPE_FRM_FC(pbFrames[0]); |
| 4169 | subType = WLAN_HDD_GET_SUBTYPE_FRM_FC(pbFrames[0]); |
| 4170 | |
| 4171 | /* Get pAdapter from Destination mac address of the frame */ |
| 4172 | if (type == SIR_MAC_MGMT_FRAME && subType == SIR_MAC_MGMT_DISASSOC) |
| 4173 | { |
| 4174 | cfg80211_send_unprot_disassoc(pAdapter->dev, pbFrames, nFrameLength); |
| 4175 | pAdapter->hdd_stats.hddPmfStats.numUnprotDisassocRx++; |
| 4176 | } |
| 4177 | else if (type == SIR_MAC_MGMT_FRAME && subType == SIR_MAC_MGMT_DEAUTH) |
| 4178 | { |
| 4179 | cfg80211_send_unprot_deauth(pAdapter->dev, pbFrames, nFrameLength); |
| 4180 | pAdapter->hdd_stats.hddPmfStats.numUnprotDeauthRx++; |
| 4181 | } |
| 4182 | else |
| 4183 | { |
| 4184 | hddLog( LOGE, FL("Frame type %d and subtype %d are not valid"), type, subType); |
| 4185 | return; |
| 4186 | } |
| 4187 | } |
| 4188 | #endif |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4189 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4190 | #if defined (FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4191 | void hdd_indicateTsmIe(hdd_adapter_t *pAdapter, tANI_U8 tid, |
| 4192 | tANI_U8 state, |
| 4193 | tANI_U16 measInterval ) |
| 4194 | { |
| 4195 | union iwreq_data wrqu; |
| 4196 | char buf[IW_CUSTOM_MAX + 1]; |
Varun Reddy Yeturu | df0e7a7 | 2013-12-05 12:12:23 -0800 | [diff] [blame] | 4197 | int nBytes = 0; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4198 | |
| 4199 | if (NULL == pAdapter) |
| 4200 | return; |
| 4201 | |
| 4202 | // create the event |
| 4203 | memset(&wrqu, '\0', sizeof(wrqu)); |
| 4204 | memset(buf, '\0', sizeof(buf)); |
| 4205 | |
| 4206 | hddLog(VOS_TRACE_LEVEL_INFO, "TSM Ind tid(%d) state(%d) MeasInt(%d)", |
| 4207 | tid, state, measInterval); |
| 4208 | |
Varun Reddy Yeturu | df0e7a7 | 2013-12-05 12:12:23 -0800 | [diff] [blame] | 4209 | nBytes = snprintf(buf, IW_CUSTOM_MAX, "TSMIE=%d:%d:%d",tid,state,measInterval); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4210 | |
| 4211 | wrqu.data.pointer = buf; |
Varun Reddy Yeturu | df0e7a7 | 2013-12-05 12:12:23 -0800 | [diff] [blame] | 4212 | wrqu.data.length = nBytes; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4213 | // send the event |
| 4214 | wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf); |
| 4215 | } |
| 4216 | |
| 4217 | void hdd_indicateCckmPreAuth(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo) |
| 4218 | { |
| 4219 | union iwreq_data wrqu; |
| 4220 | char buf[IW_CUSTOM_MAX + 1]; |
| 4221 | char *pos = buf; |
| 4222 | int nBytes = 0, freeBytes = IW_CUSTOM_MAX; |
| 4223 | |
| 4224 | if ((NULL == pAdapter) || (NULL == pRoamInfo)) |
| 4225 | return; |
| 4226 | |
| 4227 | // create the event |
| 4228 | memset(&wrqu, '\0', sizeof(wrqu)); |
| 4229 | memset(buf, '\0', sizeof(buf)); |
| 4230 | |
| 4231 | /* Timestamp0 is lower 32 bits and Timestamp1 is upper 32 bits */ |
Arun Kumar Khandavalli | e876821 | 2014-02-17 16:43:34 +0530 | [diff] [blame] | 4232 | hddLog(VOS_TRACE_LEVEL_INFO, "CCXPREAUTHNOTIFY=%02x:%02x:%02x:%02x:%02x:%02x %u:%u", |
| 4233 | pRoamInfo->bssid[0], pRoamInfo->bssid[1], pRoamInfo->bssid[2], |
| 4234 | pRoamInfo->bssid[3], pRoamInfo->bssid[4], pRoamInfo->bssid[5], |
| 4235 | pRoamInfo->timestamp[0], pRoamInfo->timestamp[1]); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4236 | |
| 4237 | nBytes = snprintf(pos, freeBytes, "CCXPREAUTHNOTIFY="); |
| 4238 | pos += nBytes; |
| 4239 | freeBytes -= nBytes; |
| 4240 | |
| 4241 | vos_mem_copy(pos, pRoamInfo->bssid, WNI_CFG_BSSID_LEN); |
| 4242 | pos += WNI_CFG_BSSID_LEN; |
| 4243 | freeBytes -= WNI_CFG_BSSID_LEN; |
| 4244 | |
Varun Reddy Yeturu | df0e7a7 | 2013-12-05 12:12:23 -0800 | [diff] [blame] | 4245 | nBytes = snprintf(pos, freeBytes, " %u:%u", pRoamInfo->timestamp[0], pRoamInfo->timestamp[1]); |
| 4246 | freeBytes -= nBytes; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4247 | |
| 4248 | wrqu.data.pointer = buf; |
Varun Reddy Yeturu | df0e7a7 | 2013-12-05 12:12:23 -0800 | [diff] [blame] | 4249 | wrqu.data.length = (IW_CUSTOM_MAX - freeBytes); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4250 | |
| 4251 | // send the event |
| 4252 | wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf); |
| 4253 | } |
| 4254 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4255 | void hdd_indicateEseAdjApRepInd(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4256 | { |
| 4257 | union iwreq_data wrqu; |
| 4258 | char buf[IW_CUSTOM_MAX + 1]; |
Varun Reddy Yeturu | df0e7a7 | 2013-12-05 12:12:23 -0800 | [diff] [blame] | 4259 | int nBytes = 0; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4260 | |
| 4261 | if ((NULL == pAdapter) || (NULL == pRoamInfo)) |
| 4262 | return; |
| 4263 | |
| 4264 | // create the event |
| 4265 | memset(&wrqu, '\0', sizeof(wrqu)); |
| 4266 | memset(buf, '\0', sizeof(buf)); |
| 4267 | |
| 4268 | hddLog(VOS_TRACE_LEVEL_INFO, "CCXADJAPREP=%u", pRoamInfo->tsmRoamDelay); |
| 4269 | |
Varun Reddy Yeturu | df0e7a7 | 2013-12-05 12:12:23 -0800 | [diff] [blame] | 4270 | nBytes = snprintf(buf, IW_CUSTOM_MAX, "CCXADJAPREP=%u", pRoamInfo->tsmRoamDelay); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4271 | |
| 4272 | wrqu.data.pointer = buf; |
Varun Reddy Yeturu | df0e7a7 | 2013-12-05 12:12:23 -0800 | [diff] [blame] | 4273 | wrqu.data.length = nBytes; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4274 | |
| 4275 | // send the event |
| 4276 | wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf); |
| 4277 | } |
| 4278 | |
Srinivas Girigowda | 0c6d7fe | 2014-05-28 18:18:10 -0700 | [diff] [blame] | 4279 | void hdd_indicateEseBcnReportNoResults(const hdd_adapter_t *pAdapter, |
| 4280 | const tANI_U16 measurementToken, |
| 4281 | const tANI_BOOLEAN flag, |
| 4282 | const tANI_U8 numBss) |
| 4283 | { |
| 4284 | union iwreq_data wrqu; |
| 4285 | char buf[IW_CUSTOM_MAX]; |
| 4286 | char *pos = buf; |
| 4287 | int nBytes = 0, freeBytes = IW_CUSTOM_MAX; |
| 4288 | |
| 4289 | memset(&wrqu, '\0', sizeof(wrqu)); |
| 4290 | memset(buf, '\0', sizeof(buf)); |
| 4291 | |
| 4292 | hddLog(VOS_TRACE_LEVEL_INFO, FL("CCXBCNREP=%d %d %d"), measurementToken, flag, |
| 4293 | numBss); |
| 4294 | |
| 4295 | nBytes = snprintf(pos, freeBytes, "CCXBCNREP=%d %d %d", measurementToken, |
| 4296 | flag, numBss); |
| 4297 | |
| 4298 | wrqu.data.pointer = buf; |
| 4299 | wrqu.data.length = nBytes; |
| 4300 | // send the event |
| 4301 | wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf); |
| 4302 | } |
| 4303 | |
| 4304 | |
| 4305 | static void hdd_indicateEseBcnReportInd(const hdd_adapter_t *pAdapter, |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4306 | const tCsrRoamInfo *pRoamInfo) |
| 4307 | { |
| 4308 | union iwreq_data wrqu; |
| 4309 | char buf[IW_CUSTOM_MAX + 1]; |
| 4310 | char *pos = buf; |
| 4311 | int nBytes = 0, freeBytes = IW_CUSTOM_MAX; |
| 4312 | tANI_U8 i = 0, len = 0; |
| 4313 | tANI_U8 tot_bcn_ieLen = 0; /* total size of the beacon report data */ |
| 4314 | tANI_U8 lastSent = 0, sendBss = 0; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4315 | int bcnRepFieldSize = sizeof(pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[0].bcnReportFields); |
| 4316 | tANI_U8 ieLenByte = 1; |
| 4317 | /* CCXBCNREP=meas_tok<sp>flag<sp>no_of_bss<sp>tot_bcn_ie_len = 18 bytes */ |
| 4318 | #define ESEBCNREPHEADER_LEN (18) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4319 | |
| 4320 | if ((NULL == pAdapter) || (NULL == pRoamInfo)) |
| 4321 | return; |
| 4322 | |
| 4323 | /* Custom event can pass maximum of 256 bytes of data, |
| 4324 | based on the IE len we need to identify how many BSS info can |
| 4325 | be filled in to custom event data */ |
| 4326 | /* |
| 4327 | meas_tok<sp>flag<sp>no_of_bss<sp>tot_bcn_ie_len bcn_rep_data |
| 4328 | bcn_rep_data will have bcn_rep_fields,ie_len,ie without any spaces |
| 4329 | CCXBCNREP=meas_tok<sp>flag<sp>no_of_bss<sp>tot_bcn_ie_len = 18 bytes |
| 4330 | */ |
| 4331 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4332 | if ((pRoamInfo->pEseBcnReportRsp->flag >> 1) && (!pRoamInfo->pEseBcnReportRsp->numBss)) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4333 | { |
| 4334 | hddLog(VOS_TRACE_LEVEL_INFO, "Measurement Done but no scan results"); |
| 4335 | /* If the measurement is none and no scan results found, |
| 4336 | indicate the supplicant about measurement done */ |
Srinivas Girigowda | 0c6d7fe | 2014-05-28 18:18:10 -0700 | [diff] [blame] | 4337 | hdd_indicateEseBcnReportNoResults(pAdapter, |
| 4338 | pRoamInfo->pEseBcnReportRsp->measurementToken, |
| 4339 | pRoamInfo->pEseBcnReportRsp->flag, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4340 | pRoamInfo->pEseBcnReportRsp->numBss); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4341 | } |
| 4342 | else |
| 4343 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4344 | while (lastSent < pRoamInfo->pEseBcnReportRsp->numBss) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4345 | { |
| 4346 | memset(&wrqu, '\0', sizeof(wrqu)); |
| 4347 | memset(buf, '\0', sizeof(buf)); |
| 4348 | tot_bcn_ieLen = 0; |
| 4349 | sendBss = 0; |
| 4350 | pos = buf; |
| 4351 | freeBytes = IW_CUSTOM_MAX; |
| 4352 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4353 | for (i = lastSent; i < pRoamInfo->pEseBcnReportRsp->numBss; i++) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4354 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4355 | len = bcnRepFieldSize + ieLenByte + pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i].ieLen; |
| 4356 | if ((len + tot_bcn_ieLen) > (IW_CUSTOM_MAX - ESEBCNREPHEADER_LEN)) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4357 | { |
| 4358 | break; |
| 4359 | } |
| 4360 | tot_bcn_ieLen += len; |
| 4361 | sendBss++; |
| 4362 | hddLog(VOS_TRACE_LEVEL_INFO, "i(%d) sizeof bcnReportFields(%d)" |
| 4363 | "IeLength(%d) Length of Ie(%d) totLen(%d)", |
| 4364 | i, bcnRepFieldSize, 1, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4365 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i].ieLen, |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4366 | tot_bcn_ieLen); |
| 4367 | } |
| 4368 | |
| 4369 | hddLog(VOS_TRACE_LEVEL_INFO, "Sending %d BSS Info", sendBss); |
| 4370 | hddLog(VOS_TRACE_LEVEL_INFO, "CCXBCNREP=%d %d %d %d", |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4371 | pRoamInfo->pEseBcnReportRsp->measurementToken, pRoamInfo->pEseBcnReportRsp->flag, |
| 4372 | sendBss, tot_bcn_ieLen); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4373 | |
| 4374 | nBytes = snprintf(pos, freeBytes, "CCXBCNREP=%d %d %d ", |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4375 | pRoamInfo->pEseBcnReportRsp->measurementToken, pRoamInfo->pEseBcnReportRsp->flag, |
| 4376 | sendBss); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4377 | pos += nBytes; |
| 4378 | freeBytes -= nBytes; |
| 4379 | |
| 4380 | /* Copy total Beacon report data length */ |
| 4381 | vos_mem_copy(pos, (char*)&tot_bcn_ieLen, sizeof(tot_bcn_ieLen)); |
| 4382 | pos += sizeof(tot_bcn_ieLen); |
| 4383 | freeBytes -= sizeof(tot_bcn_ieLen); |
| 4384 | |
| 4385 | for (i = 0; i < sendBss; i++) |
| 4386 | { |
| 4387 | hddLog(VOS_TRACE_LEVEL_INFO, "ChanNum(%d) Spare(%d) MeasDuration(%d)" |
Arun Kumar Khandavalli | e876821 | 2014-02-17 16:43:34 +0530 | [diff] [blame] | 4388 | " PhyType(%d) RecvSigPower(%d) ParentTSF(%u)" |
| 4389 | " TargetTSF[0](%u) TargetTSF[1](%u) BeaconInterval(%u)" |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4390 | " CapabilityInfo(%d) BSSID(%02X:%02X:%02X:%02X:%02X:%02X)", |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4391 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.ChanNum, |
| 4392 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.Spare, |
| 4393 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.MeasDuration, |
| 4394 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.PhyType, |
| 4395 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.RecvSigPower, |
| 4396 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.ParentTsf, |
| 4397 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.TargetTsf[0], |
| 4398 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.TargetTsf[1], |
| 4399 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.BcnInterval, |
| 4400 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.CapabilityInfo, |
| 4401 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.Bssid[0], |
| 4402 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.Bssid[1], |
| 4403 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.Bssid[2], |
| 4404 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.Bssid[3], |
| 4405 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.Bssid[4], |
| 4406 | pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields.Bssid[5]); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4407 | |
| 4408 | /* bcn report fields are copied */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4409 | len = sizeof(pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields); |
| 4410 | vos_mem_copy(pos, (char*)&pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].bcnReportFields, len); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4411 | pos += len; |
| 4412 | freeBytes -= len; |
| 4413 | |
| 4414 | /* Add 1 byte of ie len */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4415 | len = pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].ieLen; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4416 | vos_mem_copy(pos, (char*)&len, sizeof(len)); |
| 4417 | pos += sizeof(len); |
| 4418 | freeBytes -= sizeof(len); |
| 4419 | |
| 4420 | /* copy IE from scan results */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4421 | vos_mem_copy(pos, (char*)pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[i+lastSent].pBuf, len); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 4422 | pos += len; |
| 4423 | freeBytes -= len; |
| 4424 | } |
| 4425 | |
| 4426 | wrqu.data.pointer = buf; |
| 4427 | wrqu.data.length = strlen(buf); |
| 4428 | |
| 4429 | // send the event |
| 4430 | wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf); |
| 4431 | lastSent += sendBss; |
| 4432 | } |
| 4433 | } |
| 4434 | } |
| 4435 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4436 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4437 | |