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