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