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