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