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