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