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