Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 22 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * This file limProcessAssocReqFrame.cc contains the code |
| 30 | * for processing Re/Association Request Frame. |
| 31 | * Author: Chandra Modumudi |
| 32 | * Date: 03/18/02 |
| 33 | * History:- |
| 34 | * Date Modified by Modification Information |
| 35 | * -------------------------------------------------------------------- |
| 36 | * 05/26/10 js WPA handling in (Re)Assoc frames |
| 37 | * |
| 38 | */ |
| 39 | #include "palTypes.h" |
| 40 | #include "aniGlobal.h" |
Jeff Johnson | 62c2798 | 2013-02-27 17:53:55 -0800 | [diff] [blame] | 41 | #include "wniCfgSta.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 42 | #include "sirApi.h" |
| 43 | #include "cfgApi.h" |
| 44 | |
| 45 | #include "schApi.h" |
| 46 | #include "pmmApi.h" |
| 47 | #include "utilsApi.h" |
| 48 | #include "limTypes.h" |
| 49 | #include "limUtils.h" |
| 50 | #include "limAssocUtils.h" |
| 51 | #include "limSecurityUtils.h" |
| 52 | #include "limSerDesUtils.h" |
| 53 | #include "limStaHashApi.h" |
| 54 | #include "limAdmitControl.h" |
| 55 | #include "palApi.h" |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 56 | #include "limSessionUtils.h" |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 57 | #ifdef WLAN_FEATURE_11W |
| 58 | #include "wniCfgAp.h" |
| 59 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 60 | |
| 61 | |
| 62 | #include "vos_types.h" |
| 63 | /** |
| 64 | * limConvertSupportedChannels |
| 65 | * |
| 66 | *FUNCTION: |
| 67 | * This function is called by limProcessAssocReqFrame() to |
| 68 | * parse the channel support IE in the Assoc/Reassoc Request |
| 69 | * frame, and send relevant information in the SME_ASSOC_IND |
| 70 | * |
| 71 | *NOTE: |
| 72 | * |
| 73 | * @param pMac - A pointer to Global MAC structure |
| 74 | * @param pMlmAssocInd - A pointer to SME ASSOC/REASSOC IND |
| 75 | * @param assocReq - A pointer to ASSOC/REASSOC Request frame |
| 76 | * |
| 77 | * @return None |
| 78 | */ |
| 79 | static void |
| 80 | limConvertSupportedChannels(tpAniSirGlobal pMac, |
| 81 | tpLimMlmAssocInd pMlmAssocInd, |
| 82 | tSirAssocReq *assocReq) |
| 83 | { |
| 84 | |
| 85 | tANI_U16 i, j, index=0; |
| 86 | tANI_U8 firstChannelNumber; |
| 87 | tANI_U8 numberOfChannel; |
| 88 | tANI_U8 nextChannelNumber; |
| 89 | |
| 90 | if(assocReq->supportedChannels.length >= SIR_MAX_SUPPORTED_CHANNEL_LIST) |
| 91 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 92 | limLog(pMac, LOG1, FL("Number of supported channels:%d is more than " |
| 93 | "MAX"), assocReq->supportedChannels.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 94 | pMlmAssocInd->supportedChannels.numChnl = 0; |
| 95 | return; |
| 96 | } |
| 97 | |
| 98 | for(i=0; i < (assocReq->supportedChannels.length); i++) |
| 99 | { |
| 100 | // Get First Channel Number |
| 101 | firstChannelNumber = assocReq->supportedChannels.supportedChannels[i]; |
| 102 | pMlmAssocInd->supportedChannels.channelList[index] = firstChannelNumber; |
| 103 | i++; |
| 104 | index++; |
| 105 | if (index >= SIR_MAX_SUPPORTED_CHANNEL_LIST) |
| 106 | { |
| 107 | pMlmAssocInd->supportedChannels.numChnl = 0; |
| 108 | return; |
| 109 | } |
| 110 | // Get Number of Channels in a Subband |
| 111 | numberOfChannel = assocReq->supportedChannels.supportedChannels[i]; |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 112 | PELOG2(limLog(pMac, LOG2, FL("Rcv AssocReq: chnl=%d, numOfChnl=%d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 113 | firstChannelNumber, numberOfChannel);) |
| 114 | |
| 115 | if (numberOfChannel > 1) |
| 116 | { |
| 117 | nextChannelNumber = firstChannelNumber; |
| 118 | if(SIR_BAND_5_GHZ == limGetRFBand(firstChannelNumber)) |
| 119 | { |
| 120 | for (j=1; j < numberOfChannel; j++) |
| 121 | { |
| 122 | nextChannelNumber += SIR_11A_FREQUENCY_OFFSET; |
| 123 | pMlmAssocInd->supportedChannels.channelList[index] = nextChannelNumber; |
| 124 | index++; |
| 125 | if (index >= SIR_MAX_SUPPORTED_CHANNEL_LIST) |
| 126 | { |
| 127 | pMlmAssocInd->supportedChannels.numChnl = 0; |
| 128 | return; |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | else if(SIR_BAND_2_4_GHZ == limGetRFBand(firstChannelNumber)) |
| 133 | { |
| 134 | for (j=1; j < numberOfChannel; j++) |
| 135 | { |
| 136 | nextChannelNumber += SIR_11B_FREQUENCY_OFFSET; |
| 137 | pMlmAssocInd->supportedChannels.channelList[index] = nextChannelNumber; |
| 138 | index++; |
| 139 | if (index >= SIR_MAX_SUPPORTED_CHANNEL_LIST) |
| 140 | { |
| 141 | pMlmAssocInd->supportedChannels.numChnl = 0; |
| 142 | return; |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | pMlmAssocInd->supportedChannels.numChnl = (tANI_U8) index; |
| 150 | PELOG2(limLog(pMac, LOG2, |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 151 | FL("Send AssocInd to WSM: spectrum ON, minPwr %d, maxPwr %d, " |
| 152 | "numChnl %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 153 | pMlmAssocInd->powerCap.minTxPower, |
| 154 | pMlmAssocInd->powerCap.maxTxPower, |
| 155 | pMlmAssocInd->supportedChannels.numChnl);) |
| 156 | } |
| 157 | |
| 158 | |
| 159 | /**--------------------------------------------------------------- |
| 160 | \fn limProcessAssocReqFrame |
| 161 | \brief This function is called by limProcessMessageQueue() |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 162 | \ upon Re/Association Request frame reception in |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 163 | \ BTAMP AP or Soft AP role. |
| 164 | \ |
| 165 | \param pMac |
| 166 | \param *pRxPacketInfo - A pointer to Buffer descriptor + associated PDUs |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 167 | \param subType - Indicates whether it is Association Request(=0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 168 | \ or Reassociation Request(=1) frame |
| 169 | \return None |
| 170 | ------------------------------------------------------------------*/ |
| 171 | void |
| 172 | limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, |
| 173 | tANI_U8 subType, tpPESession psessionEntry) |
| 174 | { |
| 175 | tANI_U8 updateContext; |
| 176 | tANI_U8 *pBody; |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 177 | tANI_U16 peerIdx, temp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 178 | tANI_U32 val; |
| 179 | tANI_S32 framelen; |
| 180 | tSirRetStatus status; |
| 181 | tpSirMacMgmtHdr pHdr; |
| 182 | struct tLimPreAuthNode *pStaPreAuthContext; |
| 183 | tAniAuthType authType; |
| 184 | tSirMacCapabilityInfo localCapabilities; |
| 185 | tpDphHashNode pStaDs = NULL; |
| 186 | tpSirAssocReq pAssocReq; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 187 | tLimMlmStates mlmPrevState; |
| 188 | tDot11fIERSN Dot11fIERSN; |
| 189 | tDot11fIEWPA Dot11fIEWPA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 190 | tANI_U32 phyMode; |
| 191 | tHalBitVal qosMode; |
| 192 | tHalBitVal wsmMode, wmeMode; |
| 193 | tANI_U8 *wpsIe = NULL; |
| 194 | tSirMacRateSet basicRates; |
| 195 | tANI_U8 i = 0, j = 0; |
Chet Lanctot | 055d2a3 | 2013-08-31 17:29:03 -0700 | [diff] [blame] | 196 | tANI_BOOLEAN pmfConnection = eANI_BOOLEAN_FALSE; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 197 | #ifdef WLAN_FEATURE_11W |
| 198 | tPmfSaQueryTimerId timerId; |
| 199 | tANI_U32 retryInterval; |
| 200 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 201 | |
| 202 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 203 | |
| 204 | limGetQosMode(psessionEntry, &qosMode); |
| 205 | |
| 206 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 207 | framelen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 208 | |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 209 | limLog(pMac, LOG1, FL("Received %s Req Frame on sessionid: %d systemrole %d" |
| 210 | " limMlmState %d from: "MAC_ADDRESS_STR), |
| 211 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 212 | psessionEntry->peSessionId, psessionEntry->limSystemRole, |
| 213 | psessionEntry->limMlmState, MAC_ADDR_ARRAY(pHdr->sa)); |
| 214 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 215 | if (psessionEntry->limSystemRole == eLIM_STA_ROLE || psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE ) |
| 216 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 217 | limLog(pMac, LOGE, FL("received unexpected ASSOC REQ on sessionid: %d " |
| 218 | "sys subType=%d for role=%d from: "MAC_ADDRESS_STR), |
| 219 | psessionEntry->peSessionId, |
| 220 | subType, psessionEntry->limSystemRole, MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 221 | sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG3, |
| 222 | WDA_GET_RX_MPDU_DATA(pRxPacketInfo), framelen); |
| 223 | return; |
| 224 | } |
| 225 | |
| 226 | // Get pointer to Re/Association Request frame body |
| 227 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 228 | |
| 229 | if (limIsGroupAddr(pHdr->sa)) |
| 230 | { |
| 231 | // Received Re/Assoc Req frame from a BC/MC address |
| 232 | // Log error and ignore it |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 233 | limLog(pMac, LOGE, FL("Received %s Req on sessionid: %d frame from a " |
| 234 | "BC/MC address"MAC_ADDRESS_STR), |
| 235 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 236 | psessionEntry->peSessionId, |
| 237 | MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 238 | return; |
| 239 | } |
Mohit Khanna | 2386376 | 2012-09-11 17:40:09 -0700 | [diff] [blame] | 240 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 241 | sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, (tANI_U8 *) pBody, framelen); |
| 242 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 243 | if (vos_mem_compare((tANI_U8* ) pHdr->sa, (tANI_U8 *) pHdr->da, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 244 | (tANI_U8) (sizeof(tSirMacAddr)))) |
| 245 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 246 | limLog(pMac, LOGE, FL("Rejected Assoc Req frame Since same mac as" |
| 247 | " SAP/GO")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 248 | limSendAssocRspMgmtFrame(pMac, |
| 249 | eSIR_MAC_UNSPEC_FAILURE_STATUS, |
| 250 | 1, |
| 251 | pHdr->sa, |
| 252 | subType, 0,psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 253 | return ; |
| 254 | } |
| 255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | // If TKIP counter measures active send Assoc Rsp frame to station with eSIR_MAC_MIC_FAILURE_REASON |
| 257 | if ((psessionEntry->bTkipCntrMeasActive) && (psessionEntry->limSystemRole == eLIM_AP_ROLE)) |
| 258 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 259 | limLog(pMac, LOGE, FL("TKIP counter measure is active")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 260 | limSendAssocRspMgmtFrame(pMac, |
| 261 | eSIR_MAC_MIC_FAILURE_REASON, |
| 262 | 1, |
| 263 | pHdr->sa, |
| 264 | subType, 0, psessionEntry); |
| 265 | return; |
| 266 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 267 | |
| 268 | // Allocate memory for the Assoc Request frame |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 269 | pAssocReq = vos_mem_malloc(sizeof(*pAssocReq)); |
| 270 | if (NULL == pAssocReq) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 271 | { |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 272 | limLog(pMac, LOGP, FL("Allocate Memory failed in AssocReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 273 | return; |
| 274 | } |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 275 | vos_mem_set((void *)pAssocReq , sizeof(*pAssocReq), 0); |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 276 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | // Parse Assoc Request frame |
| 278 | if (subType == LIM_ASSOC) |
| 279 | status = sirConvertAssocReqFrame2Struct(pMac, pBody, framelen, pAssocReq); |
| 280 | else |
| 281 | status = sirConvertReassocReqFrame2Struct(pMac, pBody, framelen, pAssocReq); |
| 282 | |
| 283 | if (status != eSIR_SUCCESS) |
| 284 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 285 | limLog(pMac, LOGW, FL("Parse error AssocRequest, length=%d from "MAC_ADDRESS_STR), |
| 286 | framelen, MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 287 | limSendAssocRspMgmtFrame(pMac, eSIR_MAC_UNSPEC_FAILURE_STATUS, 1, pHdr->sa, subType, 0, psessionEntry); |
| 288 | goto error; |
| 289 | } |
| 290 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 291 | pAssocReq->assocReqFrame = vos_mem_malloc(framelen); |
| 292 | if ( NULL == pAssocReq->assocReqFrame ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 293 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 294 | limLog(pMac, LOGE, FL("Unable to allocate memory for the assoc req, " |
| 295 | "length=%d from "),framelen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 296 | goto error; |
| 297 | } |
| 298 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 299 | vos_mem_copy((tANI_U8 *) pAssocReq->assocReqFrame, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 300 | (tANI_U8 *) pBody, framelen); |
| 301 | pAssocReq->assocReqFrameLength = framelen; |
| 302 | |
| 303 | if (cfgGetCapabilityInfo(pMac, &temp,psessionEntry) != eSIR_SUCCESS) |
| 304 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 305 | limLog(pMac, LOGP, FL("could not retrieve Capabilities")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 306 | goto error; |
| 307 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 308 | limCopyU16((tANI_U8 *) &localCapabilities, temp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 309 | |
| 310 | if (limCompareCapabilities(pMac, |
| 311 | pAssocReq, |
| 312 | &localCapabilities,psessionEntry) == false) |
| 313 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 314 | limLog(pMac, LOGW, FL("local caps mismatch received caps")); |
| 315 | limLog(pMac, LOGW, FL("Received %s Req with unsupported " |
| 316 | "capabilities from"MAC_ADDRESS_STR), |
| 317 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 318 | MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 319 | /** |
| 320 | * Capabilities of requesting STA does not match with |
| 321 | * local capabilities. Respond with 'unsupported capabilities' |
| 322 | * status code. |
| 323 | */ |
| 324 | limSendAssocRspMgmtFrame( |
| 325 | pMac, |
| 326 | eSIR_MAC_CAPABILITIES_NOT_SUPPORTED_STATUS, |
| 327 | 1, |
| 328 | pHdr->sa, |
| 329 | subType, 0,psessionEntry); |
| 330 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 331 | goto error; |
| 332 | } |
| 333 | |
| 334 | updateContext = false; |
| 335 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 336 | if (limCmpSSid(pMac, &pAssocReq->ssId, psessionEntry) == false) |
| 337 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 338 | limLog(pMac, LOGW, FL("Received %s Req with unmatched ssid ( Received" |
| 339 | " SSID: %.*s current SSID: %.*s ) from "MAC_ADDRESS_STR), |
| 340 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", pAssocReq->ssId.length, |
| 341 | pAssocReq->ssId.ssId, psessionEntry->ssId.length, |
| 342 | psessionEntry->ssId.ssId, MAC_ADDR_ARRAY(pHdr->sa)); |
| 343 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 344 | /** |
| 345 | * Received Re/Association Request with either |
| 346 | * Broadcast SSID OR with SSID that does not |
| 347 | * match with local one. |
| 348 | * Respond with unspecified status code. |
| 349 | */ |
| 350 | limSendAssocRspMgmtFrame(pMac, |
| 351 | eSIR_MAC_UNSPEC_FAILURE_STATUS, |
| 352 | 1, |
| 353 | pHdr->sa, |
| 354 | subType, 0,psessionEntry); |
| 355 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 356 | goto error; |
| 357 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 358 | |
| 359 | /*************************************************************** |
| 360 | ** Verify if the requested rates are available in supported rate |
| 361 | ** set or Extended rate set. Some APs are adding basic rates in |
| 362 | ** Extended rateset IE |
| 363 | ***************************************************************/ |
| 364 | basicRates.numRates = 0; |
| 365 | |
Gopichand Nakkala | 94273ab | 2013-03-25 14:47:39 +0530 | [diff] [blame] | 366 | for(i = 0; i < pAssocReq->supportedRates.numRates && (i < SIR_MAC_RATESET_EID_MAX); i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 367 | { |
| 368 | basicRates.rate[i] = pAssocReq->supportedRates.rate[i]; |
| 369 | basicRates.numRates++; |
| 370 | } |
| 371 | |
| 372 | for(j = 0; (j < pAssocReq->extendedRates.numRates) && (i < SIR_MAC_RATESET_EID_MAX); i++,j++) |
| 373 | { |
| 374 | basicRates.rate[i] = pAssocReq->extendedRates.rate[j]; |
| 375 | basicRates.numRates++; |
| 376 | } |
| 377 | if (limCheckRxBasicRates(pMac, basicRates, psessionEntry) == false) |
| 378 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 379 | limLog(pMac, LOGW, FL("Received %s Req with unsupported " |
| 380 | "rates from"MAC_ADDRESS_STR), |
| 381 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 382 | MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 383 | /** |
| 384 | * Requesting STA does not support ALL BSS basic |
| 385 | * rates. Respond with 'basic rates not supported' |
| 386 | * status code. |
| 387 | */ |
| 388 | limSendAssocRspMgmtFrame( |
| 389 | pMac, |
| 390 | eSIR_MAC_BASIC_RATES_NOT_SUPPORTED_STATUS, |
| 391 | 1, |
| 392 | pHdr->sa, |
| 393 | subType, 0,psessionEntry); |
| 394 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 395 | goto error; |
| 396 | } |
| 397 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 398 | |
| 399 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 400 | (psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11G_ONLY) && |
| 401 | ((!pAssocReq->extendedRatesPresent ) || (pAssocReq->HTCaps.present))) |
| 402 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 403 | limLog(pMac, LOGE, FL("SOFTAP was in 11G only mode, rejecting legacy " |
| 404 | "STA : "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 405 | limSendAssocRspMgmtFrame( pMac, eSIR_MAC_CAPABILITIES_NOT_SUPPORTED_STATUS, |
| 406 | 1, pHdr->sa, subType, 0, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 407 | goto error; |
| 408 | |
| 409 | }//end if phyMode == 11G_only |
| 410 | |
| 411 | if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && |
| 412 | (psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11N_ONLY) && |
| 413 | (!pAssocReq->HTCaps.present)) |
| 414 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 415 | limLog(pMac, LOGE, FL("SOFTAP was in 11N only mode, rejecting legacy " |
| 416 | "STA : "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 417 | limSendAssocRspMgmtFrame( pMac, eSIR_MAC_CAPABILITIES_NOT_SUPPORTED_STATUS, |
| 418 | 1, pHdr->sa, subType, 0, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 419 | goto error; |
| 420 | }//end if PhyMode == 11N_only |
| 421 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 422 | |
| 423 | /* Spectrum Management (11h) specific checks */ |
| 424 | if (localCapabilities.spectrumMgt) |
| 425 | { |
| 426 | tSirRetStatus status = eSIR_SUCCESS; |
| 427 | |
| 428 | /* If station is 11h capable, then it SHOULD send all mandatory |
| 429 | * IEs in assoc request frame. Let us verify that |
| 430 | */ |
| 431 | if (pAssocReq->capabilityInfo.spectrumMgt) |
| 432 | { |
| 433 | if (!((pAssocReq->powerCapabilityPresent) && (pAssocReq->supportedChannelsPresent))) |
| 434 | { |
| 435 | /* One or more required information elements are missing, log the peers error */ |
| 436 | if (!pAssocReq->powerCapabilityPresent) |
| 437 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 438 | limLog(pMac, LOG1, FL("LIM Info: Missing Power capability " |
| 439 | "IE in %s Req from "MAC_ADDRESS_STR), |
| 440 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 441 | MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 442 | } |
| 443 | if (!pAssocReq->supportedChannelsPresent) |
| 444 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 445 | limLog(pMac, LOGW, FL("LIM Info: Missing Supported channel " |
| 446 | "IE in %s Req from "MAC_ADDRESS_STR), |
| 447 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 448 | MAC_ADDR_ARRAY(pHdr->sa)); |
| 449 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 450 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 451 | } |
| 452 | else |
| 453 | { |
| 454 | /* Assoc request has mandatory fields */ |
| 455 | status = limIsDot11hPowerCapabilitiesInRange(pMac, pAssocReq, psessionEntry); |
| 456 | if (eSIR_SUCCESS != status) |
| 457 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 458 | limLog(pMac, LOGW, FL("LIM Info: MinTxPower(STA) > " |
| 459 | "MaxTxPower(AP) in %s Req from "MAC_ADDRESS_STR), |
| 460 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 461 | MAC_ADDR_ARRAY(pHdr->sa)); |
| 462 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 463 | } |
| 464 | status = limIsDot11hSupportedChannelsValid(pMac, pAssocReq); |
| 465 | if (eSIR_SUCCESS != status) |
| 466 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 467 | limLog(pMac, LOGW, FL("LIM Info: wrong supported " |
| 468 | "channels (STA) in %s Req from "MAC_ADDRESS_STR), |
| 469 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 470 | MAC_ADDR_ARRAY(pHdr->sa)); |
| 471 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 472 | } |
| 473 | /* IEs are valid, use them if needed */ |
| 474 | } |
| 475 | } //if(assoc.capabilityInfo.spectrumMgt) |
| 476 | else |
| 477 | { |
| 478 | /* As per the capabiities, the spectrum management is not enabled on the station |
| 479 | * The AP may allow the associations to happen even if spectrum management is not |
| 480 | * allowed, if the transmit power of station is below the regulatory maximum |
| 481 | */ |
| 482 | |
| 483 | /* TODO: presently, this is not handled. In the current implemetation, the AP would |
| 484 | * allow the station to associate even if it doesn't support spectrum management. |
| 485 | */ |
| 486 | } |
| 487 | }// end of spectrum management related processing |
| 488 | |
| 489 | if ( (pAssocReq->HTCaps.present) && (limCheckMCSSet(pMac, pAssocReq->HTCaps.supportedMCSSet) == false)) |
| 490 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 491 | limLog(pMac, LOGW, FL("received %s req with unsupported" |
| 492 | "MCS Rate Set from "MAC_ADDRESS_STR), |
| 493 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 494 | MAC_ADDR_ARRAY(pHdr->sa)); |
| 495 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 496 | /** |
| 497 | * Requesting STA does not support ALL BSS MCS basic Rate set rates. |
| 498 | * Spec does not define any status code for this scenario. |
| 499 | */ |
| 500 | limSendAssocRspMgmtFrame( |
| 501 | pMac, |
| 502 | eSIR_MAC_OUTSIDE_SCOPE_OF_SPEC_STATUS, |
| 503 | 1, |
| 504 | pHdr->sa, |
| 505 | subType, 0,psessionEntry); |
| 506 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 507 | goto error; |
| 508 | } |
| 509 | |
| 510 | //if (pMac->dph.gDphPhyMode == WNI_CFG_PHY_MODE_11G) |
| 511 | if (phyMode == WNI_CFG_PHY_MODE_11G) |
| 512 | { |
| 513 | |
| 514 | if (wlan_cfgGetInt(pMac, WNI_CFG_11G_ONLY_POLICY, &val) != eSIR_SUCCESS) |
| 515 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 516 | limLog(pMac, LOGP, FL("could not retrieve 11g-only flag")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 517 | goto error; |
| 518 | } |
| 519 | |
| 520 | if (!pAssocReq->extendedRatesPresent && val) |
| 521 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 522 | limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from 11b STA: " |
| 523 | MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 524 | /** |
| 525 | * Received Re/Association Request from |
| 526 | * 11b STA when 11g only policy option |
| 527 | * is set. |
| 528 | * Reject with unspecified status code. |
| 529 | */ |
| 530 | limSendAssocRspMgmtFrame( |
| 531 | pMac, |
| 532 | eSIR_MAC_BASIC_RATES_NOT_SUPPORTED_STATUS, |
| 533 | 1, |
| 534 | pHdr->sa, |
| 535 | subType, 0,psessionEntry); |
| 536 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 537 | |
| 538 | #ifdef WLAN_DEBUG |
| 539 | pMac->lim.gLim11bStaAssocRejectCount++; |
| 540 | #endif |
| 541 | goto error; |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | #ifdef WMM_APSD |
| 546 | // Save the QOS info element in assoc request.. |
| 547 | limGetWmeMode(pMac, &wmeMode); |
| 548 | if (wmeMode == eHAL_SET) |
| 549 | { |
| 550 | tpQosInfoSta qInfo; |
| 551 | |
| 552 | qInfo = (tpQosInfoSta) (pAssocReq->qosCapability.qosInfo); |
| 553 | |
| 554 | if ((pMac->lim.gWmmApsd.apsdEnable == 0) && (qInfo->ac_be || qInfo->ac_bk || qInfo->ac_vo || qInfo->ac_vi)) |
| 555 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 556 | limLog(pMac, LOGW, |
| 557 | FL("Rejecting Re/Assoc req from STA: "MAC_ADDRESS_STR), |
| 558 | MAC_ADDR_ARRAY(pHdr->sa)); |
| 559 | limLog(pMac, LOGE, FL("APSD not enabled, qosInfo - 0x%x"), *qInfo); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 560 | |
| 561 | /** |
| 562 | * Received Re/Association Request from |
| 563 | * 11b STA when 11g only policy option |
| 564 | * is set. |
| 565 | * Reject with unspecified status code. |
| 566 | */ |
| 567 | limSendAssocRspMgmtFrame( |
| 568 | pMac, |
| 569 | eSIR_MAC_WME_REFUSED_STATUS, |
| 570 | 1, |
| 571 | pHdr->sa, |
| 572 | subType, 0,psessionEntry); |
| 573 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 574 | goto error; |
| 575 | } |
| 576 | } |
| 577 | #endif |
| 578 | |
| 579 | // Check for 802.11n HT caps compatibility; are HT Capabilities |
| 580 | // turned on in lim? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 581 | if ( psessionEntry->htCapability ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 582 | { |
| 583 | // There are; are they turned on in the STA? |
| 584 | if ( pAssocReq->HTCaps.present ) |
| 585 | { |
| 586 | // The station *does* support 802.11n HT capability... |
| 587 | |
| 588 | limLog( pMac, LOG1, FL( "AdvCodingCap:%d ChaWidthSet:%d " |
| 589 | "PowerSave:%d greenField:%d " |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 590 | "shortGI20:%d shortGI40:%d" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 591 | "txSTBC:%d rxSTBC:%d delayBA:%d" |
| 592 | "maxAMSDUsize:%d DSSS/CCK:%d " |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 593 | "PSMP:%d stbcCntl:%d lsigTXProt:%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 594 | pAssocReq->HTCaps.advCodingCap, |
| 595 | pAssocReq->HTCaps.supportedChannelWidthSet, |
| 596 | pAssocReq->HTCaps.mimoPowerSave, |
| 597 | pAssocReq->HTCaps.greenField, |
| 598 | pAssocReq->HTCaps.shortGI20MHz, |
| 599 | pAssocReq->HTCaps.shortGI40MHz, |
| 600 | pAssocReq->HTCaps.txSTBC, |
| 601 | pAssocReq->HTCaps.rxSTBC, |
| 602 | pAssocReq->HTCaps.delayedBA, |
| 603 | pAssocReq->HTCaps.maximalAMSDUsize, |
| 604 | pAssocReq->HTCaps.dsssCckMode40MHz, |
| 605 | pAssocReq->HTCaps.psmp, |
| 606 | pAssocReq->HTCaps.stbcControlFrame, |
| 607 | pAssocReq->HTCaps.lsigTXOPProtection ); |
| 608 | |
| 609 | // Make sure the STA's caps are compatible with our own: |
| 610 | //11.15.2 Support of DSSS/CCK in 40 MHz |
| 611 | //the AP shall refuse association requests from an HT STA that has the DSSS/CCK |
| 612 | //Mode in 40 MHz subfield set to 1; |
| 613 | |
| 614 | //FIXME_BTAMP_AP : Need to be enabled |
| 615 | /* |
| 616 | if ( !pMac->lim.gHTDsssCckRate40MHzSupport && pAssocReq->HTCaps.dsssCckMode40MHz ) |
| 617 | { |
| 618 | statusCode = eSIR_MAC_DSSS_CCK_RATE_NOT_SUPPORT_STATUS; |
| 619 | limLog( pMac, LOGW, FL( "AP DSSS/CCK is disabled; " |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 620 | "STA rejected." ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 621 | // Reject association |
| 622 | limSendAssocRspMgmtFrame( pMac, statusCode, 1, pHdr->sa, subType, 0,psessionEntry); |
| 623 | goto error; |
| 624 | } |
| 625 | */ |
| 626 | } |
| 627 | } // End if on HT caps turned on in lim. |
| 628 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 629 | /* Clear the buffers so that frame parser knows that there isn't a previously decoded IE in these buffers */ |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 630 | vos_mem_set((tANI_U8*)&Dot11fIERSN, sizeof( Dot11fIERSN ), 0); |
| 631 | vos_mem_set((tANI_U8*)&Dot11fIEWPA, sizeof( Dot11fIEWPA ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 632 | |
| 633 | /* if additional IE is present, check if it has WscIE */ |
| 634 | if( pAssocReq->addIEPresent && pAssocReq->addIE.length ) |
| 635 | wpsIe = limGetWscIEPtr(pMac, pAssocReq->addIE.addIEdata, pAssocReq->addIE.length); |
| 636 | /* when wpsIe is present, RSN/WPA IE is ignored */ |
| 637 | if( wpsIe == NULL ) |
| 638 | { |
| 639 | /** check whether as RSN IE is present */ |
| 640 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE |
| 641 | && psessionEntry->pLimStartBssReq->privacy |
| 642 | && psessionEntry->pLimStartBssReq->rsnIE.length) |
| 643 | { |
| 644 | limLog(pMac, LOGE, |
Kiet Lam | 82004c6 | 2013-11-11 13:24:28 +0530 | [diff] [blame] | 645 | FL("RSN enabled auth, Re/Assoc req from STA: "MAC_ADDRESS_STR), |
| 646 | MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 647 | if(pAssocReq->rsnPresent) |
| 648 | { |
| 649 | if(pAssocReq->rsn.length) |
| 650 | { |
| 651 | // Unpack the RSN IE |
| 652 | dot11fUnpackIeRSN(pMac, |
| 653 | &pAssocReq->rsn.info[0], |
| 654 | pAssocReq->rsn.length, |
| 655 | &Dot11fIERSN); |
| 656 | |
| 657 | /* Check RSN version is supported or not */ |
| 658 | if(SIR_MAC_OUI_VERSION_1 == Dot11fIERSN.version) |
| 659 | { |
| 660 | /* check the groupwise and pairwise cipher suites */ |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 661 | if(eSIR_SUCCESS != (status = limCheckRxRSNIeMatch(pMac, Dot11fIERSN, psessionEntry, |
| 662 | pAssocReq->HTCaps.present, &pmfConnection))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 663 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 664 | limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from " |
| 665 | "STA: "MAC_ADDRESS_STR), |
| 666 | MAC_ADDR_ARRAY(pHdr->sa)); |
| 667 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 668 | /* some IE is not properly sent */ |
| 669 | /* received Association req frame with RSN IE but length is 0 */ |
| 670 | limSendAssocRspMgmtFrame( |
| 671 | pMac, |
| 672 | status, |
| 673 | 1, |
| 674 | pHdr->sa, |
| 675 | subType, 0,psessionEntry); |
| 676 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 677 | goto error; |
| 678 | |
| 679 | } |
| 680 | } |
| 681 | else |
| 682 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 683 | limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from " |
| 684 | "STA: "MAC_ADDRESS_STR), |
| 685 | MAC_ADDR_ARRAY(pHdr->sa)); |
| 686 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 687 | /* received Association req frame with RSN IE version wrong */ |
| 688 | limSendAssocRspMgmtFrame( |
| 689 | pMac, |
| 690 | eSIR_MAC_UNSUPPORTED_RSN_IE_VERSION_STATUS, |
| 691 | 1, |
| 692 | pHdr->sa, |
| 693 | subType, 0,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 694 | goto error; |
| 695 | |
| 696 | } |
| 697 | } |
| 698 | else |
| 699 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 700 | limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from STA:" |
| 701 | MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 702 | /* received Association req frame with RSN IE but length is 0 */ |
| 703 | limSendAssocRspMgmtFrame( |
| 704 | pMac, |
| 705 | eSIR_MAC_INVALID_INFORMATION_ELEMENT_STATUS, |
| 706 | 1, |
| 707 | pHdr->sa, |
| 708 | subType, 0,psessionEntry); |
| 709 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 710 | goto error; |
| 711 | |
| 712 | } |
| 713 | } /* end - if(pAssocReq->rsnPresent) */ |
| 714 | if((!pAssocReq->rsnPresent) && pAssocReq->wpaPresent) |
| 715 | { |
| 716 | // Unpack the WPA IE |
| 717 | if(pAssocReq->wpa.length) |
| 718 | { |
| 719 | dot11fUnpackIeWPA(pMac, |
| 720 | &pAssocReq->wpa.info[4], //OUI is not taken care |
| 721 | pAssocReq->wpa.length, |
| 722 | &Dot11fIEWPA); |
| 723 | /* check the groupwise and pairwise cipher suites */ |
| 724 | if(eSIR_SUCCESS != (status = limCheckRxWPAIeMatch(pMac, Dot11fIEWPA, psessionEntry, pAssocReq->HTCaps.present))) |
| 725 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 726 | limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from " |
| 727 | "STA: "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 728 | /* received Association req frame with WPA IE but mismatch */ |
| 729 | limSendAssocRspMgmtFrame( |
| 730 | pMac, |
| 731 | status, |
| 732 | 1, |
| 733 | pHdr->sa, |
| 734 | subType, 0,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 735 | goto error; |
| 736 | |
| 737 | } |
| 738 | } |
| 739 | else |
| 740 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 741 | limLog(pMac, LOGW, FL("Rejecting Re/Assoc req from STA: " |
| 742 | MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 743 | /* received Association req frame with invalid WPA IE */ |
| 744 | limSendAssocRspMgmtFrame( |
| 745 | pMac, |
| 746 | eSIR_MAC_INVALID_INFORMATION_ELEMENT_STATUS, |
| 747 | 1, |
| 748 | pHdr->sa, |
| 749 | subType, 0,psessionEntry); |
| 750 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 751 | goto error; |
| 752 | }/* end - if(pAssocReq->wpa.length) */ |
| 753 | } /* end - if(pAssocReq->wpaPresent) */ |
| 754 | } /* end of if(psessionEntry->pLimStartBssReq->privacy |
| 755 | && psessionEntry->pLimStartBssReq->rsnIE->length) */ |
| 756 | |
| 757 | } /* end of if( ! pAssocReq->wscInfo.present ) */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 758 | |
| 759 | /** |
| 760 | * Extract 'associated' context for STA, if any. |
| 761 | * This is maintained by DPH and created by LIM. |
| 762 | */ |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 763 | pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &peerIdx, &psessionEntry->dph.dphHashTable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 764 | |
| 765 | /// Extract pre-auth context for the STA, if any. |
| 766 | pStaPreAuthContext = limSearchPreAuthList(pMac, pHdr->sa); |
| 767 | |
| 768 | if (pStaDs == NULL) |
| 769 | { |
| 770 | /// Requesting STA is not currently associated |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 771 | if (peGetCurrentSTAsCount(pMac) == pMac->lim.maxStation) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 772 | { |
| 773 | /** |
| 774 | * Maximum number of STAs that AP can handle reached. |
| 775 | * Send Association response to peer MAC entity |
| 776 | */ |
| 777 | limRejectAssociation(pMac, pHdr->sa, |
| 778 | subType, false, |
| 779 | (tAniAuthType) 0, 0, |
| 780 | false, |
| 781 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 782 | |
| 783 | goto error; |
| 784 | } |
| 785 | |
| 786 | /// Check if STA is pre-authenticated. |
| 787 | if ((pStaPreAuthContext == NULL) || |
| 788 | (pStaPreAuthContext && |
| 789 | (pStaPreAuthContext->mlmState != |
| 790 | eLIM_MLM_AUTHENTICATED_STATE))) |
| 791 | { |
| 792 | /** |
| 793 | * STA is not pre-authenticated yet requesting |
| 794 | * Re/Association before Authentication. |
| 795 | * OR STA is in the process of getting authenticated |
| 796 | * and sent Re/Association request. |
| 797 | * Send Deauthentication frame with 'prior |
| 798 | * authentication required' reason code. |
| 799 | */ |
| 800 | limSendDeauthMgmtFrame( |
| 801 | pMac, |
| 802 | eSIR_MAC_STA_NOT_PRE_AUTHENTICATED_REASON, //=9 |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 803 | pHdr->sa, psessionEntry, FALSE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 804 | |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 805 | limLog(pMac, LOGW, FL("received %s req on sessionid: %d from STA " |
| 806 | "that does not have pre-auth context"MAC_ADDRESS_STR), |
| 807 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", |
| 808 | psessionEntry->peSessionId, |
| 809 | MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 810 | goto error; |
| 811 | } |
| 812 | |
| 813 | /// Delete 'pre-auth' context of STA |
| 814 | authType = pStaPreAuthContext->authType; |
| 815 | limDeletePreAuthNode(pMac, pHdr->sa); |
| 816 | |
| 817 | // All is well. Assign AID (after else part) |
| 818 | |
| 819 | } // if (pStaDs == NULL) |
| 820 | else |
| 821 | { |
| 822 | // STA context does exist for this STA |
| 823 | |
| 824 | if (pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE) |
| 825 | { |
| 826 | /** |
| 827 | * Requesting STA is in some 'transient' state? |
| 828 | * Ignore the Re/Assoc Req frame by incrementing |
| 829 | * debug counter & logging error. |
| 830 | */ |
| 831 | if (subType == LIM_ASSOC) |
| 832 | { |
| 833 | |
| 834 | #ifdef WLAN_DEBUG |
| 835 | pMac->lim.gLimNumAssocReqDropInvldState++; |
| 836 | #endif |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 837 | limLog(pMac, LOG1, FL("received Assoc req in state " |
| 838 | "%X from "), pStaDs->mlmStaContext.mlmState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 839 | } |
| 840 | else |
| 841 | { |
| 842 | #ifdef WLAN_DEBUG |
| 843 | pMac->lim.gLimNumReassocReqDropInvldState++; |
| 844 | #endif |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 845 | limLog(pMac, LOG1, FL("received ReAssoc req in state %X" |
| 846 | " from "), pStaDs->mlmStaContext.mlmState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 847 | } |
| 848 | limPrintMacAddr(pMac, pHdr->sa, LOG1); |
| 849 | limPrintMlmState(pMac, LOG1, (tLimMlmStates) pStaDs->mlmStaContext.mlmState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 850 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 851 | goto error; |
| 852 | } // if (pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE) |
| 853 | |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 854 | /* STA sent association Request frame while already in |
| 855 | * 'associated' state */ |
| 856 | |
| 857 | #ifdef WLAN_FEATURE_11W |
| 858 | limLog(pMac, LOG1, FL("Re/Assoc request from station that is already associated")); |
| 859 | limLog(pMac, LOG1, FL("PMF enabled %d, SA Query state %d"), pStaDs->rmfEnabled, |
| 860 | pStaDs->pmfSaQueryState); |
| 861 | if (pStaDs->rmfEnabled) |
| 862 | { |
| 863 | switch (pStaDs->pmfSaQueryState) |
| 864 | { |
| 865 | |
| 866 | // start SA Query procedure, respond to Association Request |
| 867 | // with try again later |
| 868 | case DPH_SA_QUERY_NOT_IN_PROGRESS: |
Abhishek Singh | 65d6635 | 2014-07-15 23:14:38 +0530 | [diff] [blame] | 869 | /* |
| 870 | * We should reset the retry counter before we start |
| 871 | * the SA query procedure, otherwise in next set of SA query |
| 872 | * procedure we will end up using the stale value. |
| 873 | */ |
| 874 | pStaDs->pmfSaQueryRetryCount = 0; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 875 | limSendAssocRspMgmtFrame(pMac, eSIR_MAC_TRY_AGAIN_LATER, 1, |
| 876 | pHdr->sa, subType, pStaDs, psessionEntry); |
| 877 | limSendSaQueryRequestFrame( |
| 878 | pMac, (tANI_U8 *)&(pStaDs->pmfSaQueryCurrentTransId), |
| 879 | pHdr->sa, psessionEntry); |
| 880 | pStaDs->pmfSaQueryStartTransId = pStaDs->pmfSaQueryCurrentTransId; |
| 881 | pStaDs->pmfSaQueryCurrentTransId++; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 882 | |
| 883 | // start timer for SA Query retry |
| 884 | if (tx_timer_activate(&pStaDs->pmfSaQueryTimer) != TX_SUCCESS) |
| 885 | { |
| 886 | limLog(pMac, LOGE, FL("PMF SA Query timer activation failed!")); |
| 887 | goto error; |
| 888 | } |
| 889 | |
| 890 | pStaDs->pmfSaQueryState = DPH_SA_QUERY_IN_PROGRESS; |
| 891 | goto error; |
| 892 | |
| 893 | // SA Query procedure still going, respond to Association |
| 894 | // Request with try again later |
| 895 | case DPH_SA_QUERY_IN_PROGRESS: |
| 896 | limSendAssocRspMgmtFrame(pMac, eSIR_MAC_TRY_AGAIN_LATER, 1, |
| 897 | pHdr->sa, subType, 0, psessionEntry); |
| 898 | goto error; |
| 899 | |
| 900 | // SA Query procedure timed out, accept Association Request |
| 901 | // normally |
| 902 | case DPH_SA_QUERY_TIMED_OUT: |
| 903 | pStaDs->pmfSaQueryState = DPH_SA_QUERY_NOT_IN_PROGRESS; |
| 904 | break; |
| 905 | } |
| 906 | } |
| 907 | #endif |
| 908 | |
| 909 | /* no change in the capability so drop the frame */ |
Madan Mohan Koyyalamudi | 9902720 | 2013-08-05 22:14:24 +0530 | [diff] [blame] | 910 | if ((VOS_TRUE == vos_mem_compare(&pStaDs->mlmStaContext.capabilityInfo, |
| 911 | &pAssocReq->capabilityInfo, |
| 912 | sizeof(tSirMacCapabilityInfo)))&& |
| 913 | (subType == LIM_ASSOC)) |
| 914 | { |
| 915 | limLog(pMac, LOGE, FL(" Received Assoc req in state %X STAid=%d"), |
| 916 | pStaDs->mlmStaContext.mlmState,peerIdx); |
| 917 | goto error; |
| 918 | } |
| 919 | else |
| 920 | { |
| 921 | /** |
| 922 | * STA sent Re/association Request frame while already in |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 923 | * 'associated' state. Update STA capabilities and |
| 924 | * send Association response frame with same AID |
| 925 | */ |
Madan Mohan Koyyalamudi | 9902720 | 2013-08-05 22:14:24 +0530 | [diff] [blame] | 926 | pStaDs->mlmStaContext.capabilityInfo = pAssocReq->capabilityInfo; |
| 927 | if (pStaPreAuthContext && |
| 928 | (pStaPreAuthContext->mlmState == |
| 929 | eLIM_MLM_AUTHENTICATED_STATE)) |
| 930 | { |
| 931 | /// STA has triggered pre-auth again |
| 932 | authType = pStaPreAuthContext->authType; |
| 933 | limDeletePreAuthNode(pMac, pHdr->sa); |
| 934 | } |
| 935 | else |
| 936 | authType = pStaDs->mlmStaContext.authType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 937 | |
Madan Mohan Koyyalamudi | 9902720 | 2013-08-05 22:14:24 +0530 | [diff] [blame] | 938 | updateContext = true; |
| 939 | if (dphInitStaState(pMac, pHdr->sa, peerIdx, true, &psessionEntry->dph.dphHashTable) |
| 940 | == NULL) |
| 941 | { |
| 942 | limLog(pMac, LOGE, FL("could not Init STAid=%d"), peerIdx); |
| 943 | goto error; |
| 944 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 945 | } |
Madan Mohan Koyyalamudi | 9902720 | 2013-08-05 22:14:24 +0530 | [diff] [blame] | 946 | goto sendIndToSme; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 947 | } // end if (lookup for STA in perStaDs fails) |
| 948 | |
| 949 | |
| 950 | |
| 951 | // check if sta is allowed per QoS AC rules |
| 952 | //if (pMac->dph.gDphQosEnabled || pMac->dph.gDphWmeEnabled) |
| 953 | limGetWmeMode(psessionEntry, &wmeMode); |
| 954 | if ((qosMode == eHAL_SET) || (wmeMode == eHAL_SET)) |
| 955 | { |
| 956 | // for a qsta, check if the requested Traffic spec |
| 957 | // is admissible |
| 958 | // for a non-qsta check if the sta can be admitted |
| 959 | if (pAssocReq->addtsPresent) |
| 960 | { |
| 961 | tANI_U8 tspecIdx = 0; //index in the sch tspec table. |
| 962 | if (limAdmitControlAddTS(pMac, pHdr->sa, &(pAssocReq->addtsReq), |
| 963 | &(pAssocReq->qosCapability), 0, false, NULL, &tspecIdx, psessionEntry) != eSIR_SUCCESS) |
| 964 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 965 | limLog(pMac, LOGW, FL("AdmitControl: TSPEC rejected")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 966 | limSendAssocRspMgmtFrame( |
| 967 | pMac, |
| 968 | eSIR_MAC_QAP_NO_BANDWIDTH_REASON, |
| 969 | 1, |
| 970 | pHdr->sa, |
| 971 | subType, 0,psessionEntry); |
| 972 | #ifdef WLAN_DEBUG |
| 973 | pMac->lim.gLimNumAssocReqDropACRejectTS++; |
| 974 | #endif |
| 975 | goto error; |
| 976 | } |
| 977 | } |
| 978 | else if (limAdmitControlAddSta(pMac, pHdr->sa, false) |
| 979 | != eSIR_SUCCESS) |
| 980 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 981 | limLog(pMac, LOGW, FL("AdmitControl: Sta rejected")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 982 | limSendAssocRspMgmtFrame( |
| 983 | pMac, |
| 984 | eSIR_MAC_QAP_NO_BANDWIDTH_REASON, |
| 985 | 1, |
| 986 | pHdr->sa, |
| 987 | subType, 0,psessionEntry); |
| 988 | #ifdef WLAN_DEBUG |
| 989 | pMac->lim.gLimNumAssocReqDropACRejectSta++; |
| 990 | #endif |
| 991 | goto error; |
| 992 | } |
| 993 | |
| 994 | // else all ok |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 995 | limLog(pMac, LOG1, FL("AdmitControl: Sta OK!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 996 | } |
| 997 | |
| 998 | /** |
| 999 | * STA is Associated ! |
| 1000 | */ |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1001 | limLog(pMac, LOGE, FL("Received %s Req successful from "MAC_ADDRESS_STR), |
| 1002 | (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1003 | |
| 1004 | /** |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1005 | * AID for this association will be same as the peer Index used in DPH table. |
| 1006 | * Assign unused/least recently used peer Index from perStaDs. |
| 1007 | * NOTE: limAssignPeerIdx() assigns AID values ranging |
| 1008 | * between 1 - cfg_item(WNI_CFG_ASSOC_STA_LIMIT) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1009 | */ |
| 1010 | |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1011 | peerIdx = limAssignPeerIdx(pMac, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1012 | |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1013 | if (!peerIdx) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1014 | { |
| 1015 | // Could not assign AID |
| 1016 | // Reject association |
| 1017 | limRejectAssociation(pMac, pHdr->sa, |
| 1018 | subType, true, authType, |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1019 | peerIdx, false, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1020 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 1021 | |
| 1022 | goto error; |
| 1023 | } |
| 1024 | |
| 1025 | /** |
| 1026 | * Add an entry to hash table maintained by DPH module |
| 1027 | */ |
| 1028 | |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1029 | pStaDs = dphAddHashEntry(pMac, pHdr->sa, peerIdx, &psessionEntry->dph.dphHashTable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1030 | |
| 1031 | if (pStaDs == NULL) |
| 1032 | { |
| 1033 | // Could not add hash table entry at DPH |
| 1034 | limLog(pMac, LOGE, |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1035 | FL("could not add hash entry at DPH for aid=%d, MacAddr:" |
| 1036 | MAC_ADDRESS_STR), |
| 1037 | peerIdx,MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1038 | |
| 1039 | // Release AID |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1040 | limReleasePeerIdx(pMac, peerIdx, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1041 | |
| 1042 | limRejectAssociation(pMac, pHdr->sa, |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1043 | subType, true, authType, peerIdx, false, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1044 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 1045 | |
| 1046 | goto error; |
| 1047 | } |
| 1048 | |
| 1049 | |
| 1050 | sendIndToSme: |
| 1051 | |
| 1052 | psessionEntry->parsedAssocReq[pStaDs->assocId] = pAssocReq; |
| 1053 | |
| 1054 | pStaDs->mlmStaContext.htCapability = pAssocReq->HTCaps.present; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1055 | #ifdef WLAN_FEATURE_11AC |
| 1056 | pStaDs->mlmStaContext.vhtCapability = pAssocReq->VHTCaps.present; |
| 1057 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1058 | pStaDs->qos.addtsPresent = (pAssocReq->addtsPresent==0) ? false : true; |
| 1059 | pStaDs->qos.addts = pAssocReq->addtsReq; |
| 1060 | pStaDs->qos.capability = pAssocReq->qosCapability; |
| 1061 | pStaDs->versionPresent = 0; |
| 1062 | /* short slot and short preamble should be updated before doing limaddsta */ |
| 1063 | pStaDs->shortPreambleEnabled = (tANI_U8)pAssocReq->capabilityInfo.shortPreamble; |
| 1064 | pStaDs->shortSlotTimeEnabled = (tANI_U8)pAssocReq->capabilityInfo.shortSlotTime; |
| 1065 | |
| 1066 | if (pAssocReq->propIEinfo.versionPresent) //update STA version info |
| 1067 | { |
| 1068 | pStaDs->versionPresent = 1; |
| 1069 | pStaDs->version = pAssocReq->propIEinfo.version; |
| 1070 | } |
| 1071 | pStaDs->propCapability = 0; |
| 1072 | if (pAssocReq->propIEinfo.capabilityPresent) |
| 1073 | { |
| 1074 | if (sirGetCfgPropCaps(pMac, &pStaDs->propCapability)) |
| 1075 | pStaDs->propCapability &= pAssocReq->propIEinfo.capability; |
| 1076 | } |
| 1077 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1078 | pStaDs->valid = 0; |
| 1079 | pStaDs->mlmStaContext.authType = authType; |
| 1080 | pStaDs->staType = STA_ENTRY_PEER; |
| 1081 | |
| 1082 | //TODO: If listen interval is more than certain limit, reject the association. |
| 1083 | //Need to check customer requirements and then implement. |
| 1084 | pStaDs->mlmStaContext.listenInterval = pAssocReq->listenInterval; |
| 1085 | pStaDs->mlmStaContext.capabilityInfo = pAssocReq->capabilityInfo; |
| 1086 | |
| 1087 | /* The following count will be used to knock-off the station if it doesn't |
| 1088 | * come back to receive the buffered data. The AP will wait for numTimSent number |
| 1089 | * of beacons after sending TIM information for the station, before assuming that |
| 1090 | * the station is no more associated and disassociates it |
| 1091 | */ |
| 1092 | |
| 1093 | /** timWaitCount is used by PMM for monitoring the STA's in PS for LINK*/ |
| 1094 | pStaDs->timWaitCount = (tANI_U8)GET_TIM_WAIT_COUNT(pAssocReq->listenInterval); |
| 1095 | |
| 1096 | /** Initialise the Current successful MPDU's tranfered to this STA count as 0 */ |
| 1097 | pStaDs->curTxMpduCnt = 0; |
| 1098 | |
| 1099 | if(IS_DOT11_MODE_HT(psessionEntry->dot11mode) && |
| 1100 | (pAssocReq->HTCaps.present)) |
| 1101 | { |
| 1102 | pStaDs->htGreenfield = (tANI_U8)pAssocReq->HTCaps.greenField; |
| 1103 | pStaDs->htAMpduDensity = pAssocReq->HTCaps.mpduDensity; |
| 1104 | pStaDs->htDsssCckRate40MHzSupport = (tANI_U8)pAssocReq->HTCaps.dsssCckMode40MHz; |
| 1105 | pStaDs->htLsigTXOPProtection = (tANI_U8)pAssocReq->HTCaps.lsigTXOPProtection; |
| 1106 | pStaDs->htMaxAmsduLength = (tANI_U8)pAssocReq->HTCaps.maximalAMSDUsize; |
| 1107 | pStaDs->htMaxRxAMpduFactor = pAssocReq->HTCaps.maxRxAMPDUFactor; |
| 1108 | pStaDs->htMIMOPSState = pAssocReq->HTCaps.mimoPowerSave; |
| 1109 | pStaDs->htShortGI20Mhz = (tANI_U8)pAssocReq->HTCaps.shortGI20MHz; |
| 1110 | pStaDs->htShortGI40Mhz = (tANI_U8)pAssocReq->HTCaps.shortGI40MHz; |
| 1111 | pStaDs->htSupportedChannelWidthSet = (tANI_U8)pAssocReq->HTCaps.supportedChannelWidthSet; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1112 | /* peer just follows AP; so when we are softAP/GO, we just store our session entry's secondary channel offset here in peer INFRA STA |
| 1113 | * However, if peer's 40MHz channel width support is disabled then secondary channel will be zero |
| 1114 | */ |
| 1115 | pStaDs->htSecondaryChannelOffset = (pStaDs->htSupportedChannelWidthSet)?psessionEntry->htSecondaryChannelOffset:0; |
| 1116 | #ifdef WLAN_FEATURE_11AC |
Mohit Khanna | 7d5aeb2 | 2012-09-11 16:21:57 -0700 | [diff] [blame] | 1117 | if(pAssocReq->operMode.present) |
| 1118 | { |
| 1119 | pStaDs->vhtSupportedChannelWidthSet = (tANI_U8)((pAssocReq->operMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ) ? WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ : WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ); |
| 1120 | pStaDs->htSupportedChannelWidthSet = (tANI_U8)(pAssocReq->operMode.chanWidth ? eHT_CHANNEL_WIDTH_40MHZ : eHT_CHANNEL_WIDTH_20MHZ); |
| 1121 | } |
| 1122 | else if (pAssocReq->VHTCaps.present) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1123 | { |
Madan Mohan Koyyalamudi | 740f780 | 2012-09-24 14:17:14 -0700 | [diff] [blame] | 1124 | // Check if STA has enabled it's channel bonding mode. |
| 1125 | // If channel bonding mode is enabled, we decide based on SAP's current configuration. |
| 1126 | // else, we set it to VHT20. |
| 1127 | pStaDs->vhtSupportedChannelWidthSet = (tANI_U8)((pStaDs->htSupportedChannelWidthSet == eHT_CHANNEL_WIDTH_20MHZ) ? |
| 1128 | WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ : |
| 1129 | psessionEntry->vhtTxChannelWidthSet ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1130 | } |
Madan Mohan Koyyalamudi | cc39440 | 2012-10-05 10:48:19 -0700 | [diff] [blame] | 1131 | |
| 1132 | // Lesser among the AP and STA bandwidth of operation. |
| 1133 | pStaDs->htSupportedChannelWidthSet = |
| 1134 | (pStaDs->htSupportedChannelWidthSet < psessionEntry->htSupportedChannelWidthSet) ? |
| 1135 | pStaDs->htSupportedChannelWidthSet : psessionEntry->htSupportedChannelWidthSet ; |
| 1136 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1137 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1138 | pStaDs->baPolicyFlag = 0xFF; |
Gopichand Nakkala | b2d2c31 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 1139 | pStaDs->htLdpcCapable = (tANI_U8)pAssocReq->HTCaps.advCodingCap; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1140 | } |
| 1141 | |
Gopichand Nakkala | b2d2c31 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 1142 | if(pAssocReq->VHTCaps.present) |
| 1143 | { |
| 1144 | pStaDs->vhtLdpcCapable = (tANI_U8)pAssocReq->VHTCaps.ldpcCodingCap; |
| 1145 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1146 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1147 | #ifdef WLAN_FEATURE_11AC |
| 1148 | if (limPopulateMatchingRateSet(pMac, |
| 1149 | pStaDs, |
| 1150 | &(pAssocReq->supportedRates), |
| 1151 | &(pAssocReq->extendedRates), |
| 1152 | pAssocReq->HTCaps.supportedMCSSet, |
| 1153 | &(pAssocReq->propIEinfo.propRates), |
| 1154 | psessionEntry , &pAssocReq->VHTCaps) |
| 1155 | != eSIR_SUCCESS) |
| 1156 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1157 | |
| 1158 | if (limPopulateMatchingRateSet(pMac, |
| 1159 | pStaDs, |
| 1160 | &(pAssocReq->supportedRates), |
| 1161 | &(pAssocReq->extendedRates), |
| 1162 | pAssocReq->HTCaps.supportedMCSSet, |
| 1163 | &(pAssocReq->propIEinfo.propRates), psessionEntry) != eSIR_SUCCESS) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1164 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1165 | { |
| 1166 | // Could not update hash table entry at DPH with rateset |
| 1167 | limLog(pMac, LOGE, |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1168 | FL("could not update hash entry at DPH for aid=%d, MacAddr: " |
| 1169 | MAC_ADDRESS_STR), |
| 1170 | peerIdx, MAC_ADDR_ARRAY(pHdr->sa)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1171 | |
| 1172 | // Release AID |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1173 | limReleasePeerIdx(pMac, peerIdx, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1174 | |
| 1175 | |
| 1176 | limRejectAssociation(pMac, pHdr->sa, |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1177 | subType, true, authType, peerIdx, true, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1178 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 1179 | |
Kiran Kumar Lokere | fdf4241 | 2013-07-17 17:40:58 -0700 | [diff] [blame] | 1180 | pAssocReq = psessionEntry->parsedAssocReq[pStaDs->assocId]; |
| 1181 | goto error; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1182 | } |
| 1183 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1184 | vos_mem_copy((tANI_U8 *) &pStaDs->mlmStaContext.propRateSet, |
| 1185 | (tANI_U8 *) &(pAssocReq->propIEinfo.propRates), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1186 | pAssocReq->propIEinfo.propRates.numPropRates + 1); |
| 1187 | |
| 1188 | /// Add STA context at MAC HW (BMU, RHP & TFP) |
| 1189 | |
| 1190 | pStaDs->qosMode = eANI_BOOLEAN_FALSE; |
| 1191 | pStaDs->lleEnabled = eANI_BOOLEAN_FALSE; |
| 1192 | if (pAssocReq->capabilityInfo.qos && (qosMode == eHAL_SET)) |
| 1193 | { |
| 1194 | pStaDs->lleEnabled = eANI_BOOLEAN_TRUE; |
| 1195 | pStaDs->qosMode = eANI_BOOLEAN_TRUE; |
| 1196 | } |
| 1197 | |
| 1198 | pStaDs->wmeEnabled = eANI_BOOLEAN_FALSE; |
| 1199 | pStaDs->wsmEnabled = eANI_BOOLEAN_FALSE; |
| 1200 | limGetWmeMode(psessionEntry, &wmeMode); |
| 1201 | //if ((! pStaDs->lleEnabled) && assoc.wmeInfoPresent && pMac->dph.gDphWmeEnabled) |
| 1202 | if ((! pStaDs->lleEnabled) && pAssocReq->wmeInfoPresent && (wmeMode == eHAL_SET)) |
| 1203 | { |
| 1204 | pStaDs->wmeEnabled = eANI_BOOLEAN_TRUE; |
| 1205 | pStaDs->qosMode = eANI_BOOLEAN_TRUE; |
| 1206 | limGetWsmMode(psessionEntry, &wsmMode); |
| 1207 | /* WMM_APSD - WMM_SA related processing should be separate; WMM_SA and WMM_APSD |
| 1208 | can coexist */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1209 | if( pAssocReq->WMMInfoStation.present) |
| 1210 | { |
| 1211 | /* check whether AP supports or not */ |
| 1212 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 1213 | && (psessionEntry->apUapsdEnable == 0) && (pAssocReq->WMMInfoStation.acbe_uapsd |
| 1214 | || pAssocReq->WMMInfoStation.acbk_uapsd |
| 1215 | || pAssocReq->WMMInfoStation.acvo_uapsd |
| 1216 | || pAssocReq->WMMInfoStation.acvi_uapsd)) |
| 1217 | { |
| 1218 | |
| 1219 | /** |
| 1220 | * Received Re/Association Request from |
| 1221 | * STA when UPASD is not supported. |
| 1222 | */ |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1223 | limLog( pMac, LOGE, FL( "AP do not support UPASD " |
| 1224 | "REASSOC Failed" )); |
Leela Venkata Kiran Kumar Reddy Chirala | 7dc7ead | 2013-10-22 11:10:33 -0700 | [diff] [blame] | 1225 | /* During wlan fuzz tests for softAP when mal-formed assoc req is |
| 1226 | * sent to AP due to delSTA is not done in firmnware UMAC is |
| 1227 | * stuck in some bad state.if we set this flag delsta will happen |
| 1228 | * and UMAC will recover*/ |
| 1229 | if (updateContext) |
| 1230 | { |
| 1231 | pStaDs->mlmStaContext.updateContext = 1; |
| 1232 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1233 | limRejectAssociation(pMac, pHdr->sa, |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1234 | subType, true, authType, peerIdx, true, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1235 | (tSirResultCodes) eSIR_MAC_WME_REFUSED_STATUS, psessionEntry); |
| 1236 | |
| 1237 | |
Kiran Kumar Lokere | fdf4241 | 2013-07-17 17:40:58 -0700 | [diff] [blame] | 1238 | pAssocReq = psessionEntry->parsedAssocReq[pStaDs->assocId]; |
| 1239 | goto error; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1240 | } |
| 1241 | else |
| 1242 | { |
| 1243 | /* update UAPSD and send it to LIM to add STA */ |
| 1244 | pStaDs->qos.capability.qosInfo.acbe_uapsd = pAssocReq->WMMInfoStation.acbe_uapsd; |
| 1245 | pStaDs->qos.capability.qosInfo.acbk_uapsd = pAssocReq->WMMInfoStation.acbk_uapsd; |
| 1246 | pStaDs->qos.capability.qosInfo.acvo_uapsd = pAssocReq->WMMInfoStation.acvo_uapsd; |
| 1247 | pStaDs->qos.capability.qosInfo.acvi_uapsd = pAssocReq->WMMInfoStation.acvi_uapsd; |
| 1248 | pStaDs->qos.capability.qosInfo.maxSpLen = pAssocReq->WMMInfoStation.max_sp_length; |
| 1249 | } |
| 1250 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1251 | //if (assoc.wsmCapablePresent && pMac->dph.gDphWsmEnabled) |
| 1252 | if (pAssocReq->wsmCapablePresent && (wsmMode == eHAL_SET)) |
| 1253 | pStaDs->wsmEnabled = eANI_BOOLEAN_TRUE; |
| 1254 | |
| 1255 | } |
| 1256 | |
| 1257 | // Re/Assoc Response frame to requesting STA |
| 1258 | pStaDs->mlmStaContext.subType = subType; |
| 1259 | |
| 1260 | if (pAssocReq->propIEinfo.aniIndicator) |
| 1261 | pStaDs->aniPeer = 1; |
| 1262 | |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 1263 | #ifdef WLAN_FEATURE_11W |
| 1264 | pStaDs->rmfEnabled = (pmfConnection) ? 1 : 0; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 1265 | pStaDs->pmfSaQueryState = DPH_SA_QUERY_NOT_IN_PROGRESS; |
| 1266 | timerId.fields.sessionId = psessionEntry->peSessionId; |
| 1267 | timerId.fields.peerIdx = peerIdx; |
| 1268 | if (wlan_cfgGetInt(pMac, WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL, |
| 1269 | &retryInterval) != eSIR_SUCCESS) |
| 1270 | { |
| 1271 | limLog(pMac, LOGE, FL("Could not retrieve PMF SA Query retry interval value")); |
| 1272 | limRejectAssociation(pMac, pHdr->sa, |
| 1273 | subType, true, authType, |
| 1274 | peerIdx, false, |
| 1275 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 1276 | goto error; |
| 1277 | } |
Abhishek Singh | bf9f7d8 | 2014-09-25 16:24:59 +0530 | [diff] [blame^] | 1278 | if (WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_APMIN > retryInterval) |
| 1279 | { |
| 1280 | retryInterval = WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_APDEF; |
| 1281 | } |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 1282 | if (tx_timer_create(&pStaDs->pmfSaQueryTimer, "PMF SA Query timer", |
| 1283 | limPmfSaQueryTimerHandler, timerId.value, |
| 1284 | SYS_MS_TO_TICKS((retryInterval * 1024) / 1000), |
| 1285 | 0, TX_NO_ACTIVATE) != TX_SUCCESS) |
| 1286 | { |
| 1287 | limLog(pMac, LOGE, FL("could not create PMF SA Query timer")); |
| 1288 | limRejectAssociation(pMac, pHdr->sa, |
| 1289 | subType, true, authType, |
| 1290 | peerIdx, false, |
| 1291 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 1292 | goto error; |
| 1293 | } |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 1294 | #endif |
| 1295 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1296 | // BTAMP: Storing the parsed assoc request in the psessionEntry array |
| 1297 | psessionEntry->parsedAssocReq[pStaDs->assocId] = pAssocReq; |
| 1298 | |
| 1299 | /* BTAMP: If STA context already exist (ie. updateContext = 1) |
| 1300 | * for this STA, then we should delete the old one, and add |
| 1301 | * the new STA. This is taken care of in the limDelSta() routine. |
| 1302 | * |
| 1303 | * Prior to BTAMP, we were setting this flag so that when |
| 1304 | * PE receives SME_ASSOC_CNF, and if this flag is set, then |
| 1305 | * PE shall delete the old station and then add. But now in |
| 1306 | * BTAMP, we're directly adding station before waiting for |
| 1307 | * SME_ASSOC_CNF, so we can do this now. |
| 1308 | */ |
| 1309 | if (!updateContext) |
| 1310 | { |
| 1311 | pStaDs->mlmStaContext.updateContext = 0; |
| 1312 | |
| 1313 | // BTAMP: Add STA context at HW - issue WDA_ADD_STA_REQ to HAL |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 1314 | if (limAddSta(pMac, pStaDs, false, psessionEntry) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1315 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1316 | limLog(pMac, LOGE, FL("could not Add STA with assocId=%d"), |
| 1317 | pStaDs->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1318 | limRejectAssociation( pMac, pStaDs->staAddr, pStaDs->mlmStaContext.subType, |
| 1319 | true, pStaDs->mlmStaContext.authType, pStaDs->assocId, true, |
| 1320 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 1321 | |
Kiran Kumar Lokere | fdf4241 | 2013-07-17 17:40:58 -0700 | [diff] [blame] | 1322 | pAssocReq = psessionEntry->parsedAssocReq[pStaDs->assocId]; |
| 1323 | goto error; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1324 | } |
| 1325 | } |
| 1326 | else |
| 1327 | { |
| 1328 | pStaDs->mlmStaContext.updateContext = 1; |
| 1329 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1330 | mlmPrevState = pStaDs->mlmStaContext.mlmState; |
| 1331 | |
| 1332 | /* As per the HAL/FW needs the reassoc req need not be calling limDelSta */ |
| 1333 | if(subType != LIM_REASSOC) |
| 1334 | { |
| 1335 | //we need to set the mlmState here in order differentiate in limDelSta. |
| 1336 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE; |
| 1337 | if(limDelSta(pMac, pStaDs, true, psessionEntry) != eSIR_SUCCESS) |
| 1338 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1339 | limLog(pMac, LOGE, FL("could not DEL STA with assocId=%d staId %d"), |
| 1340 | pStaDs->assocId, pStaDs->staIndex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1341 | limRejectAssociation( pMac, pStaDs->staAddr, pStaDs->mlmStaContext.subType, true, pStaDs->mlmStaContext.authType, |
| 1342 | pStaDs->assocId, true,(tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 1343 | |
| 1344 | //Restoring the state back. |
| 1345 | pStaDs->mlmStaContext.mlmState = mlmPrevState; |
Kiran Kumar Lokere | fdf4241 | 2013-07-17 17:40:58 -0700 | [diff] [blame] | 1346 | pAssocReq = psessionEntry->parsedAssocReq[pStaDs->assocId]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1347 | goto error; |
| 1348 | } |
| 1349 | } |
| 1350 | else |
| 1351 | { |
| 1352 | /* mlmState is changed in limAddSta context */ |
| 1353 | /* use the same AID, already allocated */ |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 1354 | if (limAddSta(pMac, pStaDs, false, psessionEntry) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1355 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1356 | limLog( pMac, LOGE, FL( "AP do not support UPASD " |
| 1357 | "REASSOC Failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1358 | limRejectAssociation( pMac, pStaDs->staAddr, pStaDs->mlmStaContext.subType, true, pStaDs->mlmStaContext.authType, |
| 1359 | pStaDs->assocId, true,(tSirResultCodes) eSIR_MAC_WME_REFUSED_STATUS, psessionEntry); |
| 1360 | |
| 1361 | //Restoring the state back. |
| 1362 | pStaDs->mlmStaContext.mlmState = mlmPrevState; |
Kiran Kumar Lokere | fdf4241 | 2013-07-17 17:40:58 -0700 | [diff] [blame] | 1363 | pAssocReq = psessionEntry->parsedAssocReq[pStaDs->assocId]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1364 | goto error; |
| 1365 | } |
| 1366 | |
| 1367 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1368 | |
| 1369 | } |
| 1370 | |
| 1371 | return; |
| 1372 | |
| 1373 | error: |
| 1374 | if (pAssocReq != NULL) |
| 1375 | { |
| 1376 | if ( pAssocReq->assocReqFrame ) |
| 1377 | { |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1378 | vos_mem_free(pAssocReq->assocReqFrame); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1379 | pAssocReq->assocReqFrame = NULL; |
| 1380 | } |
| 1381 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1382 | vos_mem_free(pAssocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1383 | } |
| 1384 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1385 | /* If it is not duplicate Assoc request then only make to Null */ |
| 1386 | if ((pStaDs != NULL) && |
| 1387 | (pStaDs->mlmStaContext.mlmState != eLIM_MLM_WT_ADD_STA_RSP_STATE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1388 | psessionEntry->parsedAssocReq[pStaDs->assocId] = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1389 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1390 | return; |
| 1391 | |
| 1392 | } /*** end limProcessAssocReqFrame() ***/ |
| 1393 | |
| 1394 | |
| 1395 | |
| 1396 | /**--------------------------------------------------------------- |
| 1397 | \fn limSendMlmAssocInd |
| 1398 | \brief This function sends either LIM_MLM_ASSOC_IND |
| 1399 | \ or LIM_MLM_REASSOC_IND to SME. |
| 1400 | \ |
| 1401 | \param pMac |
| 1402 | \param *pStaDs - Station DPH hash entry |
| 1403 | \param psessionEntry - PE session entry |
| 1404 | \return None |
| 1405 | |
| 1406 | * ?????? How do I get |
| 1407 | * - subtype =====> psessionEntry->parsedAssocReq.reassocRequest |
| 1408 | * - aid =====> pStaDs->assocId |
| 1409 | * - pHdr->sa =====> pStaDs->staAddr |
| 1410 | * - authType |
| 1411 | * - pHdr->seqControl =====> no longer needed |
| 1412 | * - pStaDs |
| 1413 | ------------------------------------------------------------------*/ |
| 1414 | void limSendMlmAssocInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry) |
| 1415 | { |
| 1416 | tpLimMlmAssocInd pMlmAssocInd = NULL; |
| 1417 | tpLimMlmReassocInd pMlmReassocInd; |
| 1418 | tpSirAssocReq pAssocReq; |
| 1419 | tANI_U16 temp; |
| 1420 | tANI_U32 phyMode; |
| 1421 | tANI_U8 subType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1422 | tANI_U8 *wpsIe = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1423 | tANI_U32 tmp; |
| 1424 | // tANI_U16 statusCode; |
| 1425 | tANI_U16 i, j=0; |
| 1426 | |
| 1427 | // Get a copy of the already parsed Assoc Request |
| 1428 | pAssocReq = (tpSirAssocReq) psessionEntry->parsedAssocReq[pStaDs->assocId]; |
| 1429 | |
| 1430 | // Get the phyMode |
| 1431 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1432 | // Extract pre-auth context for the peer BTAMP-STA, if any. |
| 1433 | |
| 1434 | // Determiine if its Assoc or ReAssoc Request |
| 1435 | if (pAssocReq->reassocRequest == 1) |
| 1436 | subType = LIM_REASSOC; |
| 1437 | else |
| 1438 | subType = LIM_ASSOC; |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1439 | |
| 1440 | limLog(pMac, LOG1, FL("Sessionid %d ssid %s subtype %d Associd %d staAddr " |
| 1441 | MAC_ADDRESS_STR), psessionEntry->peSessionId, pAssocReq->ssId.ssId, |
| 1442 | subType,pStaDs->assocId,MAC_ADDR_ARRAY(pStaDs->staAddr)); |
| 1443 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1444 | if (subType == LIM_ASSOC || subType == LIM_REASSOC) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1445 | { |
| 1446 | temp = sizeof(tLimMlmAssocInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1447 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1448 | pMlmAssocInd = vos_mem_malloc(temp); |
| 1449 | if (NULL == pMlmAssocInd) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1450 | { |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1451 | limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry); |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1452 | limLog(pMac, LOGP, FL("AllocateMemory failed for pMlmAssocInd")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1453 | return; |
| 1454 | } |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1455 | vos_mem_set(pMlmAssocInd, temp ,0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1456 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1457 | vos_mem_copy((tANI_U8 *)pMlmAssocInd->peerMacAddr, |
| 1458 | (tANI_U8 *)pStaDs->staAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1459 | |
| 1460 | pMlmAssocInd->aid = pStaDs->assocId; |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1461 | vos_mem_copy((tANI_U8 *)&pMlmAssocInd->ssId, |
| 1462 | (tANI_U8 *)&(pAssocReq->ssId), pAssocReq->ssId.length + 1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1463 | pMlmAssocInd->sessionId = psessionEntry->peSessionId; |
| 1464 | pMlmAssocInd->authType = pStaDs->mlmStaContext.authType; |
| 1465 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1466 | pMlmAssocInd->capabilityInfo = pAssocReq->capabilityInfo; |
| 1467 | |
| 1468 | // Fill in RSN IE information |
| 1469 | pMlmAssocInd->rsnIE.length = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1470 | // if WPS IE is present, ignore RSN IE |
| 1471 | if (pAssocReq->addIEPresent && pAssocReq->addIE.length ) { |
| 1472 | wpsIe = limGetWscIEPtr(pMac, pAssocReq->addIE.addIEdata, pAssocReq->addIE.length); |
| 1473 | } |
| 1474 | if (pAssocReq->rsnPresent && (NULL == wpsIe)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1475 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1476 | limLog(pMac, LOG2, FL("Assoc Req RSN IE len = %d"), |
| 1477 | pAssocReq->rsn.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1478 | pMlmAssocInd->rsnIE.length = 2 + pAssocReq->rsn.length; |
| 1479 | pMlmAssocInd->rsnIE.rsnIEdata[0] = SIR_MAC_RSN_EID; |
| 1480 | pMlmAssocInd->rsnIE.rsnIEdata[1] = pAssocReq->rsn.length; |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1481 | vos_mem_copy(&pMlmAssocInd->rsnIE.rsnIEdata[2], |
| 1482 | pAssocReq->rsn.info, |
| 1483 | pAssocReq->rsn.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1484 | } |
| 1485 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1486 | // Fill in 802.11h related info |
| 1487 | if (pAssocReq->powerCapabilityPresent && pAssocReq->supportedChannelsPresent) |
| 1488 | { |
| 1489 | pMlmAssocInd->spectrumMgtIndicator = eSIR_TRUE; |
| 1490 | pMlmAssocInd->powerCap.minTxPower = pAssocReq->powerCapability.minTxPower; |
| 1491 | pMlmAssocInd->powerCap.maxTxPower = pAssocReq->powerCapability.maxTxPower; |
| 1492 | limConvertSupportedChannels(pMac, pMlmAssocInd, pAssocReq); |
| 1493 | } |
| 1494 | else |
| 1495 | pMlmAssocInd->spectrumMgtIndicator = eSIR_FALSE; |
| 1496 | |
| 1497 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1498 | /* This check is to avoid extra Sec IEs present incase of WPS */ |
| 1499 | if (pAssocReq->wpaPresent && (NULL == wpsIe)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1500 | { |
| 1501 | if((pMlmAssocInd->rsnIE.length + pAssocReq->wpa.length) >= SIR_MAC_MAX_IE_LENGTH) |
| 1502 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1503 | PELOGE(limLog(pMac, LOGE, FL("rsnIEdata index out of bounds %d"), |
| 1504 | pMlmAssocInd->rsnIE.length);) |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1505 | vos_mem_free(pMlmAssocInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1506 | return; |
| 1507 | } |
| 1508 | pMlmAssocInd->rsnIE.rsnIEdata[pMlmAssocInd->rsnIE.length] = SIR_MAC_WPA_EID; |
| 1509 | pMlmAssocInd->rsnIE.rsnIEdata[pMlmAssocInd->rsnIE.length + 1] = pAssocReq->wpa.length; |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1510 | vos_mem_copy(&pMlmAssocInd->rsnIE.rsnIEdata[pMlmAssocInd->rsnIE.length + 2], |
| 1511 | pAssocReq->wpa.info, |
| 1512 | pAssocReq->wpa.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1513 | pMlmAssocInd->rsnIE.length += 2 + pAssocReq->wpa.length; |
| 1514 | } |
| 1515 | |
| 1516 | |
| 1517 | pMlmAssocInd->addIE.length = 0; |
| 1518 | if (pAssocReq->addIEPresent) |
| 1519 | { |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1520 | vos_mem_copy(&pMlmAssocInd->addIE.addIEdata, |
| 1521 | pAssocReq->addIE.addIEdata, |
| 1522 | pAssocReq->addIE.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1523 | |
| 1524 | pMlmAssocInd->addIE.length = pAssocReq->addIE.length; |
| 1525 | } |
| 1526 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1527 | if(pAssocReq->wmeInfoPresent) |
| 1528 | { |
| 1529 | |
| 1530 | if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WME_ENABLED, &tmp) != eSIR_SUCCESS) |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1531 | limLog(pMac, LOGP, FL("wlan_cfgGetInt failed for id %d"), |
| 1532 | WNI_CFG_WME_ENABLED ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1533 | |
| 1534 | /* check whether AP is enabled with WMM */ |
| 1535 | if(tmp) |
| 1536 | { |
| 1537 | pMlmAssocInd->WmmStaInfoPresent = 1; |
| 1538 | } |
| 1539 | else |
| 1540 | { |
| 1541 | pMlmAssocInd->WmmStaInfoPresent= 0; |
| 1542 | } |
| 1543 | /* Note: we are not rejecting association here because IOT will fail */ |
| 1544 | |
| 1545 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1546 | |
| 1547 | // Required for indicating the frames to upper layer |
| 1548 | pMlmAssocInd->assocReqLength = pAssocReq->assocReqFrameLength; |
| 1549 | pMlmAssocInd->assocReqPtr = pAssocReq->assocReqFrame; |
| 1550 | |
| 1551 | pMlmAssocInd->beaconPtr = psessionEntry->beacon; |
| 1552 | pMlmAssocInd->beaconLength = psessionEntry->bcnLen; |
| 1553 | |
| 1554 | limPostSmeMessage(pMac, LIM_MLM_ASSOC_IND, (tANI_U32 *) pMlmAssocInd); |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1555 | vos_mem_free(pMlmAssocInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1556 | } |
| 1557 | else |
| 1558 | { |
| 1559 | // If its of Reassociation Request, then post LIM_MLM_REASSOC_IND |
| 1560 | temp = sizeof(tLimMlmReassocInd); |
| 1561 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1562 | pMlmReassocInd = vos_mem_malloc(temp); |
| 1563 | if (NULL == pMlmReassocInd) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1564 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1565 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for " |
| 1566 | "pMlmReassocInd")); |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 1567 | limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1568 | return; |
| 1569 | } |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1570 | vos_mem_set(pMlmReassocInd, temp, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1571 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1572 | vos_mem_copy((tANI_U8 *) pMlmReassocInd->peerMacAddr, |
| 1573 | (tANI_U8 *)pStaDs->staAddr, sizeof(tSirMacAddr)); |
| 1574 | vos_mem_copy((tANI_U8 *) pMlmReassocInd->currentApAddr, |
| 1575 | (tANI_U8 *)&(pAssocReq->currentApAddr), sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1576 | pMlmReassocInd->aid = pStaDs->assocId; |
| 1577 | pMlmReassocInd->authType = pStaDs->mlmStaContext.authType; |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1578 | vos_mem_copy((tANI_U8 *)&pMlmReassocInd->ssId, |
| 1579 | (tANI_U8 *)&(pAssocReq->ssId), pAssocReq->ssId.length + 1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1580 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1581 | if (pAssocReq->propIEinfo.aniIndicator) |
| 1582 | pStaDs->aniPeer = 1; |
| 1583 | |
| 1584 | pMlmReassocInd->capabilityInfo = pAssocReq->capabilityInfo; |
| 1585 | pMlmReassocInd->rsnIE.length = 0; |
| 1586 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1587 | if (pAssocReq->addIEPresent && pAssocReq->addIE.length ) |
| 1588 | wpsIe = limGetWscIEPtr(pMac, pAssocReq->addIE.addIEdata, pAssocReq->addIE.length); |
| 1589 | |
| 1590 | if (pAssocReq->rsnPresent && (NULL == wpsIe)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1591 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1592 | limLog(pMac, LOG2, FL("Assoc Req: RSN IE length = %d"), |
| 1593 | pAssocReq->rsn.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1594 | pMlmReassocInd->rsnIE.length = 2 + pAssocReq->rsn.length; |
| 1595 | pMlmReassocInd->rsnIE.rsnIEdata[0] = SIR_MAC_RSN_EID; |
| 1596 | pMlmReassocInd->rsnIE.rsnIEdata[1] = pAssocReq->rsn.length; |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1597 | vos_mem_copy(&pMlmReassocInd->rsnIE.rsnIEdata[2], |
| 1598 | pAssocReq->rsn.info, pAssocReq->rsn.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1599 | } |
| 1600 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1601 | // 802.11h support |
| 1602 | if (pAssocReq->powerCapabilityPresent && pAssocReq->supportedChannelsPresent) |
| 1603 | { |
| 1604 | pMlmReassocInd->spectrumMgtIndicator = eSIR_TRUE; |
| 1605 | pMlmReassocInd->powerCap.minTxPower = pAssocReq->powerCapability.minTxPower; |
| 1606 | pMlmReassocInd->powerCap.maxTxPower = pAssocReq->powerCapability.maxTxPower; |
| 1607 | pMlmReassocInd->supportedChannels.numChnl = (tANI_U8)(pAssocReq->supportedChannels.length / 2); |
| 1608 | |
| 1609 | limLog(pMac, LOG1, |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1610 | FL("Sending Reassoc Ind: spectrum ON, minPwr %d, " |
| 1611 | "maxPwr %d, numChnl %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1612 | pMlmReassocInd->powerCap.minTxPower, |
| 1613 | pMlmReassocInd->powerCap.maxTxPower, |
| 1614 | pMlmReassocInd->supportedChannels.numChnl); |
| 1615 | |
| 1616 | for(i=0; i < pMlmReassocInd->supportedChannels.numChnl; i++) |
| 1617 | { |
| 1618 | pMlmReassocInd->supportedChannels.channelList[i] = pAssocReq->supportedChannels.supportedChannels[j]; |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1619 | limLog(pMac, LOG1, FL("Sending ReassocInd: chn[%d] = %d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1620 | i, pMlmReassocInd->supportedChannels.channelList[i]); |
| 1621 | j+=2; |
| 1622 | } |
| 1623 | } |
| 1624 | else |
| 1625 | pMlmReassocInd->spectrumMgtIndicator = eSIR_FALSE; |
| 1626 | |
| 1627 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1628 | /* This check is to avoid extra Sec IEs present incase of WPS */ |
| 1629 | if (pAssocReq->wpaPresent && (NULL == wpsIe)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1630 | { |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1631 | limLog(pMac, LOG2, FL("Received WPA IE length in Assoc Req is %d"), |
| 1632 | pAssocReq->wpa.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1633 | pMlmReassocInd->rsnIE.rsnIEdata[pMlmReassocInd->rsnIE.length] = SIR_MAC_WPA_EID; |
| 1634 | pMlmReassocInd->rsnIE.rsnIEdata[pMlmReassocInd->rsnIE.length + 1] = pAssocReq->wpa.length; |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1635 | vos_mem_copy(&pMlmReassocInd->rsnIE.rsnIEdata[pMlmReassocInd->rsnIE.length + 2], |
| 1636 | pAssocReq->wpa.info, |
| 1637 | pAssocReq->wpa.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1638 | pMlmReassocInd->rsnIE.length += 2 + pAssocReq->wpa.length; |
| 1639 | } |
| 1640 | |
| 1641 | pMlmReassocInd->addIE.length = 0; |
| 1642 | if (pAssocReq->addIEPresent) |
| 1643 | { |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1644 | vos_mem_copy(&pMlmReassocInd->addIE.addIEdata, |
| 1645 | pAssocReq->addIE.addIEdata, |
| 1646 | pAssocReq->addIE.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1647 | |
| 1648 | pMlmReassocInd->addIE.length = pAssocReq->addIE.length; |
| 1649 | } |
| 1650 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1651 | if(pAssocReq->wmeInfoPresent) |
| 1652 | { |
| 1653 | |
| 1654 | if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WME_ENABLED, &tmp) != eSIR_SUCCESS) |
Abhishek Singh | 5170f9c | 2013-12-18 16:55:22 +0530 | [diff] [blame] | 1655 | limLog(pMac, LOGP, FL("wlan_cfgGetInt failed for id %d"), |
| 1656 | WNI_CFG_WME_ENABLED ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1657 | |
| 1658 | /* check whether AP is enabled with WMM */ |
| 1659 | if(tmp) |
| 1660 | { |
| 1661 | pMlmReassocInd->WmmStaInfoPresent = 1; |
| 1662 | } |
| 1663 | else |
| 1664 | { |
| 1665 | pMlmReassocInd->WmmStaInfoPresent = 0; |
| 1666 | } |
| 1667 | /* Note: we are not rejecting Re-association here because IOT will fail */ |
| 1668 | |
| 1669 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1670 | |
| 1671 | // Required for indicating the frames to upper layer |
| 1672 | pMlmReassocInd->assocReqLength = pAssocReq->assocReqFrameLength; |
| 1673 | pMlmReassocInd->assocReqPtr = pAssocReq->assocReqFrame; |
| 1674 | |
| 1675 | pMlmReassocInd->beaconPtr = psessionEntry->beacon; |
| 1676 | pMlmReassocInd->beaconLength = psessionEntry->bcnLen; |
| 1677 | |
| 1678 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_IND, (tANI_U32 *) pMlmReassocInd); |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1679 | vos_mem_free(pMlmReassocInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1680 | } |
| 1681 | |
| 1682 | return; |
| 1683 | |
| 1684 | } /*** end limSendMlmAssocInd() ***/ |