Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +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. |
| 20 | */ |
| 21 | |
| 22 | /* |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 26 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 27 | |
| 28 | |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 29 | |
| 30 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 31 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 32 | * This file limProcessSmeReqMessages.cc contains the code |
| 33 | * for processing SME request messages. |
| 34 | * Author: Chandra Modumudi |
| 35 | * Date: 02/11/02 |
| 36 | * History:- |
| 37 | * Date Modified by Modification Information |
| 38 | * -------------------------------------------------------------------- |
| 39 | * |
| 40 | */ |
| 41 | |
| 42 | #include "palTypes.h" |
| 43 | #include "wniApi.h" |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 44 | #include "wniCfg.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 45 | #include "cfgApi.h" |
| 46 | #include "sirApi.h" |
| 47 | #include "schApi.h" |
| 48 | #include "utilsApi.h" |
| 49 | #include "limTypes.h" |
| 50 | #include "limUtils.h" |
| 51 | #include "limAssocUtils.h" |
| 52 | #include "limSecurityUtils.h" |
| 53 | #include "limSerDesUtils.h" |
| 54 | #include "limSmeReqUtils.h" |
| 55 | #include "limIbssPeerMgmt.h" |
| 56 | #include "limAdmitControl.h" |
| 57 | #include "dphHashTable.h" |
| 58 | #include "limSendMessages.h" |
| 59 | #include "limApi.h" |
| 60 | #include "wmmApsd.h" |
| 61 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 62 | #include "sapApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 63 | |
| 64 | #if defined WLAN_FEATURE_VOWIFI |
| 65 | #include "rrmApi.h" |
| 66 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 67 | #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) |
| 68 | #include "eseApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 69 | #endif |
| 70 | |
| 71 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 72 | #include <limFT.h> |
| 73 | #endif |
| 74 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 75 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 76 | /* These are the min/max tx power (non virtual rates) range |
| 77 | supported by prima hardware */ |
Sandeep Puligilla | 33ccf33 | 2013-12-19 16:06:42 +0530 | [diff] [blame] | 78 | #define MIN_TX_PWR_CAP 8 |
| 79 | #define MAX_TX_PWR_CAP 22 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 80 | |
| 81 | #endif |
| 82 | |
Sushant Kaushik | e3ca61c | 2015-03-19 18:33:25 +0530 | [diff] [blame] | 83 | #define JOIN_FAILURE_TIMEOUT 1000 // in msecs |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 84 | /* This overhead is time for sending NOA start to host in case of GO/sending NULL data & receiving ACK |
| 85 | * in case of P2P Client and starting actual scanning with init scan req/rsp plus in case of concurrency, |
Sunil Ravi | 24fd3aa | 2013-01-21 22:12:06 -0800 | [diff] [blame] | 86 | * taking care of sending null data and receiving ACK to/from AP/Also SetChannel with calibration is taking |
| 87 | * around 7ms . |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 88 | */ |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 89 | #define SCAN_MESSAGING_OVERHEAD 20 // in msecs |
| 90 | #define JOIN_NOA_DURATION 2000 // in msecs |
| 91 | #define OEM_DATA_NOA_DURATION 60 // in msecs |
| 92 | #define DEFAULT_PASSIVE_MAX_CHANNEL_TIME 110 // in msecs |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 93 | |
Gopichand Nakkala | 096a105 | 2012-12-21 07:05:34 -0800 | [diff] [blame] | 94 | #define CONV_MS_TO_US 1024 //conversion factor from ms to us |
| 95 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 96 | // SME REQ processing function templates |
| 97 | static void __limProcessSmeStartReq(tpAniSirGlobal, tANI_U32 *); |
| 98 | static tANI_BOOLEAN __limProcessSmeSysReadyInd(tpAniSirGlobal, tANI_U32 *); |
| 99 | static tANI_BOOLEAN __limProcessSmeStartBssReq(tpAniSirGlobal, tpSirMsgQ pMsg); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 100 | static void __limProcessSmeScanReq(tpAniSirGlobal, tANI_U32 *); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 101 | static void __limProcessSmeJoinReq(tpAniSirGlobal, tANI_U32 *); |
| 102 | static void __limProcessSmeReassocReq(tpAniSirGlobal, tANI_U32 *); |
| 103 | static void __limProcessSmeDisassocReq(tpAniSirGlobal, tANI_U32 *); |
| 104 | static void __limProcessSmeDisassocCnf(tpAniSirGlobal, tANI_U32 *); |
| 105 | static void __limProcessSmeDeauthReq(tpAniSirGlobal, tANI_U32 *); |
| 106 | static void __limProcessSmeSetContextReq(tpAniSirGlobal, tANI_U32 *); |
| 107 | static tANI_BOOLEAN __limProcessSmeStopBssReq(tpAniSirGlobal, tpSirMsgQ pMsg); |
| 108 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | void __limProcessSmeAssocCnfNew(tpAniSirGlobal, tANI_U32, tANI_U32 *); |
| 110 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 111 | extern void peRegisterTLHandle(tpAniSirGlobal pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 112 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 113 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 114 | #ifdef BACKGROUND_SCAN_ENABLED |
| 115 | |
| 116 | // start the background scan timers if it hasn't already started |
| 117 | static void |
| 118 | __limBackgroundScanInitiate(tpAniSirGlobal pMac) |
| 119 | { |
| 120 | if (pMac->lim.gLimBackgroundScanStarted) |
| 121 | return; |
| 122 | |
| 123 | //make sure timer is created first |
| 124 | if (TX_TIMER_VALID(pMac->lim.limTimers.gLimBackgroundScanTimer)) |
| 125 | { |
| 126 | limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 127 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_BACKGROUND_SCAN_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 128 | if (tx_timer_activate(&pMac->lim.limTimers.gLimBackgroundScanTimer) != TX_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 129 | limLog(pMac, LOGP, FL("could not activate background scan timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 130 | pMac->lim.gLimBackgroundScanStarted = true; |
| 131 | pMac->lim.gLimBackgroundScanChannelId = 0; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | #endif // BACKGROUND_SCAN_ENABLED |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 136 | |
| 137 | // determine if a fresh scan request must be issued or not |
| 138 | /* |
| 139 | * PE will do fresh scan, if all of the active sessions are in good state (Link Est or BSS Started) |
| 140 | * If one of the sessions is not in one of the above states, then PE does not do fresh scan |
| 141 | * If no session exists (scanning very first time), then PE will always do fresh scan if SME |
| 142 | * asks it to do that. |
| 143 | */ |
| 144 | static tANI_U8 |
| 145 | __limFreshScanReqd(tpAniSirGlobal pMac, tANI_U8 returnFreshResults) |
| 146 | { |
| 147 | |
| 148 | tANI_U8 validState = TRUE; |
| 149 | int i; |
| 150 | |
| 151 | if(pMac->lim.gLimSmeState != eLIM_SME_IDLE_STATE) |
| 152 | { |
| 153 | return FALSE; |
| 154 | } |
| 155 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 156 | { |
| 157 | |
| 158 | if(pMac->lim.gpSession[i].valid == TRUE) |
| 159 | { |
| 160 | if(!( ( ( (pMac->lim.gpSession[i].bssType == eSIR_INFRASTRUCTURE_MODE) || |
| 161 | (pMac->lim.gpSession[i].limSystemRole == eLIM_BT_AMP_STA_ROLE))&& |
| 162 | (pMac->lim.gpSession[i].limSmeState == eLIM_SME_LINK_EST_STATE) )|| |
| 163 | |
| 164 | ( ( (pMac->lim.gpSession[i].bssType == eSIR_IBSS_MODE)|| |
| 165 | (pMac->lim.gpSession[i].limSystemRole == eLIM_BT_AMP_AP_ROLE)|| |
| 166 | (pMac->lim.gpSession[i].limSystemRole == eLIM_BT_AMP_STA_ROLE) )&& |
| 167 | (pMac->lim.gpSession[i].limSmeState == eLIM_SME_NORMAL_STATE) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 168 | || ( ( ( (pMac->lim.gpSession[i].bssType == eSIR_INFRA_AP_MODE) |
| 169 | && ( pMac->lim.gpSession[i].pePersona == VOS_P2P_GO_MODE) ) |
| 170 | || (pMac->lim.gpSession[i].limSystemRole == eLIM_AP_ROLE) ) |
| 171 | && (pMac->lim.gpSession[i].limSmeState == eLIM_SME_NORMAL_STATE) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 172 | )) |
| 173 | { |
| 174 | validState = FALSE; |
| 175 | break; |
| 176 | } |
| 177 | |
| 178 | } |
| 179 | } |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 180 | limLog(pMac, LOG1, FL("FreshScanReqd: %d "), validState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 181 | |
| 182 | if( (validState) && (returnFreshResults & SIR_BG_SCAN_RETURN_FRESH_RESULTS)) |
| 183 | return TRUE; |
| 184 | |
| 185 | return FALSE; |
| 186 | } |
| 187 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 188 | |
| 189 | |
| 190 | /** |
| 191 | * __limIsSmeAssocCnfValid() |
| 192 | * |
| 193 | *FUNCTION: |
| 194 | * This function is called by limProcessLmmMessages() upon |
| 195 | * receiving SME_ASSOC_CNF. |
| 196 | * |
| 197 | *LOGIC: |
| 198 | * Message validity checks are performed in this function |
| 199 | * |
| 200 | *ASSUMPTIONS: |
| 201 | * |
| 202 | *NOTE: |
| 203 | * |
| 204 | * @param pMeasReq Pointer to Received ASSOC_CNF message |
| 205 | * @return true When received SME_ASSOC_CNF is formatted |
| 206 | * correctly |
| 207 | * false otherwise |
| 208 | */ |
| 209 | |
| 210 | inline static tANI_U8 |
| 211 | __limIsSmeAssocCnfValid(tpSirSmeAssocCnf pAssocCnf) |
| 212 | { |
| 213 | if (limIsGroupAddr(pAssocCnf->peerMacAddr)) |
| 214 | return false; |
| 215 | else |
| 216 | return true; |
| 217 | } /*** end __limIsSmeAssocCnfValid() ***/ |
| 218 | |
| 219 | |
| 220 | /** |
| 221 | * __limGetSmeJoinReqSizeForAlloc() |
| 222 | * |
| 223 | *FUNCTION: |
| 224 | * This function is called in various places to get IE length |
| 225 | * from tSirBssDescription structure |
| 226 | * number being scanned. |
| 227 | * |
| 228 | *PARAMS: |
| 229 | * |
| 230 | *LOGIC: |
| 231 | * |
| 232 | *ASSUMPTIONS: |
| 233 | * NA |
| 234 | * |
| 235 | *NOTE: |
| 236 | * NA |
| 237 | * |
| 238 | * @param pBssDescr |
| 239 | * @return Total IE length |
| 240 | */ |
| 241 | |
| 242 | static tANI_U16 |
| 243 | __limGetSmeJoinReqSizeForAlloc(tANI_U8 *pBuf) |
| 244 | { |
| 245 | tANI_U16 len = 0; |
| 246 | |
| 247 | if (!pBuf) |
| 248 | return len; |
| 249 | |
| 250 | pBuf += sizeof(tANI_U16); |
| 251 | len = limGetU16( pBuf ); |
| 252 | return (len + sizeof( tANI_U16 )); |
| 253 | } /*** end __limGetSmeJoinReqSizeForAlloc() ***/ |
| 254 | |
| 255 | |
| 256 | /**---------------------------------------------------------------- |
| 257 | \fn __limIsDeferedMsgForLearn |
| 258 | |
| 259 | \brief Has role only if 11h is enabled. Not used on STA side. |
| 260 | Defers the message if SME is in learn state and brings |
| 261 | the LIM back to normal mode. |
| 262 | |
| 263 | \param pMac |
| 264 | \param pMsg - Pointer to message posted from SME to LIM. |
| 265 | \return TRUE - If defered |
| 266 | FALSE - Otherwise |
| 267 | ------------------------------------------------------------------*/ |
| 268 | static tANI_BOOLEAN |
| 269 | __limIsDeferedMsgForLearn(tpAniSirGlobal pMac, tpSirMsgQ pMsg) |
| 270 | { |
| 271 | if (limIsSystemInScanState(pMac)) |
| 272 | { |
| 273 | if (limDeferMsg(pMac, pMsg) != TX_SUCCESS) |
| 274 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 275 | PELOGE(limLog(pMac, LOGE, FL("Could not defer Msg = %d"), pMsg->type);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 276 | return eANI_BOOLEAN_FALSE; |
| 277 | } |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 278 | PELOG1(limLog(pMac, LOG1, FL("Defer the message, in learn mode type = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 279 | pMsg->type);) |
| 280 | |
| 281 | /** Send finish scan req to HAL only if LIM is not waiting for any response |
| 282 | * from HAL like init scan rsp, start scan rsp etc. |
| 283 | */ |
| 284 | if (GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 285 | { |
| 286 | //Set the resume channel to Any valid channel (invalid). |
| 287 | //This will instruct HAL to set it to any previous valid channel. |
| 288 | peSetResumeChannel(pMac, 0, 0); |
| 289 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_LEARN_WAIT_STATE); |
| 290 | } |
| 291 | |
| 292 | return eANI_BOOLEAN_TRUE; |
| 293 | } |
| 294 | return eANI_BOOLEAN_FALSE; |
| 295 | } |
| 296 | |
| 297 | /**---------------------------------------------------------------- |
| 298 | \fn __limIsDeferedMsgForRadar |
| 299 | |
| 300 | \brief Has role only if 11h is enabled. Not used on STA side. |
| 301 | Defers the message if radar is detected. |
| 302 | |
| 303 | \param pMac |
| 304 | \param pMsg - Pointer to message posted from SME to LIM. |
| 305 | \return TRUE - If defered |
| 306 | FALSE - Otherwise |
| 307 | ------------------------------------------------------------------*/ |
| 308 | static tANI_BOOLEAN |
| 309 | __limIsDeferedMsgForRadar(tpAniSirGlobal pMac, tpSirMsgQ pMsg) |
| 310 | { |
| 311 | /** fRadarDetCurOperChan will be set only if we detect radar in current |
| 312 | * operating channel and System Role == AP ROLE */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 313 | //TODO: Need to take care radar detection. |
| 314 | //if (LIM_IS_RADAR_DETECTED(pMac)) |
| 315 | if( 0 ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 316 | { |
| 317 | if (limDeferMsg(pMac, pMsg) != TX_SUCCESS) |
| 318 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 319 | PELOGE(limLog(pMac, LOGE, FL("Could not defer Msg = %d"), pMsg->type);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 320 | return eANI_BOOLEAN_FALSE; |
| 321 | } |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 322 | PELOG1(limLog(pMac, LOG1, FL("Defer the message, in learn mode type = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 323 | pMsg->type);) |
| 324 | return eANI_BOOLEAN_TRUE; |
| 325 | } |
| 326 | return eANI_BOOLEAN_FALSE; |
| 327 | } |
| 328 | |
| 329 | |
| 330 | /** |
| 331 | * __limProcessSmeStartReq() |
| 332 | * |
| 333 | *FUNCTION: |
| 334 | * This function is called to process SME_START_REQ message |
| 335 | * from HDD or upper layer application. |
| 336 | * |
| 337 | *LOGIC: |
| 338 | * |
| 339 | *ASSUMPTIONS: |
| 340 | * |
| 341 | *NOTE: |
| 342 | * |
| 343 | * @param pMac Pointer to Global MAC structure |
| 344 | * @param *pMsgBuf A pointer to the SME message buffer |
| 345 | * @return None |
| 346 | */ |
| 347 | |
| 348 | static void |
| 349 | __limProcessSmeStartReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 350 | { |
| 351 | tSirResultCodes retCode = eSIR_SME_SUCCESS; |
| 352 | tANI_U8 smesessionId; |
| 353 | tANI_U16 smetransactionId; |
| 354 | |
| 355 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 356 | limLog(pMac, LOG1, FL("Received SME_START_REQ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | |
| 358 | limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&smesessionId,&smetransactionId); |
| 359 | |
| 360 | if (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) |
| 361 | { |
| 362 | pMac->lim.gLimSmeState = eLIM_SME_IDLE_STATE; |
| 363 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 364 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, NO_SESSION, pMac->lim.gLimSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 365 | |
| 366 | /// By default do not return after first scan match |
| 367 | pMac->lim.gLimReturnAfterFirstMatch = 0; |
| 368 | |
| 369 | /// Initialize MLM state machine |
| 370 | limInitMlm(pMac); |
| 371 | |
| 372 | /// By default return unique scan results |
| 373 | pMac->lim.gLimReturnUniqueResults = true; |
| 374 | pMac->lim.gLimSmeScanResultLength = 0; |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 375 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 376 | pMac->lim.gLimSmeLfrScanResultLength = 0; |
| 377 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 378 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | if (((tSirSmeStartReq *) pMsgBuf)->sendNewBssInd) |
| 380 | { |
| 381 | /* |
| 382 | * Need to indicate new BSSs found during background scanning to |
| 383 | * host. Update this parameter at CFG |
| 384 | */ |
| 385 | if (cfgSetInt(pMac, WNI_CFG_NEW_BSS_FOUND_IND, ((tSirSmeStartReq *) pMsgBuf)->sendNewBssInd) |
| 386 | != eSIR_SUCCESS) |
| 387 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 388 | limLog(pMac, LOGP, FL("could not set NEIGHBOR_BSS_IND at CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 389 | retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 390 | } |
| 391 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 392 | } |
| 393 | else |
| 394 | { |
| 395 | /** |
| 396 | * Should not have received eWNI_SME_START_REQ in states |
| 397 | * other than OFFLINE. Return response to host and |
| 398 | * log error |
| 399 | */ |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 400 | limLog(pMac, LOGE, FL("Invalid SME_START_REQ received in SME state %d"),pMac->lim.gLimSmeState ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 401 | limPrintSmeState(pMac, LOGE, pMac->lim.gLimSmeState); |
| 402 | retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 403 | } |
| 404 | limSendSmeRsp(pMac, eWNI_SME_START_RSP, retCode,smesessionId,smetransactionId); |
| 405 | } /*** end __limProcessSmeStartReq() ***/ |
| 406 | |
| 407 | |
| 408 | /** ------------------------------------------------------------- |
| 409 | \fn __limProcessSmeSysReadyInd |
| 410 | \brief handles the notification from HDD. PE just forwards this message to HAL. |
| 411 | \param tpAniSirGlobal pMac |
| 412 | \param tANI_U32* pMsgBuf |
| 413 | \return TRUE-Posting to HAL failed, so PE will consume the buffer. |
| 414 | \ FALSE-Posting to HAL successful, so HAL will consume the buffer. |
| 415 | -------------------------------------------------------------*/ |
| 416 | static tANI_BOOLEAN |
| 417 | __limProcessSmeSysReadyInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 418 | { |
| 419 | tSirMsgQ msg; |
| 420 | |
| 421 | msg.type = WDA_SYS_READY_IND; |
| 422 | msg.reserved = 0; |
| 423 | msg.bodyptr = pMsgBuf; |
| 424 | msg.bodyval = 0; |
| 425 | |
Jeff Johnson | 9275169 | 2013-03-06 16:00:33 -0800 | [diff] [blame] | 426 | if (pMac->gDriverType != eDRIVER_TYPE_MFG) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 427 | { |
Jeff Johnson | 9275169 | 2013-03-06 16:00:33 -0800 | [diff] [blame] | 428 | peRegisterTLHandle(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 429 | } |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 430 | PELOGW(limLog(pMac, LOGW, FL("sending WDA_SYS_READY_IND msg to HAL"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 431 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 432 | |
Jeff Johnson | 9275169 | 2013-03-06 16:00:33 -0800 | [diff] [blame] | 433 | if (eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 434 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 435 | limLog(pMac, LOGP, FL("wdaPostCtrlMsg failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 436 | return eANI_BOOLEAN_TRUE; |
| 437 | } |
| 438 | return eANI_BOOLEAN_FALSE; |
| 439 | } |
| 440 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 441 | #ifdef WLAN_FEATURE_11AC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 442 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 443 | tANI_U32 limGetCenterChannel(tpAniSirGlobal pMac,tANI_U8 primarychanNum,ePhyChanBondState secondaryChanOffset, tANI_U8 chanWidth) |
| 444 | { |
| 445 | if (chanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) |
| 446 | { |
| 447 | switch(secondaryChanOffset) |
| 448 | { |
| 449 | case PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 450 | return primarychanNum; |
| 451 | case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 452 | return primarychanNum + 2; |
| 453 | case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 454 | return primarychanNum - 2; |
| 455 | case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 456 | return primarychanNum + 6; |
| 457 | case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 458 | return primarychanNum + 2; |
| 459 | case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 460 | return primarychanNum - 2; |
| 461 | case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 462 | return primarychanNum - 6; |
| 463 | default : |
| 464 | return eSIR_CFG_INVALID_ID; |
| 465 | } |
| 466 | } |
| 467 | else if (chanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ) |
| 468 | { |
| 469 | switch(secondaryChanOffset) |
| 470 | { |
| 471 | case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 472 | return primarychanNum + 2; |
| 473 | case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 474 | return primarychanNum - 2; |
| 475 | case PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 476 | return primarychanNum; |
| 477 | case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 478 | return primarychanNum + 2; |
| 479 | case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 480 | return primarychanNum - 2; |
| 481 | case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 482 | return primarychanNum + 2; |
| 483 | case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 484 | return primarychanNum - 2; |
| 485 | case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 486 | return primarychanNum + 2; |
| 487 | case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 488 | return primarychanNum - 2; |
| 489 | default : |
| 490 | return eSIR_CFG_INVALID_ID; |
| 491 | } |
| 492 | } |
| 493 | return primarychanNum; |
| 494 | } |
| 495 | |
| 496 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 497 | /** |
| 498 | * __limHandleSmeStartBssRequest() |
| 499 | * |
| 500 | *FUNCTION: |
| 501 | * This function is called to process SME_START_BSS_REQ message |
| 502 | * from HDD or upper layer application. |
| 503 | * |
| 504 | *LOGIC: |
| 505 | * |
| 506 | *ASSUMPTIONS: |
| 507 | * |
| 508 | *NOTE: |
| 509 | * |
| 510 | * @param pMac Pointer to Global MAC structure |
| 511 | * @param *pMsgBuf A pointer to the SME message buffer |
| 512 | * @return None |
| 513 | */ |
| 514 | |
| 515 | static void |
| 516 | __limHandleSmeStartBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 517 | { |
| 518 | tANI_U16 size; |
| 519 | tANI_U32 val = 0; |
| 520 | tSirRetStatus retStatus; |
| 521 | tSirMacChanNum channelNumber; |
Jeff Johnson | ace9110 | 2013-04-05 08:03:18 -0700 | [diff] [blame] | 522 | tLimMlmStartReq *pMlmStartReq = NULL; |
| 523 | tpSirSmeStartBssReq pSmeStartBssReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 524 | tSirResultCodes retCode = eSIR_SME_SUCCESS; |
| 525 | tANI_U32 autoGenBssId = FALSE; //Flag Used in case of IBSS to Auto generate BSSID. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 526 | tANI_U8 sessionId; |
| 527 | tpPESession psessionEntry = NULL; |
| 528 | tANI_U8 smesessionId; |
| 529 | tANI_U16 smetransactionId; |
| 530 | |
| 531 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 532 | //Since the session is not created yet, sending NULL. The response should have the correct state. |
| 533 | limDiagEventReport(pMac, WLAN_PE_DIAG_START_BSS_REQ_EVENT, NULL, 0, 0); |
| 534 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 535 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 536 | limLog(pMac, LOG1, FL("Received SME_START_BSS_REQ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 537 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 538 | /* Global Sme state and mlm states are not defined yet, for BT-AMP Suppoprt . TO BE DONE */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 539 | if ( (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) || |
| 540 | (pMac->lim.gLimSmeState == eLIM_SME_IDLE_STATE)) |
| 541 | { |
| 542 | size = sizeof(tSirSmeStartBssReq) + SIR_MAC_MAX_IE_LENGTH; |
| 543 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 544 | pSmeStartBssReq = vos_mem_malloc(size); |
| 545 | if ( NULL == pSmeStartBssReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 546 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 547 | PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed for pMac->lim.gpLimStartBssReq"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 548 | /// Send failure response to host |
| 549 | retCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 550 | goto end; |
| 551 | } |
| 552 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 553 | vos_mem_set((void *)pSmeStartBssReq, size, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 554 | |
| 555 | if ((limStartBssReqSerDes(pMac, pSmeStartBssReq, (tANI_U8 *) pMsgBuf) == eSIR_FAILURE) || |
| 556 | (!limIsSmeStartBssReqValid(pMac, pSmeStartBssReq))) |
| 557 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 558 | PELOGW(limLog(pMac, LOGW, FL("Received invalid eWNI_SME_START_BSS_REQ"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 559 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 560 | goto free; |
| 561 | } |
| 562 | #if 0 |
| 563 | PELOG3(limLog(pMac, LOG3, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 564 | FL("Parsed START_BSS_REQ fields are bssType=%d, channelId=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 565 | pMac->lim.gpLimStartBssReq->bssType, pMac->lim.gpLimStartBssReq->channelId);) |
| 566 | #endif |
| 567 | |
| 568 | /* This is the place where PE is going to create a session. |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 569 | * If session is not existed, then create a new session */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 570 | if((psessionEntry = peFindSessionByBssid(pMac,pSmeStartBssReq->bssId,&sessionId)) != NULL) |
| 571 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 572 | limLog(pMac, LOGW, FL("Session Already exists for given BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 573 | retCode = eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED; |
| 574 | psessionEntry = NULL; |
| 575 | goto free; |
| 576 | } |
| 577 | else |
| 578 | { |
| 579 | if((psessionEntry = peCreateSession(pMac,pSmeStartBssReq->bssId,&sessionId, pMac->lim.maxStation)) == NULL) |
| 580 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 581 | limLog(pMac, LOGW, FL("Session Can not be created ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 582 | retCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 583 | goto free; |
| 584 | } |
| 585 | |
| 586 | } |
| 587 | |
| 588 | /* Store the session related parameters in newly created session */ |
| 589 | psessionEntry->pLimStartBssReq = pSmeStartBssReq; |
| 590 | |
| 591 | /* Store PE sessionId in session Table */ |
| 592 | psessionEntry->peSessionId = sessionId; |
| 593 | |
| 594 | /* Store SME session Id in sessionTable */ |
| 595 | psessionEntry->smeSessionId = pSmeStartBssReq->sessionId; |
| 596 | |
| 597 | psessionEntry->transactionId = pSmeStartBssReq->transactionId; |
| 598 | |
| 599 | sirCopyMacAddr(psessionEntry->selfMacAddr,pSmeStartBssReq->selfMacAddr); |
| 600 | |
| 601 | /* Copy SSID to session table */ |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 602 | vos_mem_copy( (tANI_U8 *)&psessionEntry->ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 603 | (tANI_U8 *)&pSmeStartBssReq->ssId, |
| 604 | (pSmeStartBssReq->ssId.length + 1)); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 605 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 606 | psessionEntry->bssType = pSmeStartBssReq->bssType; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 607 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 608 | psessionEntry->nwType = pSmeStartBssReq->nwType; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 609 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 610 | psessionEntry->beaconParams.beaconInterval = pSmeStartBssReq->beaconInterval; |
| 611 | |
| 612 | /* Store the channel number in session Table */ |
| 613 | psessionEntry->currentOperChannel = pSmeStartBssReq->channelId; |
| 614 | |
| 615 | /*Store Persona */ |
| 616 | psessionEntry->pePersona = pSmeStartBssReq->bssPersona; |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 617 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,FL("PE PERSONA=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 618 | psessionEntry->pePersona); |
| 619 | |
| 620 | /*Update the phymode*/ |
| 621 | psessionEntry->gLimPhyMode = pSmeStartBssReq->nwType; |
| 622 | |
| 623 | psessionEntry->maxTxPower = cfgGetRegulatoryMaxTransmitPower( pMac, |
| 624 | psessionEntry->currentOperChannel ); |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 625 | |
| 626 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 627 | /*Store Overlapping BSS Scan Parameters IEs to session table */ |
| 628 | if (pSmeStartBssReq->apHT40_24GEnabled) |
| 629 | { |
| 630 | limInitOBSSScanParams(pMac, psessionEntry); |
| 631 | } |
| 632 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 633 | /* Store the dot 11 mode in to the session Table*/ |
| 634 | |
| 635 | psessionEntry->dot11mode = pSmeStartBssReq->dot11mode; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 636 | psessionEntry->htCapability = IS_DOT11_MODE_HT(psessionEntry->dot11mode); |
| 637 | #ifdef WLAN_FEATURE_11AC |
| 638 | psessionEntry->vhtCapability = IS_DOT11_MODE_VHT(psessionEntry->dot11mode); |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 639 | VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO, |
| 640 | FL("*****psessionEntry->vhtCapability = %d"),psessionEntry->vhtCapability); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 641 | #endif |
Gopichand Nakkala | b2d2c31 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 642 | |
| 643 | psessionEntry->txLdpcIniFeatureEnabled = |
| 644 | pSmeStartBssReq->txLdpcIniFeatureEnabled; |
| 645 | |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 646 | #ifdef WLAN_FEATURE_11W |
| 647 | psessionEntry->limRmfEnabled = pSmeStartBssReq->pmfCapable ? 1 : 0; |
| 648 | limLog(pMac, LOG1, FL("Session RMF enabled: %d"), psessionEntry->limRmfEnabled); |
| 649 | #endif |
| 650 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 651 | vos_mem_copy((void*)&psessionEntry->rateSet, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 652 | (void*)&pSmeStartBssReq->operationalRateSet, |
| 653 | sizeof(tSirMacRateSet)); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 654 | vos_mem_copy((void*)&psessionEntry->extRateSet, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 655 | (void*)&pSmeStartBssReq->extendedRateSet, |
| 656 | sizeof(tSirMacRateSet)); |
| 657 | |
| 658 | switch(pSmeStartBssReq->bssType) |
| 659 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 660 | case eSIR_INFRA_AP_MODE: |
| 661 | psessionEntry->limSystemRole = eLIM_AP_ROLE; |
| 662 | psessionEntry->privacy = pSmeStartBssReq->privacy; |
| 663 | psessionEntry->fwdWPSPBCProbeReq = pSmeStartBssReq->fwdWPSPBCProbeReq; |
| 664 | psessionEntry->authType = pSmeStartBssReq->authType; |
| 665 | /* Store the DTIM period */ |
| 666 | psessionEntry->dtimPeriod = (tANI_U8)pSmeStartBssReq->dtimPeriod; |
| 667 | /*Enable/disable UAPSD*/ |
| 668 | psessionEntry->apUapsdEnable = pSmeStartBssReq->apUapsdEnable; |
| 669 | if (psessionEntry->pePersona == VOS_P2P_GO_MODE) |
| 670 | { |
| 671 | psessionEntry->proxyProbeRspEn = 0; |
| 672 | } |
| 673 | else |
| 674 | { |
| 675 | /* To detect PBC overlap in SAP WPS mode, Host handles |
| 676 | * Probe Requests. |
| 677 | */ |
| 678 | if(SAP_WPS_DISABLED == pSmeStartBssReq->wps_state) |
| 679 | { |
| 680 | psessionEntry->proxyProbeRspEn = 1; |
| 681 | } |
| 682 | else |
| 683 | { |
| 684 | psessionEntry->proxyProbeRspEn = 0; |
| 685 | } |
| 686 | } |
| 687 | psessionEntry->ssidHidden = pSmeStartBssReq->ssidHidden; |
| 688 | psessionEntry->wps_state = pSmeStartBssReq->wps_state; |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 689 | limGetShortSlotFromPhyMode(pMac, psessionEntry, |
| 690 | psessionEntry->gLimPhyMode, |
| 691 | &psessionEntry->shortSlotTimeSupported); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 692 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 693 | case eSIR_IBSS_MODE: |
| 694 | psessionEntry->limSystemRole = eLIM_STA_IN_IBSS_ROLE; |
krunal soni | 45b9eb6 | 2014-03-26 12:54:25 -0700 | [diff] [blame] | 695 | limGetShortSlotFromPhyMode(pMac, psessionEntry, |
| 696 | psessionEntry->gLimPhyMode, |
| 697 | &psessionEntry->shortSlotTimeSupported); |
Abhishek Singh | d5c3127 | 2014-03-07 14:46:50 +0530 | [diff] [blame] | 698 | /* In WPA-NONE case we wont get the privacy bit in ibss config |
| 699 | * from supplicant, but we are updating WNI_CFG_PRIVACY_ENABLED |
| 700 | * on basis of Encryption type in csrRoamSetBssConfigCfg. So |
| 701 | * get the privacy info from WNI_CFG_PRIVACY_ENABLED |
| 702 | */ |
| 703 | if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED, &val) |
| 704 | != eSIR_SUCCESS) |
| 705 | limLog(pMac, LOGE, FL("cfg get WNI_CFG_PRIVACY_ENABLED" |
| 706 | " failed")); |
| 707 | psessionEntry->privacy =(tANI_U8) val; |
krunal soni | e9002db | 2013-11-25 14:24:17 -0800 | [diff] [blame] | 708 | psessionEntry->isCoalesingInIBSSAllowed = |
| 709 | pSmeStartBssReq->isCoalesingInIBSSAllowed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 710 | break; |
| 711 | |
| 712 | case eSIR_BTAMP_AP_MODE: |
| 713 | psessionEntry->limSystemRole = eLIM_BT_AMP_AP_ROLE; |
| 714 | break; |
| 715 | |
| 716 | case eSIR_BTAMP_STA_MODE: |
| 717 | psessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; |
| 718 | break; |
| 719 | |
| 720 | /* There is one more mode called auto mode. which is used no where */ |
| 721 | |
| 722 | //FORBUILD -TEMPFIX.. HOW TO use AUTO MODE????? |
| 723 | |
| 724 | |
| 725 | default: |
| 726 | //not used anywhere...used in scan function |
| 727 | break; |
| 728 | } |
| 729 | |
| 730 | // BT-AMP: Allocate memory for the array of parsed (Re)Assoc request structure |
| 731 | if ( (pSmeStartBssReq->bssType == eSIR_BTAMP_AP_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 732 | || (pSmeStartBssReq->bssType == eSIR_INFRA_AP_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 733 | ) |
| 734 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 735 | psessionEntry->parsedAssocReq = vos_mem_malloc( |
| 736 | psessionEntry->dph.dphHashTable.size * sizeof(tpSirAssocReq)); |
| 737 | if ( NULL == psessionEntry->parsedAssocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 739 | limLog(pMac, LOGW, FL("AllocateMemory() failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 740 | retCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 741 | goto free; |
| 742 | } |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 743 | vos_mem_set(psessionEntry->parsedAssocReq, |
| 744 | (psessionEntry->dph.dphHashTable.size * sizeof(tpSirAssocReq)), |
| 745 | 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 746 | } |
| 747 | |
| 748 | /* Channel Bonding is not addressd yet for BT-AMP Support.. sunit will address channel bonding */ |
| 749 | if (pSmeStartBssReq->channelId) |
| 750 | { |
| 751 | channelNumber = pSmeStartBssReq->channelId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 752 | psessionEntry->htSupportedChannelWidthSet = (pSmeStartBssReq->cbMode)?1:0; // This is already merged value of peer and self - done by csr in csrGetCBModeFromIes |
| 753 | psessionEntry->htRecommendedTxWidthSet = psessionEntry->htSupportedChannelWidthSet; |
| 754 | psessionEntry->htSecondaryChannelOffset = pSmeStartBssReq->cbMode; |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 755 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 756 | FL("cbMode %u"), pSmeStartBssReq->cbMode); |
| 757 | #ifdef WLAN_FEATURE_11AC |
| 758 | if(psessionEntry->vhtCapability) |
| 759 | { |
| 760 | tANI_U32 centerChan; |
| 761 | tANI_U32 chanWidth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 762 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 763 | if (wlan_cfgGetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH, |
| 764 | &chanWidth) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 765 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 766 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 767 | FL("Unable to retrieve Channel Width from CFG")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 768 | } |
Abhishek Singh | b92f70c | 2014-04-28 12:13:08 +0530 | [diff] [blame] | 769 | |
Abhishek Singh | 921926b | 2014-02-13 17:21:01 +0530 | [diff] [blame] | 770 | if(channelNumber <= RF_CHAN_14 && |
Abhishek Singh | b92f70c | 2014-04-28 12:13:08 +0530 | [diff] [blame] | 771 | chanWidth != eHT_CHANNEL_WIDTH_20MHZ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 772 | { |
Abhishek Singh | b92f70c | 2014-04-28 12:13:08 +0530 | [diff] [blame] | 773 | chanWidth = eHT_CHANNEL_WIDTH_20MHZ; |
Abhishek Singh | 921926b | 2014-02-13 17:21:01 +0530 | [diff] [blame] | 774 | limLog(pMac, LOG1, FL("Setting chanWidth to 20Mhz for" |
| 775 | " channel %d"),channelNumber); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 776 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 777 | |
Abhishek Singh | b92f70c | 2014-04-28 12:13:08 +0530 | [diff] [blame] | 778 | if(chanWidth == eHT_CHANNEL_WIDTH_20MHZ || |
| 779 | chanWidth == eHT_CHANNEL_WIDTH_40MHZ) |
Abhishek Singh | 921926b | 2014-02-13 17:21:01 +0530 | [diff] [blame] | 780 | { |
Abhishek Singh | b92f70c | 2014-04-28 12:13:08 +0530 | [diff] [blame] | 781 | if (cfgSetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH, |
| 782 | WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ) |
| 783 | != eSIR_SUCCESS) |
| 784 | { |
| 785 | limLog(pMac, LOGP, FL("could not set " |
| 786 | " WNI_CFG_CHANNEL_BONDING_MODE at CFG")); |
| 787 | retCode = eSIR_LOGP_EXCEPTION; |
| 788 | goto free; |
| 789 | } |
| 790 | } |
| 791 | if (chanWidth == eHT_CHANNEL_WIDTH_80MHZ) |
| 792 | { |
| 793 | if (cfgSetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH, |
| 794 | WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) |
| 795 | != eSIR_SUCCESS) |
| 796 | { |
| 797 | limLog(pMac, LOGP, FL("could not set " |
| 798 | " WNI_CFG_CHANNEL_BONDING_MODE at CFG")); |
| 799 | retCode = eSIR_LOGP_EXCEPTION; |
| 800 | goto free; |
| 801 | } |
| 802 | |
| 803 | centerChan = limGetCenterChannel( pMac, channelNumber, |
| 804 | pSmeStartBssReq->cbMode, |
| 805 | WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 806 | if(centerChan != eSIR_CFG_INVALID_ID) |
| 807 | { |
Abhishek Singh | b92f70c | 2014-04-28 12:13:08 +0530 | [diff] [blame] | 808 | limLog(pMac, LOGW, FL("***Center Channel for " |
| 809 | "80MHZ channel width = %d"),centerChan); |
Madan Mohan Koyyalamudi | 8b152b8 | 2012-10-18 20:56:27 -0700 | [diff] [blame] | 810 | psessionEntry->apCenterChan = centerChan; |
Abhishek Singh | 921926b | 2014-02-13 17:21:01 +0530 | [diff] [blame] | 811 | if (cfgSetInt(pMac, |
Abhishek Singh | b92f70c | 2014-04-28 12:13:08 +0530 | [diff] [blame] | 812 | WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1, |
| 813 | centerChan) != eSIR_SUCCESS) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 814 | { |
Abhishek Singh | 921926b | 2014-02-13 17:21:01 +0530 | [diff] [blame] | 815 | limLog(pMac, LOGP, FL("could not set " |
Abhishek Singh | b92f70c | 2014-04-28 12:13:08 +0530 | [diff] [blame] | 816 | "WNI_CFG_CHANNEL_BONDING_MODE at CFG")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 817 | retCode = eSIR_LOGP_EXCEPTION; |
| 818 | goto free; |
| 819 | } |
| 820 | } |
| 821 | } |
| 822 | |
Abhishek Singh | b92f70c | 2014-04-28 12:13:08 +0530 | [diff] [blame] | 823 | /* All the translation is done by now for gVhtChannelWidth |
| 824 | * from .ini file to the actual values as defined in spec. |
| 825 | * So, grabing the spec value which is |
| 826 | * updated in .dat file by the above logic */ |
| 827 | if (wlan_cfgGetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH, |
| 828 | &chanWidth) != eSIR_SUCCESS) |
| 829 | { |
| 830 | limLog(pMac, LOGP, |
| 831 | FL("Unable to retrieve Channel Width from CFG")); |
| 832 | } |
Madan Mohan Koyyalamudi | 8b152b8 | 2012-10-18 20:56:27 -0700 | [diff] [blame] | 833 | /*For Sta+p2p-Go concurrency |
| 834 | vhtTxChannelWidthSet is used for storing p2p-GO channel width |
| 835 | apChanWidth is used for storing the AP channel width that the Sta is going to associate. |
| 836 | Initialize the apChanWidth same as p2p-GO channel width this gets over written once the station joins the AP |
| 837 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 838 | psessionEntry->vhtTxChannelWidthSet = chanWidth; |
Madan Mohan Koyyalamudi | 8b152b8 | 2012-10-18 20:56:27 -0700 | [diff] [blame] | 839 | psessionEntry->apChanWidth = chanWidth; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 840 | } |
| 841 | psessionEntry->htSecondaryChannelOffset = limGetHTCBState(pSmeStartBssReq->cbMode); |
| 842 | #endif |
| 843 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 844 | else |
| 845 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 846 | PELOGW(limLog(pMac, LOGW, FL("Received invalid eWNI_SME_START_BSS_REQ"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 847 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 848 | goto free; |
| 849 | } |
| 850 | |
| 851 | // Delete pre-auth list if any |
| 852 | limDeletePreAuthList(pMac); |
| 853 | |
| 854 | // Delete IBSS peer BSSdescription list if any |
| 855 | //limIbssDelete(pMac); sep 26 review |
| 856 | |
| 857 | |
| 858 | |
| 859 | #ifdef FIXME_GEN6 //following code may not be required. limInitMlm is now being invoked during peStart |
| 860 | /// Initialize MLM state machine |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 861 | limInitMlm(pMac); |
| 862 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 863 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 864 | psessionEntry->htCapability = IS_DOT11_MODE_HT(pSmeStartBssReq->dot11mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 865 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 866 | /* keep the RSN/WPA IE information in PE Session Entry |
| 867 | * later will be using this to check when received (Re)Assoc req |
| 868 | * */ |
| 869 | limSetRSNieWPAiefromSmeStartBSSReqMessage(pMac,&pSmeStartBssReq->rsnIE,psessionEntry); |
| 870 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 871 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 872 | //Taken care for only softAP case rest need to be done |
| 873 | if (psessionEntry->limSystemRole == eLIM_AP_ROLE){ |
| 874 | psessionEntry->gLimProtectionControl = pSmeStartBssReq->protEnabled; |
| 875 | /*each byte will have the following info |
| 876 | *bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 |
| 877 | *reserved reserved RIFS Lsig n-GF ht20 11g 11b*/ |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 878 | vos_mem_copy( (void *) &psessionEntry->cfgProtection, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 879 | (void *) &pSmeStartBssReq->ht_capab, |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 880 | sizeof( tANI_U16 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 881 | psessionEntry->pAPWPSPBCSession = NULL; // Initialize WPS PBC session link list |
| 882 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 883 | |
| 884 | // Prepare and Issue LIM_MLM_START_REQ to MLM |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 885 | pMlmStartReq = vos_mem_malloc(sizeof(tLimMlmStartReq)); |
| 886 | if ( NULL == pMlmStartReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 887 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 888 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for mlmStartReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 889 | retCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 890 | goto free; |
| 891 | } |
| 892 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 893 | vos_mem_set((void *) pMlmStartReq, sizeof(tLimMlmStartReq), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 894 | |
| 895 | /* Copy SSID to the MLM start structure */ |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 896 | vos_mem_copy( (tANI_U8 *) &pMlmStartReq->ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 897 | (tANI_U8 *) &pSmeStartBssReq->ssId, |
| 898 | pSmeStartBssReq->ssId.length + 1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 899 | pMlmStartReq->ssidHidden = pSmeStartBssReq->ssidHidden; |
| 900 | pMlmStartReq->obssProtEnabled = pSmeStartBssReq->obssProtEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 901 | |
| 902 | |
| 903 | pMlmStartReq->bssType = psessionEntry->bssType; |
| 904 | |
| 905 | /* Fill PE session Id from the session Table */ |
| 906 | pMlmStartReq->sessionId = psessionEntry->peSessionId; |
| 907 | |
| 908 | if( (pMlmStartReq->bssType == eSIR_BTAMP_STA_MODE) || (pMlmStartReq->bssType == eSIR_BTAMP_AP_MODE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 909 | || (pMlmStartReq->bssType == eSIR_INFRA_AP_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 910 | ) |
| 911 | { |
| 912 | //len = sizeof(tSirMacAddr); |
| 913 | //retStatus = wlan_cfgGetStr(pMac, WNI_CFG_STA_ID, (tANI_U8 *) pMlmStartReq->bssId, &len); |
| 914 | //if (retStatus != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 915 | //limLog(pMac, LOGP, FL("could not retrive BSSID, retStatus=%d"), retStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 916 | |
| 917 | /* Copy the BSSId from sessionTable to mlmStartReq struct */ |
| 918 | sirCopyMacAddr(pMlmStartReq->bssId,psessionEntry->bssId); |
| 919 | } |
| 920 | |
| 921 | else // ibss mode |
| 922 | { |
| 923 | pMac->lim.gLimIbssCoalescingHappened = false; |
| 924 | |
| 925 | if((retStatus = wlan_cfgGetInt(pMac, WNI_CFG_IBSS_AUTO_BSSID, &autoGenBssId)) != eSIR_SUCCESS) |
| 926 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 927 | limLog(pMac, LOGP, FL("Could not retrieve Auto Gen BSSID, retStatus=%d"), retStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 928 | retCode = eSIR_LOGP_EXCEPTION; |
| 929 | goto free; |
| 930 | } |
| 931 | |
| 932 | if(!autoGenBssId) |
| 933 | { |
| 934 | // We're not auto generating BSSID. Instead, get it from session entry |
| 935 | sirCopyMacAddr(pMlmStartReq->bssId,psessionEntry->bssId); |
| 936 | |
| 937 | if(pMlmStartReq->bssId[0] & 0x01) |
| 938 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 939 | PELOGE(limLog(pMac, LOGE, FL("Request to start IBSS with group BSSID\n Autogenerating the BSSID"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 940 | autoGenBssId = TRUE; |
| 941 | } |
| 942 | } |
| 943 | |
| 944 | if( autoGenBssId ) |
| 945 | { //if BSSID is not any uc id. then use locally generated BSSID. |
| 946 | //Autogenerate the BSSID |
| 947 | limGetRandomBssid( pMac, pMlmStartReq->bssId); |
| 948 | pMlmStartReq->bssId[0]= 0x02; |
| 949 | |
| 950 | /* Copy randomly generated BSSID to the session Table */ |
| 951 | sirCopyMacAddr(psessionEntry->bssId,pMlmStartReq->bssId); |
| 952 | } |
| 953 | } |
| 954 | /* store the channel num in mlmstart req structure */ |
| 955 | pMlmStartReq->channelNumber = psessionEntry->currentOperChannel; |
| 956 | pMlmStartReq->cbMode = pSmeStartBssReq->cbMode; |
| 957 | pMlmStartReq->beaconPeriod = psessionEntry->beaconParams.beaconInterval; |
| 958 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 959 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE ){ |
| 960 | pMlmStartReq->dtimPeriod = psessionEntry->dtimPeriod; |
| 961 | pMlmStartReq->wps_state = psessionEntry->wps_state; |
| 962 | |
| 963 | }else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 964 | { |
| 965 | if (wlan_cfgGetInt(pMac, WNI_CFG_DTIM_PERIOD, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 966 | limLog(pMac, LOGP, FL("could not retrieve DTIM Period")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 967 | pMlmStartReq->dtimPeriod = (tANI_U8)val; |
| 968 | } |
| 969 | |
| 970 | if (wlan_cfgGetInt(pMac, WNI_CFG_CFP_PERIOD, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 971 | limLog(pMac, LOGP, FL("could not retrieve Beacon interval")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 972 | pMlmStartReq->cfParamSet.cfpPeriod = (tANI_U8)val; |
| 973 | |
| 974 | if (wlan_cfgGetInt(pMac, WNI_CFG_CFP_MAX_DURATION, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 975 | limLog(pMac, LOGP, FL("could not retrieve CFPMaxDuration")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 976 | pMlmStartReq->cfParamSet.cfpMaxDuration = (tANI_U16) val; |
| 977 | |
| 978 | //this may not be needed anymore now, as rateSet is now included in the session entry and MLM has session context. |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 979 | vos_mem_copy((void*)&pMlmStartReq->rateSet, (void*)&psessionEntry->rateSet, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 980 | sizeof(tSirMacRateSet)); |
| 981 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 982 | // Now populate the 11n related parameters |
| 983 | pMlmStartReq->nwType = psessionEntry->nwType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 984 | pMlmStartReq->htCapable = psessionEntry->htCapability; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 985 | // |
| 986 | // FIXME_GEN4 - Determine the appropriate defaults... |
| 987 | // |
| 988 | pMlmStartReq->htOperMode = pMac->lim.gHTOperMode; |
| 989 | pMlmStartReq->dualCTSProtection = pMac->lim.gHTDualCTSProtection; // Unused |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 990 | pMlmStartReq->txChannelWidthSet = psessionEntry->htRecommendedTxWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 991 | |
| 992 | /* sep26 review */ |
| 993 | psessionEntry->limRFBand = limGetRFBand(channelNumber); |
| 994 | |
| 995 | // Initialize 11h Enable Flag |
| 996 | psessionEntry->lim11hEnable = 0; |
| 997 | if((pMlmStartReq->bssType != eSIR_IBSS_MODE) && |
| 998 | (SIR_BAND_5_GHZ == psessionEntry->limRFBand) ) |
| 999 | { |
| 1000 | if (wlan_cfgGetInt(pMac, WNI_CFG_11H_ENABLED, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1001 | limLog(pMac, LOGP, FL("Fail to get WNI_CFG_11H_ENABLED ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1002 | psessionEntry->lim11hEnable = val; |
| 1003 | } |
| 1004 | |
| 1005 | if (!psessionEntry->lim11hEnable) |
| 1006 | { |
| 1007 | if (cfgSetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, 0) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1008 | limLog(pMac, LOGP, FL("Fail to get WNI_CFG_11H_ENABLED ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1009 | } |
| 1010 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1011 | psessionEntry ->limPrevSmeState = psessionEntry->limSmeState; |
| 1012 | psessionEntry ->limSmeState = eLIM_SME_WT_START_BSS_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1013 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry ->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1014 | |
| 1015 | limPostMlmMessage(pMac, LIM_MLM_START_REQ, (tANI_U32 *) pMlmStartReq); |
| 1016 | return; |
| 1017 | } |
| 1018 | else |
| 1019 | { |
| 1020 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1021 | limLog(pMac, LOGE, FL("Received unexpected START_BSS_REQ, in state %X"),pMac->lim.gLimSmeState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1022 | retCode = eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED; |
| 1023 | goto end; |
| 1024 | } // if (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) |
| 1025 | |
| 1026 | free: |
Jeff Johnson | ace9110 | 2013-04-05 08:03:18 -0700 | [diff] [blame] | 1027 | if ((psessionEntry != NULL) && |
| 1028 | (psessionEntry->pLimStartBssReq == pSmeStartBssReq)) |
| 1029 | { |
| 1030 | psessionEntry->pLimStartBssReq = NULL; |
| 1031 | } |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1032 | vos_mem_free( pSmeStartBssReq); |
| 1033 | vos_mem_free( pMlmStartReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1034 | |
| 1035 | end: |
| 1036 | |
| 1037 | /* This routine should return the sme sessionId and SME transaction Id */ |
| 1038 | limGetSessionInfo(pMac,(tANI_U8*)pMsgBuf,&smesessionId,&smetransactionId); |
| 1039 | |
| 1040 | if(NULL != psessionEntry) |
| 1041 | { |
| 1042 | peDeleteSession(pMac,psessionEntry); |
| 1043 | psessionEntry = NULL; |
| 1044 | } |
| 1045 | limSendSmeStartBssRsp(pMac, eWNI_SME_START_BSS_RSP, retCode,psessionEntry,smesessionId,smetransactionId); |
| 1046 | } /*** end __limHandleSmeStartBssRequest() ***/ |
| 1047 | |
| 1048 | |
| 1049 | /**-------------------------------------------------------------- |
| 1050 | \fn __limProcessSmeStartBssReq |
| 1051 | |
| 1052 | \brief Wrapper for the function __limHandleSmeStartBssRequest |
| 1053 | This message will be defered until softmac come out of |
| 1054 | scan mode or if we have detected radar on the current |
| 1055 | operating channel. |
| 1056 | \param pMac |
| 1057 | \param pMsg |
| 1058 | |
| 1059 | \return TRUE - If we consumed the buffer |
| 1060 | FALSE - If have defered the message. |
| 1061 | ---------------------------------------------------------------*/ |
| 1062 | static tANI_BOOLEAN |
| 1063 | __limProcessSmeStartBssReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg) |
| 1064 | { |
| 1065 | if (__limIsDeferedMsgForLearn(pMac, pMsg) || |
| 1066 | __limIsDeferedMsgForRadar(pMac, pMsg)) |
| 1067 | { |
| 1068 | /** |
| 1069 | * If message defered, buffer is not consumed yet. |
| 1070 | * So return false |
| 1071 | */ |
| 1072 | return eANI_BOOLEAN_FALSE; |
| 1073 | } |
| 1074 | |
| 1075 | __limHandleSmeStartBssRequest(pMac, (tANI_U32 *) pMsg->bodyptr); |
| 1076 | return eANI_BOOLEAN_TRUE; |
| 1077 | } |
| 1078 | |
| 1079 | |
| 1080 | /** |
| 1081 | * limGetRandomBssid() |
| 1082 | * |
| 1083 | * FUNCTION:This function is called to process generate the random number for bssid |
| 1084 | * This function is called to process SME_SCAN_REQ message |
| 1085 | * from HDD or upper layer application. |
| 1086 | * |
| 1087 | * LOGIC: |
| 1088 | * |
| 1089 | * ASSUMPTIONS: |
| 1090 | * |
| 1091 | * NOTE: |
| 1092 | * 1. geneartes the unique random number for bssid in ibss |
| 1093 | * |
| 1094 | * @param pMac Pointer to Global MAC structure |
| 1095 | * @param *data Pointer to bssid buffer |
| 1096 | * @return None |
| 1097 | */ |
| 1098 | void limGetRandomBssid(tpAniSirGlobal pMac, tANI_U8 *data) |
| 1099 | { |
| 1100 | tANI_U32 random[2] ; |
| 1101 | random[0] = tx_time_get(); |
| 1102 | random[0] |= (random[0] << 15) ; |
| 1103 | random[1] = random[0] >> 1; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1104 | vos_mem_copy( data, (tANI_U8*)random, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1105 | } |
| 1106 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1107 | static eHalStatus limSendHalStartScanOffloadReq(tpAniSirGlobal pMac, |
| 1108 | tpSirSmeScanReq pScanReq) |
| 1109 | { |
| 1110 | tSirScanOffloadReq *pScanOffloadReq; |
| 1111 | tANI_U8 *p; |
| 1112 | tSirMsgQ msg; |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1113 | tANI_U16 i, len; |
| 1114 | tSirRetStatus rc = eSIR_SUCCESS; |
| 1115 | |
| 1116 | /* The tSirScanOffloadReq will reserve the space for first channel, |
| 1117 | so allocate the memory for (numChannels - 1) and uIEFieldLen */ |
| 1118 | len = sizeof(tSirScanOffloadReq) + (pScanReq->channelList.numChannels - 1) + |
| 1119 | pScanReq->uIEFieldLen; |
| 1120 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1121 | pScanOffloadReq = vos_mem_malloc(len); |
| 1122 | if ( NULL == pScanOffloadReq ) |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1123 | { |
| 1124 | limLog(pMac, LOGE, |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1125 | FL("AllocateMemory failed for pScanOffloadReq")); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1126 | return eHAL_STATUS_FAILURE; |
| 1127 | } |
| 1128 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1129 | vos_mem_set( (tANI_U8 *) pScanOffloadReq, len, 0); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1130 | |
| 1131 | msg.type = WDA_START_SCAN_OFFLOAD_REQ; |
| 1132 | msg.bodyptr = pScanOffloadReq; |
| 1133 | msg.bodyval = 0; |
| 1134 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1135 | vos_mem_copy((tANI_U8 *) pScanOffloadReq->bssId, |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1136 | (tANI_U8*) pScanReq->bssId, |
| 1137 | sizeof(tSirMacAddr)); |
| 1138 | |
| 1139 | if (pScanReq->numSsid > SIR_SCAN_MAX_NUM_SSID) |
| 1140 | { |
| 1141 | limLog(pMac, LOGE, |
| 1142 | FL("Invalid value (%d) for numSsid"), SIR_SCAN_MAX_NUM_SSID); |
Kiet Lam | b123319 | 2013-11-28 13:38:20 +0530 | [diff] [blame] | 1143 | vos_mem_free (pScanOffloadReq); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1144 | return eHAL_STATUS_FAILURE; |
| 1145 | } |
| 1146 | |
| 1147 | pScanOffloadReq->numSsid = pScanReq->numSsid; |
| 1148 | for (i = 0; i < pScanOffloadReq->numSsid; i++) |
| 1149 | { |
| 1150 | pScanOffloadReq->ssId[i].length = pScanReq->ssId[i].length; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1151 | vos_mem_copy((tANI_U8 *) pScanOffloadReq->ssId[i].ssId, |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1152 | (tANI_U8 *) pScanReq->ssId[i].ssId, |
| 1153 | pScanOffloadReq->ssId[i].length); |
| 1154 | } |
| 1155 | |
| 1156 | pScanOffloadReq->hiddenSsid = pScanReq->hiddenSsid; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1157 | vos_mem_copy((tANI_U8 *) pScanOffloadReq->selfMacAddr, |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1158 | (tANI_U8 *) pScanReq->selfMacAddr, |
| 1159 | sizeof(tSirMacAddr)); |
| 1160 | pScanOffloadReq->bssType = pScanReq->bssType; |
| 1161 | pScanOffloadReq->dot11mode = pScanReq->dot11mode; |
| 1162 | pScanOffloadReq->scanType = pScanReq->scanType; |
| 1163 | pScanOffloadReq->minChannelTime = pScanReq->minChannelTime; |
| 1164 | pScanOffloadReq->maxChannelTime = pScanReq->maxChannelTime; |
| 1165 | pScanOffloadReq->p2pSearch = pScanReq->p2pSearch; |
| 1166 | pScanOffloadReq->sessionId = pScanReq->sessionId; |
| 1167 | pScanOffloadReq->channelList.numChannels = |
| 1168 | pScanReq->channelList.numChannels; |
| 1169 | p = &(pScanOffloadReq->channelList.channelNumber[0]); |
| 1170 | for (i = 0; i < pScanOffloadReq->channelList.numChannels; i++) |
| 1171 | p[i] = pScanReq->channelList.channelNumber[i]; |
| 1172 | |
| 1173 | pScanOffloadReq->uIEFieldLen = pScanReq->uIEFieldLen; |
| 1174 | pScanOffloadReq->uIEFieldOffset = len - pScanOffloadReq->uIEFieldLen; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1175 | vos_mem_copy((tANI_U8 *) p + i, |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1176 | (tANI_U8 *) pScanReq + pScanReq->uIEFieldOffset, |
| 1177 | pScanOffloadReq->uIEFieldLen); |
| 1178 | |
| 1179 | rc = wdaPostCtrlMsg(pMac, &msg); |
| 1180 | if (rc != eSIR_SUCCESS) |
| 1181 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1182 | limLog(pMac, LOGE, FL("wdaPostCtrlMsg() return failure")); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1183 | vos_mem_free(pScanOffloadReq); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1184 | return eHAL_STATUS_FAILURE; |
| 1185 | } |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 1186 | limLog(pMac, LOG1, FL("Processed Offload Scan Request Successfully")); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1187 | |
| 1188 | return eHAL_STATUS_SUCCESS; |
| 1189 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1190 | |
| 1191 | /** |
| 1192 | * __limProcessSmeScanReq() |
| 1193 | * |
| 1194 | *FUNCTION: |
| 1195 | * This function is called to process SME_SCAN_REQ message |
| 1196 | * from HDD or upper layer application. |
| 1197 | * |
| 1198 | *LOGIC: |
| 1199 | * |
| 1200 | *ASSUMPTIONS: |
| 1201 | * |
| 1202 | *NOTE: |
| 1203 | * 1. Periodic scanning should be requesting to return unique |
| 1204 | * scan results. |
| 1205 | * |
| 1206 | * @param pMac Pointer to Global MAC structure |
| 1207 | * @param *pMsgBuf A pointer to the SME message buffer |
| 1208 | * @return None |
| 1209 | */ |
| 1210 | |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1211 | static void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1212 | __limProcessSmeScanReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1213 | { |
| 1214 | tANI_U32 len; |
| 1215 | tLimMlmScanReq *pMlmScanReq; |
| 1216 | tpSirSmeScanReq pScanReq; |
| 1217 | tANI_U8 i = 0; |
| 1218 | |
| 1219 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1220 | limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_REQ_EVENT, NULL, 0, 0); |
| 1221 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1222 | |
| 1223 | pScanReq = (tpSirSmeScanReq) pMsgBuf; |
Sushant Kaushik | e0d2cce | 2014-04-10 14:36:07 +0530 | [diff] [blame] | 1224 | limLog(pMac, LOG1,FL("SME SCAN REQ numChan %d min %d max %d IELen %d" |
| 1225 | "first %d fresh %d unique %d type %s (%d)" |
| 1226 | " mode %s (%d)rsp %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1227 | pScanReq->channelList.numChannels, |
| 1228 | pScanReq->minChannelTime, |
| 1229 | pScanReq->maxChannelTime, |
| 1230 | pScanReq->uIEFieldLen, |
| 1231 | pScanReq->returnAfterFirstMatch, |
| 1232 | pScanReq->returnFreshResults, |
| 1233 | pScanReq->returnUniqueResults, |
Sushant Kaushik | e0d2cce | 2014-04-10 14:36:07 +0530 | [diff] [blame] | 1234 | lim_ScanTypetoString(pScanReq->scanType), |
Madan Mohan Koyyalamudi | 70bb4cb | 2012-10-18 19:31:25 -0700 | [diff] [blame] | 1235 | pScanReq->scanType, |
Sushant Kaushik | e0d2cce | 2014-04-10 14:36:07 +0530 | [diff] [blame] | 1236 | lim_BackgroundScanModetoString(pScanReq->backgroundScanMode), |
| 1237 | pScanReq->backgroundScanMode, pMac->lim.gLimRspReqd ? 1 : 0); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1238 | |
| 1239 | /* Since scan req always requires a response, we will overwrite response required here. |
| 1240 | * This is added esp to take care of the condition where in p2p go case, we hold the scan req and |
| 1241 | * insert single NOA. We send the held scan request to FW later on getting start NOA ind from FW so |
| 1242 | * we lose state of the gLimRspReqd flag for the scan req if any other request comes by then. |
| 1243 | * e.g. While unit testing, we found when insert single NOA is done, we see a get stats request which turns the flag |
| 1244 | * gLimRspReqd to FALSE; now when we actually start the saved scan req for init scan after getting |
| 1245 | * NOA started, the gLimRspReqd being a global flag is showing FALSE instead of TRUE value for |
| 1246 | * this saved scan req. Since all scan reqs coming to lim require a response, there is no harm in setting |
| 1247 | * the global flag gLimRspReqd to TRUE here. |
| 1248 | */ |
| 1249 | pMac->lim.gLimRspReqd = TRUE; |
| 1250 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1251 | /*copy the Self MAC address from SmeReq to the globalplace, used for sending probe req*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1252 | sirCopyMacAddr(pMac->lim.gSelfMacAddr, pScanReq->selfMacAddr); |
| 1253 | |
| 1254 | /* This routine should return the sme sessionId and SME transaction Id */ |
| 1255 | |
| 1256 | if (!limIsSmeScanReqValid(pMac, pScanReq)) |
| 1257 | { |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 1258 | limLog(pMac, LOGE, FL("Received SME_SCAN_REQ with invalid parameters")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1259 | |
| 1260 | if (pMac->lim.gLimRspReqd) |
| 1261 | { |
| 1262 | pMac->lim.gLimRspReqd = false; |
| 1263 | |
| 1264 | limSendSmeScanRsp(pMac, sizeof(tSirSmeScanRsp), eSIR_SME_INVALID_PARAMETERS, pScanReq->sessionId, pScanReq->transactionId); |
| 1265 | |
| 1266 | } // if (pMac->lim.gLimRspReqd) |
| 1267 | |
| 1268 | return; |
| 1269 | } |
| 1270 | |
| 1271 | //if scan is disabled then return as invalid scan request. |
| 1272 | //if scan in power save is disabled, and system is in power save mode, then ignore scan request. |
| 1273 | if( (pMac->lim.fScanDisabled) || (!pMac->lim.gScanInPowersave && !limIsSystemInActiveState(pMac)) ) |
| 1274 | { |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 1275 | limLog(pMac, LOGE, FL("SCAN is disabled or SCAN in power save" |
| 1276 | " is disabled and system is in power save.")); |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 1277 | limSendSmeScanRsp(pMac, offsetof(tSirSmeScanRsp,bssDescription[0]), eSIR_SME_INVALID_PARAMETERS, pScanReq->sessionId, pScanReq->transactionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1278 | return; |
| 1279 | } |
| 1280 | |
| 1281 | |
| 1282 | /** |
| 1283 | * If scan request is received in idle, joinFailed |
| 1284 | * states or in link established state (in STA role) |
| 1285 | * or in normal state (in STA-in-IBSS/AP role) with |
| 1286 | * 'return fresh scan results' request from HDD or |
| 1287 | * it is periodic background scanning request, |
| 1288 | * trigger fresh scan request to MLM |
| 1289 | */ |
| 1290 | if (__limFreshScanReqd(pMac, pScanReq->returnFreshResults)) |
| 1291 | { |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1292 | if (pScanReq->returnFreshResults & SIR_BG_SCAN_PURGE_RESUTLS) |
| 1293 | { |
| 1294 | // Discard previously cached scan results |
| 1295 | limReInitScanResults(pMac); |
| 1296 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1297 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1298 | pMac->lim.gLim24Band11dScanDone = 0; |
| 1299 | pMac->lim.gLim50Band11dScanDone = 0; |
| 1300 | pMac->lim.gLimReturnAfterFirstMatch = |
| 1301 | pScanReq->returnAfterFirstMatch; |
| 1302 | pMac->lim.gLimBackgroundScanMode = |
| 1303 | pScanReq->backgroundScanMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1304 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1305 | pMac->lim.gLimReturnUniqueResults = |
| 1306 | ((pScanReq->returnUniqueResults) > 0 ? true : false); |
| 1307 | /* De-activate Heartbeat timers for connected sessions while |
| 1308 | * scan is in progress if the system is in Active mode * |
| 1309 | * AND it is not a ROAMING ("background") scan */ |
| 1310 | if(((ePMM_STATE_BMPS_WAKEUP == pMac->pmm.gPmmState) || |
| 1311 | (ePMM_STATE_READY == pMac->pmm.gPmmState)) && |
| 1312 | (pScanReq->backgroundScanMode != eSIR_ROAMING_SCAN ) && |
| 1313 | (!IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)) |
| 1314 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1315 | for(i=0;i<pMac->lim.maxBssId;i++) |
| 1316 | { |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1317 | if((peFindSessionBySessionId(pMac,i) != NULL) && |
| 1318 | (pMac->lim.gpSession[i].valid == TRUE) && |
| 1319 | (eLIM_MLM_LINK_ESTABLISHED_STATE == pMac->lim.gpSession[i].limMlmState)) |
| 1320 | { |
| 1321 | limHeartBeatDeactivateAndChangeTimer(pMac, peFindSessionBySessionId(pMac,i)); |
| 1322 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1323 | } |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1324 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1325 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1326 | if (pMac->fScanOffload) |
| 1327 | { |
| 1328 | if (eHAL_STATUS_SUCCESS != |
| 1329 | limSendHalStartScanOffloadReq(pMac, pScanReq)) |
| 1330 | { |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 1331 | limLog(pMac, LOGE, FL("Couldn't send Offload scan request")); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1332 | limSendSmeScanRsp(pMac, |
| 1333 | offsetof(tSirSmeScanRsp, bssDescription[0]), |
| 1334 | eSIR_SME_INVALID_PARAMETERS, |
| 1335 | pScanReq->sessionId, |
| 1336 | pScanReq->transactionId); |
| 1337 | return; |
| 1338 | } |
| 1339 | } |
| 1340 | else |
| 1341 | { |
| 1342 | |
| 1343 | /*Change Global SME state */ |
| 1344 | /* Store the previous SME state */ |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 1345 | limLog(pMac, LOG1, FL("Non Offload SCAN request ")); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1346 | pMac->lim.gLimPrevSmeState = pMac->lim.gLimSmeState; |
| 1347 | pMac->lim.gLimSmeState = eLIM_SME_WT_SCAN_STATE; |
| 1348 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, pScanReq->sessionId, pMac->lim.gLimSmeState)); |
| 1349 | |
| 1350 | if (pScanReq->channelList.numChannels == 0) |
| 1351 | { |
| 1352 | tANI_U32 cfg_len; |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 1353 | |
| 1354 | limLog(pMac, LOG1, |
| 1355 | FL("Scan all channels as Number of channels is 0")); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1356 | // Scan all channels |
| 1357 | len = sizeof(tLimMlmScanReq) + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1358 | (sizeof( pScanReq->channelList.channelNumber ) * (WNI_CFG_VALID_CHANNEL_LIST_LEN - 1)) + |
| 1359 | pScanReq->uIEFieldLen; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1360 | pMlmScanReq = vos_mem_malloc(len); |
| 1361 | if ( NULL == pMlmScanReq ) |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1362 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1363 | // Log error |
| 1364 | limLog(pMac, LOGP, |
| 1365 | FL("call to AllocateMemory failed for mlmScanReq (%d)"), len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1366 | |
Padma, Santhosh Kumar | 8fa8521 | 2015-02-18 12:24:56 +0530 | [diff] [blame] | 1367 | if (pMac->lim.gLimRspReqd) |
| 1368 | { |
| 1369 | pMac->lim.gLimRspReqd = false; |
| 1370 | |
| 1371 | limSendSmeScanRsp(pMac, sizeof(tSirSmeScanRsp), |
| 1372 | eSIR_SME_RESOURCES_UNAVAILABLE, |
| 1373 | pScanReq->sessionId, |
| 1374 | pScanReq->transactionId); |
| 1375 | } |
| 1376 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1377 | return; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1378 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1379 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1380 | // Initialize this buffer |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1381 | vos_mem_set( (tANI_U8 *) pMlmScanReq, len, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1382 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1383 | cfg_len = WNI_CFG_VALID_CHANNEL_LIST_LEN; |
| 1384 | if (wlan_cfgGetStr(pMac, WNI_CFG_VALID_CHANNEL_LIST, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1385 | pMlmScanReq->channelList.channelNumber, |
| 1386 | &cfg_len) != eSIR_SUCCESS) |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1387 | { |
| 1388 | /** |
| 1389 | * Could not get Valid channel list from CFG. |
| 1390 | * Log error. |
| 1391 | */ |
| 1392 | limLog(pMac, LOGP, |
| 1393 | FL("could not retrieve Valid channel list")); |
Padma, Santhosh Kumar | 778d838 | 2015-03-04 17:41:22 +0530 | [diff] [blame] | 1394 | |
| 1395 | if (pMac->lim.gLimRspReqd) |
| 1396 | { |
| 1397 | pMac->lim.gLimRspReqd = false; |
| 1398 | |
| 1399 | limSendSmeScanRsp(pMac, sizeof(tSirSmeScanRsp), |
| 1400 | eSIR_SME_INVALID_PARAMETERS, |
| 1401 | pScanReq->sessionId, |
| 1402 | pScanReq->transactionId); |
| 1403 | } |
| 1404 | return; |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1405 | } |
| 1406 | pMlmScanReq->channelList.numChannels = (tANI_U8) cfg_len; |
Padma, Santhosh Kumar | 778d838 | 2015-03-04 17:41:22 +0530 | [diff] [blame] | 1407 | |
| 1408 | //Ignore DFS channels if DFS scan is disabled |
| 1409 | if(pMac->scan.fEnableDFSChnlScan == DFS_CHNL_SCAN_DISABLED) |
| 1410 | { |
| 1411 | tANI_U8 numChan = 0; |
| 1412 | tANI_U8 channel_state; |
| 1413 | tANI_U8 *chan_ptr = pMlmScanReq->channelList.channelNumber; |
| 1414 | |
| 1415 | limLog(pMac, LOG1, |
| 1416 | FL("Ignore DFS channels from valid channel list")); |
| 1417 | |
| 1418 | VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
| 1419 | pMlmScanReq->channelList.channelNumber, |
| 1420 | pMlmScanReq->channelList.numChannels); |
| 1421 | |
| 1422 | //Filter DFS channels |
| 1423 | for (i = 0; i < cfg_len; i++) |
| 1424 | { |
| 1425 | channel_state = |
| 1426 | vos_nv_getChannelEnabledState(*(chan_ptr + i)); |
| 1427 | |
| 1428 | //Allow channel if not DFS |
| 1429 | if(channel_state != NV_CHANNEL_DFS) |
| 1430 | { |
| 1431 | *(chan_ptr + numChan) = *(chan_ptr + i); |
| 1432 | numChan++; |
| 1433 | } |
| 1434 | } |
| 1435 | pMlmScanReq->channelList.numChannels = (tANI_U8) numChan; |
| 1436 | |
| 1437 | limLog(pMac, LOG1, FL("No of valid channels %d, No of" |
| 1438 | "channels after filtering %d"), cfg_len, numChan); |
| 1439 | |
| 1440 | limLog(pMac, LOG1, FL("Channel list after filtering: ")); |
| 1441 | |
| 1442 | VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
| 1443 | pMlmScanReq->channelList.channelNumber, |
| 1444 | pMlmScanReq->channelList.numChannels); |
| 1445 | } |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1446 | } |
| 1447 | else |
| 1448 | { |
| 1449 | len = sizeof( tLimMlmScanReq ) - sizeof( pScanReq->channelList.channelNumber ) + |
| 1450 | (sizeof( pScanReq->channelList.channelNumber ) * pScanReq->channelList.numChannels ) + |
| 1451 | pScanReq->uIEFieldLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1452 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1453 | pMlmScanReq = vos_mem_malloc(len); |
| 1454 | if ( NULL == pMlmScanReq ) |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1455 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1456 | // Log error |
| 1457 | limLog(pMac, LOGP, |
| 1458 | FL("call to AllocateMemory failed for mlmScanReq(%d)"), len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1459 | |
Padma, Santhosh Kumar | 8fa8521 | 2015-02-18 12:24:56 +0530 | [diff] [blame] | 1460 | if (pMac->lim.gLimRspReqd) |
| 1461 | { |
| 1462 | pMac->lim.gLimRspReqd = false; |
| 1463 | |
| 1464 | limSendSmeScanRsp(pMac, sizeof(tSirSmeScanRsp), |
| 1465 | eSIR_SME_RESOURCES_UNAVAILABLE, |
| 1466 | pScanReq->sessionId, |
| 1467 | pScanReq->transactionId); |
| 1468 | } |
| 1469 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1470 | return; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1471 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1472 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1473 | // Initialize this buffer |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1474 | vos_mem_set( (tANI_U8 *) pMlmScanReq, len, 0); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1475 | pMlmScanReq->channelList.numChannels = |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1476 | pScanReq->channelList.numChannels; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1477 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1478 | vos_mem_copy( pMlmScanReq->channelList.channelNumber, |
| 1479 | pScanReq->channelList.channelNumber, |
| 1480 | pScanReq->channelList.numChannels); |
| 1481 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1482 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1483 | pMlmScanReq->uIEFieldLen = pScanReq->uIEFieldLen; |
| 1484 | pMlmScanReq->uIEFieldOffset = len - pScanReq->uIEFieldLen; |
| 1485 | if(pScanReq->uIEFieldLen) |
| 1486 | { |
| 1487 | vos_mem_copy( (tANI_U8 *)pMlmScanReq+ pMlmScanReq->uIEFieldOffset, |
| 1488 | (tANI_U8 *)pScanReq+(pScanReq->uIEFieldOffset), |
| 1489 | pScanReq->uIEFieldLen); |
| 1490 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1491 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1492 | pMlmScanReq->bssType = pScanReq->bssType; |
| 1493 | vos_mem_copy( pMlmScanReq->bssId, |
| 1494 | pScanReq->bssId, |
| 1495 | sizeof(tSirMacAddr)); |
| 1496 | pMlmScanReq->numSsid = pScanReq->numSsid; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1497 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1498 | i = 0; |
| 1499 | while (i < pMlmScanReq->numSsid) |
| 1500 | { |
| 1501 | vos_mem_copy( (tANI_U8 *) &pMlmScanReq->ssId[i], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1502 | (tANI_U8 *) &pScanReq->ssId[i], |
| 1503 | pScanReq->ssId[i].length + 1); |
| 1504 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1505 | i++; |
| 1506 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1507 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1508 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1509 | pMlmScanReq->scanType = pScanReq->scanType; |
| 1510 | pMlmScanReq->backgroundScanMode = pScanReq->backgroundScanMode; |
Ganesh Kondabattini | 8f6e3b3 | 2014-08-25 16:07:54 +0530 | [diff] [blame] | 1511 | if (pMac->miracast_mode) |
| 1512 | { |
| 1513 | pMlmScanReq->minChannelTime = DEFAULT_MIN_CHAN_TIME_DURING_MIRACAST; |
| 1514 | pMlmScanReq->maxChannelTime = DEFAULT_MAX_CHAN_TIME_DURING_MIRACAST; |
| 1515 | } |
| 1516 | else |
| 1517 | { |
| 1518 | pMlmScanReq->minChannelTime = pScanReq->minChannelTime; |
| 1519 | pMlmScanReq->maxChannelTime = pScanReq->maxChannelTime; |
| 1520 | } |
| 1521 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1522 | pMlmScanReq->minChannelTimeBtc = pScanReq->minChannelTimeBtc; |
| 1523 | pMlmScanReq->maxChannelTimeBtc = pScanReq->maxChannelTimeBtc; |
| 1524 | pMlmScanReq->dot11mode = pScanReq->dot11mode; |
| 1525 | pMlmScanReq->p2pSearch = pScanReq->p2pSearch; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1526 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1527 | //Store the smeSessionID and transaction ID for later use. |
| 1528 | pMac->lim.gSmeSessionId = pScanReq->sessionId; |
| 1529 | pMac->lim.gTransactionId = pScanReq->transactionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1530 | |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1531 | // Issue LIM_MLM_SCAN_REQ to MLM |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 1532 | limLog(pMac, LOG1, FL("Issue Scan request command to MLM ")); |
Ganesh Kondabattini | f0fa07c | 2013-06-11 17:47:49 +0530 | [diff] [blame] | 1533 | limPostMlmMessage(pMac, LIM_MLM_SCAN_REQ, (tANI_U32 *) pMlmScanReq); |
| 1534 | } |
| 1535 | } // if ((pMac->lim.gLimSmeState == eLIM_SME_IDLE_STATE) || ... |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1536 | |
| 1537 | else |
| 1538 | { |
| 1539 | /// In all other cases return 'cached' scan results |
| 1540 | if ((pMac->lim.gLimRspReqd) || pMac->lim.gLimReportBackgroundScanResults) |
| 1541 | { |
| 1542 | tANI_U16 scanRspLen = sizeof(tSirSmeScanRsp); |
| 1543 | |
| 1544 | pMac->lim.gLimRspReqd = false; |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1545 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1546 | if (pScanReq->returnFreshResults & SIR_BG_SCAN_RETURN_LFR_CACHED_RESULTS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1547 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1548 | pMac->lim.gLimSmeLfrScanResultLength = pMac->lim.gLimMlmLfrScanResultLength; |
| 1549 | if (pMac->lim.gLimSmeLfrScanResultLength == 0) |
| 1550 | { |
| 1551 | limSendSmeLfrScanRsp(pMac, scanRspLen, |
| 1552 | eSIR_SME_SUCCESS, |
| 1553 | pScanReq->sessionId, |
| 1554 | pScanReq->transactionId); |
| 1555 | } |
| 1556 | else |
| 1557 | { |
| 1558 | scanRspLen = sizeof(tSirSmeScanRsp) + |
| 1559 | pMac->lim.gLimSmeLfrScanResultLength - |
| 1560 | sizeof(tSirBssDescription); |
| 1561 | limSendSmeLfrScanRsp(pMac, scanRspLen, eSIR_SME_SUCCESS, |
| 1562 | pScanReq->sessionId, pScanReq->transactionId); |
| 1563 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1564 | } |
| 1565 | else |
| 1566 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1567 | #endif |
| 1568 | if (pMac->lim.gLimSmeScanResultLength == 0) |
| 1569 | { |
| 1570 | limSendSmeScanRsp(pMac, scanRspLen, eSIR_SME_SUCCESS, |
| 1571 | pScanReq->sessionId, pScanReq->transactionId); |
| 1572 | } |
| 1573 | else |
| 1574 | { |
| 1575 | scanRspLen = sizeof(tSirSmeScanRsp) + |
| 1576 | pMac->lim.gLimSmeScanResultLength - |
| 1577 | sizeof(tSirBssDescription); |
| 1578 | limSendSmeScanRsp(pMac, scanRspLen, eSIR_SME_SUCCESS, |
| 1579 | pScanReq->sessionId, pScanReq->transactionId); |
| 1580 | } |
| 1581 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1582 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1583 | #endif |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 1584 | limLog(pMac, LOG1, FL("Cached scan results are returned ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1585 | |
| 1586 | if (pScanReq->returnFreshResults & SIR_BG_SCAN_PURGE_RESUTLS) |
| 1587 | { |
| 1588 | // Discard previously cached scan results |
| 1589 | limReInitScanResults(pMac); |
| 1590 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1591 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1592 | if (pScanReq->returnFreshResults & SIR_BG_SCAN_PURGE_LFR_RESULTS) |
| 1593 | { |
| 1594 | // Discard previously cached scan results |
| 1595 | limReInitLfrScanResults(pMac); |
| 1596 | } |
| 1597 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1598 | |
| 1599 | } // if (pMac->lim.gLimRspReqd) |
| 1600 | } // else ((pMac->lim.gLimSmeState == eLIM_SME_IDLE_STATE) || ... |
| 1601 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1602 | #ifdef BACKGROUND_SCAN_ENABLED |
| 1603 | // start background scans if needed |
| 1604 | // There is a bug opened against softmac. Need to enable when the bug is fixed. |
| 1605 | __limBackgroundScanInitiate(pMac); |
| 1606 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1607 | |
| 1608 | } /*** end __limProcessSmeScanReq() ***/ |
| 1609 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1610 | #ifdef FEATURE_OEM_DATA_SUPPORT |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1611 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1612 | static void __limProcessSmeOemDataReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1613 | { |
| 1614 | tpSirOemDataReq pOemDataReq; |
| 1615 | tLimMlmOemDataReq* pMlmOemDataReq; |
| 1616 | |
| 1617 | pOemDataReq = (tpSirOemDataReq) pMsgBuf; |
| 1618 | |
| 1619 | //post the lim mlm message now |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1620 | pMlmOemDataReq = vos_mem_malloc(sizeof(tLimMlmOemDataReq)); |
| 1621 | if ( NULL == pMlmOemDataReq ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1622 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1623 | limLog(pMac, LOGP, FL("AllocateMemory failed for mlmOemDataReq")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1624 | return; |
| 1625 | } |
| 1626 | |
| 1627 | //Initialize this buffer |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1628 | vos_mem_set( pMlmOemDataReq, (sizeof(tLimMlmOemDataReq)), 0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1629 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1630 | vos_mem_copy( pMlmOemDataReq->selfMacAddr, pOemDataReq->selfMacAddr, |
| 1631 | sizeof(tSirMacAddr)); |
| 1632 | vos_mem_copy( pMlmOemDataReq->oemDataReq, pOemDataReq->oemDataReq, |
| 1633 | OEM_DATA_REQ_SIZE); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1634 | |
| 1635 | //Issue LIM_MLM_OEM_DATA_REQ to MLM |
| 1636 | limPostMlmMessage(pMac, LIM_MLM_OEM_DATA_REQ, (tANI_U32*)pMlmOemDataReq); |
| 1637 | |
| 1638 | return; |
| 1639 | |
| 1640 | } /*** end __limProcessSmeOemDataReq() ***/ |
| 1641 | |
| 1642 | #endif //FEATURE_OEM_DATA_SUPPORT |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1643 | |
Gopichand Nakkala | c178ac8 | 2013-05-30 19:53:39 +0530 | [diff] [blame] | 1644 | /** |
| 1645 | * __limProcessClearDfsChannelList() |
| 1646 | * |
| 1647 | *FUNCTION: |
| 1648 | *Clear DFS channel list when country is changed/aquired. |
| 1649 | .*This message is sent from SME. |
| 1650 | * |
| 1651 | *LOGIC: |
| 1652 | * |
| 1653 | *ASSUMPTIONS: |
| 1654 | * |
| 1655 | *NOTE: |
| 1656 | * |
| 1657 | * @param pMac Pointer to Global MAC structure |
| 1658 | * @param *pMsgBuf A pointer to the SME message buffer |
| 1659 | * @return None |
| 1660 | */ |
| 1661 | static void __limProcessClearDfsChannelList(tpAniSirGlobal pMac, |
| 1662 | tpSirMsgQ pMsg) |
| 1663 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1664 | vos_mem_set( &pMac->lim.dfschannelList, |
| 1665 | sizeof(tSirDFSChannelList), 0); |
Gopichand Nakkala | c178ac8 | 2013-05-30 19:53:39 +0530 | [diff] [blame] | 1666 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1667 | |
| 1668 | /** |
| 1669 | * __limProcessSmeJoinReq() |
| 1670 | * |
| 1671 | *FUNCTION: |
| 1672 | * This function is called to process SME_JOIN_REQ message |
| 1673 | * from HDD or upper layer application. |
| 1674 | * |
| 1675 | *LOGIC: |
| 1676 | * |
| 1677 | *ASSUMPTIONS: |
| 1678 | * |
| 1679 | *NOTE: |
| 1680 | * |
| 1681 | * @param pMac Pointer to Global MAC structure |
| 1682 | * @param *pMsgBuf A pointer to the SME message buffer |
| 1683 | * @return None |
| 1684 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1685 | static void |
| 1686 | __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1687 | { |
| 1688 | // tANI_U8 *pBuf; |
| 1689 | //tANI_U32 len; |
| 1690 | // tSirMacAddr currentBssId; |
| 1691 | tpSirSmeJoinReq pSmeJoinReq = NULL; |
| 1692 | tLimMlmJoinReq *pMlmJoinReq; |
| 1693 | tSirResultCodes retCode = eSIR_SME_SUCCESS; |
| 1694 | tANI_U32 val = 0; |
| 1695 | tANI_U16 nSize; |
| 1696 | tANI_U8 sessionId; |
| 1697 | tpPESession psessionEntry = NULL; |
| 1698 | tANI_U8 smesessionId; |
| 1699 | tANI_U16 smetransactionId; |
| 1700 | tPowerdBm localPowerConstraint = 0, regMax = 0; |
Agarwal Ashish | 87039eb | 2014-01-15 14:13:15 +0530 | [diff] [blame] | 1701 | tANI_U16 ieLen; |
| 1702 | v_U8_t *vendorIE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1703 | |
| 1704 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1705 | //Not sending any session, since it is not created yet. The response whould have correct state. |
| 1706 | limDiagEventReport(pMac, WLAN_PE_DIAG_JOIN_REQ_EVENT, NULL, 0, 0); |
| 1707 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1708 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1709 | limLog(pMac, LOG1, FL("Received SME_JOIN_REQ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1710 | |
| 1711 | #ifdef WLAN_FEATURE_VOWIFI |
| 1712 | /* Need to read the CFG here itself as this is used in limExtractAPCapability() below. |
| 1713 | * This CFG is actually read in rrmUpdateConfig() which is called later. Because this is not |
| 1714 | * read, RRM related path before calling rrmUpdateConfig() is not getting executed causing issues |
| 1715 | * like not honoring power constraint on 1st association after driver loading. */ |
| 1716 | if (wlan_cfgGetInt(pMac, WNI_CFG_RRM_ENABLED, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1717 | limLog(pMac, LOGP, FL("cfg get rrm enabled failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1718 | pMac->rrm.rrmPEContext.rrmEnable = (val) ? 1 : 0; |
| 1719 | val = 0; |
| 1720 | #endif /* WLAN_FEATURE_VOWIFI */ |
| 1721 | |
| 1722 | /** |
| 1723 | * Expect Join request in idle state. |
| 1724 | * Reassociate request is expected in link established state. |
| 1725 | */ |
| 1726 | |
| 1727 | /* Global SME and LIM states are not defined yet for BT-AMP Support */ |
| 1728 | if(pMac->lim.gLimSmeState == eLIM_SME_IDLE_STATE) |
| 1729 | { |
| 1730 | nSize = __limGetSmeJoinReqSizeForAlloc((tANI_U8*) pMsgBuf); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1731 | |
| 1732 | pSmeJoinReq = vos_mem_malloc(nSize); |
| 1733 | if ( NULL == pSmeJoinReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1734 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1735 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for " |
| 1736 | "pSmeJoinReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1737 | retCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 1738 | goto end; |
| 1739 | } |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1740 | (void) vos_mem_set((void *) pSmeJoinReq, nSize, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1741 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1742 | if ((limJoinReqSerDes(pMac, pSmeJoinReq, (tANI_U8 *)pMsgBuf) == eSIR_FAILURE) || |
| 1743 | (!limIsSmeJoinReqValid(pMac, pSmeJoinReq))) |
| 1744 | { |
| 1745 | /// Received invalid eWNI_SME_JOIN_REQ |
| 1746 | // Log the event |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 1747 | limLog(pMac, LOGW, FL("SessionId:%d Received SME_JOIN_REQ with" |
| 1748 | "invalid data"),pSmeJoinReq->sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1749 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 1750 | goto end; |
| 1751 | } |
| 1752 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1753 | //pMac->lim.gpLimJoinReq = pSmeJoinReq; TO SUPPORT BT-AMP, review os sep 23 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1754 | |
| 1755 | /* check for the existence of start BSS session */ |
| 1756 | #ifdef FIXME_GEN6 |
| 1757 | if(pSmeJoinReq->bsstype == eSIR_BTAMP_AP_MODE) |
| 1758 | { |
| 1759 | if(peValidateBtJoinRequest(pMac)!= TRUE) |
| 1760 | { |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 1761 | limLog(pMac, LOGW, FL("SessionId:%d Start Bss session" |
| 1762 | "not present::SME_JOIN_REQ in unexpected state"), |
| 1763 | pSmeJoinReq->sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1764 | retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 1765 | psessionEntry = NULL; |
| 1766 | goto end; |
| 1767 | } |
| 1768 | } |
| 1769 | |
| 1770 | #endif |
| 1771 | |
| 1772 | |
| 1773 | if((psessionEntry = peFindSessionByBssid(pMac,pSmeJoinReq->bssDescription.bssId,&sessionId)) != NULL) |
| 1774 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1775 | limLog(pMac, LOGE, FL("Session(%d) Already exists for BSSID: " |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 1776 | MAC_ADDRESS_STR" in limSmeState = %d"),sessionId, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1777 | MAC_ADDR_ARRAY(pSmeJoinReq->bssDescription.bssId), |
| 1778 | psessionEntry->limSmeState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1779 | |
| 1780 | if(psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) |
| 1781 | { |
| 1782 | // Received eWNI_SME_JOIN_REQ for same |
| 1783 | // BSS as currently associated. |
| 1784 | // Log the event and send success |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 1785 | PELOGW(limLog(pMac, LOGW, FL("SessionId:%d Received" |
| 1786 | "SME_JOIN_REQ for currently joined BSS"),sessionId);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1787 | /// Send Join success response to host |
Deepthi Gowri | f3e2725 | 2013-12-11 20:50:01 +0530 | [diff] [blame] | 1788 | retCode = eSIR_SME_ALREADY_JOINED_A_BSS; |
| 1789 | psessionEntry = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1790 | goto end; |
| 1791 | } |
| 1792 | else |
| 1793 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1794 | PELOGE(limLog(pMac, LOGE, FL("SME_JOIN_REQ not for" |
| 1795 | "currently joined BSS"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1796 | retCode = eSIR_SME_REFUSED; |
| 1797 | psessionEntry = NULL; |
| 1798 | goto end; |
| 1799 | } |
| 1800 | } |
| 1801 | else /* Session Entry does not exist for given BSSId */ |
| 1802 | { |
| 1803 | /* Try to Create a new session */ |
| 1804 | if((psessionEntry = peCreateSession(pMac,pSmeJoinReq->bssDescription.bssId,&sessionId, pMac->lim.maxStation)) == NULL) |
| 1805 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1806 | limLog(pMac, LOGE, FL("Session Can not be created ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1807 | retCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 1808 | goto end; |
| 1809 | } |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 1810 | else |
| 1811 | limLog(pMac,LOG1,FL("SessionId:%d New session created"), |
| 1812 | sessionId); |
Masti, Narayanraddi | 67ea591 | 2015-01-08 12:34:05 +0530 | [diff] [blame] | 1813 | } |
| 1814 | |
| 1815 | if(psessionEntry != NULL && pSmeJoinReq->operationalRateSet.numRates > 0 ){ |
| 1816 | if(!limCheck11BRateBitmap(pSmeJoinReq->rateBitMap)){ |
| 1817 | psessionEntry->is11Gonly = true; |
| 1818 | } |
| 1819 | } |
| 1820 | |
krunal soni | 5afa96c | 2013-09-06 22:19:02 -0700 | [diff] [blame] | 1821 | psessionEntry->isAmsduSupportInAMPDU = pSmeJoinReq->isAmsduSupportInAMPDU; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1822 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1823 | /* Store Session related parameters */ |
| 1824 | /* Store PE session Id in session Table */ |
| 1825 | psessionEntry->peSessionId = sessionId; |
| 1826 | |
| 1827 | /* store the smejoin req handle in session table */ |
| 1828 | psessionEntry->pLimJoinReq = pSmeJoinReq; |
| 1829 | |
| 1830 | /* Store SME session Id in sessionTable */ |
| 1831 | psessionEntry->smeSessionId = pSmeJoinReq->sessionId; |
| 1832 | |
| 1833 | /* Store SME transaction Id in session Table */ |
| 1834 | psessionEntry->transactionId = pSmeJoinReq->transactionId; |
| 1835 | |
| 1836 | /* Store beaconInterval */ |
| 1837 | psessionEntry->beaconParams.beaconInterval = pSmeJoinReq->bssDescription.beaconInterval; |
| 1838 | |
| 1839 | /* Copying of bssId is already done, while creating session */ |
| 1840 | //sirCopyMacAddr(psessionEntry->bssId,pSmeJoinReq->bssId); |
| 1841 | sirCopyMacAddr(psessionEntry->selfMacAddr,pSmeJoinReq->selfMacAddr); |
| 1842 | psessionEntry->bssType = pSmeJoinReq->bsstype; |
| 1843 | |
| 1844 | psessionEntry->statypeForBss = STA_ENTRY_PEER; |
Sandeep Puligilla | aea98a2 | 2013-12-04 13:36:32 +0530 | [diff] [blame] | 1845 | psessionEntry->limWmeEnabled = pSmeJoinReq->isWMEenabled; |
| 1846 | psessionEntry->limQosEnabled = pSmeJoinReq->isQosEnabled; |
Sushant Kaushik | 74df8db | 2015-03-11 18:09:05 +0530 | [diff] [blame] | 1847 | psessionEntry->bOSENAssociation = pSmeJoinReq->bOSENAssociation; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1848 | |
Agarwal Ashish | 87039eb | 2014-01-15 14:13:15 +0530 | [diff] [blame] | 1849 | /* Store vendor specfic IE for CISCO AP */ |
| 1850 | ieLen = (pSmeJoinReq->bssDescription.length + |
| 1851 | sizeof( pSmeJoinReq->bssDescription.length ) - |
| 1852 | GET_FIELD_OFFSET( tSirBssDescription, ieFields )); |
| 1853 | |
| 1854 | vendorIE = limGetVendorIEOuiPtr(pMac, SIR_MAC_CISCO_OUI, |
| 1855 | SIR_MAC_CISCO_OUI_SIZE, |
| 1856 | ((tANI_U8 *)&pSmeJoinReq->bssDescription.ieFields) , ieLen); |
| 1857 | |
| 1858 | if ( NULL != vendorIE ) |
| 1859 | { |
| 1860 | limLog(pMac, LOGE, |
| 1861 | FL("DUT is trying to connect to Cisco AP")); |
| 1862 | psessionEntry->isCiscoVendorAP = TRUE; |
| 1863 | } |
| 1864 | else |
| 1865 | { |
| 1866 | psessionEntry->isCiscoVendorAP = FALSE; |
| 1867 | } |
| 1868 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1869 | /* Copy the dot 11 mode in to the session table */ |
| 1870 | |
| 1871 | psessionEntry->dot11mode = pSmeJoinReq->dot11mode; |
| 1872 | psessionEntry->nwType = pSmeJoinReq->bssDescription.nwType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1873 | #ifdef WLAN_FEATURE_11AC |
| 1874 | psessionEntry->vhtCapability = IS_DOT11_MODE_VHT(psessionEntry->dot11mode); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 1875 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO_MED, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1876 | "***__limProcessSmeJoinReq: vhtCapability=%d****",psessionEntry->vhtCapability); |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 1877 | if (psessionEntry->vhtCapability ) |
| 1878 | { |
| 1879 | psessionEntry->txBFIniFeatureEnabled = pSmeJoinReq->txBFIniFeatureEnabled; |
| 1880 | |
| 1881 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO_MED, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1882 | "***__limProcessSmeJoinReq: txBFIniFeatureEnabled=%d****", |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 1883 | psessionEntry->txBFIniFeatureEnabled); |
| 1884 | |
| 1885 | if( psessionEntry->txBFIniFeatureEnabled ) |
| 1886 | { |
| 1887 | if (cfgSetInt(pMac, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, psessionEntry->txBFIniFeatureEnabled) |
| 1888 | != eSIR_SUCCESS) |
| 1889 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1890 | limLog(pMac, LOGP, FL("could not set " |
| 1891 | "WNI_CFG_VHT_SU_BEAMFORMEE_CAP at CFG")); |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 1892 | retCode = eSIR_LOGP_EXCEPTION; |
| 1893 | goto end; |
| 1894 | } |
Shailender Karmuchi | cc3fe44 | 2013-02-16 18:18:33 -0800 | [diff] [blame] | 1895 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO_MED, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1896 | "***__limProcessSmeJoinReq: txBFCsnValue=%d****", |
| 1897 | pSmeJoinReq->txBFCsnValue); |
Shailender Karmuchi | cc3fe44 | 2013-02-16 18:18:33 -0800 | [diff] [blame] | 1898 | |
| 1899 | if (cfgSetInt(pMac, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, pSmeJoinReq->txBFCsnValue) |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 1900 | != eSIR_SUCCESS) |
| 1901 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1902 | limLog(pMac, LOGP, FL("could not set " |
| 1903 | "WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED at CFG")); |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 1904 | retCode = eSIR_LOGP_EXCEPTION; |
| 1905 | goto end; |
| 1906 | } |
Abhishek Singh | 6d5d29c | 2014-07-03 14:25:22 +0530 | [diff] [blame] | 1907 | |
| 1908 | if ( FALSE == pMac->isMuBfsessionexist ) |
| 1909 | psessionEntry->txMuBformee = pSmeJoinReq->txMuBformee; |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 1910 | } |
Abhishek Singh | 6d5d29c | 2014-07-03 14:25:22 +0530 | [diff] [blame] | 1911 | |
| 1912 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
| 1913 | "SmeJoinReq:txMuBformee=%d psessionEntry: txMuBformee = %d", |
| 1914 | pSmeJoinReq->txMuBformee, psessionEntry->txMuBformee); |
| 1915 | |
| 1916 | if(cfgSetInt(pMac, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, psessionEntry->txMuBformee) |
| 1917 | != eSIR_SUCCESS) |
| 1918 | { |
| 1919 | limLog(pMac, LOGE, FL("could not set " |
| 1920 | "WNI_CFG_VHT_MU_BEAMFORMEE_CAP at CFG")); |
| 1921 | retCode = eSIR_LOGP_EXCEPTION; |
| 1922 | goto end; |
| 1923 | } |
| 1924 | |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 1925 | } |
| 1926 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1927 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1928 | |
| 1929 | /*Phy mode*/ |
| 1930 | psessionEntry->gLimPhyMode = pSmeJoinReq->bssDescription.nwType; |
| 1931 | |
Abhishek Singh | ca6ec5d | 2015-06-24 13:13:27 +0530 | [diff] [blame] | 1932 | handleHTCapabilityandHTInfo(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1933 | /* Copy The channel Id to the session Table */ |
| 1934 | psessionEntry->currentOperChannel = pSmeJoinReq->bssDescription.channelId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1935 | psessionEntry->htSupportedChannelWidthSet = (pSmeJoinReq->cbMode)?1:0; // This is already merged value of peer and self - done by csr in csrGetCBModeFromIes |
| 1936 | psessionEntry->htRecommendedTxWidthSet = psessionEntry->htSupportedChannelWidthSet; |
| 1937 | psessionEntry->htSecondaryChannelOffset = pSmeJoinReq->cbMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1938 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1939 | /* Record if management frames need to be protected */ |
| 1940 | #ifdef WLAN_FEATURE_11W |
| 1941 | if(eSIR_ED_AES_128_CMAC == pSmeJoinReq->MgmtEncryptionType) |
| 1942 | { |
| 1943 | psessionEntry->limRmfEnabled = 1; |
| 1944 | } |
| 1945 | else |
| 1946 | { |
| 1947 | psessionEntry->limRmfEnabled = 0; |
| 1948 | } |
| 1949 | #endif |
| 1950 | |
krunal soni | 8d13b09 | 2013-07-19 13:23:29 -0700 | [diff] [blame] | 1951 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM |
| 1952 | psessionEntry->rssi = pSmeJoinReq->bssDescription.rssi; |
| 1953 | #endif |
| 1954 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1955 | /*Store Persona */ |
| 1956 | psessionEntry->pePersona = pSmeJoinReq->staPersona; |
| 1957 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1958 | FL("PE PERSONA=%d cbMode %u"), psessionEntry->pePersona, |
| 1959 | pSmeJoinReq->cbMode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1960 | |
| 1961 | /* Copy the SSID from smejoinreq to session entry */ |
| 1962 | psessionEntry->ssId.length = pSmeJoinReq->ssId.length; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1963 | vos_mem_copy( psessionEntry->ssId.ssId, |
| 1964 | pSmeJoinReq->ssId.ssId, psessionEntry->ssId.length); |
| 1965 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1966 | // Determin 11r or ESE connection based on input from SME |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1967 | // which inturn is dependent on the profile the user wants to connect |
| 1968 | // to, So input is coming from supplicant |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1969 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1970 | psessionEntry->is11Rconnection = pSmeJoinReq->is11Rconnection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1971 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1972 | #ifdef FEATURE_WLAN_ESE |
| 1973 | psessionEntry->isESEconnection = pSmeJoinReq->isESEconnection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1974 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1975 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1976 | psessionEntry->isFastTransitionEnabled = pSmeJoinReq->isFastTransitionEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1977 | #endif |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1978 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1979 | #ifdef FEATURE_WLAN_LFR |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1980 | psessionEntry->isFastRoamIniFeatureEnabled = pSmeJoinReq->isFastRoamIniFeatureEnabled; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1981 | #endif |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1982 | psessionEntry->txLdpcIniFeatureEnabled = pSmeJoinReq->txLdpcIniFeatureEnabled; |
Gopichand Nakkala | b2d2c31 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 1983 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1984 | if (psessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1985 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1986 | psessionEntry->limSystemRole = eLIM_STA_ROLE; |
| 1987 | } |
| 1988 | else if (psessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 1989 | { |
| 1990 | psessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; |
| 1991 | } |
| 1992 | else |
| 1993 | { |
| 1994 | /* Throw an error and return and make sure to delete the session.*/ |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1995 | limLog(pMac, LOGE, FL("received SME_JOIN_REQ with invalid" |
| 1996 | " bss type %d"), psessionEntry->bssType); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 1997 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 1998 | goto end; |
| 1999 | } |
| 2000 | |
| 2001 | if (pSmeJoinReq->addIEScan.length) |
| 2002 | { |
| 2003 | vos_mem_copy( &psessionEntry->pLimJoinReq->addIEScan, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2004 | &pSmeJoinReq->addIEScan, sizeof(tSirAddie)); |
| 2005 | } |
| 2006 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2007 | if (pSmeJoinReq->addIEAssoc.length) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2008 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2009 | vos_mem_copy( &psessionEntry->pLimJoinReq->addIEAssoc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2010 | &pSmeJoinReq->addIEAssoc, sizeof(tSirAddie)); |
| 2011 | } |
| 2012 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2013 | val = sizeof(tLimMlmJoinReq) + psessionEntry->pLimJoinReq->bssDescription.length + 2; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2014 | pMlmJoinReq = vos_mem_malloc(val); |
| 2015 | if ( NULL == pMlmJoinReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2016 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2017 | limLog(pMac, LOGP, FL("call to AllocateMemory " |
| 2018 | "failed for mlmJoinReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2019 | return; |
| 2020 | } |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2021 | (void) vos_mem_set((void *) pMlmJoinReq, val, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2022 | |
| 2023 | /* PE SessionId is stored as a part of JoinReq*/ |
| 2024 | pMlmJoinReq->sessionId = psessionEntry->peSessionId; |
| 2025 | |
| 2026 | if (wlan_cfgGetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT, (tANI_U32 *) &pMlmJoinReq->joinFailureTimeout) |
| 2027 | != eSIR_SUCCESS) |
Sushant Kaushik | e3ca61c | 2015-03-19 18:33:25 +0530 | [diff] [blame] | 2028 | { |
| 2029 | limLog(pMac, LOGE, FL("could not retrieve JoinFailureTimer value " |
| 2030 | "setting it to default value")); |
| 2031 | pMlmJoinReq->joinFailureTimeout = JOIN_FAILURE_TIMEOUT; |
| 2032 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2033 | |
| 2034 | /* copy operational rate from psessionEntry*/ |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2035 | vos_mem_copy((void*)&psessionEntry->rateSet, (void*)&pSmeJoinReq->operationalRateSet, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2036 | sizeof(tSirMacRateSet)); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2037 | vos_mem_copy((void*)&psessionEntry->extRateSet, (void*)&pSmeJoinReq->extendedRateSet, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2038 | sizeof(tSirMacRateSet)); |
| 2039 | //this may not be needed anymore now, as rateSet is now included in the session entry and MLM has session context. |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2040 | vos_mem_copy((void*)&pMlmJoinReq->operationalRateSet, (void*)&psessionEntry->rateSet, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2041 | sizeof(tSirMacRateSet)); |
| 2042 | |
| 2043 | psessionEntry->encryptType = pSmeJoinReq->UCEncryptionType; |
| 2044 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2045 | pMlmJoinReq->bssDescription.length = psessionEntry->pLimJoinReq->bssDescription.length; |
| 2046 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2047 | vos_mem_copy((tANI_U8 *) &pMlmJoinReq->bssDescription.bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2048 | (tANI_U8 *) &psessionEntry->pLimJoinReq->bssDescription.bssId, |
| 2049 | psessionEntry->pLimJoinReq->bssDescription.length + 2); |
| 2050 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2051 | psessionEntry->limCurrentBssCaps = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2052 | psessionEntry->pLimJoinReq->bssDescription.capabilityInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2053 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2054 | regMax = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel ); |
Sandeep Puligilla | a9eb9ad | 2014-05-27 14:42:50 +0530 | [diff] [blame] | 2055 | localPowerConstraint = regMax; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2056 | limExtractApCapability( pMac, |
| 2057 | (tANI_U8 *) psessionEntry->pLimJoinReq->bssDescription.ieFields, |
| 2058 | limGetIElenFromBssDescription(&psessionEntry->pLimJoinReq->bssDescription), |
| 2059 | &psessionEntry->limCurrentBssQosCaps, |
| 2060 | &psessionEntry->limCurrentBssPropCap, |
| 2061 | &pMac->lim.gLimCurrentBssUapsd //TBD-RAJESH make gLimCurrentBssUapsd this session specific |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2062 | , &localPowerConstraint, |
| 2063 | psessionEntry |
Sandeep Puligilla | 4ce0259 | 2014-04-22 09:05:57 +0530 | [diff] [blame] | 2064 | ); |
Sandeep Puligilla | a9eb9ad | 2014-05-27 14:42:50 +0530 | [diff] [blame] | 2065 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2066 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2067 | psessionEntry->maxTxPower = limGetMaxTxPower(regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2068 | #else |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2069 | psessionEntry->maxTxPower = VOS_MIN( regMax, (localPowerConstraint) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2070 | #endif |
Sushant Kaushik | ece4b56 | 2015-04-09 18:27:33 +0530 | [diff] [blame] | 2071 | if (!psessionEntry->maxTxPower) |
| 2072 | { |
| 2073 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, FL("Tx power" |
| 2074 | "is zero. Setting it to default value %d"), |
| 2075 | TX_POWER_DEFAULT); |
| 2076 | psessionEntry->maxTxPower = TX_POWER_DEFAULT; |
| 2077 | } |
| 2078 | |
Sandeep Puligilla | 4ce0259 | 2014-04-22 09:05:57 +0530 | [diff] [blame] | 2079 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
| 2080 | "Regulatory max = %d, local power constraint = %d," |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2081 | " max tx = %d", regMax, localPowerConstraint, |
| 2082 | psessionEntry->maxTxPower ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2083 | |
| 2084 | if (pMac->lim.gLimCurrentBssUapsd) |
| 2085 | { |
| 2086 | pMac->lim.gUapsdPerAcBitmask = psessionEntry->pLimJoinReq->uapsdPerAcBitmask; |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2087 | limLog( pMac, LOG1, FL("UAPSD flag for all AC - 0x%2x"), |
| 2088 | pMac->lim.gUapsdPerAcBitmask); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2089 | |
| 2090 | // resetting the dynamic uapsd mask |
| 2091 | pMac->lim.gUapsdPerAcDeliveryEnableMask = 0; |
| 2092 | pMac->lim.gUapsdPerAcTriggerEnableMask = 0; |
| 2093 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2094 | |
| 2095 | psessionEntry->limRFBand = limGetRFBand(psessionEntry->currentOperChannel); |
| 2096 | |
| 2097 | // Initialize 11h Enable Flag |
| 2098 | if(SIR_BAND_5_GHZ == psessionEntry->limRFBand) |
| 2099 | { |
| 2100 | if (wlan_cfgGetInt(pMac, WNI_CFG_11H_ENABLED, &val) != eSIR_SUCCESS) |
Sushant Kaushik | e3ca61c | 2015-03-19 18:33:25 +0530 | [diff] [blame] | 2101 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2102 | limLog(pMac, LOGP, FL("Fail to get WNI_CFG_11H_ENABLED ")); |
Sushant Kaushik | e3ca61c | 2015-03-19 18:33:25 +0530 | [diff] [blame] | 2103 | psessionEntry->lim11hEnable = 1; |
| 2104 | } |
| 2105 | else |
| 2106 | psessionEntry->lim11hEnable = val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2107 | } |
| 2108 | else |
| 2109 | psessionEntry->lim11hEnable = 0; |
| 2110 | |
| 2111 | //To care of the scenario when STA transitions from IBSS to Infrastructure mode. |
| 2112 | pMac->lim.gLimIbssCoalescingHappened = false; |
| 2113 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2114 | psessionEntry->limPrevSmeState = psessionEntry->limSmeState; |
| 2115 | psessionEntry->limSmeState = eLIM_SME_WT_JOIN_STATE; |
| 2116 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2117 | |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2118 | limLog(pMac, LOG1, FL("SME JoinReq:Sessionid %d SSID len %d SSID : %s " |
| 2119 | "Channel %d, BSSID "MAC_ADDRESS_STR), pMlmJoinReq->sessionId, |
| 2120 | psessionEntry->ssId.length,psessionEntry->ssId.ssId, |
| 2121 | psessionEntry->currentOperChannel, |
| 2122 | MAC_ADDR_ARRAY(psessionEntry->bssId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2123 | |
| 2124 | /* Indicate whether spectrum management is enabled*/ |
| 2125 | psessionEntry->spectrumMgtEnabled = |
| 2126 | pSmeJoinReq->spectrumMgtIndicator; |
Rajesh Babu Prathipati | 043149f | 2014-06-06 13:33:45 +0530 | [diff] [blame] | 2127 | |
| 2128 | /* Enable the spectrum management if this is a DFS channel */ |
| 2129 | if (psessionEntry->countryInfoPresent && |
| 2130 | limIsconnectedOnDFSChannel(psessionEntry->currentOperChannel)) |
| 2131 | { |
| 2132 | psessionEntry->spectrumMgtEnabled = TRUE; |
| 2133 | } |
| 2134 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2135 | limLog(pMac,LOG1,FL("SessionId: %d LIM_MLM_JOIN_REQ is posted to MLM " |
| 2136 | "SM"), pMlmJoinReq->sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2137 | /* Issue LIM_MLM_JOIN_REQ to MLM */ |
| 2138 | limPostMlmMessage(pMac, LIM_MLM_JOIN_REQ, (tANI_U32 *) pMlmJoinReq); |
| 2139 | return; |
| 2140 | |
| 2141 | } |
| 2142 | else |
| 2143 | { |
| 2144 | /* Received eWNI_SME_JOIN_REQ un expected state */ |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2145 | limLog(pMac, LOGE, FL("received unexpected SME_JOIN_REQ " |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 2146 | "in state %d"), pMac->lim.gLimSmeState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2147 | limPrintSmeState(pMac, LOGE, pMac->lim.gLimSmeState); |
| 2148 | retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 2149 | psessionEntry = NULL; |
| 2150 | goto end; |
| 2151 | |
| 2152 | } |
| 2153 | |
| 2154 | end: |
| 2155 | limGetSessionInfo(pMac,(tANI_U8*)pMsgBuf,&smesessionId,&smetransactionId); |
| 2156 | |
| 2157 | if(pSmeJoinReq) |
| 2158 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2159 | vos_mem_free(pSmeJoinReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2160 | pSmeJoinReq = NULL; |
| 2161 | if (NULL != psessionEntry) |
| 2162 | { |
| 2163 | psessionEntry->pLimJoinReq = NULL; |
| 2164 | } |
| 2165 | } |
| 2166 | |
| 2167 | if(retCode != eSIR_SME_SUCCESS) |
| 2168 | { |
| 2169 | if(NULL != psessionEntry) |
| 2170 | { |
| 2171 | peDeleteSession(pMac,psessionEntry); |
| 2172 | psessionEntry = NULL; |
| 2173 | } |
| 2174 | } |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2175 | limLog(pMac, LOG1, FL("Sending failure status limSendSmeJoinReassocRsp" |
| 2176 | "on sessionid: %d with retCode = %d"),smesessionId, retCode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2177 | limSendSmeJoinReassocRsp(pMac, eWNI_SME_JOIN_RSP, retCode, eSIR_MAC_UNSPEC_FAILURE_STATUS,psessionEntry,smesessionId,smetransactionId); |
| 2178 | } /*** end __limProcessSmeJoinReq() ***/ |
| 2179 | |
| 2180 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2181 | #ifdef FEATURE_WLAN_ESE |
Madan Mohan Koyyalamudi | 3282c57 | 2012-11-09 17:01:41 -0800 | [diff] [blame] | 2182 | tANI_U8 limGetMaxTxPower(tPowerdBm regMax, tPowerdBm apTxPower, tANI_U8 iniTxPower) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2183 | { |
| 2184 | tANI_U8 maxTxPower = 0; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2185 | tANI_U8 txPower = VOS_MIN( regMax, (apTxPower) ); |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2186 | txPower = VOS_MIN(txPower, iniTxPower); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2187 | if((txPower >= MIN_TX_PWR_CAP) && (txPower <= MAX_TX_PWR_CAP)) |
| 2188 | maxTxPower = txPower; |
| 2189 | else if (txPower < MIN_TX_PWR_CAP) |
| 2190 | maxTxPower = MIN_TX_PWR_CAP; |
| 2191 | else |
| 2192 | maxTxPower = MAX_TX_PWR_CAP; |
| 2193 | |
| 2194 | return (maxTxPower); |
| 2195 | } |
| 2196 | #endif |
| 2197 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2198 | /** |
| 2199 | * __limProcessSmeReassocReq() |
| 2200 | * |
| 2201 | *FUNCTION: |
| 2202 | * This function is called to process SME_REASSOC_REQ message |
| 2203 | * from HDD or upper layer application. |
| 2204 | * |
| 2205 | *LOGIC: |
| 2206 | * |
| 2207 | *ASSUMPTIONS: |
| 2208 | * |
| 2209 | *NOTE: |
| 2210 | * |
| 2211 | * @param pMac Pointer to Global MAC structure |
| 2212 | * @param *pMsgBuf A pointer to the SME message buffer |
| 2213 | * @return None |
| 2214 | */ |
| 2215 | |
| 2216 | static void |
| 2217 | __limProcessSmeReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 2218 | { |
| 2219 | tANI_U16 caps; |
| 2220 | tANI_U32 val; |
Srinivas Girigowda | c16730e | 2013-01-16 13:39:39 -0800 | [diff] [blame] | 2221 | tpSirSmeJoinReq pReassocReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2222 | tLimMlmReassocReq *pMlmReassocReq; |
| 2223 | tSirResultCodes retCode = eSIR_SME_SUCCESS; |
| 2224 | tpPESession psessionEntry = NULL; |
| 2225 | tANI_U8 sessionId; |
| 2226 | tANI_U8 smeSessionId; |
| 2227 | tANI_U16 transactionId; |
| 2228 | tPowerdBm localPowerConstraint = 0, regMax = 0; |
| 2229 | tANI_U32 teleBcnEn = 0; |
Madan Mohan Koyyalamudi | 7df624d | 2012-10-31 16:32:50 -0700 | [diff] [blame] | 2230 | tANI_U16 nSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2231 | |
| 2232 | |
Abhishek Singh | 127a844 | 2014-12-15 17:31:27 +0530 | [diff] [blame] | 2233 | limLog(pMac, LOG1, FL("Received SME_REASSOC_REQ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2234 | |
Madan Mohan Koyyalamudi | 7df624d | 2012-10-31 16:32:50 -0700 | [diff] [blame] | 2235 | nSize = __limGetSmeJoinReqSizeForAlloc((tANI_U8 *) pMsgBuf); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2236 | pReassocReq = vos_mem_malloc(nSize); |
| 2237 | if ( NULL == pReassocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2238 | { |
| 2239 | // Log error |
| 2240 | limLog(pMac, LOGP, |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2241 | FL("call to AllocateMemory failed for pReassocReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2242 | |
| 2243 | retCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 2244 | goto end; |
| 2245 | } |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2246 | (void) vos_mem_set((void *) pReassocReq, nSize, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2247 | if ((limJoinReqSerDes(pMac, (tpSirSmeJoinReq) pReassocReq, |
| 2248 | (tANI_U8 *) pMsgBuf) == eSIR_FAILURE) || |
| 2249 | (!limIsSmeJoinReqValid(pMac, |
| 2250 | (tpSirSmeJoinReq) pReassocReq))) |
| 2251 | { |
| 2252 | /// Received invalid eWNI_SME_REASSOC_REQ |
| 2253 | // Log the event |
| 2254 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2255 | FL("received SME_REASSOC_REQ with invalid data")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2256 | |
| 2257 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 2258 | goto end; |
| 2259 | } |
| 2260 | |
| 2261 | if((psessionEntry = peFindSessionByBssid(pMac,pReassocReq->bssDescription.bssId,&sessionId))==NULL) |
| 2262 | { |
| 2263 | limPrintMacAddr(pMac, pReassocReq->bssDescription.bssId, LOGE); |
Srinivas Girigowda | 2a69dcf | 2013-09-13 14:48:34 -0700 | [diff] [blame] | 2264 | limLog(pMac, LOGE, FL("Session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2265 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 2266 | goto end; |
| 2267 | } |
| 2268 | |
| 2269 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2270 | limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_REQ_EVENT, psessionEntry, 0, 0); |
| 2271 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2272 | //pMac->lim.gpLimReassocReq = pReassocReq;//TO SUPPORT BT-AMP |
| 2273 | |
| 2274 | /* Store the reassoc handle in the session Table.. 23rd sep review */ |
| 2275 | psessionEntry->pLimReAssocReq = pReassocReq; |
Padma, Santhosh Kumar | 0d25d10 | 2014-07-17 15:08:48 +0530 | [diff] [blame] | 2276 | psessionEntry->dot11mode = pReassocReq->dot11mode; |
| 2277 | psessionEntry->vhtCapability = IS_DOT11_MODE_VHT(pReassocReq->dot11mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2278 | |
| 2279 | /** |
| 2280 | * Reassociate request is expected |
| 2281 | * in link established state only. |
| 2282 | */ |
| 2283 | |
| 2284 | if (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE) |
| 2285 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2286 | #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] | 2287 | if (psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) |
| 2288 | { |
| 2289 | // May be from 11r FT pre-auth. So lets check it before we bail out |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 2290 | limLog(pMac, LOG1, FL("Session in reassoc state is %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2291 | psessionEntry->peSessionId); |
| 2292 | |
| 2293 | // Make sure its our preauth bssid |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2294 | if (!vos_mem_compare( pReassocReq->bssDescription.bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2295 | pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, 6)) |
| 2296 | { |
| 2297 | limPrintMacAddr(pMac, pReassocReq->bssDescription.bssId, LOGE); |
| 2298 | limPrintMacAddr(pMac, pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, LOGE); |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2299 | limLog(pMac, LOGP, FL("Unknown bssId in reassoc state")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2300 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 2301 | goto end; |
| 2302 | } |
| 2303 | |
| 2304 | limProcessMlmFTReassocReq(pMac, pMsgBuf, psessionEntry); |
| 2305 | return; |
| 2306 | } |
| 2307 | #endif |
| 2308 | /// Should not have received eWNI_SME_REASSOC_REQ |
| 2309 | // Log the event |
| 2310 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 2311 | FL("received unexpected SME_REASSOC_REQ in state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2312 | psessionEntry->limSmeState); |
| 2313 | limPrintSmeState(pMac, LOGE, psessionEntry->limSmeState); |
| 2314 | |
| 2315 | retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 2316 | goto end; |
| 2317 | } |
| 2318 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2319 | vos_mem_copy( psessionEntry->limReAssocbssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2320 | psessionEntry->pLimReAssocReq->bssDescription.bssId, |
| 2321 | sizeof(tSirMacAddr)); |
| 2322 | |
| 2323 | psessionEntry->limReassocChannelId = |
| 2324 | psessionEntry->pLimReAssocReq->bssDescription.channelId; |
| 2325 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2326 | psessionEntry->reAssocHtSupportedChannelWidthSet = |
| 2327 | (psessionEntry->pLimReAssocReq->cbMode)?1:0; |
| 2328 | psessionEntry->reAssocHtRecommendedTxWidthSet = |
| 2329 | psessionEntry->reAssocHtSupportedChannelWidthSet; |
| 2330 | psessionEntry->reAssocHtSecondaryChannelOffset = |
| 2331 | psessionEntry->pLimReAssocReq->cbMode; |
| 2332 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2333 | psessionEntry->limReassocBssCaps = |
| 2334 | psessionEntry->pLimReAssocReq->bssDescription.capabilityInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2335 | regMax = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel ); |
| 2336 | localPowerConstraint = regMax; |
| 2337 | limExtractApCapability( pMac, |
| 2338 | (tANI_U8 *) psessionEntry->pLimReAssocReq->bssDescription.ieFields, |
| 2339 | limGetIElenFromBssDescription( |
| 2340 | &psessionEntry->pLimReAssocReq->bssDescription), |
| 2341 | &psessionEntry->limReassocBssQosCaps, |
| 2342 | &psessionEntry->limReassocBssPropCap, |
| 2343 | &pMac->lim.gLimCurrentBssUapsd //TBD-RAJESH make gLimReassocBssUapsd session specific |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2344 | , &localPowerConstraint, |
| 2345 | psessionEntry |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2346 | ); |
| 2347 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2348 | psessionEntry->maxTxPower = VOS_MIN( regMax, (localPowerConstraint) ); |
Sushant Kaushik | ece4b56 | 2015-04-09 18:27:33 +0530 | [diff] [blame] | 2349 | if (!psessionEntry->maxTxPower) |
| 2350 | { |
| 2351 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, FL("Tx power " |
| 2352 | "is zero. Setting it to default value %d"), |
| 2353 | TX_POWER_DEFAULT); |
| 2354 | psessionEntry->maxTxPower = TX_POWER_DEFAULT; |
| 2355 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2356 | #if defined WLAN_VOWIFI_DEBUG |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2357 | limLog( pMac, LOGE, "Regulatory max = %d, local power constraint " |
| 2358 | "= %d, max tx = %d", regMax, localPowerConstraint, |
| 2359 | psessionEntry->maxTxPower ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2360 | #endif |
| 2361 | { |
| 2362 | #if 0 |
| 2363 | if (wlan_cfgGetStr(pMac, WNI_CFG_SSID, pMac->lim.gLimReassocSSID.ssId, |
| 2364 | &cfgLen) != eSIR_SUCCESS) |
| 2365 | { |
| 2366 | /// Could not get SSID from CFG. Log error. |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2367 | limLog(pMac, LOGP, FL("could not retrive SSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2368 | } |
| 2369 | #endif//TO SUPPORT BT-AMP |
| 2370 | |
| 2371 | /* Copy the SSID from sessio entry to local variable */ |
| 2372 | #if 0 |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2373 | vos_mem_copy( pMac->lim.gLimReassocSSID.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2374 | psessionEntry->ssId.ssId, |
| 2375 | psessionEntry->ssId.length); |
| 2376 | #endif |
| 2377 | psessionEntry->limReassocSSID.length = pReassocReq->ssId.length; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2378 | vos_mem_copy( psessionEntry->limReassocSSID.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2379 | pReassocReq->ssId.ssId, psessionEntry->limReassocSSID.length); |
| 2380 | |
| 2381 | } |
| 2382 | |
| 2383 | if (pMac->lim.gLimCurrentBssUapsd) |
| 2384 | { |
| 2385 | pMac->lim.gUapsdPerAcBitmask = psessionEntry->pLimReAssocReq->uapsdPerAcBitmask; |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2386 | limLog( pMac, LOG1, FL("UAPSD flag for all AC - 0x%2x"), |
| 2387 | pMac->lim.gUapsdPerAcBitmask); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2388 | } |
| 2389 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2390 | pMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); |
| 2391 | if ( NULL == pMlmReassocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2392 | { |
| 2393 | // Log error |
| 2394 | limLog(pMac, LOGP, |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2395 | FL("call to AllocateMemory failed for mlmReassocReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2396 | |
| 2397 | retCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 2398 | goto end; |
| 2399 | } |
| 2400 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2401 | vos_mem_copy( pMlmReassocReq->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2402 | psessionEntry->limReAssocbssId, |
| 2403 | sizeof(tSirMacAddr)); |
| 2404 | |
| 2405 | if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, |
| 2406 | (tANI_U32 *) &pMlmReassocReq->reassocFailureTimeout) |
| 2407 | != eSIR_SUCCESS) |
| 2408 | { |
| 2409 | /** |
| 2410 | * Could not get ReassocFailureTimeout value |
| 2411 | * from CFG. Log error. |
| 2412 | */ |
| 2413 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2414 | FL("could not retrieve ReassocFailureTimeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2415 | } |
| 2416 | |
| 2417 | if (cfgGetCapabilityInfo(pMac, &caps,psessionEntry) != eSIR_SUCCESS) |
| 2418 | { |
| 2419 | /** |
| 2420 | * Could not get Capabilities value |
| 2421 | * from CFG. Log error. |
| 2422 | */ |
| 2423 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2424 | FL("could not retrieve Capabilities value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2425 | } |
| 2426 | pMlmReassocReq->capabilityInfo = caps; |
| 2427 | |
| 2428 | /* Update PE sessionId*/ |
| 2429 | pMlmReassocReq->sessionId = sessionId; |
| 2430 | |
| 2431 | /* If telescopic beaconing is enabled, set listen interval to |
| 2432 | WNI_CFG_TELE_BCN_MAX_LI */ |
| 2433 | if(wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_WAKEUP_EN, &teleBcnEn) != |
| 2434 | eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2435 | limLog(pMac, LOGP, FL("Couldn't get WNI_CFG_TELE_BCN_WAKEUP_EN")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2436 | |
| 2437 | val = WNI_CFG_LISTEN_INTERVAL_STADEF; |
| 2438 | |
| 2439 | if(teleBcnEn) |
| 2440 | { |
| 2441 | if(wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_MAX_LI, &val) != |
| 2442 | eSIR_SUCCESS) |
| 2443 | { |
| 2444 | /** |
| 2445 | * Could not get ListenInterval value |
| 2446 | * from CFG. Log error. |
| 2447 | */ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2448 | limLog(pMac, LOGP, FL("could not retrieve ListenInterval")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2449 | } |
| 2450 | } |
| 2451 | else |
| 2452 | { |
| 2453 | if (wlan_cfgGetInt(pMac, WNI_CFG_LISTEN_INTERVAL, &val) != eSIR_SUCCESS) |
| 2454 | { |
| 2455 | /** |
| 2456 | * Could not get ListenInterval value |
| 2457 | * from CFG. Log error. |
| 2458 | */ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2459 | limLog(pMac, LOGP, FL("could not retrieve ListenInterval")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2460 | } |
| 2461 | } |
| 2462 | |
| 2463 | /* Delete all BA sessions before Re-Assoc. |
| 2464 | * BA frames are class 3 frames and the session |
| 2465 | * is lost upon disassociation and reassociation. |
| 2466 | */ |
| 2467 | |
Ganesh Kondabattini | 01f75c9 | 2014-07-07 19:27:41 +0530 | [diff] [blame] | 2468 | limDeleteBASessions(pMac, psessionEntry, BA_BOTH_DIRECTIONS, |
| 2469 | eSIR_MAC_UNSPEC_FAILURE_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2470 | |
| 2471 | pMlmReassocReq->listenInterval = (tANI_U16) val; |
| 2472 | |
| 2473 | /* Indicate whether spectrum management is enabled*/ |
| 2474 | psessionEntry->spectrumMgtEnabled = pReassocReq->spectrumMgtIndicator; |
| 2475 | |
Rajesh Babu Prathipati | 043149f | 2014-06-06 13:33:45 +0530 | [diff] [blame] | 2476 | /* Enable the spectrum management if this is a DFS channel */ |
| 2477 | if (psessionEntry->countryInfoPresent && |
| 2478 | limIsconnectedOnDFSChannel(psessionEntry->currentOperChannel)) |
| 2479 | { |
| 2480 | psessionEntry->spectrumMgtEnabled = TRUE; |
| 2481 | } |
| 2482 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2483 | psessionEntry->limPrevSmeState = psessionEntry->limSmeState; |
| 2484 | psessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
| 2485 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2486 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2487 | |
| 2488 | limPostMlmMessage(pMac, |
| 2489 | LIM_MLM_REASSOC_REQ, |
| 2490 | (tANI_U32 *) pMlmReassocReq); |
| 2491 | return; |
| 2492 | |
| 2493 | end: |
| 2494 | if (pReassocReq) |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2495 | vos_mem_free( pReassocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2496 | |
| 2497 | if (psessionEntry) |
| 2498 | { |
| 2499 | // error occurred after we determined the session so extract |
| 2500 | // session and transaction info from there |
| 2501 | smeSessionId = psessionEntry->smeSessionId; |
| 2502 | transactionId = psessionEntry->transactionId; |
| 2503 | } |
| 2504 | else |
| 2505 | { |
| 2506 | // error occurred before or during the time we determined the session |
| 2507 | // so extract the session and transaction info from the message |
| 2508 | limGetSessionInfo(pMac,(tANI_U8*)pMsgBuf, &smeSessionId, &transactionId); |
| 2509 | } |
| 2510 | |
| 2511 | /// Send Reassoc failure response to host |
| 2512 | /// (note psessionEntry may be NULL, but that's OK) |
| 2513 | limSendSmeJoinReassocRsp(pMac, eWNI_SME_REASSOC_RSP, |
| 2514 | retCode, eSIR_MAC_UNSPEC_FAILURE_STATUS, |
| 2515 | psessionEntry, smeSessionId, transactionId); |
| 2516 | |
| 2517 | } /*** end __limProcessSmeReassocReq() ***/ |
| 2518 | |
| 2519 | |
| 2520 | tANI_BOOLEAN sendDisassocFrame = 1; |
| 2521 | /** |
| 2522 | * __limProcessSmeDisassocReq() |
| 2523 | * |
| 2524 | *FUNCTION: |
| 2525 | * This function is called to process SME_DISASSOC_REQ message |
| 2526 | * from HDD or upper layer application. |
| 2527 | * |
| 2528 | *LOGIC: |
| 2529 | * |
| 2530 | *ASSUMPTIONS: |
| 2531 | * |
| 2532 | *NOTE: |
| 2533 | * |
| 2534 | * @param pMac Pointer to Global MAC structure |
| 2535 | * @param *pMsgBuf A pointer to the SME message buffer |
| 2536 | * @return None |
| 2537 | */ |
| 2538 | |
| 2539 | static void |
| 2540 | __limProcessSmeDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 2541 | { |
| 2542 | tANI_U16 disassocTrigger, reasonCode; |
| 2543 | tLimMlmDisassocReq *pMlmDisassocReq; |
| 2544 | tSirResultCodes retCode = eSIR_SME_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2545 | tSirRetStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2546 | tSirSmeDisassocReq smeDisassocReq; |
| 2547 | tpPESession psessionEntry = NULL; |
| 2548 | tANI_U8 sessionId; |
| 2549 | tANI_U8 smesessionId; |
| 2550 | tANI_U16 smetransactionId; |
| 2551 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2552 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2553 | if (pMsgBuf == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2554 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2555 | limLog(pMac, LOGE, FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2556 | return; |
| 2557 | } |
| 2558 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2559 | limGetSessionInfo(pMac, (tANI_U8 *)pMsgBuf,&smesessionId, &smetransactionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2560 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2561 | status = limDisassocReqSerDes(pMac, &smeDisassocReq, (tANI_U8 *) pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2562 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2563 | if ( (eSIR_FAILURE == status) || |
| 2564 | (!limIsSmeDisassocReqValid(pMac, &smeDisassocReq, psessionEntry)) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2565 | { |
| 2566 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2567 | FL("received invalid SME_DISASSOC_REQ message"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2568 | |
| 2569 | if (pMac->lim.gLimRspReqd) |
| 2570 | { |
| 2571 | pMac->lim.gLimRspReqd = false; |
| 2572 | |
| 2573 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 2574 | disassocTrigger = eLIM_HOST_DISASSOC; |
| 2575 | goto sendDisassoc; |
| 2576 | } |
| 2577 | |
| 2578 | return; |
| 2579 | } |
| 2580 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2581 | if((psessionEntry = peFindSessionByBssid(pMac,smeDisassocReq.bssId,&sessionId))== NULL) |
| 2582 | { |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2583 | limLog(pMac, LOGE,FL("session does not exist for given bssId "MAC_ADDRESS_STR), |
| 2584 | MAC_ADDR_ARRAY(smeDisassocReq.bssId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2585 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 2586 | disassocTrigger = eLIM_HOST_DISASSOC; |
| 2587 | goto sendDisassoc; |
| 2588 | |
| 2589 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2590 | limLog(pMac, LOG1, FL("received DISASSOC_REQ message on sessionid %d" |
| 2591 | "Systemrole %d Reason: %u SmeState: %d from: "MAC_ADDRESS_STR), |
| 2592 | smesessionId,psessionEntry->limSystemRole, |
| 2593 | smeDisassocReq.reasonCode, pMac->lim.gLimSmeState, |
| 2594 | MAC_ADDR_ARRAY(smeDisassocReq.peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2595 | |
| 2596 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2597 | limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_REQ_EVENT, psessionEntry, 0, smeDisassocReq.reasonCode); |
| 2598 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2599 | |
| 2600 | /* Update SME session Id and SME transaction ID*/ |
| 2601 | |
| 2602 | psessionEntry->smeSessionId = smesessionId; |
| 2603 | psessionEntry->transactionId = smetransactionId; |
| 2604 | |
| 2605 | switch (psessionEntry->limSystemRole) |
| 2606 | { |
| 2607 | case eLIM_STA_ROLE: |
| 2608 | case eLIM_BT_AMP_STA_ROLE: |
| 2609 | switch (psessionEntry->limSmeState) |
| 2610 | { |
| 2611 | case eLIM_SME_ASSOCIATED_STATE: |
| 2612 | case eLIM_SME_LINK_EST_STATE: |
Kanchanapally, Vidyullatha | c796fc6 | 2015-03-17 10:45:28 +0530 | [diff] [blame] | 2613 | limLog(pMac, LOG1, FL("Rcvd SME_DISASSOC_REQ while in " |
| 2614 | "limSmeState: %d "),psessionEntry->limSmeState); |
| 2615 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2616 | psessionEntry->limPrevSmeState = psessionEntry->limSmeState; |
| 2617 | psessionEntry->limSmeState= eLIM_SME_WT_DISASSOC_STATE; |
Hoonki Lee | 8c9e99f | 2013-04-18 22:59:11 -0700 | [diff] [blame] | 2618 | #ifdef FEATURE_WLAN_TDLS |
| 2619 | /* Delete all TDLS peers connected before leaving BSS*/ |
| 2620 | limDeleteTDLSPeers(pMac, psessionEntry); |
| 2621 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2622 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2623 | break; |
| 2624 | |
| 2625 | case eLIM_SME_WT_DEAUTH_STATE: |
| 2626 | /* PE shall still process the DISASSOC_REQ and proceed with |
| 2627 | * link tear down even if it had already sent a DEAUTH_IND to |
| 2628 | * to SME. pMac->lim.gLimPrevSmeState shall remain the same as |
| 2629 | * its been set when PE entered WT_DEAUTH_STATE. |
| 2630 | */ |
| 2631 | psessionEntry->limSmeState= eLIM_SME_WT_DISASSOC_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2632 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2633 | limLog(pMac, LOG1, FL("Rcvd SME_DISASSOC_REQ while in " |
| 2634 | "SME_WT_DEAUTH_STATE. ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2635 | break; |
| 2636 | |
| 2637 | case eLIM_SME_WT_DISASSOC_STATE: |
| 2638 | /* PE Recieved a Disassoc frame. Normally it gets DISASSOC_CNF but it |
| 2639 | * received DISASSOC_REQ. Which means host is also trying to disconnect. |
| 2640 | * PE can continue processing DISASSOC_REQ and send the response instead |
| 2641 | * of failing the request. SME will anyway ignore DEAUTH_IND that was sent |
| 2642 | * for disassoc frame. |
| 2643 | * |
| 2644 | * It will send a disassoc, which is ok. However, we can use the global flag |
| 2645 | * sendDisassoc to not send disassoc frame. |
| 2646 | */ |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2647 | limLog(pMac, LOG1, FL("Rcvd SME_DISASSOC_REQ while in " |
| 2648 | "SME_WT_DISASSOC_STATE. ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2649 | break; |
| 2650 | |
| 2651 | case eLIM_SME_JOIN_FAILURE_STATE: { |
| 2652 | /** Return Success as we are already in Disconnected State*/ |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2653 | limLog(pMac, LOG1, FL("Rcvd SME_DISASSOC_REQ while in " |
| 2654 | "eLIM_SME_JOIN_FAILURE_STATE. ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2655 | if (pMac->lim.gLimRspReqd) { |
| 2656 | retCode = eSIR_SME_SUCCESS; |
| 2657 | disassocTrigger = eLIM_HOST_DISASSOC; |
| 2658 | goto sendDisassoc; |
| 2659 | } |
| 2660 | }break; |
| 2661 | default: |
| 2662 | /** |
| 2663 | * STA is not currently associated. |
| 2664 | * Log error and send response to host |
| 2665 | */ |
| 2666 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 2667 | FL("received unexpected SME_DISASSOC_REQ in state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2668 | psessionEntry->limSmeState); |
| 2669 | limPrintSmeState(pMac, LOGE, psessionEntry->limSmeState); |
| 2670 | |
| 2671 | if (pMac->lim.gLimRspReqd) |
| 2672 | { |
| 2673 | if (psessionEntry->limSmeState != |
| 2674 | eLIM_SME_WT_ASSOC_STATE) |
| 2675 | pMac->lim.gLimRspReqd = false; |
| 2676 | |
| 2677 | retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 2678 | disassocTrigger = eLIM_HOST_DISASSOC; |
| 2679 | goto sendDisassoc; |
| 2680 | } |
| 2681 | |
| 2682 | return; |
| 2683 | } |
| 2684 | |
| 2685 | break; |
| 2686 | |
| 2687 | case eLIM_AP_ROLE: |
| 2688 | case eLIM_BT_AMP_AP_ROLE: |
| 2689 | // Fall through |
| 2690 | break; |
| 2691 | |
| 2692 | case eLIM_STA_IN_IBSS_ROLE: |
| 2693 | default: // eLIM_UNKNOWN_ROLE |
| 2694 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2695 | FL("received unexpected SME_DISASSOC_REQ for role %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2696 | psessionEntry->limSystemRole); |
| 2697 | |
| 2698 | retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 2699 | disassocTrigger = eLIM_HOST_DISASSOC; |
| 2700 | goto sendDisassoc; |
| 2701 | } // end switch (pMac->lim.gLimSystemRole) |
| 2702 | |
| 2703 | if (smeDisassocReq.reasonCode == eLIM_LINK_MONITORING_DISASSOC) |
| 2704 | { |
| 2705 | /// Disassociation is triggered by Link Monitoring |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 2706 | limLog(pMac, LOG1, FL("Sending Disasscoc with reason Link Monitoring")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2707 | disassocTrigger = eLIM_LINK_MONITORING_DISASSOC; |
| 2708 | reasonCode = eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON; |
| 2709 | } |
| 2710 | else |
| 2711 | { |
| 2712 | disassocTrigger = eLIM_HOST_DISASSOC; |
| 2713 | reasonCode = smeDisassocReq.reasonCode; |
| 2714 | } |
| 2715 | |
| 2716 | if (smeDisassocReq.doNotSendOverTheAir) |
| 2717 | { |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2718 | limLog(pMac, LOG1, FL("do not send dissoc over the air")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2719 | sendDisassocFrame = 0; |
| 2720 | } |
| 2721 | // Trigger Disassociation frame to peer MAC entity |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 2722 | limLog(pMac, LOG1, FL("Sending Disasscoc with disassoc Trigger" |
| 2723 | " : %d, reasonCode : %d"), |
| 2724 | disassocTrigger, reasonCode); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2725 | pMlmDisassocReq = vos_mem_malloc(sizeof(tLimMlmDisassocReq)); |
| 2726 | if ( NULL == pMlmDisassocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2727 | { |
| 2728 | // Log error |
| 2729 | limLog(pMac, LOGP, |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2730 | FL("call to AllocateMemory failed for mlmDisassocReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2731 | |
| 2732 | return; |
| 2733 | } |
| 2734 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 2735 | vos_mem_copy( (tANI_U8 *) &pMlmDisassocReq->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2736 | (tANI_U8 *) &smeDisassocReq.peerMacAddr, |
| 2737 | sizeof(tSirMacAddr)); |
| 2738 | |
| 2739 | pMlmDisassocReq->reasonCode = reasonCode; |
| 2740 | pMlmDisassocReq->disassocTrigger = disassocTrigger; |
| 2741 | |
| 2742 | /* Update PE session ID*/ |
| 2743 | pMlmDisassocReq->sessionId = sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2744 | |
| 2745 | limPostMlmMessage(pMac, |
| 2746 | LIM_MLM_DISASSOC_REQ, |
| 2747 | (tANI_U32 *) pMlmDisassocReq); |
| 2748 | return; |
| 2749 | |
| 2750 | sendDisassoc: |
| 2751 | if (psessionEntry) |
| 2752 | limSendSmeDisassocNtf(pMac, smeDisassocReq.peerMacAddr, |
| 2753 | retCode, |
| 2754 | disassocTrigger, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2755 | 1,smesessionId,smetransactionId,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2756 | else |
| 2757 | limSendSmeDisassocNtf(pMac, smeDisassocReq.peerMacAddr, |
| 2758 | retCode, |
| 2759 | disassocTrigger, |
Sudhir Sattayappa Kohalli | 5a8ac22 | 2013-03-06 12:41:42 -0800 | [diff] [blame] | 2760 | 1, smesessionId, smetransactionId, NULL); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2761 | |
| 2762 | |
| 2763 | } /*** end __limProcessSmeDisassocReq() ***/ |
| 2764 | |
| 2765 | |
| 2766 | /** ----------------------------------------------------------------- |
| 2767 | \brief __limProcessSmeDisassocCnf() - Process SME_DISASSOC_CNF |
| 2768 | |
| 2769 | This function is called to process SME_DISASSOC_CNF message |
| 2770 | from HDD or upper layer application. |
| 2771 | |
| 2772 | \param pMac - global mac structure |
| 2773 | \param pStaDs - station dph hash node |
| 2774 | \return none |
| 2775 | \sa |
| 2776 | ----------------------------------------------------------------- */ |
| 2777 | static void |
| 2778 | __limProcessSmeDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 2779 | { |
| 2780 | tSirSmeDisassocCnf smeDisassocCnf; |
| 2781 | tANI_U16 aid; |
| 2782 | tpDphHashNode pStaDs; |
| 2783 | tSirRetStatus status = eSIR_SUCCESS; |
| 2784 | tpPESession psessionEntry; |
| 2785 | tANI_U8 sessionId; |
| 2786 | |
| 2787 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2788 | limLog(pMac, LOG1, FL("received SME_DISASSOC_CNF message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2789 | |
| 2790 | status = limDisassocCnfSerDes(pMac, &smeDisassocCnf,(tANI_U8 *) pMsgBuf); |
| 2791 | |
| 2792 | if (status == eSIR_FAILURE) |
| 2793 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2794 | PELOGE(limLog(pMac, LOGE, FL("invalid SME_DISASSOC_CNF message"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2795 | return; |
| 2796 | } |
| 2797 | |
| 2798 | if((psessionEntry = peFindSessionByBssid(pMac, smeDisassocCnf.bssId, &sessionId))== NULL) |
| 2799 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2800 | limLog(pMac, LOGE,FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2801 | return; |
| 2802 | } |
| 2803 | |
| 2804 | if (!limIsSmeDisassocCnfValid(pMac, &smeDisassocCnf, psessionEntry)) |
| 2805 | { |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2806 | limLog(pMac, LOGE, FL("received invalid SME_DISASSOC_CNF message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2807 | return; |
| 2808 | } |
| 2809 | |
| 2810 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2811 | if (smeDisassocCnf.messageType == eWNI_SME_DISASSOC_CNF) |
| 2812 | limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_CNF_EVENT, psessionEntry, (tANI_U16)smeDisassocCnf.statusCode, 0); |
| 2813 | else if (smeDisassocCnf.messageType == eWNI_SME_DEAUTH_CNF) |
| 2814 | limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_CNF_EVENT, psessionEntry, (tANI_U16)smeDisassocCnf.statusCode, 0); |
| 2815 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2816 | |
| 2817 | switch (psessionEntry->limSystemRole) |
| 2818 | { |
| 2819 | case eLIM_STA_ROLE: |
| 2820 | case eLIM_BT_AMP_STA_ROLE: //To test reconn |
| 2821 | if ((psessionEntry->limSmeState != eLIM_SME_IDLE_STATE) && |
| 2822 | (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && |
| 2823 | (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) |
| 2824 | { |
| 2825 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 2826 | FL("received unexp SME_DISASSOC_CNF in state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2827 | psessionEntry->limSmeState); |
| 2828 | limPrintSmeState(pMac, LOGE, psessionEntry->limSmeState); |
| 2829 | return; |
| 2830 | } |
| 2831 | break; |
| 2832 | |
| 2833 | case eLIM_AP_ROLE: |
| 2834 | // Fall through |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2835 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2836 | |
| 2837 | case eLIM_STA_IN_IBSS_ROLE: |
| 2838 | default: // eLIM_UNKNOWN_ROLE |
| 2839 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2840 | FL("received unexpected SME_DISASSOC_CNF role %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2841 | psessionEntry->limSystemRole); |
| 2842 | |
| 2843 | return; |
| 2844 | } |
| 2845 | |
| 2846 | |
| 2847 | if ( (psessionEntry->limSmeState == eLIM_SME_WT_DISASSOC_STATE) || |
| 2848 | (psessionEntry->limSmeState == eLIM_SME_WT_DEAUTH_STATE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2849 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2850 | ) |
| 2851 | { |
| 2852 | pStaDs = dphLookupHashEntry(pMac, smeDisassocCnf.peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 2853 | if (pStaDs == NULL) |
| 2854 | { |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2855 | PELOGE(limLog(pMac, LOGE, FL("received DISASSOC_CNF for a STA that " |
| 2856 | "does not have context, addr= "MAC_ADDRESS_STR), |
| 2857 | MAC_ADDR_ARRAY(smeDisassocCnf.peerMacAddr));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2858 | return; |
| 2859 | } |
Madan Mohan Koyyalamudi | 2300172 | 2012-10-31 16:48:56 -0700 | [diff] [blame] | 2860 | /* Delete FT session if there exists one */ |
| 2861 | limFTCleanup(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2862 | limCleanupRxPath(pMac, pStaDs, psessionEntry); |
Madan Mohan Koyyalamudi | a67d433 | 2012-11-29 11:35:23 -0800 | [diff] [blame] | 2863 | |
| 2864 | limCleanUpDisassocDeauthReq(pMac, (char*)&smeDisassocCnf.peerMacAddr, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2865 | } |
| 2866 | |
| 2867 | return; |
| 2868 | } |
| 2869 | |
| 2870 | |
| 2871 | /** |
| 2872 | * __limProcessSmeDeauthReq() |
| 2873 | * |
| 2874 | *FUNCTION: |
| 2875 | * This function is called to process SME_DEAUTH_REQ message |
| 2876 | * from HDD or upper layer application. |
| 2877 | * |
| 2878 | *LOGIC: |
| 2879 | * |
| 2880 | *ASSUMPTIONS: |
| 2881 | * |
| 2882 | *NOTE: |
| 2883 | * |
| 2884 | * @param pMac Pointer to Global MAC structure |
| 2885 | * @param *pMsgBuf A pointer to the SME message buffer |
| 2886 | * @return None |
| 2887 | */ |
| 2888 | |
| 2889 | static void |
| 2890 | __limProcessSmeDeauthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 2891 | { |
| 2892 | tANI_U16 deauthTrigger, reasonCode; |
| 2893 | tLimMlmDeauthReq *pMlmDeauthReq; |
| 2894 | tSirSmeDeauthReq smeDeauthReq; |
| 2895 | tSirResultCodes retCode = eSIR_SME_SUCCESS; |
| 2896 | tSirRetStatus status = eSIR_SUCCESS; |
| 2897 | tpPESession psessionEntry; |
| 2898 | tANI_U8 sessionId; //PE sessionId |
| 2899 | tANI_U8 smesessionId; |
| 2900 | tANI_U16 smetransactionId; |
| 2901 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2902 | |
| 2903 | status = limDeauthReqSerDes(pMac, &smeDeauthReq,(tANI_U8 *) pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2904 | limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&smesessionId,&smetransactionId); |
| 2905 | |
| 2906 | //We need to get a session first but we don't even know if the message is correct. |
| 2907 | if((psessionEntry = peFindSessionByBssid(pMac, smeDeauthReq.bssId, &sessionId)) == NULL) |
| 2908 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2909 | limLog(pMac, LOGE,FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2910 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 2911 | deauthTrigger = eLIM_HOST_DEAUTH; |
| 2912 | goto sendDeauth; |
| 2913 | |
| 2914 | } |
| 2915 | |
| 2916 | if ((status == eSIR_FAILURE) || (!limIsSmeDeauthReqValid(pMac, &smeDeauthReq, psessionEntry))) |
| 2917 | { |
Sachin Ahuja | 4235414 | 2015-01-06 19:48:35 +0530 | [diff] [blame] | 2918 | PELOGE(limLog(pMac, LOGE,FL |
| 2919 | ("received invalid SME_DEAUTH_REQ message"));) |
| 2920 | pMac->lim.gLimRspReqd = false; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2921 | |
Sachin Ahuja | 4235414 | 2015-01-06 19:48:35 +0530 | [diff] [blame] | 2922 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 2923 | deauthTrigger = eLIM_HOST_DEAUTH; |
| 2924 | goto sendDeauth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2925 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2926 | limLog(pMac, LOG1,FL("received DEAUTH_REQ message on sessionid %d " |
| 2927 | "Systemrole %d with reasoncode %u in limSmestate %d from " |
| 2928 | MAC_ADDRESS_STR), smesessionId, psessionEntry->limSystemRole, |
| 2929 | smeDeauthReq.reasonCode, psessionEntry->limSmeState, |
| 2930 | MAC_ADDR_ARRAY(smeDeauthReq.peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2931 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2932 | limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_REQ_EVENT, psessionEntry, 0, smeDeauthReq.reasonCode); |
| 2933 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2934 | |
| 2935 | /* Update SME session ID and Transaction ID */ |
| 2936 | psessionEntry->smeSessionId = smesessionId; |
| 2937 | psessionEntry->transactionId = smetransactionId; |
| 2938 | |
| 2939 | |
| 2940 | switch (psessionEntry->limSystemRole) |
| 2941 | { |
| 2942 | case eLIM_STA_ROLE: |
| 2943 | case eLIM_BT_AMP_STA_ROLE: |
| 2944 | |
| 2945 | switch (psessionEntry->limSmeState) |
| 2946 | { |
| 2947 | case eLIM_SME_ASSOCIATED_STATE: |
| 2948 | case eLIM_SME_LINK_EST_STATE: |
| 2949 | case eLIM_SME_WT_ASSOC_STATE: |
| 2950 | case eLIM_SME_JOIN_FAILURE_STATE: |
| 2951 | case eLIM_SME_IDLE_STATE: |
| 2952 | psessionEntry->limPrevSmeState = psessionEntry->limSmeState; |
| 2953 | psessionEntry->limSmeState = eLIM_SME_WT_DEAUTH_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 2954 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2955 | |
| 2956 | // Send Deauthentication request to MLM below |
| 2957 | |
| 2958 | break; |
Sachin Ahuja | a100dcc | 2014-07-03 14:30:18 +0530 | [diff] [blame] | 2959 | case eLIM_SME_WT_DEAUTH_STATE: |
| 2960 | /* |
| 2961 | * PE Recieved a Deauth frame. Normally it gets |
| 2962 | * DEAUTH_CNF but it received DEAUTH_REQ. Which |
| 2963 | * means host is also trying to disconnect. |
| 2964 | * PE can continue processing DEAUTH_REQ and send |
| 2965 | * the response instead of failing the request. |
| 2966 | * SME will anyway ignore DEAUTH_IND that was sent |
| 2967 | * for deauth frame. |
| 2968 | */ |
| 2969 | limLog(pMac, LOG1, FL("Rcvd SME_DEAUTH_REQ while in " |
| 2970 | "SME_WT_DEAUTH_STATE. ")); |
| 2971 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2972 | default: |
| 2973 | /** |
| 2974 | * STA is not in a state to deauthenticate with |
| 2975 | * peer. Log error and send response to host. |
| 2976 | */ |
| 2977 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 2978 | FL("received unexp SME_DEAUTH_REQ in state %d"), |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 2979 | psessionEntry->limSmeState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2980 | limPrintSmeState(pMac, LOGE, psessionEntry->limSmeState); |
| 2981 | |
| 2982 | if (pMac->lim.gLimRspReqd) |
| 2983 | { |
| 2984 | pMac->lim.gLimRspReqd = false; |
| 2985 | |
| 2986 | retCode = eSIR_SME_STA_NOT_AUTHENTICATED; |
| 2987 | deauthTrigger = eLIM_HOST_DEAUTH; |
Leela Venkata Kiran Kumar Reddy Chirala | 56df73f | 2014-01-30 14:18:00 -0800 | [diff] [blame] | 2988 | /** |
| 2989 | *here we received deauth request from AP so sme state is |
| 2990 | eLIM_SME_WT_DEAUTH_STATE.if we have ISSUED delSta then |
| 2991 | mlm state should be eLIM_MLM_WT_DEL_STA_RSP_STATE and if |
| 2992 | we got delBSS rsp then mlm state should be eLIM_MLM_IDLE_STATE |
| 2993 | so the below condition captures the state where delSta |
| 2994 | not done and firmware still in connected state. |
| 2995 | */ |
| 2996 | if (psessionEntry->limSmeState == eLIM_SME_WT_DEAUTH_STATE && |
| 2997 | psessionEntry->limMlmState != eLIM_MLM_IDLE_STATE && |
| 2998 | psessionEntry->limMlmState != eLIM_MLM_WT_DEL_STA_RSP_STATE) |
| 2999 | { |
| 3000 | retCode = eSIR_SME_DEAUTH_STATUS; |
| 3001 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3002 | goto sendDeauth; |
| 3003 | } |
| 3004 | |
| 3005 | return; |
| 3006 | } |
| 3007 | |
| 3008 | break; |
| 3009 | |
| 3010 | case eLIM_STA_IN_IBSS_ROLE: |
Abhishek Singh | 92fbac2 | 2015-03-24 17:57:36 +0530 | [diff] [blame] | 3011 | limLog(pMac, LOGE,FL("Deauth not allowed in IBSS")); |
| 3012 | if (pMac->lim.gLimRspReqd) |
| 3013 | { |
| 3014 | pMac->lim.gLimRspReqd = false; |
| 3015 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 3016 | deauthTrigger = eLIM_HOST_DEAUTH; |
| 3017 | goto sendDeauth; |
| 3018 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3019 | return; |
| 3020 | |
| 3021 | case eLIM_AP_ROLE: |
| 3022 | // Fall through |
| 3023 | |
| 3024 | break; |
| 3025 | |
| 3026 | default: |
| 3027 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3028 | FL("received unexpected SME_DEAUTH_REQ for role %d"), |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 3029 | psessionEntry->limSystemRole); |
Abhishek Singh | 92fbac2 | 2015-03-24 17:57:36 +0530 | [diff] [blame] | 3030 | if (pMac->lim.gLimRspReqd) |
| 3031 | { |
| 3032 | pMac->lim.gLimRspReqd = false; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3033 | |
Abhishek Singh | 92fbac2 | 2015-03-24 17:57:36 +0530 | [diff] [blame] | 3034 | retCode = eSIR_SME_INVALID_PARAMETERS; |
| 3035 | deauthTrigger = eLIM_HOST_DEAUTH; |
| 3036 | goto sendDeauth; |
| 3037 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3038 | return; |
Abhishek Singh | 92fbac2 | 2015-03-24 17:57:36 +0530 | [diff] [blame] | 3039 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3040 | } // end switch (pMac->lim.gLimSystemRole) |
| 3041 | |
| 3042 | if (smeDeauthReq.reasonCode == eLIM_LINK_MONITORING_DEAUTH) |
| 3043 | { |
| 3044 | /// Deauthentication is triggered by Link Monitoring |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3045 | limLog(pMac, LOG1, |
| 3046 | FL("Deauthentication is triggered by Link Monitoring")); |
| 3047 | limLog(pMac, LOG1, |
| 3048 | FL("Set Trigger to eLIM_LINK_MONITORING_DEAUTH")); |
| 3049 | limLog(pMac, LOG1, |
| 3050 | FL("and Reason to eSIR_MAC_UNSPEC_FAILURE_REASON")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3051 | deauthTrigger = eLIM_LINK_MONITORING_DEAUTH; |
| 3052 | reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 3053 | } |
| 3054 | else |
| 3055 | { |
| 3056 | deauthTrigger = eLIM_HOST_DEAUTH; |
| 3057 | reasonCode = smeDeauthReq.reasonCode; |
| 3058 | } |
| 3059 | |
| 3060 | // Trigger Deauthentication frame to peer MAC entity |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3061 | pMlmDeauthReq = vos_mem_malloc(sizeof(tLimMlmDeauthReq)); |
| 3062 | if ( NULL == pMlmDeauthReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3063 | { |
| 3064 | // Log error |
Abhishek Singh | 92fbac2 | 2015-03-24 17:57:36 +0530 | [diff] [blame] | 3065 | limLog(pMac, LOGE, |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3066 | FL("call to AllocateMemory failed for mlmDeauthReq")); |
Abhishek Singh | 92fbac2 | 2015-03-24 17:57:36 +0530 | [diff] [blame] | 3067 | if (pMac->lim.gLimRspReqd) |
| 3068 | { |
| 3069 | pMac->lim.gLimRspReqd = false; |
| 3070 | retCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3071 | deauthTrigger = eLIM_HOST_DEAUTH; |
| 3072 | goto sendDeauth; |
| 3073 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3074 | return; |
| 3075 | } |
| 3076 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3077 | vos_mem_copy( (tANI_U8 *) &pMlmDeauthReq->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3078 | (tANI_U8 *) &smeDeauthReq.peerMacAddr, |
| 3079 | sizeof(tSirMacAddr)); |
| 3080 | |
| 3081 | pMlmDeauthReq->reasonCode = reasonCode; |
| 3082 | pMlmDeauthReq->deauthTrigger = deauthTrigger; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3083 | |
| 3084 | /* Update PE session Id*/ |
| 3085 | pMlmDeauthReq->sessionId = sessionId; |
| 3086 | |
| 3087 | limPostMlmMessage(pMac, |
| 3088 | LIM_MLM_DEAUTH_REQ, |
| 3089 | (tANI_U32 *) pMlmDeauthReq); |
| 3090 | return; |
| 3091 | |
| 3092 | sendDeauth: |
| 3093 | limSendSmeDeauthNtf(pMac, smeDeauthReq.peerMacAddr, |
| 3094 | retCode, |
| 3095 | deauthTrigger, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3096 | 1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3097 | smesessionId, smetransactionId); |
| 3098 | } /*** end __limProcessSmeDeauthReq() ***/ |
| 3099 | |
| 3100 | |
| 3101 | |
| 3102 | /** |
| 3103 | * __limProcessSmeSetContextReq() |
| 3104 | * |
| 3105 | *FUNCTION: |
| 3106 | * This function is called to process SME_SETCONTEXT_REQ message |
| 3107 | * from HDD or upper layer application. |
| 3108 | * |
| 3109 | *LOGIC: |
| 3110 | * |
| 3111 | *ASSUMPTIONS: |
| 3112 | * |
| 3113 | *NOTE: |
| 3114 | * |
| 3115 | * @param pMac Pointer to Global MAC structure |
| 3116 | * @param *pMsgBuf A pointer to the SME message buffer |
| 3117 | * @return None |
| 3118 | */ |
| 3119 | |
| 3120 | static void |
| 3121 | __limProcessSmeSetContextReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 3122 | { |
| 3123 | tpSirSmeSetContextReq pSetContextReq; |
| 3124 | tLimMlmSetKeysReq *pMlmSetKeysReq; |
| 3125 | tpPESession psessionEntry; |
| 3126 | tANI_U8 sessionId; //PE sessionID |
| 3127 | tANI_U8 smesessionId; |
| 3128 | tANI_U16 smetransactionId; |
| 3129 | |
| 3130 | |
| 3131 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3132 | FL("received SETCONTEXT_REQ message"));); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3133 | |
| 3134 | |
| 3135 | if(pMsgBuf == NULL) |
| 3136 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3137 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3138 | return; |
| 3139 | } |
| 3140 | |
| 3141 | limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&smesessionId,&smetransactionId); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3142 | |
| 3143 | pSetContextReq = vos_mem_malloc(sizeof(tSirKeys) * SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS); |
| 3144 | if ( NULL == pSetContextReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3145 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3146 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for pSetContextReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3147 | return; |
| 3148 | } |
| 3149 | |
| 3150 | if ((limSetContextReqSerDes(pMac, pSetContextReq, (tANI_U8 *) pMsgBuf) == eSIR_FAILURE) || |
| 3151 | (!limIsSmeSetContextReqValid(pMac, pSetContextReq))) |
| 3152 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3153 | limLog(pMac, LOGW, FL("received invalid SME_SETCONTEXT_REQ message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3154 | goto end; |
| 3155 | } |
| 3156 | |
| 3157 | if(pSetContextReq->keyMaterial.numKeys > SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS) |
| 3158 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3159 | PELOGE(limLog(pMac, LOGE, FL("numKeys:%d is more than SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS"), pSetContextReq->keyMaterial.numKeys);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3160 | limSendSmeSetContextRsp(pMac, |
| 3161 | pSetContextReq->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3162 | 1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3163 | eSIR_SME_INVALID_PARAMETERS,NULL, |
| 3164 | smesessionId,smetransactionId); |
| 3165 | |
| 3166 | goto end; |
| 3167 | } |
| 3168 | |
| 3169 | |
| 3170 | if((psessionEntry = peFindSessionByBssid(pMac, pSetContextReq->bssId, &sessionId)) == NULL) |
| 3171 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3172 | limLog(pMac, LOGW, FL("Session does not exist for given BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3173 | limSendSmeSetContextRsp(pMac, |
| 3174 | pSetContextReq->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3175 | 1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3176 | eSIR_SME_INVALID_PARAMETERS,NULL, |
| 3177 | smesessionId,smetransactionId); |
| 3178 | |
| 3179 | goto end; |
| 3180 | } |
| 3181 | |
| 3182 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 3183 | limDiagEventReport(pMac, WLAN_PE_DIAG_SETCONTEXT_REQ_EVENT, psessionEntry, 0, 0); |
| 3184 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 3185 | |
| 3186 | |
| 3187 | if ((((psessionEntry->limSystemRole == eLIM_STA_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && |
| 3188 | (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE)) || |
| 3189 | (((psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) || |
| 3190 | (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && |
| 3191 | (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))) |
| 3192 | { |
| 3193 | // Trigger MLM_SETKEYS_REQ |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3194 | pMlmSetKeysReq = vos_mem_malloc(sizeof(tLimMlmSetKeysReq)); |
| 3195 | if ( NULL == pMlmSetKeysReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3196 | { |
| 3197 | // Log error |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3198 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for mlmSetKeysReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3199 | goto end; |
| 3200 | } |
Abhishek Singh | b25e844 | 2015-06-23 14:28:05 +0530 | [diff] [blame] | 3201 | vos_mem_zero(pMlmSetKeysReq,sizeof(tLimMlmSetKeysReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3202 | pMlmSetKeysReq->edType = pSetContextReq->keyMaterial.edType; |
| 3203 | pMlmSetKeysReq->numKeys = pSetContextReq->keyMaterial.numKeys; |
| 3204 | if(pMlmSetKeysReq->numKeys > SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS) |
| 3205 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3206 | limLog(pMac, LOGP, FL("Num of keys exceeded max num of default keys limit")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3207 | goto end; |
| 3208 | } |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3209 | vos_mem_copy( (tANI_U8 *) &pMlmSetKeysReq->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3210 | (tANI_U8 *) &pSetContextReq->peerMacAddr, |
| 3211 | sizeof(tSirMacAddr)); |
| 3212 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3213 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3214 | vos_mem_copy( (tANI_U8 *) &pMlmSetKeysReq->key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3215 | (tANI_U8 *) &pSetContextReq->keyMaterial.key, |
| 3216 | sizeof(tSirKeys) * (pMlmSetKeysReq->numKeys ? pMlmSetKeysReq->numKeys : 1)); |
| 3217 | |
| 3218 | pMlmSetKeysReq->sessionId = sessionId; |
| 3219 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
| 3220 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3221 | FL("received SETCONTEXT_REQ message sessionId=%d"), pMlmSetKeysReq->sessionId);); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3222 | #endif |
| 3223 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3224 | if(((pSetContextReq->keyMaterial.edType == eSIR_ED_WEP40) || (pSetContextReq->keyMaterial.edType == eSIR_ED_WEP104)) |
| 3225 | && (psessionEntry->limSystemRole == eLIM_AP_ROLE)) |
| 3226 | { |
| 3227 | if(pSetContextReq->keyMaterial.key[0].keyLength) |
| 3228 | { |
| 3229 | tANI_U8 keyId; |
| 3230 | keyId = pSetContextReq->keyMaterial.key[0].keyId; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3231 | vos_mem_copy( (tANI_U8 *)&psessionEntry->WEPKeyMaterial[keyId], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3232 | (tANI_U8 *) &pSetContextReq->keyMaterial, sizeof(tSirKeyMaterial)); |
| 3233 | } |
| 3234 | else { |
| 3235 | tANI_U32 i; |
| 3236 | for( i = 0; i < SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS; i++) |
| 3237 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3238 | vos_mem_copy( (tANI_U8 *) &pMlmSetKeysReq->key[i], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3239 | (tANI_U8 *)psessionEntry->WEPKeyMaterial[i].key, sizeof(tSirKeys)); |
| 3240 | } |
| 3241 | } |
| 3242 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3243 | |
| 3244 | limPostMlmMessage(pMac, LIM_MLM_SETKEYS_REQ, (tANI_U32 *) pMlmSetKeysReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3245 | } |
| 3246 | else |
| 3247 | { |
| 3248 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3249 | FL("received unexpected SME_SETCONTEXT_REQ for role %d, state=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3250 | psessionEntry->limSystemRole, |
| 3251 | psessionEntry->limSmeState); |
| 3252 | limPrintSmeState(pMac, LOGE, psessionEntry->limSmeState); |
| 3253 | |
| 3254 | limSendSmeSetContextRsp(pMac, pSetContextReq->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3255 | 1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3256 | eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,psessionEntry, |
| 3257 | smesessionId, |
| 3258 | smetransactionId); |
| 3259 | } |
| 3260 | |
| 3261 | end: |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3262 | vos_mem_zero(pSetContextReq, |
| 3263 | (sizeof(tSirKeys) * SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS)); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3264 | vos_mem_free( pSetContextReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3265 | return; |
| 3266 | } /*** end __limProcessSmeSetContextReq() ***/ |
| 3267 | |
| 3268 | /** |
| 3269 | * __limProcessSmeRemoveKeyReq() |
| 3270 | * |
| 3271 | *FUNCTION: |
| 3272 | * This function is called to process SME_REMOVEKEY_REQ message |
| 3273 | * from HDD or upper layer application. |
| 3274 | * |
| 3275 | *LOGIC: |
| 3276 | * |
| 3277 | *ASSUMPTIONS: |
| 3278 | * |
| 3279 | *NOTE: |
| 3280 | * |
| 3281 | * @param pMac Pointer to Global MAC structure |
| 3282 | * @param *pMsgBuf A pointer to the SME message buffer |
| 3283 | * @return None |
| 3284 | */ |
| 3285 | |
| 3286 | static void |
| 3287 | __limProcessSmeRemoveKeyReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 3288 | { |
| 3289 | tpSirSmeRemoveKeyReq pRemoveKeyReq; |
| 3290 | tLimMlmRemoveKeyReq *pMlmRemoveKeyReq; |
| 3291 | tpPESession psessionEntry; |
| 3292 | tANI_U8 sessionId; //PE sessionID |
| 3293 | tANI_U8 smesessionId; |
| 3294 | tANI_U16 smetransactionId; |
| 3295 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3296 | limLog(pMac, LOG1, |
| 3297 | FL("received SME_REMOVEKEY_REQ message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3298 | |
| 3299 | if(pMsgBuf == NULL) |
| 3300 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3301 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3302 | return; |
| 3303 | } |
| 3304 | |
| 3305 | |
| 3306 | limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&smesessionId,&smetransactionId); |
| 3307 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3308 | pRemoveKeyReq = vos_mem_malloc(sizeof(*pRemoveKeyReq)); |
| 3309 | if ( NULL == pRemoveKeyReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3310 | { |
| 3311 | //Log error |
| 3312 | limLog(pMac, LOGP, |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3313 | FL("call to AllocateMemory failed for pRemoveKeyReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3314 | |
| 3315 | return; |
| 3316 | } |
| 3317 | |
| 3318 | if ((limRemoveKeyReqSerDes(pMac, |
| 3319 | pRemoveKeyReq, |
| 3320 | (tANI_U8 *) pMsgBuf) == eSIR_FAILURE)) |
| 3321 | { |
| 3322 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3323 | FL("received invalid SME_REMOVECONTEXT_REQ message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3324 | |
| 3325 | /* extra look up is needed since, session entry to be passed il limsendremovekey response */ |
| 3326 | |
| 3327 | if((psessionEntry = peFindSessionByBssid(pMac,pRemoveKeyReq->bssId,&sessionId))== NULL) |
| 3328 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3329 | limLog(pMac, LOGE,FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3330 | //goto end; |
| 3331 | } |
| 3332 | |
| 3333 | limSendSmeRemoveKeyRsp(pMac, |
| 3334 | pRemoveKeyReq->peerMacAddr, |
| 3335 | eSIR_SME_INVALID_PARAMETERS,psessionEntry, |
| 3336 | smesessionId,smetransactionId); |
| 3337 | |
| 3338 | goto end; |
| 3339 | } |
| 3340 | |
| 3341 | if((psessionEntry = peFindSessionByBssid(pMac,pRemoveKeyReq->bssId, &sessionId))== NULL) |
| 3342 | { |
| 3343 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3344 | FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3345 | limSendSmeRemoveKeyRsp(pMac, |
| 3346 | pRemoveKeyReq->peerMacAddr, |
| 3347 | eSIR_SME_UNEXPECTED_REQ_RESULT_CODE, NULL, |
| 3348 | smesessionId, smetransactionId); |
| 3349 | goto end; |
| 3350 | } |
| 3351 | |
| 3352 | |
| 3353 | if ((((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE))&& |
| 3354 | (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE)) || |
| 3355 | (((psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) || |
| 3356 | (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && |
| 3357 | (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))) |
| 3358 | { |
| 3359 | // Trigger MLM_REMOVEKEYS_REQ |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3360 | pMlmRemoveKeyReq = vos_mem_malloc(sizeof(tLimMlmRemoveKeyReq)); |
| 3361 | if ( NULL == pMlmRemoveKeyReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3362 | { |
| 3363 | // Log error |
| 3364 | limLog(pMac, LOGP, |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3365 | FL("call to AllocateMemory failed for mlmRemoveKeysReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3366 | |
| 3367 | goto end; |
| 3368 | } |
| 3369 | |
| 3370 | pMlmRemoveKeyReq->edType = (tAniEdType)pRemoveKeyReq->edType; |
| 3371 | pMlmRemoveKeyReq->keyId = pRemoveKeyReq->keyId; |
| 3372 | pMlmRemoveKeyReq->wepType = pRemoveKeyReq->wepType; |
| 3373 | pMlmRemoveKeyReq->unicast = pRemoveKeyReq->unicast; |
| 3374 | |
| 3375 | /* Update PE session Id */ |
| 3376 | pMlmRemoveKeyReq->sessionId = sessionId; |
| 3377 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3378 | vos_mem_copy( (tANI_U8 *) &pMlmRemoveKeyReq->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3379 | (tANI_U8 *) &pRemoveKeyReq->peerMacAddr, |
| 3380 | sizeof(tSirMacAddr)); |
| 3381 | |
| 3382 | |
| 3383 | limPostMlmMessage(pMac, |
| 3384 | LIM_MLM_REMOVEKEY_REQ, |
| 3385 | (tANI_U32 *) pMlmRemoveKeyReq); |
| 3386 | } |
| 3387 | else |
| 3388 | { |
| 3389 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3390 | FL("received unexpected SME_REMOVEKEY_REQ for role %d, state=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3391 | psessionEntry->limSystemRole, |
| 3392 | psessionEntry->limSmeState); |
| 3393 | limPrintSmeState(pMac, LOGE, psessionEntry->limSmeState); |
| 3394 | |
| 3395 | limSendSmeRemoveKeyRsp(pMac, |
| 3396 | pRemoveKeyReq->peerMacAddr, |
| 3397 | eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,psessionEntry, |
| 3398 | smesessionId,smetransactionId); |
| 3399 | } |
| 3400 | |
| 3401 | end: |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3402 | vos_mem_free( pRemoveKeyReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3403 | } /*** end __limProcessSmeRemoveKeyReq() ***/ |
| 3404 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3405 | void limProcessSmeGetScanChannelInfo(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 3406 | { |
| 3407 | tSirMsgQ mmhMsg; |
| 3408 | tpSmeGetScanChnRsp pSirSmeRsp; |
| 3409 | tANI_U16 len = 0; |
Madan Mohan Koyyalamudi | de1b5bc | 2013-07-12 00:56:04 +0530 | [diff] [blame] | 3410 | tANI_U8 sessionId; |
| 3411 | tANI_U16 transactionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3412 | |
| 3413 | if(pMac->lim.scanChnInfo.numChnInfo > SIR_MAX_SUPPORTED_CHANNEL_LIST) |
| 3414 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3415 | limLog(pMac, LOGW, FL("numChn is out of bounds %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3416 | pMac->lim.scanChnInfo.numChnInfo); |
| 3417 | pMac->lim.scanChnInfo.numChnInfo = SIR_MAX_SUPPORTED_CHANNEL_LIST; |
| 3418 | } |
| 3419 | |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 3420 | limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3421 | FL("Sending message %s with number of channels %d"), |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 3422 | limMsgStr(eWNI_SME_GET_SCANNED_CHANNEL_RSP), pMac->lim.scanChnInfo.numChnInfo); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3423 | |
| 3424 | len = sizeof(tSmeGetScanChnRsp) + (pMac->lim.scanChnInfo.numChnInfo - 1) * sizeof(tLimScanChn); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3425 | pSirSmeRsp = vos_mem_malloc(len); |
| 3426 | if ( NULL == pSirSmeRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3427 | { |
| 3428 | /// Buffer not available. Log error |
| 3429 | limLog(pMac, LOGP, |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3430 | FL("call to AllocateMemory failed for JOIN/REASSOC_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3431 | |
| 3432 | return; |
| 3433 | } |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3434 | vos_mem_set(pSirSmeRsp, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3435 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3436 | pSirSmeRsp->mesgType = eWNI_SME_GET_SCANNED_CHANNEL_RSP; |
| 3437 | pSirSmeRsp->mesgLen = len; |
Madan Mohan Koyyalamudi | de1b5bc | 2013-07-12 00:56:04 +0530 | [diff] [blame] | 3438 | |
| 3439 | if (pMac->fScanOffload) |
| 3440 | { |
| 3441 | limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&sessionId,&transactionId); |
| 3442 | pSirSmeRsp->sessionId = sessionId; |
| 3443 | } |
| 3444 | else |
| 3445 | pSirSmeRsp->sessionId = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3446 | |
| 3447 | if(pMac->lim.scanChnInfo.numChnInfo) |
| 3448 | { |
| 3449 | pSirSmeRsp->numChn = pMac->lim.scanChnInfo.numChnInfo; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3450 | vos_mem_copy( pSirSmeRsp->scanChn, pMac->lim.scanChnInfo.scanChn, |
| 3451 | sizeof(tLimScanChn) * pSirSmeRsp->numChn); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3452 | } |
| 3453 | //Clear the list |
| 3454 | limRessetScanChannelInfo(pMac); |
| 3455 | |
| 3456 | mmhMsg.type = eWNI_SME_GET_SCANNED_CHANNEL_RSP; |
| 3457 | mmhMsg.bodyptr = pSirSmeRsp; |
| 3458 | mmhMsg.bodyval = 0; |
| 3459 | |
| 3460 | pMac->lim.gLimRspReqd = false; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3461 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3462 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 3463 | } |
| 3464 | |
| 3465 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3466 | void limProcessSmeGetAssocSTAsInfo(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 3467 | { |
| 3468 | tSirSmeGetAssocSTAsReq getAssocSTAsReq; |
| 3469 | tpDphHashNode pStaDs = NULL; |
| 3470 | tpPESession psessionEntry = NULL; |
| 3471 | tSap_Event sapEvent; |
| 3472 | tpWLAN_SAPEventCB pSapEventCallback = NULL; |
| 3473 | tpSap_AssocMacAddr pAssocStasTemp = NULL;// #include "sapApi.h" |
| 3474 | tANI_U8 sessionId = CSR_SESSION_ID_INVALID; |
| 3475 | tANI_U8 assocId = 0; |
| 3476 | tANI_U8 staCount = 0; |
| 3477 | |
| 3478 | if (!limIsSmeGetAssocSTAsReqValid(pMac, &getAssocSTAsReq, (tANI_U8 *) pMsgBuf)) |
| 3479 | { |
| 3480 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3481 | FL("received invalid eWNI_SME_GET_ASSOC_STAS_REQ message")); |
Girish Gowli | afd4231 | 2014-07-24 13:13:59 +0530 | [diff] [blame] | 3482 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3483 | } |
| 3484 | |
| 3485 | switch (getAssocSTAsReq.modId) |
| 3486 | { |
| 3487 | /** |
| 3488 | case VOS_MODULE_ID_HAL: |
| 3489 | wdaPostCtrlMsg( pMac, &msgQ ); |
| 3490 | return; |
| 3491 | |
| 3492 | case VOS_MODULE_ID_TL: |
| 3493 | Post msg TL |
| 3494 | return; |
| 3495 | */ |
| 3496 | case VOS_MODULE_ID_PE: |
| 3497 | default: |
| 3498 | break; |
| 3499 | } |
| 3500 | |
Jeff Johnson | 1250df4 | 2012-12-10 14:31:52 -0800 | [diff] [blame] | 3501 | // Get Associated stations from PE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3502 | // Find PE session Entry |
| 3503 | if ((psessionEntry = peFindSessionByBssid(pMac, getAssocSTAsReq.bssId, &sessionId)) == NULL) |
| 3504 | { |
| 3505 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3506 | FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3507 | goto limAssocStaEnd; |
| 3508 | } |
| 3509 | |
| 3510 | if (psessionEntry->limSystemRole != eLIM_AP_ROLE) |
| 3511 | { |
| 3512 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3513 | FL("Received unexpected message in state %d, in role %d"), |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3514 | psessionEntry->limSmeState, psessionEntry->limSystemRole); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3515 | goto limAssocStaEnd; |
| 3516 | } |
| 3517 | |
| 3518 | // Retrieve values obtained in the request message |
| 3519 | pSapEventCallback = (tpWLAN_SAPEventCB)getAssocSTAsReq.pSapEventCallback; |
| 3520 | pAssocStasTemp = (tpSap_AssocMacAddr)getAssocSTAsReq.pAssocStasArray; |
| 3521 | |
| 3522 | for (assocId = 0; assocId < psessionEntry->dph.dphHashTable.size; assocId++)// Softap dphHashTable.size = 8 |
| 3523 | { |
| 3524 | pStaDs = dphGetHashEntry(pMac, assocId, &psessionEntry->dph.dphHashTable); |
| 3525 | |
Abhishek Singh | 8a99b9f | 2015-03-31 14:18:26 +0530 | [diff] [blame] | 3526 | if ((NULL == pStaDs) || (NULL == pAssocStasTemp)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3527 | continue; |
| 3528 | |
| 3529 | if (pStaDs->valid) |
| 3530 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3531 | vos_mem_copy((tANI_U8 *)&pAssocStasTemp->staMac, |
| 3532 | (tANI_U8 *)&pStaDs->staAddr, |
| 3533 | sizeof(v_MACADDR_t)); // Mac address |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3534 | pAssocStasTemp->assocId = (v_U8_t)pStaDs->assocId; // Association Id |
| 3535 | pAssocStasTemp->staId = (v_U8_t)pStaDs->staIndex; // Station Id |
| 3536 | |
Kiet Lam | b123319 | 2013-11-28 13:38:20 +0530 | [diff] [blame] | 3537 | vos_mem_copy((tANI_U8 *)&pAssocStasTemp->supportedRates, |
Leo Chang | 614d207 | 2013-08-22 14:59:44 -0700 | [diff] [blame] | 3538 | (tANI_U8 *)&pStaDs->supportedRates, |
| 3539 | sizeof(tSirSupportedRates)); |
| 3540 | pAssocStasTemp->ShortGI40Mhz = pStaDs->htShortGI40Mhz; |
| 3541 | pAssocStasTemp->ShortGI20Mhz = pStaDs->htShortGI20Mhz; |
| 3542 | pAssocStasTemp->Support40Mhz = pStaDs->htDsssCckRate40MHzSupport; |
| 3543 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3544 | limLog(pMac, LOG1, FL("dph Station Number = %d"), staCount+1); |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 3545 | limLog(pMac, LOG1, FL("MAC = " MAC_ADDRESS_STR), |
| 3546 | MAC_ADDR_ARRAY(pStaDs->staAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3547 | limLog(pMac, LOG1, FL("Association Id = %d"),pStaDs->assocId); |
| 3548 | limLog(pMac, LOG1, FL("Station Index = %d"),pStaDs->staIndex); |
| 3549 | |
| 3550 | pAssocStasTemp++; |
| 3551 | staCount++; |
| 3552 | } |
| 3553 | } |
| 3554 | |
| 3555 | limAssocStaEnd: |
| 3556 | // Call hdd callback with sap event to send the list of associated stations from PE |
| 3557 | if (pSapEventCallback != NULL) |
| 3558 | { |
| 3559 | sapEvent.sapHddEventCode = eSAP_ASSOC_STA_CALLBACK_EVENT; |
| 3560 | sapEvent.sapevt.sapAssocStaListEvent.module = VOS_MODULE_ID_PE; |
| 3561 | sapEvent.sapevt.sapAssocStaListEvent.noOfAssocSta = staCount; |
| 3562 | sapEvent.sapevt.sapAssocStaListEvent.pAssocStas = (tpSap_AssocMacAddr)getAssocSTAsReq.pAssocStasArray; |
| 3563 | pSapEventCallback(&sapEvent, getAssocSTAsReq.pUsrContext); |
| 3564 | } |
| 3565 | } |
| 3566 | |
| 3567 | |
| 3568 | /** |
| 3569 | * limProcessSmeGetWPSPBCSessions |
| 3570 | * |
| 3571 | *FUNCTION: |
| 3572 | * This function is called when query the WPS PBC overlap message is received |
| 3573 | * |
| 3574 | *LOGIC: |
| 3575 | * This function parses get WPS PBC overlap information message and call callback to pass |
| 3576 | * WPS PBC overlap information back to hdd. |
| 3577 | *ASSUMPTIONS: |
| 3578 | * |
| 3579 | * |
| 3580 | *NOTE: |
| 3581 | * |
| 3582 | * @param pMac Pointer to Global MAC structure |
| 3583 | * @param pMsgBuf A pointer to WPS PBC overlap query message |
| 3584 | * |
| 3585 | * @return None |
| 3586 | */ |
| 3587 | void limProcessSmeGetWPSPBCSessions(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 3588 | { |
| 3589 | tSirSmeGetWPSPBCSessionsReq GetWPSPBCSessionsReq; |
| 3590 | tpPESession psessionEntry = NULL; |
| 3591 | tSap_Event sapEvent; |
| 3592 | tpWLAN_SAPEventCB pSapEventCallback = NULL; |
| 3593 | tANI_U8 sessionId = CSR_SESSION_ID_INVALID; |
| 3594 | tSirMacAddr zeroMac = {0,0,0,0,0,0}; |
| 3595 | |
| 3596 | sapEvent.sapevt.sapGetWPSPBCSessionEvent.status = VOS_STATUS_E_FAULT; |
| 3597 | |
| 3598 | if (limIsSmeGetWPSPBCSessionsReqValid(pMac, &GetWPSPBCSessionsReq, (tANI_U8 *) pMsgBuf) != eSIR_SUCCESS) |
| 3599 | { |
| 3600 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3601 | FL("received invalid eWNI_SME_GET_ASSOC_STAS_REQ message")); |
Girish Gowli | afd4231 | 2014-07-24 13:13:59 +0530 | [diff] [blame] | 3602 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3603 | } |
| 3604 | |
Jeff Johnson | 1250df4 | 2012-12-10 14:31:52 -0800 | [diff] [blame] | 3605 | // Get Associated stations from PE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3606 | // Find PE session Entry |
| 3607 | if ((psessionEntry = peFindSessionByBssid(pMac, GetWPSPBCSessionsReq.bssId, &sessionId)) == NULL) |
| 3608 | { |
| 3609 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3610 | FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3611 | goto limGetWPSPBCSessionsEnd; |
| 3612 | } |
| 3613 | |
| 3614 | if (psessionEntry->limSystemRole != eLIM_AP_ROLE) |
| 3615 | { |
| 3616 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3617 | FL("Received unexpected message in role %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3618 | psessionEntry->limSystemRole); |
| 3619 | goto limGetWPSPBCSessionsEnd; |
| 3620 | } |
| 3621 | |
Jeff Johnson | 1250df4 | 2012-12-10 14:31:52 -0800 | [diff] [blame] | 3622 | // Call hdd callback with sap event to send the WPS PBC overlap information |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3623 | sapEvent.sapHddEventCode = eSAP_GET_WPSPBC_SESSION_EVENT; |
| 3624 | sapEvent.sapevt.sapGetWPSPBCSessionEvent.module = VOS_MODULE_ID_PE; |
| 3625 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3626 | if (vos_mem_compare( zeroMac, GetWPSPBCSessionsReq.pRemoveMac, sizeof(tSirMacAddr))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3627 | { //This is GetWpsSession call |
| 3628 | |
| 3629 | limGetWPSPBCSessions(pMac, |
| 3630 | sapEvent.sapevt.sapGetWPSPBCSessionEvent.addr.bytes, sapEvent.sapevt.sapGetWPSPBCSessionEvent.UUID_E, |
| 3631 | &sapEvent.sapevt.sapGetWPSPBCSessionEvent.wpsPBCOverlap, psessionEntry); |
| 3632 | } |
| 3633 | else |
| 3634 | { |
| 3635 | limRemovePBCSessions(pMac, GetWPSPBCSessionsReq.pRemoveMac,psessionEntry); |
| 3636 | /* don't have to inform the HDD/Host */ |
| 3637 | return; |
| 3638 | } |
| 3639 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3640 | PELOG4(limLog(pMac, LOGE, FL("wpsPBCOverlap %d"), sapEvent.sapevt.sapGetWPSPBCSessionEvent.wpsPBCOverlap);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3641 | PELOG4(limPrintMacAddr(pMac, sapEvent.sapevt.sapGetWPSPBCSessionEvent.addr.bytes, LOG4);) |
| 3642 | |
| 3643 | sapEvent.sapevt.sapGetWPSPBCSessionEvent.status = VOS_STATUS_SUCCESS; |
| 3644 | |
| 3645 | limGetWPSPBCSessionsEnd: |
| 3646 | pSapEventCallback = (tpWLAN_SAPEventCB)GetWPSPBCSessionsReq.pSapEventCallback; |
Abhishek Singh | 8a99b9f | 2015-03-31 14:18:26 +0530 | [diff] [blame] | 3647 | |
| 3648 | if (NULL != pSapEventCallback) |
| 3649 | pSapEventCallback(&sapEvent, GetWPSPBCSessionsReq.pUsrContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3650 | } |
| 3651 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3652 | |
| 3653 | |
| 3654 | /** |
| 3655 | * __limCounterMeasures() |
| 3656 | * |
| 3657 | * FUNCTION: |
| 3658 | * This function is called to "implement" MIC counter measure |
| 3659 | * and is *temporary* only |
| 3660 | * |
| 3661 | * LOGIC: on AP, disassoc all STA associated thru TKIP, |
| 3662 | * we don't do the proper STA disassoc sequence since the |
| 3663 | * BSS will be stoped anyway |
| 3664 | * |
| 3665 | *ASSUMPTIONS: |
| 3666 | * |
| 3667 | *NOTE: |
| 3668 | * |
| 3669 | * @param pMac Pointer to Global MAC structure |
| 3670 | * @return None |
| 3671 | */ |
| 3672 | |
| 3673 | static void |
| 3674 | __limCounterMeasures(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 3675 | { |
| 3676 | tSirMacAddr mac = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
Abhishek Singh | 8944b22 | 2014-09-17 16:13:17 +0530 | [diff] [blame] | 3677 | /* If PMF is enabled then don't send broadcast disassociation */ |
| 3678 | if ( ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || |
| 3679 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) || |
| 3680 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 3681 | #ifdef WLAN_FEATURE_11W |
| 3682 | && !psessionEntry->limRmfEnabled |
| 3683 | #endif |
| 3684 | ) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3685 | limSendDisassocMgmtFrame(pMac, eSIR_MAC_MIC_FAILURE_REASON, mac, psessionEntry, FALSE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3686 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3687 | }; |
| 3688 | |
| 3689 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3690 | void |
| 3691 | limProcessTkipCounterMeasures(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 3692 | { |
| 3693 | tSirSmeTkipCntrMeasReq tkipCntrMeasReq; |
| 3694 | tpPESession psessionEntry; |
| 3695 | tANI_U8 sessionId; //PE sessionId |
| 3696 | |
| 3697 | if ( limTkipCntrMeasReqSerDes( pMac, &tkipCntrMeasReq, (tANI_U8 *) pMsgBuf ) != eSIR_SUCCESS ) |
| 3698 | { |
| 3699 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3700 | FL("received invalid eWNI_SME_TKIP_CNTR_MEAS_REQ message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3701 | return; |
| 3702 | } |
| 3703 | |
| 3704 | if ( NULL == (psessionEntry = peFindSessionByBssid( pMac, tkipCntrMeasReq.bssId, &sessionId )) ) |
| 3705 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3706 | limLog(pMac, LOGE, FL("session does not exist for given BSSID ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3707 | return; |
| 3708 | } |
| 3709 | |
| 3710 | if ( tkipCntrMeasReq.bEnable ) |
| 3711 | { |
| 3712 | __limCounterMeasures( pMac, psessionEntry ); |
| 3713 | } |
| 3714 | |
| 3715 | psessionEntry->bTkipCntrMeasActive = tkipCntrMeasReq.bEnable; |
| 3716 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3717 | |
| 3718 | |
| 3719 | static void |
| 3720 | __limHandleSmeStopBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 3721 | { |
| 3722 | tSirSmeStopBssReq stopBssReq; |
| 3723 | tSirRetStatus status; |
| 3724 | tLimSmeStates prevState; |
| 3725 | tANI_U8 sessionId; //PE sessionId |
| 3726 | tpPESession psessionEntry; |
| 3727 | tANI_U8 smesessionId; |
| 3728 | tANI_U16 smetransactionId; |
Sachin Ahuja | 51c08e6 | 2014-03-26 19:21:29 +0530 | [diff] [blame] | 3729 | tANI_U8 i = 0; |
| 3730 | tpDphHashNode pStaDs = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3731 | |
| 3732 | limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&smesessionId,&smetransactionId); |
| 3733 | |
| 3734 | |
| 3735 | |
| 3736 | if ((limStopBssReqSerDes(pMac, &stopBssReq, (tANI_U8 *) pMsgBuf) != eSIR_SUCCESS) || |
| 3737 | !limIsSmeStopBssReqValid(pMsgBuf)) |
| 3738 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3739 | PELOGW(limLog(pMac, LOGW, FL("received invalid SME_STOP_BSS_REQ message"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3740 | /// Send Stop BSS response to host |
| 3741 | limSendSmeRsp(pMac, eWNI_SME_STOP_BSS_RSP, eSIR_SME_INVALID_PARAMETERS,smesessionId,smetransactionId); |
| 3742 | return; |
| 3743 | } |
| 3744 | |
| 3745 | |
| 3746 | if((psessionEntry = peFindSessionByBssid(pMac,stopBssReq.bssId,&sessionId)) == NULL) |
| 3747 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3748 | limLog(pMac, LOGW, FL("session does not exist for given BSSID ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3749 | limSendSmeRsp(pMac, eWNI_SME_STOP_BSS_RSP, eSIR_SME_INVALID_PARAMETERS,smesessionId,smetransactionId); |
| 3750 | return; |
| 3751 | } |
| 3752 | |
| 3753 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 3754 | limDiagEventReport(pMac, WLAN_PE_DIAG_STOP_BSS_REQ_EVENT, psessionEntry, 0, 0); |
| 3755 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 3756 | |
| 3757 | |
| 3758 | if ((psessionEntry->limSmeState != eLIM_SME_NORMAL_STATE) || /* Added For BT -AMP Support */ |
| 3759 | (psessionEntry->limSystemRole == eLIM_STA_ROLE )) |
| 3760 | { |
| 3761 | /** |
| 3762 | * Should not have received STOP_BSS_REQ in states |
| 3763 | * other than 'normal' state or on STA in Infrastructure |
| 3764 | * mode. Log error and return response to host. |
| 3765 | */ |
| 3766 | limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3767 | FL("received unexpected SME_STOP_BSS_REQ in state %d, for role %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3768 | psessionEntry->limSmeState, psessionEntry->limSystemRole); |
| 3769 | limPrintSmeState(pMac, LOGE, psessionEntry->limSmeState); |
| 3770 | /// Send Stop BSS response to host |
| 3771 | limSendSmeRsp(pMac, eWNI_SME_STOP_BSS_RSP, eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,smesessionId,smetransactionId); |
| 3772 | return; |
| 3773 | } |
| 3774 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3775 | if (psessionEntry->limSystemRole == eLIM_AP_ROLE ) |
| 3776 | { |
| 3777 | limWPSPBCClose(pMac, psessionEntry); |
| 3778 | } |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3779 | PELOGW(limLog(pMac, LOGW, FL("RECEIVED STOP_BSS_REQ with reason code=%d"), stopBssReq.reasonCode);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3780 | |
| 3781 | prevState = psessionEntry->limSmeState; |
| 3782 | |
| 3783 | psessionEntry->limSmeState = eLIM_SME_IDLE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3784 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3785 | |
| 3786 | /* Update SME session Id and Transaction Id */ |
| 3787 | psessionEntry->smeSessionId = smesessionId; |
| 3788 | psessionEntry->transactionId = smetransactionId; |
| 3789 | |
Abhishek Singh | 8944b22 | 2014-09-17 16:13:17 +0530 | [diff] [blame] | 3790 | /* BTAMP_STA and STA_IN_IBSS should NOT send Disassoc frame. |
| 3791 | * If PMF is enabled then don't send broadcast disassociation */ |
| 3792 | if ( ( (eLIM_STA_IN_IBSS_ROLE != psessionEntry->limSystemRole) && |
| 3793 | (eLIM_BT_AMP_STA_ROLE != psessionEntry->limSystemRole) ) |
| 3794 | #ifdef WLAN_FEATURE_11W |
| 3795 | && !psessionEntry->limRmfEnabled |
| 3796 | #endif |
| 3797 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3798 | { |
| 3799 | tSirMacAddr bcAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
| 3800 | if ((stopBssReq.reasonCode == eSIR_SME_MIC_COUNTER_MEASURES)) |
| 3801 | // Send disassoc all stations associated thru TKIP |
| 3802 | __limCounterMeasures(pMac,psessionEntry); |
| 3803 | else |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3804 | limSendDisassocMgmtFrame(pMac, eSIR_MAC_DEAUTH_LEAVING_BSS_REASON, bcAddr, psessionEntry, FALSE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3805 | } |
| 3806 | |
| 3807 | //limDelBss is also called as part of coalescing, when we send DEL BSS followed by Add Bss msg. |
| 3808 | pMac->lim.gLimIbssCoalescingHappened = false; |
| 3809 | |
Sachin Ahuja | 51c08e6 | 2014-03-26 19:21:29 +0530 | [diff] [blame] | 3810 | for(i = 1 ; i < pMac->lim.gLimAssocStaLimit ; i++) |
| 3811 | { |
| 3812 | pStaDs = dphGetHashEntry(pMac, i, &psessionEntry->dph.dphHashTable); |
| 3813 | if (NULL == pStaDs) |
| 3814 | continue; |
| 3815 | status = limDelSta(pMac, pStaDs, false, psessionEntry) ; |
| 3816 | if(eSIR_SUCCESS == status) |
| 3817 | { |
| 3818 | limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, psessionEntry) ; |
| 3819 | limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry) ; |
| 3820 | } |
| 3821 | else |
| 3822 | { |
| 3823 | limLog(pMac, LOGE, FL("limDelSta failed with Status : %d"), status); |
| 3824 | VOS_ASSERT(0) ; |
| 3825 | } |
| 3826 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3827 | /* send a delBss to HAL and wait for a response */ |
| 3828 | status = limDelBss(pMac, NULL,psessionEntry->bssIdx,psessionEntry); |
| 3829 | |
| 3830 | if (status != eSIR_SUCCESS) |
| 3831 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3832 | PELOGE(limLog(pMac, LOGE, FL("delBss failed for bss %d"), psessionEntry->bssIdx);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3833 | psessionEntry->limSmeState= prevState; |
| 3834 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3835 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3836 | |
| 3837 | limSendSmeRsp(pMac, eWNI_SME_STOP_BSS_RSP, eSIR_SME_STOP_BSS_FAILURE,smesessionId,smetransactionId); |
| 3838 | } |
| 3839 | } |
| 3840 | |
| 3841 | |
| 3842 | /**-------------------------------------------------------------- |
| 3843 | \fn __limProcessSmeStopBssReq |
| 3844 | |
| 3845 | \brief Wrapper for the function __limHandleSmeStopBssRequest |
| 3846 | This message will be defered until softmac come out of |
| 3847 | scan mode. Message should be handled even if we have |
| 3848 | detected radar in the current operating channel. |
| 3849 | \param pMac |
| 3850 | \param pMsg |
| 3851 | |
| 3852 | \return TRUE - If we consumed the buffer |
| 3853 | FALSE - If have defered the message. |
| 3854 | ---------------------------------------------------------------*/ |
| 3855 | static tANI_BOOLEAN |
| 3856 | __limProcessSmeStopBssReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg) |
| 3857 | { |
| 3858 | if (__limIsDeferedMsgForLearn(pMac, pMsg)) |
| 3859 | { |
| 3860 | /** |
| 3861 | * If message defered, buffer is not consumed yet. |
| 3862 | * So return false |
| 3863 | */ |
| 3864 | return eANI_BOOLEAN_FALSE; |
| 3865 | } |
| 3866 | __limHandleSmeStopBssRequest(pMac, (tANI_U32 *) pMsg->bodyptr); |
| 3867 | return eANI_BOOLEAN_TRUE; |
| 3868 | } /*** end __limProcessSmeStopBssReq() ***/ |
| 3869 | |
| 3870 | |
| 3871 | void limProcessSmeDelBssRsp( |
| 3872 | tpAniSirGlobal pMac, |
| 3873 | tANI_U32 body,tpPESession psessionEntry) |
| 3874 | { |
| 3875 | |
| 3876 | (void) body; |
| 3877 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3878 | //TBD: get the sessionEntry |
Ravi Joshi | b58ca0d | 2013-10-29 09:50:23 -0700 | [diff] [blame] | 3879 | limIbssDelete(pMac,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3880 | dphHashTableClassInit(pMac, &psessionEntry->dph.dphHashTable); |
| 3881 | limDeletePreAuthList(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3882 | limSendSmeRsp(pMac, eWNI_SME_STOP_BSS_RSP, eSIR_SME_SUCCESS,psessionEntry->smeSessionId,psessionEntry->transactionId); |
| 3883 | return; |
| 3884 | } |
| 3885 | |
| 3886 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3887 | /**--------------------------------------------------------------- |
| 3888 | \fn __limProcessSmeAssocCnfNew |
| 3889 | \brief This function handles SME_ASSOC_CNF/SME_REASSOC_CNF |
| 3890 | \ in BTAMP AP. |
| 3891 | \ |
| 3892 | \param pMac |
| 3893 | \param msgType - message type |
| 3894 | \param pMsgBuf - a pointer to the SME message buffer |
| 3895 | \return None |
| 3896 | ------------------------------------------------------------------*/ |
| 3897 | |
| 3898 | void |
| 3899 | __limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsgBuf) |
| 3900 | { |
| 3901 | tSirSmeAssocCnf assocCnf; |
| 3902 | tpDphHashNode pStaDs = NULL; |
| 3903 | tpPESession psessionEntry= NULL; |
| 3904 | tANI_U8 sessionId; |
| 3905 | |
| 3906 | |
| 3907 | if(pMsgBuf == NULL) |
| 3908 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3909 | limLog(pMac, LOGE, FL("pMsgBuf is NULL ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3910 | goto end; |
| 3911 | } |
| 3912 | |
| 3913 | if ((limAssocCnfSerDes(pMac, &assocCnf, (tANI_U8 *) pMsgBuf) == eSIR_FAILURE) || |
| 3914 | !__limIsSmeAssocCnfValid(&assocCnf)) |
| 3915 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3916 | limLog(pMac, LOGE, FL("Received invalid SME_RE(ASSOC)_CNF message ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3917 | goto end; |
| 3918 | } |
| 3919 | |
| 3920 | if((psessionEntry = peFindSessionByBssid(pMac, assocCnf.bssId, &sessionId))== NULL) |
| 3921 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3922 | limLog(pMac, LOGE, FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3923 | goto end; |
| 3924 | } |
| 3925 | |
| 3926 | if ( ((psessionEntry->limSystemRole != eLIM_AP_ROLE) && (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE)) || |
| 3927 | ((psessionEntry->limSmeState != eLIM_SME_NORMAL_STATE) && (psessionEntry->limSmeState != eLIM_SME_NORMAL_CHANNEL_SCAN_STATE))) |
| 3928 | { |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3929 | limLog(pMac, LOGE, FL("Received unexpected message %X in state %d, in role %d"), |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3930 | msgType, psessionEntry->limSmeState, psessionEntry->limSystemRole); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3931 | goto end; |
| 3932 | } |
| 3933 | |
| 3934 | pStaDs = dphGetHashEntry(pMac, assocCnf.aid, &psessionEntry->dph.dphHashTable); |
| 3935 | |
| 3936 | if (pStaDs == NULL) |
| 3937 | { |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 3938 | limLog(pMac, LOGE, |
| 3939 | FL("Received invalid message %X due to no STA context, " |
| 3940 | "for aid %d, peer "), |
| 3941 | msgType, assocCnf.aid); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3942 | limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1); |
| 3943 | |
| 3944 | /* |
| 3945 | ** send a DISASSOC_IND message to WSM to make sure |
| 3946 | ** the state in WSM and LIM is the same |
| 3947 | **/ |
| 3948 | limSendSmeDisassocNtf( pMac, assocCnf.peerMacAddr, eSIR_SME_STA_NOT_ASSOCIATED, |
| 3949 | eLIM_PEER_ENTITY_DISASSOC, assocCnf.aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); |
| 3950 | goto end; |
| 3951 | } |
| 3952 | if ((pStaDs && |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 3953 | (( !vos_mem_compare( (tANI_U8 *) pStaDs->staAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3954 | (tANI_U8 *) assocCnf.peerMacAddr, |
| 3955 | sizeof(tSirMacAddr)) ) || |
| 3956 | (pStaDs->mlmStaContext.mlmState != eLIM_MLM_WT_ASSOC_CNF_STATE) || |
| 3957 | ((pStaDs->mlmStaContext.subType == LIM_ASSOC) && |
| 3958 | (msgType != eWNI_SME_ASSOC_CNF)) || |
| 3959 | ((pStaDs->mlmStaContext.subType == LIM_REASSOC) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3960 | (msgType != eWNI_SME_ASSOC_CNF))))) // since softap is passing this as ASSOC_CNF and subtype differs |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3961 | { |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 3962 | limLog(pMac, LOGE, |
| 3963 | FL("Received invalid message %X due to peerMacAddr mismatched " |
| 3964 | "or not in eLIM_MLM_WT_ASSOC_CNF_STATE state, for aid %d, peer " |
| 3965 | "StaD mlmState : %d"), |
| 3966 | msgType, assocCnf.aid, pStaDs->mlmStaContext.mlmState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3967 | limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1); |
| 3968 | goto end; |
| 3969 | } |
| 3970 | |
| 3971 | /* |
| 3972 | ** Deactivate/delet CNF_WAIT timer since ASSOC_CNF |
| 3973 | ** has been received |
| 3974 | **/ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3975 | limLog(pMac, LOG1, FL("Received SME_ASSOC_CNF. Delete Timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3976 | limDeactivateAndChangePerStaIdTimer(pMac, eLIM_CNF_WAIT_TIMER, pStaDs->assocId); |
| 3977 | |
| 3978 | if (assocCnf.statusCode == eSIR_SME_SUCCESS) |
| 3979 | { |
| 3980 | /* In BTAMP-AP, PE already finished the WDA_ADD_STA sequence |
| 3981 | * when it had received Assoc Request frame. Now, PE just needs to send |
| 3982 | * Association Response frame to the requesting BTAMP-STA. |
| 3983 | */ |
| 3984 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3985 | limLog(pMac, LOG1, FL("sending Assoc Rsp frame to STA (assoc id=%d) "), pStaDs->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3986 | limSendAssocRspMgmtFrame( pMac, eSIR_SUCCESS, pStaDs->assocId, pStaDs->staAddr, |
| 3987 | pStaDs->mlmStaContext.subType, pStaDs, psessionEntry); |
| 3988 | goto end; |
| 3989 | } // (assocCnf.statusCode == eSIR_SME_SUCCESS) |
| 3990 | else |
| 3991 | { |
| 3992 | // SME_ASSOC_CNF status is non-success, so STA is not allowed to be associated |
| 3993 | /*Since the HAL sta entry is created for denied STA we need to remove this HAL entry.So to do that set updateContext to 1*/ |
| 3994 | if(!pStaDs->mlmStaContext.updateContext) |
| 3995 | pStaDs->mlmStaContext.updateContext = 1; |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 3996 | limLog(pMac, LOG1, FL("Receive Assoc Cnf with status Code : %d(assoc id=%d) "), |
| 3997 | assocCnf.statusCode, pStaDs->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3998 | limRejectAssociation(pMac, pStaDs->staAddr, |
| 3999 | pStaDs->mlmStaContext.subType, |
| 4000 | true, pStaDs->mlmStaContext.authType, |
| 4001 | pStaDs->assocId, true, |
| 4002 | eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4003 | } |
| 4004 | |
| 4005 | end: |
| 4006 | if((psessionEntry != NULL) && (pStaDs != NULL)) |
| 4007 | { |
| 4008 | if ( psessionEntry->parsedAssocReq[pStaDs->assocId] != NULL ) |
| 4009 | { |
| 4010 | if ( ((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame) |
| 4011 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4012 | vos_mem_free(((tpSirAssocReq) |
| 4013 | (psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4014 | ((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame = NULL; |
| 4015 | } |
| 4016 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4017 | vos_mem_free(psessionEntry->parsedAssocReq[pStaDs->assocId]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4018 | psessionEntry->parsedAssocReq[pStaDs->assocId] = NULL; |
| 4019 | } |
| 4020 | } |
| 4021 | |
| 4022 | } /*** end __limProcessSmeAssocCnfNew() ***/ |
| 4023 | |
| 4024 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4025 | |
| 4026 | |
| 4027 | static void |
| 4028 | __limProcessSmeAddtsReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4029 | { |
| 4030 | tpDphHashNode pStaDs; |
| 4031 | tSirMacAddr peerMac; |
| 4032 | tpSirAddtsReq pSirAddts; |
| 4033 | tANI_U32 timeout; |
| 4034 | tpPESession psessionEntry; |
| 4035 | tANI_U8 sessionId; //PE sessionId |
| 4036 | tANI_U8 smesessionId; |
| 4037 | tANI_U16 smetransactionId; |
| 4038 | |
| 4039 | |
| 4040 | if(pMsgBuf == NULL) |
| 4041 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4042 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4043 | return; |
| 4044 | } |
| 4045 | |
| 4046 | limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&smesessionId,&smetransactionId); |
| 4047 | |
| 4048 | pSirAddts = (tpSirAddtsReq) pMsgBuf; |
| 4049 | |
| 4050 | if((psessionEntry = peFindSessionByBssid(pMac, pSirAddts->bssId,&sessionId))== NULL) |
| 4051 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4052 | limLog(pMac, LOGE, "Session Does not exist for given bssId"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4053 | return; |
| 4054 | } |
| 4055 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 4056 | limDiagEventReport(pMac, WLAN_PE_DIAG_ADDTS_REQ_EVENT, psessionEntry, 0, 0); |
| 4057 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 4058 | |
| 4059 | |
| 4060 | |
| 4061 | /* if sta |
| 4062 | * - verify assoc state |
| 4063 | * - send addts request to ap |
| 4064 | * - wait for addts response from ap |
| 4065 | * if ap, just ignore with error log |
| 4066 | */ |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 4067 | limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4068 | FL("Received SME_ADDTS_REQ (TSid %d, UP %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4069 | pSirAddts->req.tspec.tsinfo.traffic.tsid, |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 4070 | pSirAddts->req.tspec.tsinfo.traffic.userPrio); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4071 | |
| 4072 | if ((psessionEntry->limSystemRole != eLIM_STA_ROLE)&&(psessionEntry->limSystemRole != eLIM_BT_AMP_STA_ROLE)) |
| 4073 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4074 | PELOGE(limLog(pMac, LOGE, "AddTs received on AP - ignoring");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4075 | limSendSmeAddtsRsp(pMac, pSirAddts->rspReqd, eSIR_FAILURE, psessionEntry, pSirAddts->req.tspec, |
| 4076 | smesessionId,smetransactionId); |
| 4077 | return; |
| 4078 | } |
| 4079 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4080 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 4081 | |
| 4082 | if(pStaDs == NULL) |
| 4083 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4084 | PELOGE(limLog(pMac, LOGE, "Cannot find AP context for addts req");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4085 | limSendSmeAddtsRsp(pMac, pSirAddts->rspReqd, eSIR_FAILURE, psessionEntry, pSirAddts->req.tspec, |
| 4086 | smesessionId,smetransactionId); |
| 4087 | return; |
| 4088 | } |
| 4089 | |
| 4090 | if ((! pStaDs->valid) || |
| 4091 | (pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE)) |
| 4092 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4093 | PELOGE(limLog(pMac, LOGE, "AddTs received in invalid MLM state");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4094 | limSendSmeAddtsRsp(pMac, pSirAddts->rspReqd, eSIR_FAILURE, psessionEntry, pSirAddts->req.tspec, |
| 4095 | smesessionId,smetransactionId); |
| 4096 | return; |
| 4097 | } |
| 4098 | |
| 4099 | pSirAddts->req.wsmTspecPresent = 0; |
| 4100 | pSirAddts->req.wmeTspecPresent = 0; |
| 4101 | pSirAddts->req.lleTspecPresent = 0; |
| 4102 | |
| 4103 | if ((pStaDs->wsmEnabled) && |
| 4104 | (pSirAddts->req.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA)) |
| 4105 | pSirAddts->req.wsmTspecPresent = 1; |
| 4106 | else if (pStaDs->wmeEnabled) |
| 4107 | pSirAddts->req.wmeTspecPresent = 1; |
| 4108 | else if (pStaDs->lleEnabled) |
| 4109 | pSirAddts->req.lleTspecPresent = 1; |
| 4110 | else |
| 4111 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4112 | PELOGW(limLog(pMac, LOGW, FL("ADDTS_REQ ignore - qos is disabled"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4113 | limSendSmeAddtsRsp(pMac, pSirAddts->rspReqd, eSIR_FAILURE, psessionEntry, pSirAddts->req.tspec, |
| 4114 | smesessionId,smetransactionId); |
| 4115 | return; |
| 4116 | } |
| 4117 | |
| 4118 | if ((psessionEntry->limSmeState != eLIM_SME_ASSOCIATED_STATE) && |
| 4119 | (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) |
| 4120 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4121 | limLog(pMac, LOGE, "AddTs received in invalid LIMsme state (%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4122 | psessionEntry->limSmeState); |
| 4123 | limSendSmeAddtsRsp(pMac, pSirAddts->rspReqd, eSIR_FAILURE, psessionEntry, pSirAddts->req.tspec, |
| 4124 | smesessionId,smetransactionId); |
| 4125 | return; |
| 4126 | } |
| 4127 | |
| 4128 | if (pMac->lim.gLimAddtsSent) |
| 4129 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4130 | limLog(pMac, LOGE, "Addts (token %d, tsid %d, up %d) is still pending", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4131 | pMac->lim.gLimAddtsReq.req.dialogToken, |
| 4132 | pMac->lim.gLimAddtsReq.req.tspec.tsinfo.traffic.tsid, |
| 4133 | pMac->lim.gLimAddtsReq.req.tspec.tsinfo.traffic.userPrio); |
| 4134 | limSendSmeAddtsRsp(pMac, pSirAddts->rspReqd, eSIR_FAILURE, psessionEntry, pSirAddts->req.tspec, |
| 4135 | smesessionId,smetransactionId); |
| 4136 | return; |
| 4137 | } |
| 4138 | |
| 4139 | #if 0 |
| 4140 | val = sizeof(tSirMacAddr); |
| 4141 | if (wlan_cfgGetStr(pMac, WNI_CFG_BSSID, peerMac, &val) != eSIR_SUCCESS) |
| 4142 | { |
| 4143 | /// Could not get BSSID from CFG. Log error. |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4144 | limLog(pMac, LOGP, FL("could not retrieve BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4145 | return; |
| 4146 | } |
| 4147 | #endif |
| 4148 | sirCopyMacAddr(peerMac,psessionEntry->bssId); |
| 4149 | |
| 4150 | // save the addts request |
| 4151 | pMac->lim.gLimAddtsSent = true; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4152 | vos_mem_copy( (tANI_U8 *) &pMac->lim.gLimAddtsReq, (tANI_U8 *) pSirAddts, sizeof(tSirAddtsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4153 | |
| 4154 | // ship out the message now |
| 4155 | limSendAddtsReqActionFrame(pMac, peerMac, &pSirAddts->req, |
| 4156 | psessionEntry); |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 4157 | limLog(pMac, LOG1, FL("Sent ADDTS request")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4158 | |
| 4159 | // start a timer to wait for the response |
| 4160 | if (pSirAddts->timeout) |
| 4161 | timeout = pSirAddts->timeout; |
| 4162 | else if (wlan_cfgGetInt(pMac, WNI_CFG_ADDTS_RSP_TIMEOUT, &timeout) != eSIR_SUCCESS) |
| 4163 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4164 | limLog(pMac, LOGP, FL("Unable to get Cfg param %d (Addts Rsp Timeout)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4165 | WNI_CFG_ADDTS_RSP_TIMEOUT); |
| 4166 | return; |
| 4167 | } |
| 4168 | |
| 4169 | timeout = SYS_MS_TO_TICKS(timeout); |
| 4170 | if (tx_timer_change(&pMac->lim.limTimers.gLimAddtsRspTimer, timeout, 0) != TX_SUCCESS) |
| 4171 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4172 | limLog(pMac, LOGP, FL("AddtsRsp timer change failed!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4173 | return; |
| 4174 | } |
| 4175 | pMac->lim.gLimAddtsRspTimerCount++; |
| 4176 | if (tx_timer_change_context(&pMac->lim.limTimers.gLimAddtsRspTimer, |
| 4177 | pMac->lim.gLimAddtsRspTimerCount) != TX_SUCCESS) |
| 4178 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4179 | limLog(pMac, LOGP, FL("AddtsRsp timer change failed!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4180 | return; |
| 4181 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4182 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_ADDTS_RSP_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4183 | |
| 4184 | //add the sessionId to the timer object |
| 4185 | pMac->lim.limTimers.gLimAddtsRspTimer.sessionId = sessionId; |
| 4186 | if (tx_timer_activate(&pMac->lim.limTimers.gLimAddtsRspTimer) != TX_SUCCESS) |
| 4187 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4188 | limLog(pMac, LOGP, FL("AddtsRsp timer activation failed!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4189 | return; |
| 4190 | } |
| 4191 | return; |
| 4192 | } |
| 4193 | |
| 4194 | |
| 4195 | static void |
| 4196 | __limProcessSmeDeltsReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4197 | { |
| 4198 | tSirMacAddr peerMacAddr; |
| 4199 | tANI_U8 ac; |
| 4200 | tSirMacTSInfo *pTsinfo; |
| 4201 | tpSirDeltsReq pDeltsReq = (tpSirDeltsReq) pMsgBuf; |
| 4202 | tpDphHashNode pStaDs = NULL; |
| 4203 | tpPESession psessionEntry; |
| 4204 | tANI_U8 sessionId; |
| 4205 | tANI_U32 status = eSIR_SUCCESS; |
| 4206 | tANI_U8 smesessionId; |
| 4207 | tANI_U16 smetransactionId; |
| 4208 | |
| 4209 | limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&smesessionId,&smetransactionId); |
| 4210 | |
| 4211 | if((psessionEntry = peFindSessionByBssid(pMac, pDeltsReq->bssId, &sessionId))== NULL) |
| 4212 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4213 | limLog(pMac, LOGE, "Session Does not exist for given bssId"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4214 | status = eSIR_FAILURE; |
| 4215 | goto end; |
| 4216 | } |
| 4217 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 4218 | limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_REQ_EVENT, psessionEntry, 0, 0); |
| 4219 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 4220 | |
| 4221 | |
| 4222 | if (eSIR_SUCCESS != limValidateDeltsReq(pMac, pDeltsReq, peerMacAddr,psessionEntry)) |
| 4223 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4224 | PELOGE(limLog(pMac, LOGE, FL("limValidateDeltsReq failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4225 | status = eSIR_FAILURE; |
| 4226 | limSendSmeDeltsRsp(pMac, pDeltsReq, eSIR_FAILURE,psessionEntry,smesessionId,smetransactionId); |
| 4227 | return; |
| 4228 | } |
| 4229 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 4230 | limLog(pMac, LOG1, FL("Sent DELTS request to station with " |
| 4231 | "assocId = %d MacAddr = "MAC_ADDRESS_STR), |
| 4232 | pDeltsReq->aid, MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4233 | |
| 4234 | limSendDeltsReqActionFrame(pMac, peerMacAddr, pDeltsReq->req.wmeTspecPresent, &pDeltsReq->req.tsinfo, &pDeltsReq->req.tspec, |
| 4235 | psessionEntry); |
| 4236 | |
| 4237 | pTsinfo = pDeltsReq->req.wmeTspecPresent ? &pDeltsReq->req.tspec.tsinfo : &pDeltsReq->req.tsinfo; |
| 4238 | |
| 4239 | /* We've successfully send DELTS frame to AP. Update the |
| 4240 | * dynamic UAPSD mask. The AC for this TSPEC to be deleted |
| 4241 | * is no longer trigger enabled or delivery enabled |
| 4242 | */ |
| 4243 | limSetTspecUapsdMask(pMac, pTsinfo, CLEAR_UAPSD_MASK); |
| 4244 | |
| 4245 | /* We're deleting the TSPEC, so this particular AC is no longer |
| 4246 | * admitted. PE needs to downgrade the EDCA |
| 4247 | * parameters(for the AC for which TS is being deleted) to the |
| 4248 | * next best AC for which ACM is not enabled, and send the |
| 4249 | * updated values to HAL. |
| 4250 | */ |
| 4251 | ac = upToAc(pTsinfo->traffic.userPrio); |
| 4252 | |
| 4253 | if(pTsinfo->traffic.direction == SIR_MAC_DIRECTION_UPLINK) |
| 4254 | { |
| 4255 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac); |
| 4256 | } |
| 4257 | else if(pTsinfo->traffic.direction == SIR_MAC_DIRECTION_DNLINK) |
| 4258 | { |
| 4259 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac); |
| 4260 | } |
| 4261 | else if(pTsinfo->traffic.direction == SIR_MAC_DIRECTION_BIDIR) |
| 4262 | { |
| 4263 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac); |
| 4264 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac); |
| 4265 | } |
| 4266 | |
| 4267 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 4268 | |
| 4269 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 4270 | if (pStaDs != NULL) |
| 4271 | { |
| 4272 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) |
| 4273 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 4274 | else |
| 4275 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 4276 | status = eSIR_SUCCESS; |
| 4277 | } |
| 4278 | else |
| 4279 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4280 | limLog(pMac, LOGE, FL("Self entry missing in Hash Table ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4281 | status = eSIR_FAILURE; |
| 4282 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4283 | #ifdef FEATURE_WLAN_ESE |
| 4284 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4285 | limSendSmeTsmIEInd(pMac, psessionEntry, 0, 0, 0); |
| 4286 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4287 | limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4288 | #endif /* FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4289 | #endif |
| 4290 | |
| 4291 | // send an sme response back |
| 4292 | end: |
| 4293 | limSendSmeDeltsRsp(pMac, pDeltsReq, eSIR_SUCCESS,psessionEntry,smesessionId,smetransactionId); |
| 4294 | } |
| 4295 | |
| 4296 | |
| 4297 | void |
| 4298 | limProcessSmeAddtsRspTimeout(tpAniSirGlobal pMac, tANI_U32 param) |
| 4299 | { |
| 4300 | //fetch the sessionEntry based on the sessionId |
| 4301 | tpPESession psessionEntry; |
| 4302 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimAddtsRspTimer.sessionId))== NULL) |
| 4303 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4304 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4305 | return; |
| 4306 | } |
| 4307 | |
| 4308 | if ( (psessionEntry->limSystemRole != eLIM_STA_ROLE) && (psessionEntry->limSystemRole != eLIM_BT_AMP_STA_ROLE) ) |
| 4309 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4310 | limLog(pMac, LOGW, "AddtsRspTimeout in non-Sta role (%d)", psessionEntry->limSystemRole); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4311 | pMac->lim.gLimAddtsSent = false; |
| 4312 | return; |
| 4313 | } |
| 4314 | |
| 4315 | if (! pMac->lim.gLimAddtsSent) |
| 4316 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4317 | PELOGW(limLog(pMac, LOGW, "AddtsRspTimeout but no AddtsSent");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4318 | return; |
| 4319 | } |
| 4320 | |
| 4321 | if (param != pMac->lim.gLimAddtsRspTimerCount) |
| 4322 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4323 | limLog(pMac, LOGE, FL("Invalid AddtsRsp Timer count %d (exp %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4324 | param, pMac->lim.gLimAddtsRspTimerCount); |
| 4325 | return; |
| 4326 | } |
| 4327 | |
| 4328 | // this a real response timeout |
| 4329 | pMac->lim.gLimAddtsSent = false; |
| 4330 | pMac->lim.gLimAddtsRspTimerCount++; |
| 4331 | |
| 4332 | limSendSmeAddtsRsp(pMac, true, eSIR_SME_ADDTS_RSP_TIMEOUT, psessionEntry, pMac->lim.gLimAddtsReq.req.tspec, |
| 4333 | psessionEntry->smeSessionId, psessionEntry->transactionId); |
| 4334 | } |
| 4335 | |
| 4336 | |
| 4337 | /** |
| 4338 | * __limProcessSmeStatsRequest() |
| 4339 | * |
| 4340 | *FUNCTION: |
| 4341 | * |
| 4342 | * |
| 4343 | *NOTE: |
| 4344 | * |
| 4345 | * @param pMac Pointer to Global MAC structure |
| 4346 | * @param *pMsgBuf A pointer to the SME message buffer |
| 4347 | * @return None |
| 4348 | */ |
| 4349 | static void |
| 4350 | __limProcessSmeStatsRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4351 | { |
| 4352 | tpAniGetStatsReq pStatsReq; |
| 4353 | tSirMsgQ msgQ; |
| 4354 | tpPESession psessionEntry; |
| 4355 | tANI_U8 sessionId; |
| 4356 | |
| 4357 | |
| 4358 | if(pMsgBuf == NULL) |
| 4359 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4360 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4361 | return; |
| 4362 | } |
| 4363 | |
| 4364 | pStatsReq = (tpAniGetStatsReq) pMsgBuf; |
| 4365 | |
| 4366 | if((psessionEntry = peFindSessionByBssid(pMac,pStatsReq->bssId,&sessionId))== NULL) |
| 4367 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4368 | limLog(pMac, LOGE, FL("session does not exist for given bssId")); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4369 | vos_mem_free( pMsgBuf ); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4370 | pMsgBuf = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4371 | return; |
| 4372 | } |
| 4373 | |
| 4374 | |
| 4375 | |
| 4376 | switch(pStatsReq->msgType) |
| 4377 | { |
| 4378 | //Add Lim stats here. and send reqsponse. |
| 4379 | |
| 4380 | //HAL maintained Stats. |
| 4381 | case eWNI_SME_STA_STAT_REQ: |
| 4382 | msgQ.type = WDA_STA_STAT_REQ; |
| 4383 | break; |
| 4384 | case eWNI_SME_AGGR_STAT_REQ: |
| 4385 | msgQ.type = WDA_AGGR_STAT_REQ; |
| 4386 | break; |
| 4387 | case eWNI_SME_GLOBAL_STAT_REQ: |
| 4388 | msgQ.type = WDA_GLOBAL_STAT_REQ; |
| 4389 | break; |
| 4390 | case eWNI_SME_STAT_SUMM_REQ: |
| 4391 | msgQ.type = WDA_STAT_SUMM_REQ; |
| 4392 | break; |
| 4393 | default: //Unknown request. |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4394 | PELOGE(limLog(pMac, LOGE, "Unknown Statistics request");) |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4395 | vos_mem_free( pMsgBuf ); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4396 | pMsgBuf = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4397 | return; |
| 4398 | } |
| 4399 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4400 | msgQ.reserved = 0; |
| 4401 | msgQ.bodyptr = pMsgBuf; |
| 4402 | msgQ.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 4403 | if(NULL == psessionEntry) |
| 4404 | { |
| 4405 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
| 4406 | } |
| 4407 | else |
| 4408 | { |
| 4409 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
| 4410 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4411 | if( eSIR_SUCCESS != (wdaPostCtrlMsg( pMac, &msgQ ))){ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4412 | limLog(pMac, LOGP, "Unable to forward request"); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4413 | vos_mem_free( pMsgBuf ); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4414 | pMsgBuf = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4415 | return; |
| 4416 | } |
| 4417 | |
| 4418 | return; |
| 4419 | } |
| 4420 | |
| 4421 | |
| 4422 | /** |
| 4423 | * __limProcessSmeGetStatisticsRequest() |
| 4424 | * |
| 4425 | *FUNCTION: |
| 4426 | * |
| 4427 | * |
| 4428 | *NOTE: |
| 4429 | * |
| 4430 | * @param pMac Pointer to Global MAC structure |
| 4431 | * @param *pMsgBuf A pointer to the SME message buffer |
| 4432 | * @return None |
| 4433 | */ |
| 4434 | static void |
| 4435 | __limProcessSmeGetStatisticsRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4436 | { |
| 4437 | tpAniGetPEStatsReq pPEStatsReq; |
| 4438 | tSirMsgQ msgQ; |
| 4439 | |
| 4440 | pPEStatsReq = (tpAniGetPEStatsReq) pMsgBuf; |
| 4441 | |
| 4442 | //pPEStatsReq->msgType should be eWNI_SME_GET_STATISTICS_REQ |
| 4443 | |
| 4444 | msgQ.type = WDA_GET_STATISTICS_REQ; |
| 4445 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4446 | msgQ.reserved = 0; |
| 4447 | msgQ.bodyptr = pMsgBuf; |
| 4448 | msgQ.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4449 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4450 | |
| 4451 | if( eSIR_SUCCESS != (wdaPostCtrlMsg( pMac, &msgQ ))){ |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4452 | vos_mem_free( pMsgBuf ); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4453 | pMsgBuf = NULL; |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4454 | limLog(pMac, LOGP, "Unable to forward request"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4455 | return; |
| 4456 | } |
| 4457 | |
| 4458 | return; |
| 4459 | } |
| 4460 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4461 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4462 | /** |
| 4463 | *FUNCTION: __limProcessSmeGetTsmStatsRequest() |
| 4464 | * |
| 4465 | *NOTE: |
| 4466 | * |
| 4467 | * @param pMac Pointer to Global MAC structure |
| 4468 | * @param *pMsgBuf A pointer to the SME message buffer |
| 4469 | * @return None |
| 4470 | */ |
| 4471 | static void |
| 4472 | __limProcessSmeGetTsmStatsRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4473 | { |
| 4474 | tSirMsgQ msgQ; |
| 4475 | |
| 4476 | msgQ.type = WDA_TSM_STATS_REQ; |
| 4477 | msgQ.reserved = 0; |
| 4478 | msgQ.bodyptr = pMsgBuf; |
| 4479 | msgQ.bodyval = 0; |
| 4480 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
| 4481 | |
| 4482 | if( eSIR_SUCCESS != (wdaPostCtrlMsg( pMac, &msgQ ))){ |
| 4483 | vos_mem_free( pMsgBuf ); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4484 | pMsgBuf = NULL; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4485 | limLog(pMac, LOGP, "Unable to forward request"); |
| 4486 | return; |
| 4487 | } |
| 4488 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4489 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4490 | |
| 4491 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4492 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4493 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4494 | /** |
| 4495 | * __limProcessSmeGetRoamRssiRequest() |
| 4496 | * |
| 4497 | *FUNCTION: |
| 4498 | * |
| 4499 | * |
| 4500 | *NOTE: |
| 4501 | * |
| 4502 | * @param pMac Pointer to Global MAC structure |
| 4503 | * @param *pMsgBuf A pointer to the SME message buffer |
| 4504 | * @return None |
| 4505 | */ |
| 4506 | static void |
| 4507 | __limProcessSmeGetRoamRssiRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4508 | { |
| 4509 | tpAniGetRssiReq pPEGetRoamRssiReq = NULL; |
| 4510 | tSirMsgQ msgQ; |
| 4511 | |
| 4512 | pPEGetRoamRssiReq = (tpAniGetRssiReq) pMsgBuf; |
| 4513 | msgQ.type = WDA_GET_ROAM_RSSI_REQ; |
| 4514 | |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4515 | msgQ.reserved = 0; |
| 4516 | msgQ.bodyptr = pMsgBuf; |
| 4517 | msgQ.bodyval = 0; |
| 4518 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
| 4519 | |
| 4520 | if( eSIR_SUCCESS != (wdaPostCtrlMsg( pMac, &msgQ ))){ |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4521 | vos_mem_free( pMsgBuf ); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4522 | pMsgBuf = NULL; |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4523 | limLog(pMac, LOGP, "Unable to forward request"); |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4524 | return; |
| 4525 | } |
| 4526 | |
| 4527 | return; |
| 4528 | } |
| 4529 | #endif |
| 4530 | |
| 4531 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4532 | static void |
| 4533 | __limProcessSmeUpdateAPWPSIEs(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4534 | { |
| 4535 | tpSirUpdateAPWPSIEsReq pUpdateAPWPSIEsReq; |
| 4536 | tpPESession psessionEntry; |
| 4537 | tANI_U8 sessionId; //PE sessionID |
| 4538 | |
| 4539 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4540 | FL("received UPDATE_APWPSIEs_REQ message"));); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4541 | |
| 4542 | if(pMsgBuf == NULL) |
| 4543 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4544 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4545 | return; |
| 4546 | } |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4547 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4548 | pUpdateAPWPSIEsReq = vos_mem_malloc(sizeof(tSirUpdateAPWPSIEsReq)); |
| 4549 | if ( NULL == pUpdateAPWPSIEsReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4550 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4551 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for pUpdateAPWPSIEsReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4552 | return; |
| 4553 | } |
| 4554 | |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4555 | if ((limUpdateAPWPSIEsReqSerDes(pMac, pUpdateAPWPSIEsReq, (tANI_U8 *) pMsgBuf) == eSIR_FAILURE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4556 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4557 | limLog(pMac, LOGW, FL("received invalid SME_SETCONTEXT_REQ message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4558 | goto end; |
| 4559 | } |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4560 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4561 | if((psessionEntry = peFindSessionByBssid(pMac, pUpdateAPWPSIEsReq->bssId, &sessionId)) == NULL) |
| 4562 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4563 | limLog(pMac, LOGW, FL("Session does not exist for given BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4564 | goto end; |
| 4565 | } |
| 4566 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4567 | vos_mem_copy( &psessionEntry->APWPSIEs, &pUpdateAPWPSIEsReq->APWPSIEs, sizeof(tSirAPWPSIEs)); |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4568 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4569 | schSetFixedBeaconFields(pMac, psessionEntry); |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4570 | limSendBeaconInd(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4571 | |
| 4572 | end: |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4573 | vos_mem_free( pUpdateAPWPSIEsReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4574 | return; |
| 4575 | } /*** end __limProcessSmeUpdateAPWPSIEs(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) ***/ |
| 4576 | |
| 4577 | static void |
| 4578 | __limProcessSmeHideSSID(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4579 | { |
| 4580 | tpSirUpdateParams pUpdateParams; |
| 4581 | tpPESession psessionEntry; |
| 4582 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 4583 | limLog(pMac, LOG1, |
| 4584 | FL("received SME_HIDE_SSID message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4585 | |
| 4586 | if(pMsgBuf == NULL) |
| 4587 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4588 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4589 | return; |
| 4590 | } |
| 4591 | |
| 4592 | pUpdateParams = (tpSirUpdateParams)pMsgBuf; |
| 4593 | |
| 4594 | if((psessionEntry = peFindSessionBySessionId(pMac, pUpdateParams->sessionId)) == NULL) |
| 4595 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4596 | limLog(pMac, LOGW, "Session does not exist for given sessionId %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4597 | pUpdateParams->sessionId); |
| 4598 | return; |
| 4599 | } |
| 4600 | |
| 4601 | /* Update the session entry */ |
| 4602 | psessionEntry->ssidHidden = pUpdateParams->ssidHidden; |
| 4603 | |
| 4604 | /* Update beacon */ |
| 4605 | schSetFixedBeaconFields(pMac, psessionEntry); |
| 4606 | limSendBeaconInd(pMac, psessionEntry); |
| 4607 | |
| 4608 | return; |
| 4609 | } /*** end __limProcessSmeHideSSID(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) ***/ |
| 4610 | |
| 4611 | static void |
| 4612 | __limProcessSmeSetWPARSNIEs(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4613 | { |
| 4614 | tpSirUpdateAPWPARSNIEsReq pUpdateAPWPARSNIEsReq; |
| 4615 | tpPESession psessionEntry; |
| 4616 | tANI_U8 sessionId; //PE sessionID |
| 4617 | |
| 4618 | if(pMsgBuf == NULL) |
| 4619 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4620 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4621 | return; |
| 4622 | } |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4623 | |
| 4624 | pUpdateAPWPARSNIEsReq = vos_mem_malloc(sizeof(tSirUpdateAPWPSIEsReq)); |
| 4625 | if ( NULL == pUpdateAPWPARSNIEsReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4626 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4627 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for pUpdateAPWPARSNIEsReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4628 | return; |
| 4629 | } |
| 4630 | |
| 4631 | if ((limUpdateAPWPARSNIEsReqSerDes(pMac, pUpdateAPWPARSNIEsReq, (tANI_U8 *) pMsgBuf) == eSIR_FAILURE)) |
| 4632 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4633 | limLog(pMac, LOGW, FL("received invalid SME_SETCONTEXT_REQ message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4634 | goto end; |
| 4635 | } |
| 4636 | |
| 4637 | if((psessionEntry = peFindSessionByBssid(pMac, pUpdateAPWPARSNIEsReq->bssId, &sessionId)) == NULL) |
| 4638 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4639 | limLog(pMac, LOGW, FL("Session does not exist for given BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4640 | goto end; |
| 4641 | } |
| 4642 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4643 | vos_mem_copy(&psessionEntry->pLimStartBssReq->rsnIE, |
| 4644 | &pUpdateAPWPARSNIEsReq->APWPARSNIEs, sizeof(tSirRSNie)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4645 | |
| 4646 | limSetRSNieWPAiefromSmeStartBSSReqMessage(pMac, &psessionEntry->pLimStartBssReq->rsnIE, psessionEntry); |
| 4647 | |
| 4648 | psessionEntry->pLimStartBssReq->privacy = 1; |
| 4649 | psessionEntry->privacy = 1; |
| 4650 | |
| 4651 | schSetFixedBeaconFields(pMac, psessionEntry); |
| 4652 | limSendBeaconInd(pMac, psessionEntry); |
| 4653 | |
| 4654 | end: |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4655 | vos_mem_free(pUpdateAPWPARSNIEsReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4656 | return; |
| 4657 | } /*** end __limProcessSmeSetWPARSNIEs(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) ***/ |
| 4658 | |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 4659 | /* |
| 4660 | Update the beacon Interval dynamically if beaconInterval is different in MCC |
| 4661 | */ |
| 4662 | static void |
| 4663 | __limProcessSmeChangeBI(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4664 | { |
| 4665 | tpSirChangeBIParams pChangeBIParams; |
| 4666 | tpPESession psessionEntry; |
| 4667 | tANI_U8 sessionId = 0; |
| 4668 | tUpdateBeaconParams beaconParams; |
| 4669 | |
| 4670 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4671 | FL("received Update Beacon Interval message"));); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 4672 | |
| 4673 | if(pMsgBuf == NULL) |
| 4674 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4675 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 4676 | return; |
| 4677 | } |
| 4678 | |
Kaushik, Sushant | fb15673 | 2014-01-07 15:36:03 +0530 | [diff] [blame] | 4679 | vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 4680 | pChangeBIParams = (tpSirChangeBIParams)pMsgBuf; |
| 4681 | |
| 4682 | if((psessionEntry = peFindSessionByBssid(pMac, pChangeBIParams->bssId, &sessionId)) == NULL) |
| 4683 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4684 | limLog(pMac, LOGE, FL("Session does not exist for given BSSID")); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 4685 | return; |
| 4686 | } |
| 4687 | |
| 4688 | /*Update sessionEntry Beacon Interval*/ |
| 4689 | if(psessionEntry->beaconParams.beaconInterval != |
| 4690 | pChangeBIParams->beaconInterval ) |
| 4691 | { |
| 4692 | psessionEntry->beaconParams.beaconInterval = pChangeBIParams->beaconInterval; |
| 4693 | } |
| 4694 | |
| 4695 | /*Update sch beaconInterval*/ |
| 4696 | if(pMac->sch.schObject.gSchBeaconInterval != |
| 4697 | pChangeBIParams->beaconInterval ) |
| 4698 | { |
| 4699 | pMac->sch.schObject.gSchBeaconInterval = pChangeBIParams->beaconInterval; |
| 4700 | |
| 4701 | PELOG1(limLog(pMac, LOG1, |
| 4702 | FL("LIM send update BeaconInterval Indication : %d"),pChangeBIParams->beaconInterval);); |
| 4703 | |
| 4704 | /* Update beacon */ |
| 4705 | schSetFixedBeaconFields(pMac, psessionEntry); |
| 4706 | |
Sunil Ravi | b96f7b5 | 2013-05-22 21:40:05 -0700 | [diff] [blame] | 4707 | beaconParams.bssIdx = psessionEntry->bssIdx; |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 4708 | //Set change in beacon Interval |
| 4709 | beaconParams.beaconInterval = pChangeBIParams->beaconInterval; |
Jeff Johnson | 312557b | 2013-04-03 16:27:48 -0700 | [diff] [blame] | 4710 | beaconParams.paramChangeBitmap = PARAM_BCN_INTERVAL_CHANGED; |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 4711 | limSendBeaconParams(pMac, &beaconParams, psessionEntry); |
| 4712 | } |
| 4713 | |
| 4714 | return; |
| 4715 | } /*** end __limProcessSmeChangeBI(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) ***/ |
| 4716 | |
Hardik Kantilal Patel | 62a3a76 | 2014-11-21 12:55:57 +0530 | [diff] [blame] | 4717 | /** ------------------------------------------------------------- |
| 4718 | \fn |
| 4719 | \brief handles indication message from HDD to update HT mode |
| 4720 | \param tpAniSirGlobal pMac |
| 4721 | \param tANI_U32 pMsgBuf |
| 4722 | \return None |
| 4723 | -------------------------------------------------------------*/ |
| 4724 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 4725 | static void __limProcessSmeSetHT2040Mode(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4726 | { |
| 4727 | tpSirSetHT2040Mode pSetHT2040Mode; |
| 4728 | tpPESession psessionEntry; |
| 4729 | tANI_U8 sessionId = 0; |
| 4730 | tUpdateVHTOpMode *pHtOpMode = NULL; |
| 4731 | vos_msg_t msg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4732 | |
Hardik Kantilal Patel | 62a3a76 | 2014-11-21 12:55:57 +0530 | [diff] [blame] | 4733 | PELOG1(limLog(pMac, LOGRW, |
| 4734 | FL("received Set HT 20/40 mode message"));); |
| 4735 | |
| 4736 | if(pMsgBuf == NULL) |
| 4737 | { |
| 4738 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
| 4739 | return; |
| 4740 | } |
| 4741 | |
| 4742 | pSetHT2040Mode = (tpSirSetHT2040Mode)pMsgBuf; |
| 4743 | |
| 4744 | if((psessionEntry = peFindSessionByBssid(pMac, pSetHT2040Mode->bssId, |
| 4745 | &sessionId)) == NULL) |
| 4746 | { |
| 4747 | limLog(pMac, LOGE, FL("Session does not exist for given BSSID ")); |
| 4748 | limPrintMacAddr(pMac, pSetHT2040Mode->bssId, LOGE); |
| 4749 | return; |
| 4750 | } |
| 4751 | |
| 4752 | limLog(pMac, LOGW, FL("Update session entry for cbMod=%d"), |
| 4753 | pSetHT2040Mode->cbMode); |
| 4754 | |
| 4755 | /*Update sessionEntry HT related fields*/ |
| 4756 | switch(pSetHT2040Mode->cbMode) |
| 4757 | { |
| 4758 | case PHY_SINGLE_CHANNEL_CENTERED: |
| 4759 | psessionEntry->htSecondaryChannelOffset = PHY_SINGLE_CHANNEL_CENTERED; |
| 4760 | psessionEntry->htRecommendedTxWidthSet = 0; |
| 4761 | break; |
| 4762 | case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 4763 | psessionEntry->htSecondaryChannelOffset = |
| 4764 | PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 4765 | psessionEntry->htRecommendedTxWidthSet = 1; |
| 4766 | break; |
| 4767 | case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 4768 | psessionEntry->htSecondaryChannelOffset = |
| 4769 | PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 4770 | psessionEntry->htRecommendedTxWidthSet = 1; |
| 4771 | break; |
| 4772 | default: |
| 4773 | limLog(pMac, LOGE,FL("Invalid cbMode")); |
| 4774 | return; |
| 4775 | } |
| 4776 | |
| 4777 | limLog(pMac, LOGW, FL("Channel Bonding mode : %d" |
| 4778 | " htSecondaryChannelOffset: %d" |
| 4779 | " htRecommendedTxWidthSet :%d"), |
| 4780 | pSetHT2040Mode->cbMode, |
| 4781 | psessionEntry->htSecondaryChannelOffset, |
| 4782 | psessionEntry->htRecommendedTxWidthSet); |
| 4783 | |
| 4784 | limLog(pMac, LOGW, FL("Update Beacon IEs")); |
| 4785 | |
| 4786 | /* Update beacon */ |
| 4787 | schSetFixedBeaconFields(pMac, psessionEntry); |
| 4788 | limSendBeaconInd(pMac, psessionEntry); |
| 4789 | |
| 4790 | /* Update OP Mode */ |
| 4791 | pHtOpMode = vos_mem_malloc(sizeof(tUpdateVHTOpMode)); |
| 4792 | if ( NULL == pHtOpMode ) |
| 4793 | { |
| 4794 | limLog(pMac, LOGE, |
| 4795 | FL("Not able to allocate memory for setting OP mode")); |
| 4796 | return; |
| 4797 | } |
| 4798 | |
| 4799 | pHtOpMode->opMode = (psessionEntry->htSecondaryChannelOffset == |
| 4800 | PHY_SINGLE_CHANNEL_CENTERED)? |
| 4801 | eHT_CHANNEL_WIDTH_20MHZ:eHT_CHANNEL_WIDTH_40MHZ; |
| 4802 | |
| 4803 | /* Pass Self STA ID to FW. Based on Self STA ID FW will update the |
| 4804 | * operating mode for all connected STA. |
| 4805 | */ |
| 4806 | |
| 4807 | pHtOpMode->staId = psessionEntry->staId; |
| 4808 | |
| 4809 | msg.type = WDA_UPDATE_OP_MODE; |
| 4810 | msg.reserved = 0; |
| 4811 | msg.bodyptr = pHtOpMode; |
| 4812 | |
| 4813 | if (!VOS_IS_STATUS_SUCCESS( |
| 4814 | vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 4815 | { |
| 4816 | limLog(pMac, LOGE, |
| 4817 | FL("Not able to post WDA_UPDATE_OP_MODE message to WDA")); |
| 4818 | vos_mem_free(pHtOpMode); |
| 4819 | return; |
| 4820 | } |
| 4821 | |
| 4822 | limLog(pMac, LOGW, |
| 4823 | FL("Notifed FW about OP mode: %d for staId=%d"), |
| 4824 | pHtOpMode->opMode, pHtOpMode->staId); |
| 4825 | |
| 4826 | return; |
| 4827 | } |
| 4828 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4829 | |
| 4830 | /** ------------------------------------------------------------- |
| 4831 | \fn limProcessSmeDelBaPeerInd |
| 4832 | \brief handles indication message from HDD to send delete BA request |
| 4833 | \param tpAniSirGlobal pMac |
| 4834 | \param tANI_U32 pMsgBuf |
| 4835 | \return None |
| 4836 | -------------------------------------------------------------*/ |
| 4837 | void |
| 4838 | limProcessSmeDelBaPeerInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 4839 | { |
| 4840 | tANI_U16 assocId =0; |
| 4841 | tpSmeDelBAPeerInd pSmeDelBAPeerInd = (tpSmeDelBAPeerInd)pMsgBuf; |
| 4842 | tpDphHashNode pSta; |
| 4843 | tpPESession psessionEntry; |
| 4844 | tANI_U8 sessionId; |
| 4845 | |
| 4846 | |
| 4847 | |
| 4848 | if(NULL == pSmeDelBAPeerInd) |
| 4849 | return; |
| 4850 | |
| 4851 | if ((psessionEntry = peFindSessionByBssid(pMac,pSmeDelBAPeerInd->bssId,&sessionId))==NULL) |
| 4852 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4853 | limLog(pMac, LOGE,FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4854 | return; |
| 4855 | } |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4856 | limLog(pMac, LOGW, FL("called with staId = %d, tid = %d, baDirection = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4857 | pSmeDelBAPeerInd->staIdx, pSmeDelBAPeerInd->baTID, pSmeDelBAPeerInd->baDirection); |
| 4858 | |
| 4859 | pSta = dphLookupAssocId(pMac, pSmeDelBAPeerInd->staIdx, &assocId, &psessionEntry->dph.dphHashTable); |
| 4860 | if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac, |
| 4861 | pSta, |
| 4862 | pSmeDelBAPeerInd->baDirection, |
| 4863 | pSmeDelBAPeerInd->baTID, |
| 4864 | eSIR_MAC_UNSPEC_FAILURE_REASON,psessionEntry)) |
| 4865 | { |
| 4866 | limLog( pMac, LOGW, |
| 4867 | FL( "Failed to post LIM_MLM_DELBA_REQ to " )); |
| 4868 | if (pSta) |
| 4869 | limPrintMacAddr(pMac, pSta->staAddr, LOGW); |
| 4870 | } |
| 4871 | } |
| 4872 | |
| 4873 | // -------------------------------------------------------------------- |
| 4874 | /** |
| 4875 | * __limProcessReportMessage |
| 4876 | * |
| 4877 | * FUNCTION: Processes the next received Radio Resource Management message |
| 4878 | * |
| 4879 | * LOGIC: |
| 4880 | * |
| 4881 | * ASSUMPTIONS: |
| 4882 | * |
| 4883 | * NOTE: |
| 4884 | * |
| 4885 | * @param None |
| 4886 | * @return None |
| 4887 | */ |
| 4888 | |
| 4889 | void __limProcessReportMessage(tpAniSirGlobal pMac, tpSirMsgQ pMsg) |
| 4890 | { |
| 4891 | #ifdef WLAN_FEATURE_VOWIFI |
| 4892 | switch (pMsg->type) |
| 4893 | { |
| 4894 | case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: |
| 4895 | rrmProcessNeighborReportReq( pMac, pMsg->bodyptr ); |
| 4896 | break; |
| 4897 | case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND: |
| 4898 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4899 | #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4900 | tpSirBeaconReportXmitInd pBcnReport=NULL; |
| 4901 | tpPESession psessionEntry=NULL; |
| 4902 | tANI_U8 sessionId; |
| 4903 | |
| 4904 | if(pMsg->bodyptr == NULL) |
| 4905 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4906 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4907 | return; |
| 4908 | } |
| 4909 | pBcnReport = (tpSirBeaconReportXmitInd )pMsg->bodyptr; |
| 4910 | if((psessionEntry = peFindSessionByBssid(pMac, pBcnReport->bssId,&sessionId))== NULL) |
| 4911 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4912 | limLog(pMac, LOGE, "Session Does not exist for given bssId"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4913 | return; |
| 4914 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4915 | if (psessionEntry->isESEconnection) |
| 4916 | eseProcessBeaconReportXmit( pMac, pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4917 | else |
| 4918 | #endif |
| 4919 | rrmProcessBeaconReportXmit( pMac, pMsg->bodyptr ); |
| 4920 | } |
| 4921 | break; |
| 4922 | } |
| 4923 | #endif |
| 4924 | } |
| 4925 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4926 | #if defined(FEATURE_WLAN_ESE) || defined(WLAN_FEATURE_VOWIFI) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4927 | // -------------------------------------------------------------------- |
| 4928 | /** |
| 4929 | * limSendSetMaxTxPowerReq |
| 4930 | * |
| 4931 | * FUNCTION: Send SIR_HAL_SET_MAX_TX_POWER_REQ message to change the max tx power. |
| 4932 | * |
| 4933 | * LOGIC: |
| 4934 | * |
| 4935 | * ASSUMPTIONS: |
| 4936 | * |
| 4937 | * NOTE: |
| 4938 | * |
| 4939 | * @param txPower txPower to be set. |
| 4940 | * @param pSessionEntry session entry. |
| 4941 | * @return None |
| 4942 | */ |
| 4943 | tSirRetStatus |
| 4944 | limSendSetMaxTxPowerReq ( tpAniSirGlobal pMac, tPowerdBm txPower, tpPESession pSessionEntry ) |
| 4945 | { |
| 4946 | tpMaxTxPowerParams pMaxTxParams = NULL; |
| 4947 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 4948 | tSirMsgQ msgQ; |
| 4949 | |
| 4950 | if( pSessionEntry == NULL ) |
| 4951 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4952 | PELOGE(limLog(pMac, LOGE, "%s:%d: Inavalid parameters", __func__, __LINE__ );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4953 | return eSIR_FAILURE; |
| 4954 | } |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4955 | |
| 4956 | pMaxTxParams = vos_mem_malloc(sizeof(tMaxTxPowerParams)); |
| 4957 | if ( NULL == pMaxTxParams ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4958 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4959 | limLog( pMac, LOGP, "%s:%d:Unable to allocate memory for pMaxTxParams ", __func__, __LINE__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4960 | return eSIR_MEM_ALLOC_FAILED; |
| 4961 | |
| 4962 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4963 | #if defined(WLAN_VOWIFI_DEBUG) || defined(FEATURE_WLAN_ESE) |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 4964 | limLog( pMac, LOG1, |
| 4965 | FL(" Allocated memory for pMaxTxParams, which will be freed in other module")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4966 | #endif |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 4967 | if( pMaxTxParams == NULL ) |
| 4968 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 4969 | limLog( pMac, LOGE, FL("pMaxTxParams is NULL")); |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 4970 | return eSIR_FAILURE; |
| 4971 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4972 | pMaxTxParams->power = txPower; |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4973 | vos_mem_copy( pMaxTxParams->bssId, pSessionEntry->bssId, sizeof(tSirMacAddr) ); |
| 4974 | vos_mem_copy( pMaxTxParams->selfStaMacAddr, pSessionEntry->selfMacAddr, sizeof(tSirMacAddr) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4975 | |
Jeff Johnson | 68ce9c4 | 2013-04-08 10:33:28 -0700 | [diff] [blame] | 4976 | msgQ.type = WDA_SET_MAX_TX_POWER_REQ; |
| 4977 | msgQ.bodyptr = pMaxTxParams; |
| 4978 | msgQ.bodyval = 0; |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 4979 | limLog(pMac, LOG1, FL("Posting WDA_SET_MAX_TX_POWER_REQ to WDA")); |
Jeff Johnson | 68ce9c4 | 2013-04-08 10:33:28 -0700 | [diff] [blame] | 4980 | MTRACE(macTraceMsgTx(pMac, pSessionEntry->peSessionId, msgQ.type)); |
| 4981 | retCode = wdaPostCtrlMsg(pMac, &msgQ); |
| 4982 | if (eSIR_SUCCESS != retCode) |
| 4983 | { |
| 4984 | PELOGE(limLog(pMac, LOGE, FL("wdaPostCtrlMsg() failed"));) |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 4985 | vos_mem_free(pMaxTxParams); |
Jeff Johnson | 68ce9c4 | 2013-04-08 10:33:28 -0700 | [diff] [blame] | 4986 | } |
| 4987 | return retCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4988 | } |
| 4989 | #endif |
| 4990 | |
| 4991 | /** |
| 4992 | * __limProcessSmeAddStaSelfReq() |
| 4993 | * |
| 4994 | *FUNCTION: |
| 4995 | * This function is called to process SME_ADD_STA_SELF_REQ message |
| 4996 | * from SME. It sends a SIR_HAL_ADD_STA_SELF_REQ message to HAL. |
| 4997 | * |
| 4998 | *LOGIC: |
| 4999 | * |
| 5000 | *ASSUMPTIONS: |
| 5001 | * |
| 5002 | *NOTE: |
| 5003 | * |
| 5004 | * @param pMac Pointer to Global MAC structure |
| 5005 | * @param *pMsgBuf A pointer to the SME message buffer |
| 5006 | * @return None |
| 5007 | */ |
| 5008 | |
| 5009 | static void |
| 5010 | __limProcessSmeAddStaSelfReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 5011 | { |
| 5012 | tSirMsgQ msg; |
| 5013 | tpAddStaSelfParams pAddStaSelfParams; |
| 5014 | tpSirSmeAddStaSelfReq pSmeReq = (tpSirSmeAddStaSelfReq) pMsgBuf; |
| 5015 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5016 | pAddStaSelfParams = vos_mem_malloc(sizeof(tAddStaSelfParams)); |
| 5017 | if ( NULL == pAddStaSelfParams ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5018 | { |
| 5019 | limLog( pMac, LOGP, FL("Unable to allocate memory for tAddSelfStaParams") ); |
| 5020 | return; |
| 5021 | } |
| 5022 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5023 | vos_mem_copy( pAddStaSelfParams->selfMacAddr, pSmeReq->selfMacAddr, sizeof(tSirMacAddr) ); |
Kiran Kumar Lokere | ad7dbc8 | 2013-10-07 20:12:50 -0700 | [diff] [blame] | 5024 | pAddStaSelfParams->currDeviceMode = pSmeReq->currDeviceMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5025 | msg.type = SIR_HAL_ADD_STA_SELF_REQ; |
| 5026 | msg.reserved = 0; |
| 5027 | msg.bodyptr = pAddStaSelfParams; |
| 5028 | msg.bodyval = 0; |
| 5029 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5030 | PELOGW(limLog(pMac, LOG1, FL("sending SIR_HAL_ADD_STA_SELF_REQ msg to HAL"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5031 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5032 | |
| 5033 | if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) |
| 5034 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5035 | limLog(pMac, LOGP, FL("wdaPostCtrlMsg failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5036 | } |
| 5037 | return; |
| 5038 | } /*** end __limProcessAddStaSelfReq() ***/ |
| 5039 | |
| 5040 | |
| 5041 | /** |
| 5042 | * __limProcessSmeDelStaSelfReq() |
| 5043 | * |
| 5044 | *FUNCTION: |
| 5045 | * This function is called to process SME_DEL_STA_SELF_REQ message |
| 5046 | * from SME. It sends a SIR_HAL_DEL_STA_SELF_REQ message to HAL. |
| 5047 | * |
| 5048 | *LOGIC: |
| 5049 | * |
| 5050 | *ASSUMPTIONS: |
| 5051 | * |
| 5052 | *NOTE: |
| 5053 | * |
| 5054 | * @param pMac Pointer to Global MAC structure |
| 5055 | * @param *pMsgBuf A pointer to the SME message buffer |
| 5056 | * @return None |
| 5057 | */ |
| 5058 | |
| 5059 | static void |
| 5060 | __limProcessSmeDelStaSelfReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 5061 | { |
| 5062 | tSirMsgQ msg; |
| 5063 | tpDelStaSelfParams pDelStaSelfParams; |
| 5064 | tpSirSmeDelStaSelfReq pSmeReq = (tpSirSmeDelStaSelfReq) pMsgBuf; |
| 5065 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5066 | pDelStaSelfParams = vos_mem_malloc(sizeof( tDelStaSelfParams)); |
| 5067 | if ( NULL == pDelStaSelfParams ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5068 | { |
| 5069 | limLog( pMac, LOGP, FL("Unable to allocate memory for tDelStaSelfParams") ); |
| 5070 | return; |
| 5071 | } |
| 5072 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5073 | vos_mem_copy( pDelStaSelfParams->selfMacAddr, pSmeReq->selfMacAddr, sizeof(tSirMacAddr) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5074 | |
| 5075 | msg.type = SIR_HAL_DEL_STA_SELF_REQ; |
| 5076 | msg.reserved = 0; |
| 5077 | msg.bodyptr = pDelStaSelfParams; |
| 5078 | msg.bodyval = 0; |
| 5079 | |
Mukul Sharma | caf4aca | 2015-04-17 20:01:40 +0530 | [diff] [blame] | 5080 | PELOGW(limLog(pMac, LOG1, FL("sending SIR_HAL_DEL_STA_SELF_REQ msg to HAL"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5081 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5082 | |
| 5083 | if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) |
| 5084 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5085 | limLog(pMac, LOGP, FL("wdaPostCtrlMsg failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5086 | } |
| 5087 | return; |
| 5088 | } /*** end __limProcessSmeDelStaSelfReq() ***/ |
| 5089 | |
| 5090 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5091 | /** |
| 5092 | * __limProcessSmeRegisterMgmtFrameReq() |
| 5093 | * |
| 5094 | *FUNCTION: |
| 5095 | * This function is called to process eWNI_SME_REGISTER_MGMT_FRAME_REQ message |
| 5096 | * from SME. It Register this information within PE. |
| 5097 | * |
| 5098 | *LOGIC: |
| 5099 | * |
| 5100 | *ASSUMPTIONS: |
| 5101 | * |
| 5102 | *NOTE: |
| 5103 | * |
| 5104 | * @param pMac Pointer to Global MAC structure |
| 5105 | * @param *pMsgBuf A pointer to the SME message buffer |
| 5106 | * @return None |
| 5107 | */ |
| 5108 | static void |
| 5109 | __limProcessSmeRegisterMgmtFrameReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 5110 | { |
| 5111 | VOS_STATUS vosStatus; |
| 5112 | tpSirRegisterMgmtFrame pSmeReq = (tpSirRegisterMgmtFrame)pMsgBuf; |
| 5113 | tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL; |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 5114 | tANI_BOOLEAN match = VOS_FALSE; |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5115 | limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5116 | FL("registerFrame %d, frameType %d, matchLen %d"), |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5117 | pSmeReq->registerFrame, pSmeReq->frameType, pSmeReq->matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5118 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 5119 | /* First check whether entry exists already*/ |
| 5120 | |
| 5121 | vos_list_peek_front(&pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 5122 | (vos_list_node_t**)&pLimMgmtRegistration); |
| 5123 | |
| 5124 | while(pLimMgmtRegistration != NULL) |
| 5125 | { |
| 5126 | if (pLimMgmtRegistration->frameType == pSmeReq->frameType) |
| 5127 | { |
| 5128 | if(pSmeReq->matchLen) |
| 5129 | { |
| 5130 | if (pLimMgmtRegistration->matchLen == pSmeReq->matchLen) |
| 5131 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5132 | if (vos_mem_compare( pLimMgmtRegistration->matchData, |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 5133 | pSmeReq->matchData, pLimMgmtRegistration->matchLen)) |
| 5134 | { |
Madan Mohan Koyyalamudi | c537df2 | 2012-10-22 15:07:08 -0700 | [diff] [blame] | 5135 | /* found match! */ |
| 5136 | match = VOS_TRUE; |
| 5137 | break; |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 5138 | } |
| 5139 | } |
| 5140 | } |
| 5141 | else |
| 5142 | { |
Madan Mohan Koyyalamudi | c537df2 | 2012-10-22 15:07:08 -0700 | [diff] [blame] | 5143 | /* found match! */ |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 5144 | match = VOS_TRUE; |
| 5145 | break; |
| 5146 | } |
| 5147 | } |
| 5148 | vosStatus = vos_list_peek_next ( |
| 5149 | &pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 5150 | (vos_list_node_t*) pLimMgmtRegistration, |
| 5151 | (vos_list_node_t**) &pNext ); |
| 5152 | |
| 5153 | pLimMgmtRegistration = pNext; |
| 5154 | pNext = NULL; |
| 5155 | |
| 5156 | } |
| 5157 | |
| 5158 | if (match) |
| 5159 | { |
| 5160 | vos_list_remove_node(&pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 5161 | (vos_list_node_t*)pLimMgmtRegistration); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5162 | vos_mem_free(pLimMgmtRegistration); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 5163 | } |
| 5164 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5165 | if(pSmeReq->registerFrame) |
| 5166 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5167 | pLimMgmtRegistration = vos_mem_malloc(sizeof(tLimMgmtFrameRegistration) + pSmeReq->matchLen); |
| 5168 | if ( pLimMgmtRegistration != NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5169 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5170 | vos_mem_set((void*)pLimMgmtRegistration, |
| 5171 | sizeof(tLimMgmtFrameRegistration) + pSmeReq->matchLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5172 | pLimMgmtRegistration->frameType = pSmeReq->frameType; |
| 5173 | pLimMgmtRegistration->matchLen = pSmeReq->matchLen; |
| 5174 | pLimMgmtRegistration->sessionId = pSmeReq->sessionId; |
| 5175 | if(pSmeReq->matchLen) |
| 5176 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5177 | vos_mem_copy(pLimMgmtRegistration->matchData, |
| 5178 | pSmeReq->matchData, pSmeReq->matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5179 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5180 | vos_list_insert_front(&pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 5181 | &pLimMgmtRegistration->node); |
| 5182 | } |
| 5183 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5184 | |
| 5185 | return; |
| 5186 | } /*** end __limProcessSmeRegisterMgmtFrameReq() ***/ |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5187 | |
| 5188 | static tANI_BOOLEAN |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5189 | __limInsertSingleShotNOAForScan(tpAniSirGlobal pMac, tANI_U32 noaDuration) |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5190 | { |
| 5191 | tpP2pPsParams pMsgNoA; |
| 5192 | tSirMsgQ msg; |
Vinay Malekal | 6275736 | 2012-12-17 12:15:51 -0800 | [diff] [blame] | 5193 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5194 | pMsgNoA = vos_mem_malloc(sizeof( tP2pPsConfig )); |
| 5195 | if ( NULL == pMsgNoA ) |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5196 | { |
| 5197 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5198 | FL( "Unable to allocate memory during NoA Update" )); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5199 | goto error; |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5200 | } |
| 5201 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5202 | vos_mem_set((tANI_U8 *)pMsgNoA, sizeof(tP2pPsConfig), 0); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5203 | /* Below params used for opp PS/periodic NOA and are don't care in this case - so initialized to 0 */ |
| 5204 | pMsgNoA->opp_ps = 0; |
| 5205 | pMsgNoA->ctWindow = 0; |
| 5206 | pMsgNoA->duration = 0; |
| 5207 | pMsgNoA->interval = 0; |
| 5208 | pMsgNoA->count = 0; |
Vinay Malekal | 6275736 | 2012-12-17 12:15:51 -0800 | [diff] [blame] | 5209 | |
Vinay Malekal | 6275736 | 2012-12-17 12:15:51 -0800 | [diff] [blame] | 5210 | /* Below params used for Single Shot NOA - so assign proper values */ |
| 5211 | pMsgNoA->psSelection = P2P_SINGLE_NOA; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5212 | pMsgNoA->single_noa_duration = noaDuration; |
Gopichand Nakkala | 096a105 | 2012-12-21 07:05:34 -0800 | [diff] [blame] | 5213 | |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5214 | /* Start Insert NOA timer |
| 5215 | * If insert NOA req fails or NOA rsp fails or start NOA indication doesn't come from FW due to GO session deletion |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5216 | * or any other failure or reason, we still need to process the deferred SME req. The insert NOA |
| 5217 | * timer of 500 ms will ensure the stored SME req always gets processed |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5218 | */ |
| 5219 | if (tx_timer_activate(&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer) |
| 5220 | == TX_TIMER_ERROR) |
| 5221 | { |
| 5222 | /// Could not activate Insert NOA timer. |
| 5223 | // Log error |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5224 | limLog(pMac, LOGP, FL("could not activate Insert Single Shot NOA during scan timer")); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5225 | |
| 5226 | // send the scan response back with status failure and do not even call insert NOA |
| 5227 | limSendSmeScanRsp(pMac, sizeof(tSirSmeScanRsp), eSIR_SME_SCAN_FAILED, pMac->lim.gSmeSessionId, pMac->lim.gTransactionId); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5228 | vos_mem_free(pMsgNoA); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5229 | goto error; |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5230 | } |
| 5231 | |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5232 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_INSERT_SINGLESHOT_NOA_TIMER)); |
| 5233 | |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5234 | msg.type = WDA_SET_P2P_GO_NOA_REQ; |
| 5235 | msg.reserved = 0; |
| 5236 | msg.bodyptr = pMsgNoA; |
| 5237 | msg.bodyval = 0; |
| 5238 | |
| 5239 | if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) |
| 5240 | { |
| 5241 | /* In this failure case, timer is already started, so its expiration will take care of sending scan response */ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5242 | limLog(pMac, LOGP, FL("wdaPost Msg failed")); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5243 | /* Deactivate the NOA timer in failure case */ |
| 5244 | limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER); |
| 5245 | goto error; |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5246 | } |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5247 | return FALSE; |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5248 | |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5249 | error: |
| 5250 | /* In any of the failure cases, just go ahead with the processing of registered deferred SME request without |
| 5251 | * worrying about the NOA |
| 5252 | */ |
| 5253 | limProcessRegdDefdSmeReqAfterNOAStart(pMac); |
| 5254 | // msg buffer is consumed and freed in above function so return FALSE |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 5255 | return FALSE; |
| 5256 | |
| 5257 | } |
| 5258 | |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5259 | static void __limRegisterDeferredSmeReqForNOAStart(tpAniSirGlobal pMac, tANI_U16 msgType, tANI_U32 *pMsgBuf) |
| 5260 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5261 | limLog(pMac, LOG1, FL("Reg msgType %d"), msgType) ; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5262 | pMac->lim.gDeferMsgTypeForNOA = msgType; |
| 5263 | pMac->lim.gpDefdSmeMsgForNOA = pMsgBuf; |
| 5264 | } |
| 5265 | |
| 5266 | static void __limDeregisterDeferredSmeReqAfterNOAStart(tpAniSirGlobal pMac) |
| 5267 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5268 | limLog(pMac, LOG1, FL("Dereg msgType %d"), pMac->lim.gDeferMsgTypeForNOA) ; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5269 | pMac->lim.gDeferMsgTypeForNOA = 0; |
| 5270 | if (pMac->lim.gpDefdSmeMsgForNOA != NULL) |
| 5271 | { |
| 5272 | /* __limProcessSmeScanReq consumed the buffer. We can free it. */ |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 5273 | vos_mem_free(pMac->lim.gpDefdSmeMsgForNOA); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5274 | pMac->lim.gpDefdSmeMsgForNOA = NULL; |
| 5275 | } |
| 5276 | } |
| 5277 | |
| 5278 | static |
Ganesh Kondabattini | 1693007 | 2014-08-22 16:02:34 +0530 | [diff] [blame] | 5279 | tANI_U32 limCalculateNOADuration(tpAniSirGlobal pMac, tANI_U16 msgType, |
| 5280 | tANI_U32 *pMsgBuf, tANI_BOOLEAN isPassiveScan) |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5281 | { |
| 5282 | tANI_U32 noaDuration = 0; |
| 5283 | |
| 5284 | switch (msgType) |
| 5285 | { |
| 5286 | case eWNI_SME_SCAN_REQ: |
| 5287 | { |
| 5288 | tANI_U32 val; |
| 5289 | tANI_U8 i; |
| 5290 | tpSirSmeScanReq pScanReq = (tpSirSmeScanReq) pMsgBuf; |
| 5291 | if (wlan_cfgGetInt(pMac, WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME, &val) != eSIR_SUCCESS) |
| 5292 | { |
| 5293 | /* |
| 5294 | * Could not get max channel value |
| 5295 | * from CFG. Log error. |
| 5296 | */ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5297 | limLog(pMac, LOGP, FL("could not retrieve passive max channel value")); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5298 | |
| 5299 | /* use a default value of 110ms */ |
| 5300 | val = DEFAULT_PASSIVE_MAX_CHANNEL_TIME; |
| 5301 | } |
| 5302 | |
| 5303 | for (i = 0; i < pScanReq->channelList.numChannels; i++) { |
| 5304 | tANI_U8 channelNum = pScanReq->channelList.channelNumber[i]; |
| 5305 | |
Ganesh Kondabattini | 8f6e3b3 | 2014-08-25 16:07:54 +0530 | [diff] [blame] | 5306 | if (pMac->miracast_mode) { |
| 5307 | noaDuration += DEFAULT_MIN_CHAN_TIME_DURING_MIRACAST + |
| 5308 | DEFAULT_MAX_CHAN_TIME_DURING_MIRACAST; |
| 5309 | } else if (isPassiveScan || !limActiveScanAllowed(pMac, channelNum)) { |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5310 | /* using the value from WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME as is done in |
| 5311 | * void limContinuePostChannelScan(tpAniSirGlobal pMac) |
| 5312 | */ |
| 5313 | noaDuration += val; |
Ganesh Kondabattini | 1693007 | 2014-08-22 16:02:34 +0530 | [diff] [blame] | 5314 | } else { |
| 5315 | /* Use min + max channel time to calculate the total duration of scan */ |
| 5316 | noaDuration += pScanReq->minChannelTime + pScanReq->maxChannelTime; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5317 | } |
| 5318 | } |
| 5319 | |
| 5320 | /* Adding an overhead of 20ms to account for the scan messaging delays */ |
| 5321 | noaDuration += SCAN_MESSAGING_OVERHEAD; |
| 5322 | noaDuration *= CONV_MS_TO_US; |
| 5323 | |
| 5324 | break; |
| 5325 | } |
| 5326 | |
| 5327 | case eWNI_SME_OEM_DATA_REQ: |
| 5328 | noaDuration = OEM_DATA_NOA_DURATION*CONV_MS_TO_US; // use 60 msec as default |
| 5329 | break; |
| 5330 | |
| 5331 | case eWNI_SME_REMAIN_ON_CHANNEL_REQ: |
| 5332 | { |
| 5333 | tSirRemainOnChnReq *pRemainOnChnReq = (tSirRemainOnChnReq *) pMsgBuf; |
| 5334 | noaDuration = (pRemainOnChnReq->duration)*CONV_MS_TO_US; |
| 5335 | break; |
| 5336 | } |
| 5337 | |
| 5338 | case eWNI_SME_JOIN_REQ: |
| 5339 | noaDuration = JOIN_NOA_DURATION*CONV_MS_TO_US; |
| 5340 | break; |
| 5341 | |
| 5342 | default: |
| 5343 | noaDuration = 0; |
| 5344 | break; |
| 5345 | |
| 5346 | } |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5347 | limLog(pMac, LOGW, FL("msgType %d noa %d"), msgType, noaDuration); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5348 | return noaDuration; |
| 5349 | } |
| 5350 | |
| 5351 | void limProcessRegdDefdSmeReqAfterNOAStart(tpAniSirGlobal pMac) |
| 5352 | { |
Gopichand Nakkala | 7c4c3b9 | 2013-03-25 18:08:31 +0530 | [diff] [blame] | 5353 | tANI_BOOLEAN bufConsumed = TRUE; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5354 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5355 | limLog(pMac, LOG1, FL("Process defd sme req %d"), pMac->lim.gDeferMsgTypeForNOA); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5356 | if ( (pMac->lim.gDeferMsgTypeForNOA != 0) && |
| 5357 | (pMac->lim.gpDefdSmeMsgForNOA != NULL) ) |
| 5358 | { |
| 5359 | switch (pMac->lim.gDeferMsgTypeForNOA) |
| 5360 | { |
| 5361 | case eWNI_SME_SCAN_REQ: |
| 5362 | __limProcessSmeScanReq(pMac, pMac->lim.gpDefdSmeMsgForNOA); |
| 5363 | break; |
| 5364 | case eWNI_SME_OEM_DATA_REQ: |
| 5365 | __limProcessSmeOemDataReq(pMac, pMac->lim.gpDefdSmeMsgForNOA); |
| 5366 | break; |
| 5367 | case eWNI_SME_REMAIN_ON_CHANNEL_REQ: |
Gopichand Nakkala | 7c4c3b9 | 2013-03-25 18:08:31 +0530 | [diff] [blame] | 5368 | bufConsumed = limProcessRemainOnChnlReq(pMac, pMac->lim.gpDefdSmeMsgForNOA); |
| 5369 | /* limProcessRemainOnChnlReq doesnt want us to free the buffer since |
| 5370 | * it is freed in limRemainOnChnRsp. this change is to avoid "double free" |
| 5371 | */ |
| 5372 | if (FALSE == bufConsumed) |
| 5373 | { |
| 5374 | pMac->lim.gpDefdSmeMsgForNOA = NULL; |
| 5375 | } |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5376 | break; |
| 5377 | case eWNI_SME_JOIN_REQ: |
| 5378 | __limProcessSmeJoinReq(pMac, pMac->lim.gpDefdSmeMsgForNOA); |
| 5379 | break; |
| 5380 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5381 | limLog(pMac, LOGE, FL("Unknown deferred msg type %d"), pMac->lim.gDeferMsgTypeForNOA); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5382 | break; |
| 5383 | } |
| 5384 | __limDeregisterDeferredSmeReqAfterNOAStart(pMac); |
| 5385 | } |
| 5386 | else |
| 5387 | { |
| 5388 | limLog( pMac, LOGW, FL("start received from FW when no sme deferred msg pending. Do nothing." |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5389 | "It might happen sometime when NOA start ind and timeout happen at the same time")); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5390 | } |
| 5391 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5392 | |
Gopichand Nakkala | cca24d1 | 2013-03-07 17:05:07 +0530 | [diff] [blame] | 5393 | static void |
| 5394 | __limProcessSmeResetApCapsChange(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 5395 | { |
| 5396 | tpSirResetAPCapsChange pResetCapsChange; |
| 5397 | tpPESession psessionEntry; |
| 5398 | tANI_U8 sessionId = 0; |
| 5399 | if (pMsgBuf == NULL) |
| 5400 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5401 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Gopichand Nakkala | cca24d1 | 2013-03-07 17:05:07 +0530 | [diff] [blame] | 5402 | return; |
| 5403 | } |
| 5404 | |
| 5405 | pResetCapsChange = (tpSirResetAPCapsChange)pMsgBuf; |
| 5406 | psessionEntry = peFindSessionByBssid(pMac, pResetCapsChange->bssId, &sessionId); |
| 5407 | if (psessionEntry == NULL) |
| 5408 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5409 | limLog(pMac, LOGE, FL("Session does not exist for given BSSID")); |
Gopichand Nakkala | cca24d1 | 2013-03-07 17:05:07 +0530 | [diff] [blame] | 5410 | return; |
| 5411 | } |
| 5412 | |
| 5413 | psessionEntry->limSentCapsChangeNtf = false; |
| 5414 | return; |
| 5415 | } |
| 5416 | |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 5417 | static void |
| 5418 | __limProcessSmeSpoofMacAddrRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 5419 | { |
| 5420 | tSirMsgQ msg; |
| 5421 | tpSpoofMacAddrReqParams pSpoofMacAddrParams; |
| 5422 | tpSirSpoofMacAddrReq pSmeReq = (tpSirSpoofMacAddrReq) pMsgBuf; |
| 5423 | |
| 5424 | pSpoofMacAddrParams = vos_mem_malloc(sizeof( tSpoofMacAddrReqParams)); |
| 5425 | if ( NULL == pSpoofMacAddrParams ) |
| 5426 | { |
Siddharth Bhal | 4f3187c | 2014-10-09 21:38:08 +0530 | [diff] [blame] | 5427 | limLog( pMac, LOGE, FL("Unable to allocate memory for tDelStaSelfParams") ); |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 5428 | return; |
| 5429 | } |
| 5430 | |
| 5431 | vos_mem_copy( pSpoofMacAddrParams->macAddr, pSmeReq->macAddr, sizeof(tSirMacAddr) ); |
| 5432 | |
Siddharth Bhal | 4f3187c | 2014-10-09 21:38:08 +0530 | [diff] [blame] | 5433 | vos_mem_copy(pMac->lim.spoofMacAddr, pSmeReq->macAddr, VOS_MAC_ADDRESS_LEN); |
| 5434 | |
| 5435 | limLog( pMac, LOG1, FL("Recieved Spoofed Mac Addr request with Addr:" |
| 5436 | MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pMac->lim.spoofMacAddr) ); |
| 5437 | |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 5438 | msg.type = WDA_SPOOF_MAC_ADDR_REQ; |
| 5439 | msg.reserved = 0; |
| 5440 | msg.bodyptr = pSpoofMacAddrParams; |
| 5441 | msg.bodyval = 0; |
| 5442 | |
| 5443 | limLog(pMac, LOG1, FL("sending SIR_HAL_SPOOF_MAC_ADDR_REQ msg to HAL")); |
| 5444 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type)); |
| 5445 | |
| 5446 | if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg)) |
| 5447 | { |
Siddharth Bhal | 4f3187c | 2014-10-09 21:38:08 +0530 | [diff] [blame] | 5448 | limLog(pMac, LOGE, FL("wdaPostCtrlMsg failed for SIR_HAL_SPOOF_MAC_ADDR_REQ")); |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 5449 | vos_mem_free(pSpoofMacAddrParams); |
| 5450 | } |
| 5451 | return; |
| 5452 | } |
| 5453 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5454 | /** |
| 5455 | * limProcessSmeReqMessages() |
| 5456 | * |
| 5457 | *FUNCTION: |
| 5458 | * This function is called by limProcessMessageQueue(). This |
| 5459 | * function processes SME request messages from HDD or upper layer |
| 5460 | * application. |
| 5461 | * |
| 5462 | *LOGIC: |
| 5463 | * |
| 5464 | *ASSUMPTIONS: |
| 5465 | * |
| 5466 | *NOTE: |
| 5467 | * |
| 5468 | * @param pMac Pointer to Global MAC structure |
| 5469 | * @param msgType Indicates the SME message type |
| 5470 | * @param *pMsgBuf A pointer to the SME message buffer |
| 5471 | * @return Boolean - TRUE - if pMsgBuf is consumed and can be freed. |
| 5472 | * FALSE - if pMsgBuf is not to be freed. |
| 5473 | */ |
| 5474 | |
| 5475 | tANI_BOOLEAN |
| 5476 | limProcessSmeReqMessages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) |
| 5477 | { |
| 5478 | tANI_BOOLEAN bufConsumed = TRUE; //Set this flag to false within case block of any following message, that doesnt want pMsgBuf to be freed. |
| 5479 | tANI_U32 *pMsgBuf = pMsg->bodyptr; |
Sudhir Sattayappa Kohalli | abf751c | 2013-06-30 15:37:18 -0700 | [diff] [blame] | 5480 | tpSirSmeScanReq pScanReq; |
Ganesh Kondabattini | 1693007 | 2014-08-22 16:02:34 +0530 | [diff] [blame] | 5481 | tANI_BOOLEAN isPassiveScan = FALSE; |
| 5482 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5483 | PELOG1(limLog(pMac, LOG1, FL("LIM Received SME Message %s(%d) Global LimSmeState:%s(%d) Global LimMlmState: %s(%d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5484 | limMsgStr(pMsg->type), pMsg->type, |
| 5485 | limSmeStateStr(pMac->lim.gLimSmeState), pMac->lim.gLimSmeState, |
| 5486 | limMlmStateStr(pMac->lim.gLimMlmState), pMac->lim.gLimMlmState );) |
| 5487 | |
Sudhir Sattayappa Kohalli | abf751c | 2013-06-30 15:37:18 -0700 | [diff] [blame] | 5488 | pScanReq = (tpSirSmeScanReq) pMsgBuf; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5489 | /* Special handling of some SME Req msgs where we have an existing GO session and |
| 5490 | * want to insert NOA before processing those msgs. These msgs will be processed later when |
| 5491 | * start event happens |
| 5492 | */ |
| 5493 | switch (pMsg->type) |
| 5494 | { |
| 5495 | case eWNI_SME_SCAN_REQ: |
Ganesh Kondabattini | 1693007 | 2014-08-22 16:02:34 +0530 | [diff] [blame] | 5496 | pScanReq = (tpSirSmeScanReq) pMsgBuf; |
| 5497 | isPassiveScan = (pScanReq->scanType == eSIR_PASSIVE_SCAN) ? TRUE : FALSE; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5498 | case eWNI_SME_REMAIN_ON_CHANNEL_REQ: |
Sudhir Sattayappa Kohalli | abf751c | 2013-06-30 15:37:18 -0700 | [diff] [blame] | 5499 | |
| 5500 | /* If scan is disabled return from here |
| 5501 | */ |
| 5502 | if (pMac->lim.fScanDisabled) |
| 5503 | { |
Sudhir Sattayappa Kohalli | abf751c | 2013-06-30 15:37:18 -0700 | [diff] [blame] | 5504 | if (pMsg->type == eWNI_SME_SCAN_REQ) |
| 5505 | { |
| 5506 | limSendSmeScanRsp(pMac, |
| 5507 | offsetof(tSirSmeScanRsp,bssDescription[0]), |
| 5508 | eSIR_SME_INVALID_PARAMETERS, |
| 5509 | pScanReq->sessionId, |
| 5510 | pScanReq->transactionId); |
| 5511 | |
| 5512 | bufConsumed = TRUE; |
| 5513 | } |
| 5514 | else if (pMsg->type == eWNI_SME_REMAIN_ON_CHANNEL_REQ) |
| 5515 | { |
| 5516 | pMac->lim.gpDefdSmeMsgForNOA = NULL; |
| 5517 | pMac->lim.gpLimRemainOnChanReq = (tpSirRemainOnChnReq )pMsgBuf; |
| 5518 | limRemainOnChnRsp(pMac,eHAL_STATUS_FAILURE, NULL); |
| 5519 | |
| 5520 | /* |
| 5521 | * limRemainOnChnRsp will free the buffer this change is to |
| 5522 | * avoid "double free" |
| 5523 | */ |
| 5524 | bufConsumed = FALSE; |
| 5525 | } |
| 5526 | |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 5527 | limLog(pMac, LOGE, |
| 5528 | FL("Error: Scan Disabled." |
| 5529 | " Return with error status for SME Message %s(%d)"), |
| 5530 | limMsgStr(pMsg->type), pMsg->type); |
| 5531 | |
Sudhir Sattayappa Kohalli | abf751c | 2013-06-30 15:37:18 -0700 | [diff] [blame] | 5532 | return bufConsumed; |
| 5533 | } |
| 5534 | /* |
| 5535 | * Do not add BREAK here |
| 5536 | */ |
| 5537 | case eWNI_SME_OEM_DATA_REQ: |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5538 | case eWNI_SME_JOIN_REQ: |
| 5539 | /* If we have an existing P2P GO session we need to insert NOA before actually process this SME Req */ |
| 5540 | if ((limIsNOAInsertReqd(pMac) == TRUE) && IS_FEATURE_SUPPORTED_BY_FW(P2P_GO_NOA_DECOUPLE_INIT_SCAN)) |
| 5541 | { |
| 5542 | tANI_U32 noaDuration; |
| 5543 | __limRegisterDeferredSmeReqForNOAStart(pMac, pMsg->type, pMsgBuf); |
Ganesh Kondabattini | 1693007 | 2014-08-22 16:02:34 +0530 | [diff] [blame] | 5544 | noaDuration = limCalculateNOADuration(pMac, pMsg->type, pMsgBuf, isPassiveScan); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5545 | bufConsumed = __limInsertSingleShotNOAForScan(pMac, noaDuration); |
| 5546 | return bufConsumed; |
| 5547 | } |
| 5548 | } |
| 5549 | /* If no insert NOA required then execute the code below */ |
| 5550 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5551 | switch (pMsg->type) |
| 5552 | { |
| 5553 | case eWNI_SME_START_REQ: |
| 5554 | __limProcessSmeStartReq(pMac, pMsgBuf); |
| 5555 | break; |
| 5556 | |
| 5557 | case eWNI_SME_SYS_READY_IND: |
| 5558 | bufConsumed = __limProcessSmeSysReadyInd(pMac, pMsgBuf); |
| 5559 | break; |
| 5560 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5561 | case eWNI_SME_START_BSS_REQ: |
| 5562 | bufConsumed = __limProcessSmeStartBssReq(pMac, pMsg); |
| 5563 | break; |
| 5564 | |
| 5565 | case eWNI_SME_SCAN_REQ: |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 5566 | __limProcessSmeScanReq(pMac, pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5567 | break; |
| 5568 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5569 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 5570 | case eWNI_SME_OEM_DATA_REQ: |
| 5571 | __limProcessSmeOemDataReq(pMac, pMsgBuf); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5572 | break; |
| 5573 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5574 | case eWNI_SME_REMAIN_ON_CHANNEL_REQ: |
| 5575 | bufConsumed = limProcessRemainOnChnlReq(pMac, pMsgBuf); |
| 5576 | break; |
| 5577 | |
| 5578 | case eWNI_SME_UPDATE_NOA: |
| 5579 | __limProcessSmeNoAUpdate(pMac, pMsgBuf); |
| 5580 | break; |
Gopichand Nakkala | c178ac8 | 2013-05-30 19:53:39 +0530 | [diff] [blame] | 5581 | case eWNI_SME_CLEAR_DFS_CHANNEL_LIST: |
| 5582 | __limProcessClearDfsChannelList(pMac, pMsg); |
| 5583 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5584 | case eWNI_SME_JOIN_REQ: |
| 5585 | __limProcessSmeJoinReq(pMac, pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5586 | break; |
| 5587 | |
| 5588 | case eWNI_SME_AUTH_REQ: |
| 5589 | // __limProcessSmeAuthReq(pMac, pMsgBuf); |
| 5590 | |
| 5591 | break; |
| 5592 | |
| 5593 | case eWNI_SME_REASSOC_REQ: |
| 5594 | __limProcessSmeReassocReq(pMac, pMsgBuf); |
| 5595 | |
| 5596 | break; |
| 5597 | |
| 5598 | case eWNI_SME_PROMISCUOUS_MODE_REQ: |
| 5599 | //__limProcessSmePromiscuousReq(pMac, pMsgBuf); |
| 5600 | |
| 5601 | break; |
| 5602 | |
| 5603 | case eWNI_SME_DISASSOC_REQ: |
| 5604 | __limProcessSmeDisassocReq(pMac, pMsgBuf); |
| 5605 | |
| 5606 | break; |
| 5607 | |
| 5608 | case eWNI_SME_DISASSOC_CNF: |
| 5609 | case eWNI_SME_DEAUTH_CNF: |
| 5610 | __limProcessSmeDisassocCnf(pMac, pMsgBuf); |
| 5611 | |
| 5612 | break; |
| 5613 | |
| 5614 | case eWNI_SME_DEAUTH_REQ: |
| 5615 | __limProcessSmeDeauthReq(pMac, pMsgBuf); |
| 5616 | |
| 5617 | break; |
| 5618 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5619 | |
| 5620 | |
| 5621 | case eWNI_SME_SETCONTEXT_REQ: |
| 5622 | __limProcessSmeSetContextReq(pMac, pMsgBuf); |
| 5623 | |
| 5624 | break; |
| 5625 | |
| 5626 | case eWNI_SME_REMOVEKEY_REQ: |
| 5627 | __limProcessSmeRemoveKeyReq(pMac, pMsgBuf); |
| 5628 | |
| 5629 | break; |
| 5630 | |
| 5631 | case eWNI_SME_STOP_BSS_REQ: |
| 5632 | bufConsumed = __limProcessSmeStopBssReq(pMac, pMsg); |
| 5633 | break; |
| 5634 | |
| 5635 | case eWNI_SME_ASSOC_CNF: |
| 5636 | case eWNI_SME_REASSOC_CNF: |
| 5637 | if (pMsg->type == eWNI_SME_ASSOC_CNF) |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5638 | limLog(pMac, LOG1, FL("Received ASSOC_CNF message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5639 | else |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5640 | limLog(pMac, LOG1, FL("Received REASSOC_CNF message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5641 | __limProcessSmeAssocCnfNew(pMac, pMsg->type, pMsgBuf); |
| 5642 | break; |
| 5643 | |
| 5644 | case eWNI_SME_ADDTS_REQ: |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5645 | limLog(pMac, LOG1, FL("Received ADDTS_REQ message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5646 | __limProcessSmeAddtsReq(pMac, pMsgBuf); |
| 5647 | break; |
| 5648 | |
| 5649 | case eWNI_SME_DELTS_REQ: |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5650 | limLog(pMac, LOG1, FL("Received DELTS_REQ message")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5651 | __limProcessSmeDeltsReq(pMac, pMsgBuf); |
| 5652 | break; |
| 5653 | |
| 5654 | case SIR_LIM_ADDTS_RSP_TIMEOUT: |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 5655 | limLog(pMac, LOG1, FL("Received SIR_LIM_ADDTS_RSP_TIMEOUT message ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5656 | limProcessSmeAddtsRspTimeout(pMac, pMsg->bodyval); |
| 5657 | break; |
| 5658 | |
| 5659 | case eWNI_SME_STA_STAT_REQ: |
| 5660 | case eWNI_SME_AGGR_STAT_REQ: |
| 5661 | case eWNI_SME_GLOBAL_STAT_REQ: |
| 5662 | case eWNI_SME_STAT_SUMM_REQ: |
| 5663 | __limProcessSmeStatsRequest( pMac, pMsgBuf); |
| 5664 | //HAL consumes pMsgBuf. It will be freed there. Set bufConsumed to false. |
| 5665 | bufConsumed = FALSE; |
| 5666 | break; |
| 5667 | case eWNI_SME_GET_STATISTICS_REQ: |
| 5668 | __limProcessSmeGetStatisticsRequest( pMac, pMsgBuf); |
| 5669 | //HAL consumes pMsgBuf. It will be freed there. Set bufConsumed to false. |
| 5670 | bufConsumed = FALSE; |
| 5671 | break; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 5672 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 5673 | case eWNI_SME_GET_ROAM_RSSI_REQ: |
| 5674 | __limProcessSmeGetRoamRssiRequest( pMac, pMsgBuf); |
| 5675 | //HAL consumes pMsgBuf. It will be freed there. Set bufConsumed to false. |
| 5676 | bufConsumed = FALSE; |
| 5677 | break; |
| 5678 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 5679 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 5680 | case eWNI_SME_GET_TSM_STATS_REQ: |
| 5681 | __limProcessSmeGetTsmStatsRequest( pMac, pMsgBuf); |
| 5682 | bufConsumed = FALSE; |
| 5683 | break; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 5684 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5685 | case eWNI_SME_DEL_BA_PEER_IND: |
| 5686 | limProcessSmeDelBaPeerInd(pMac, pMsgBuf); |
| 5687 | break; |
| 5688 | case eWNI_SME_GET_SCANNED_CHANNEL_REQ: |
| 5689 | limProcessSmeGetScanChannelInfo(pMac, pMsgBuf); |
| 5690 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5691 | case eWNI_SME_GET_ASSOC_STAS_REQ: |
| 5692 | limProcessSmeGetAssocSTAsInfo(pMac, pMsgBuf); |
| 5693 | break; |
| 5694 | case eWNI_SME_TKIP_CNTR_MEAS_REQ: |
| 5695 | limProcessTkipCounterMeasures(pMac, pMsgBuf); |
| 5696 | break; |
| 5697 | |
| 5698 | case eWNI_SME_HIDE_SSID_REQ: |
| 5699 | __limProcessSmeHideSSID(pMac, pMsgBuf); |
| 5700 | break; |
| 5701 | case eWNI_SME_UPDATE_APWPSIE_REQ: |
| 5702 | __limProcessSmeUpdateAPWPSIEs(pMac, pMsgBuf); |
| 5703 | break; |
| 5704 | case eWNI_SME_GET_WPSPBC_SESSION_REQ: |
| 5705 | limProcessSmeGetWPSPBCSessions(pMac, pMsgBuf); |
| 5706 | break; |
| 5707 | |
| 5708 | case eWNI_SME_SET_APWPARSNIEs_REQ: |
| 5709 | __limProcessSmeSetWPARSNIEs(pMac, pMsgBuf); |
| 5710 | break; |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 5711 | |
| 5712 | case eWNI_SME_CHNG_MCC_BEACON_INTERVAL: |
| 5713 | //Update the beaconInterval |
| 5714 | __limProcessSmeChangeBI(pMac, pMsgBuf ); |
| 5715 | break; |
Hardik Kantilal Patel | 62a3a76 | 2014-11-21 12:55:57 +0530 | [diff] [blame] | 5716 | |
| 5717 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 5718 | case eWNI_SME_SET_HT_2040_MODE: |
| 5719 | __limProcessSmeSetHT2040Mode(pMac, pMsgBuf); |
| 5720 | break; |
| 5721 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5722 | |
| 5723 | #if defined WLAN_FEATURE_VOWIFI |
| 5724 | case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: |
| 5725 | case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND: |
| 5726 | __limProcessReportMessage(pMac, pMsg); |
| 5727 | break; |
| 5728 | #endif |
| 5729 | |
| 5730 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 5731 | case eWNI_SME_FT_PRE_AUTH_REQ: |
| 5732 | bufConsumed = (tANI_BOOLEAN)limProcessFTPreAuthReq(pMac, pMsg); |
| 5733 | break; |
| 5734 | case eWNI_SME_FT_UPDATE_KEY: |
| 5735 | limProcessFTUpdateKey(pMac, pMsgBuf); |
| 5736 | break; |
| 5737 | |
| 5738 | case eWNI_SME_FT_AGGR_QOS_REQ: |
| 5739 | limProcessFTAggrQosReq(pMac, pMsgBuf); |
| 5740 | break; |
| 5741 | #endif |
| 5742 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 5743 | #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) |
| 5744 | case eWNI_SME_ESE_ADJACENT_AP_REPORT: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5745 | limProcessAdjacentAPRepMsg ( pMac, pMsgBuf ); |
| 5746 | break; |
| 5747 | #endif |
| 5748 | case eWNI_SME_ADD_STA_SELF_REQ: |
| 5749 | __limProcessSmeAddStaSelfReq( pMac, pMsgBuf ); |
| 5750 | break; |
| 5751 | case eWNI_SME_DEL_STA_SELF_REQ: |
| 5752 | __limProcessSmeDelStaSelfReq( pMac, pMsgBuf ); |
| 5753 | break; |
| 5754 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5755 | case eWNI_SME_REGISTER_MGMT_FRAME_REQ: |
| 5756 | __limProcessSmeRegisterMgmtFrameReq( pMac, pMsgBuf ); |
| 5757 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 5758 | #ifdef FEATURE_WLAN_TDLS |
| 5759 | case eWNI_SME_TDLS_SEND_MGMT_REQ: |
| 5760 | limProcessSmeTdlsMgmtSendReq(pMac, pMsgBuf); |
| 5761 | break; |
| 5762 | case eWNI_SME_TDLS_ADD_STA_REQ: |
| 5763 | limProcessSmeTdlsAddStaReq(pMac, pMsgBuf); |
| 5764 | break; |
| 5765 | case eWNI_SME_TDLS_DEL_STA_REQ: |
| 5766 | limProcessSmeTdlsDelStaReq(pMac, pMsgBuf); |
| 5767 | break; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 5768 | case eWNI_SME_TDLS_LINK_ESTABLISH_REQ: |
| 5769 | limProcesSmeTdlsLinkEstablishReq(pMac, pMsgBuf); |
| 5770 | break; |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 5771 | // tdlsoffchan |
| 5772 | case eWNI_SME_TDLS_CHANNEL_SWITCH_REQ: |
| 5773 | limProcesSmeTdlsChanSwitchReq(pMac, pMsgBuf); |
| 5774 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 5775 | #endif |
Gopichand Nakkala | cca24d1 | 2013-03-07 17:05:07 +0530 | [diff] [blame] | 5776 | case eWNI_SME_RESET_AP_CAPS_CHANGED: |
| 5777 | __limProcessSmeResetApCapsChange(pMac, pMsgBuf); |
| 5778 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5779 | |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 5780 | case eWNI_SME_SET_TX_POWER_REQ: |
| 5781 | limSendSetTxPowerReq(pMac, pMsgBuf); |
| 5782 | break ; |
| 5783 | |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 5784 | case eWNI_SME_MAC_SPOOF_ADDR_IND: |
| 5785 | __limProcessSmeSpoofMacAddrRequest(pMac, pMsgBuf); |
| 5786 | break ; |
| 5787 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5788 | default: |
| 5789 | vos_mem_free((v_VOID_t*)pMsg->bodyptr); |
| 5790 | pMsg->bodyptr = NULL; |
| 5791 | break; |
| 5792 | } // switch (msgType) |
| 5793 | |
| 5794 | return bufConsumed; |
| 5795 | } /*** end limProcessSmeReqMessages() ***/ |