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