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