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