Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Paul Zhang | c3fc0a8 | 2018-01-09 16:38:20 +0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 19 | /**========================================================================= |
| 20 | |
| 21 | \brief implementation for PE 11r VoWiFi FT Protocol |
| 22 | |
| 23 | ========================================================================*/ |
| 24 | |
| 25 | /* $Header$ */ |
| 26 | |
| 27 | /*-------------------------------------------------------------------------- |
| 28 | Include Files |
| 29 | ------------------------------------------------------------------------*/ |
| 30 | #include <lim_send_messages.h> |
| 31 | #include <lim_types.h> |
| 32 | #include <lim_ft.h> |
| 33 | #include <lim_ft_defs.h> |
| 34 | #include <lim_utils.h> |
| 35 | #include <lim_prop_exts_utils.h> |
| 36 | #include <lim_assoc_utils.h> |
| 37 | #include <lim_session.h> |
| 38 | #include <lim_admit_control.h> |
| 39 | #include "wmm_apsd.h" |
Deepak Dhamdhere | d97bfb3 | 2015-10-11 15:16:18 -0700 | [diff] [blame] | 40 | #include "wma.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 41 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 42 | extern void lim_send_set_sta_key_req(struct mac_context *mac, |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 43 | tLimMlmSetKeysReq * pMlmSetKeysReq, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 44 | uint16_t staIdx, |
| 45 | uint8_t defWEPIdx, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 46 | struct pe_session *pe_session, bool sendRsp); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 47 | |
| 48 | /*-------------------------------------------------------------------------- |
| 49 | Initialize the FT variables. |
| 50 | ------------------------------------------------------------------------*/ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 51 | void lim_ft_open(struct mac_context *mac, struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 52 | { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 53 | if (pe_session) |
| 54 | qdf_mem_set(&pe_session->ftPEContext, sizeof(tftPEContext), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 55 | 0); |
| 56 | } |
| 57 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 58 | void lim_ft_cleanup_all_ft_sessions(struct mac_context *mac) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 59 | { |
| 60 | /* Wrapper function to cleanup all FT sessions */ |
| 61 | int i; |
| 62 | |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 63 | for (i = 0; i < mac->lim.maxBssId; i++) { |
| 64 | if (true == mac->lim.gpSession[i].valid) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 65 | /* The session is valid, may have FT data */ |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 66 | lim_ft_cleanup(mac, &mac->lim.gpSession[i]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 71 | void lim_ft_cleanup(struct mac_context *mac, struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 72 | { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 73 | if (NULL == pe_session) { |
| 74 | pe_err("pe_session is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 75 | return; |
| 76 | } |
| 77 | |
| 78 | /* Nothing to be done if the session is not in STA mode */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 79 | if (!LIM_IS_STA_ROLE(pe_session)) { |
| 80 | pe_err("pe_session is not in STA mode"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 81 | return; |
| 82 | } |
| 83 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 84 | if (NULL != pe_session->ftPEContext.pFTPreAuthReq) { |
Jeff Johnson | 11bd4f3 | 2017-09-18 08:15:17 -0700 | [diff] [blame] | 85 | pe_debug("Freeing pFTPreAuthReq: %pK", |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 86 | pe_session->ftPEContext.pFTPreAuthReq); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 87 | if (NULL != |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 88 | pe_session->ftPEContext.pFTPreAuthReq-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 89 | pbssDescription) { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 90 | qdf_mem_free(pe_session->ftPEContext.pFTPreAuthReq-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 91 | pbssDescription); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 92 | pe_session->ftPEContext.pFTPreAuthReq-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 93 | pbssDescription = NULL; |
| 94 | } |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 95 | qdf_mem_free(pe_session->ftPEContext.pFTPreAuthReq); |
| 96 | pe_session->ftPEContext.pFTPreAuthReq = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 97 | } |
| 98 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 99 | if (pe_session->ftPEContext.pAddBssReq) { |
| 100 | qdf_mem_free(pe_session->ftPEContext.pAddBssReq); |
| 101 | pe_session->ftPEContext.pAddBssReq = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 102 | } |
| 103 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 104 | if (pe_session->ftPEContext.pAddStaReq) { |
| 105 | qdf_mem_free(pe_session->ftPEContext.pAddStaReq); |
| 106 | pe_session->ftPEContext.pAddStaReq = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | /* The session is being deleted, cleanup the contents */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 110 | qdf_mem_set(&pe_session->ftPEContext, sizeof(tftPEContext), 0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 111 | } |
| 112 | |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 113 | #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 114 | /*------------------------------------------------------------------ |
| 115 | * |
| 116 | * Create the new Add Bss Req to the new AP. |
| 117 | * This will be used when we are ready to FT to the new AP. |
| 118 | * The newly created ft Session entry is passed to this function |
| 119 | * |
| 120 | *------------------------------------------------------------------*/ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 121 | void lim_ft_prepare_add_bss_req(struct mac_context *mac, |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 122 | uint8_t updateEntry, struct pe_session *ft_session, |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 123 | tpSirBssDescription bssDescription) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 124 | { |
| 125 | tpAddBssParams pAddBssParams = NULL; |
| 126 | tAddStaParams *sta_ctx; |
| 127 | uint8_t chanWidthSupp = 0; |
| 128 | tSchBeaconStruct *pBeaconStruct; |
| 129 | |
| 130 | /* Nothing to be done if the session is not in STA mode */ |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 131 | if (!LIM_IS_STA_ROLE(ft_session)) { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 132 | pe_err("pe_session is not in STA mode"); |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 133 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 134 | } |
| 135 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 136 | pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 137 | if (!pBeaconStruct) |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 138 | return; |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 139 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 140 | /* Package SIR_HAL_ADD_BSS_REQ message parameters */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 141 | pAddBssParams = qdf_mem_malloc(sizeof(tAddBssParams)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 142 | if (!pAddBssParams) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 143 | qdf_mem_free(pBeaconStruct); |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 144 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 145 | } |
| 146 | |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 147 | lim_extract_ap_capabilities(mac, (uint8_t *) bssDescription->ieFields, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 148 | lim_get_ielen_from_bss_description(bssDescription), |
| 149 | pBeaconStruct); |
| 150 | |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 151 | if (mac->lim.gLimProtectionControl != |
Pragaspathi Thilagaraj | 1ee7600 | 2018-09-18 21:38:51 +0530 | [diff] [blame] | 152 | MLME_FORCE_POLICY_PROTECTION_DISABLE) |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 153 | lim_decide_sta_protection_on_assoc(mac, pBeaconStruct, |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 154 | ft_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 155 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 156 | qdf_mem_copy(pAddBssParams->bssId, bssDescription->bssId, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 157 | sizeof(tSirMacAddr)); |
| 158 | |
| 159 | /* Fill in tAddBssParams selfMacAddr */ |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 160 | qdf_mem_copy(pAddBssParams->selfMacAddr, ft_session->selfMacAddr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 161 | sizeof(tSirMacAddr)); |
| 162 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 163 | pAddBssParams->bssType = ft_session->bssType; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 164 | pAddBssParams->operMode = BSS_OPERATIONAL_MODE_STA; |
| 165 | |
| 166 | pAddBssParams->beaconInterval = bssDescription->beaconInterval; |
| 167 | |
| 168 | pAddBssParams->dtimPeriod = pBeaconStruct->tim.dtimPeriod; |
| 169 | pAddBssParams->updateBss = updateEntry; |
| 170 | |
| 171 | pAddBssParams->reassocReq = true; |
| 172 | |
| 173 | pAddBssParams->cfParamSet.cfpCount = pBeaconStruct->cfParamSet.cfpCount; |
| 174 | pAddBssParams->cfParamSet.cfpPeriod = |
| 175 | pBeaconStruct->cfParamSet.cfpPeriod; |
| 176 | pAddBssParams->cfParamSet.cfpMaxDuration = |
| 177 | pBeaconStruct->cfParamSet.cfpMaxDuration; |
| 178 | pAddBssParams->cfParamSet.cfpDurRemaining = |
| 179 | pBeaconStruct->cfParamSet.cfpDurRemaining; |
| 180 | |
| 181 | pAddBssParams->rateSet.numRates = |
| 182 | pBeaconStruct->supportedRates.numRates; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 183 | qdf_mem_copy(pAddBssParams->rateSet.rate, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 184 | pBeaconStruct->supportedRates.rate, |
| 185 | pBeaconStruct->supportedRates.numRates); |
| 186 | |
| 187 | pAddBssParams->nwType = bssDescription->nwType; |
| 188 | |
| 189 | pAddBssParams->shortSlotTimeSupported = |
| 190 | (uint8_t) pBeaconStruct->capabilityInfo.shortSlotTime; |
| 191 | pAddBssParams->llaCoexist = |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 192 | (uint8_t) ft_session->beaconParams.llaCoexist; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 193 | pAddBssParams->llbCoexist = |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 194 | (uint8_t) ft_session->beaconParams.llbCoexist; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 195 | pAddBssParams->llgCoexist = |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 196 | (uint8_t) ft_session->beaconParams.llgCoexist; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 197 | pAddBssParams->ht20Coexist = |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 198 | (uint8_t) ft_session->beaconParams.ht20Coexist; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 199 | #ifdef WLAN_FEATURE_11W |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 200 | pAddBssParams->rmfEnabled = ft_session->limRmfEnabled; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 201 | #endif |
| 202 | |
| 203 | /* Use the advertised capabilities from the received beacon/PR */ |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 204 | if (IS_DOT11_MODE_HT(ft_session->dot11mode) && |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 205 | (pBeaconStruct->HTCaps.present)) { |
| 206 | pAddBssParams->htCapable = pBeaconStruct->HTCaps.present; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 207 | qdf_mem_copy(&pAddBssParams->staContext.capab_info, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 208 | &pBeaconStruct->capabilityInfo, |
| 209 | sizeof(pAddBssParams->staContext.capab_info)); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 210 | qdf_mem_copy(&pAddBssParams->staContext.ht_caps, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 211 | (uint8_t *) &pBeaconStruct->HTCaps + |
| 212 | sizeof(uint8_t), |
| 213 | sizeof(pAddBssParams->staContext.ht_caps)); |
| 214 | |
| 215 | if (pBeaconStruct->HTInfo.present) { |
| 216 | pAddBssParams->htOperMode = |
| 217 | (tSirMacHTOperatingMode) pBeaconStruct->HTInfo. |
| 218 | opMode; |
| 219 | pAddBssParams->dualCTSProtection = |
| 220 | (uint8_t) pBeaconStruct->HTInfo.dualCTSProtection; |
| 221 | |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 222 | chanWidthSupp = lim_get_ht_capability(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 223 | eHT_SUPPORTED_CHANNEL_WIDTH_SET, |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 224 | ft_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 225 | if ((pBeaconStruct->HTCaps.supportedChannelWidthSet) && |
| 226 | (chanWidthSupp)) { |
| 227 | pAddBssParams->ch_width = (uint8_t) |
| 228 | pBeaconStruct->HTInfo.recommendedTxWidthSet; |
| 229 | if (pBeaconStruct->HTInfo.secondaryChannelOffset == |
| 230 | PHY_DOUBLE_CHANNEL_LOW_PRIMARY) |
| 231 | pAddBssParams->ch_center_freq_seg0 = |
| 232 | bssDescription->channelId + 2; |
| 233 | else if (pBeaconStruct->HTInfo.secondaryChannelOffset == |
| 234 | PHY_DOUBLE_CHANNEL_HIGH_PRIMARY) |
| 235 | pAddBssParams->ch_center_freq_seg0 = |
| 236 | bssDescription->channelId - 2; |
| 237 | } else { |
| 238 | pAddBssParams->ch_width = CH_WIDTH_20MHZ; |
| 239 | pAddBssParams->ch_center_freq_seg0 = 0; |
| 240 | } |
| 241 | pAddBssParams->llnNonGFCoexist = |
| 242 | (uint8_t) pBeaconStruct->HTInfo.nonGFDevicesPresent; |
| 243 | pAddBssParams->fLsigTXOPProtectionFullSupport = |
| 244 | (uint8_t) pBeaconStruct->HTInfo. |
| 245 | lsigTXOPProtectionFullSupport; |
| 246 | pAddBssParams->fRIFSMode = |
| 247 | pBeaconStruct->HTInfo.rifsMode; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | pAddBssParams->currentOperChannel = bssDescription->channelId; |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 252 | ft_session->htSecondaryChannelOffset = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 253 | pBeaconStruct->HTInfo.secondaryChannelOffset; |
| 254 | sta_ctx = &pAddBssParams->staContext; |
| 255 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 256 | if (ft_session->vhtCapability && |
| 257 | ft_session->vhtCapabilityPresentInBeacon) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 258 | pAddBssParams->vhtCapable = pBeaconStruct->VHTCaps.present; |
| 259 | if (pBeaconStruct->VHTOperation.chanWidth && chanWidthSupp) { |
| 260 | pAddBssParams->ch_width = |
| 261 | pBeaconStruct->VHTOperation.chanWidth + 1; |
| 262 | pAddBssParams->ch_center_freq_seg0 = |
| 263 | pBeaconStruct->VHTOperation.chanCenterFreqSeg1; |
| 264 | pAddBssParams->ch_center_freq_seg1 = |
| 265 | pBeaconStruct->VHTOperation.chanCenterFreqSeg2; |
| 266 | } |
| 267 | pAddBssParams->staContext.vht_caps = |
| 268 | ((pBeaconStruct->VHTCaps.maxMPDULen << |
| 269 | SIR_MAC_VHT_CAP_MAX_MPDU_LEN) | |
| 270 | (pBeaconStruct->VHTCaps.supportedChannelWidthSet << |
| 271 | SIR_MAC_VHT_CAP_SUPP_CH_WIDTH_SET) | |
| 272 | (pBeaconStruct->VHTCaps.ldpcCodingCap << |
| 273 | SIR_MAC_VHT_CAP_LDPC_CODING_CAP) | |
| 274 | (pBeaconStruct->VHTCaps.shortGI80MHz << |
| 275 | SIR_MAC_VHT_CAP_SHORTGI_80MHZ) | |
| 276 | (pBeaconStruct->VHTCaps.shortGI160and80plus80MHz << |
| 277 | SIR_MAC_VHT_CAP_SHORTGI_160_80_80MHZ) | |
| 278 | (pBeaconStruct->VHTCaps.txSTBC << |
| 279 | SIR_MAC_VHT_CAP_TXSTBC) | |
| 280 | (pBeaconStruct->VHTCaps.rxSTBC << |
| 281 | SIR_MAC_VHT_CAP_RXSTBC) | |
| 282 | (pBeaconStruct->VHTCaps.suBeamFormerCap << |
| 283 | SIR_MAC_VHT_CAP_SU_BEAMFORMER_CAP) | |
| 284 | (pBeaconStruct->VHTCaps.suBeamformeeCap << |
| 285 | SIR_MAC_VHT_CAP_SU_BEAMFORMEE_CAP) | |
| 286 | (pBeaconStruct->VHTCaps.csnofBeamformerAntSup << |
| 287 | SIR_MAC_VHT_CAP_CSN_BEAMORMER_ANT_SUP) | |
| 288 | (pBeaconStruct->VHTCaps.numSoundingDim << |
| 289 | SIR_MAC_VHT_CAP_NUM_SOUNDING_DIM) | |
| 290 | (pBeaconStruct->VHTCaps.muBeamformerCap << |
| 291 | SIR_MAC_VHT_CAP_NUM_BEAM_FORMER_CAP) | |
| 292 | (pBeaconStruct->VHTCaps.muBeamformeeCap << |
| 293 | SIR_MAC_VHT_CAP_NUM_BEAM_FORMEE_CAP) | |
| 294 | (pBeaconStruct->VHTCaps.vhtTXOPPS << |
| 295 | SIR_MAC_VHT_CAP_TXOPPS) | |
| 296 | (pBeaconStruct->VHTCaps.htcVHTCap << |
| 297 | SIR_MAC_VHT_CAP_HTC_CAP) | |
| 298 | (pBeaconStruct->VHTCaps.maxAMPDULenExp << |
| 299 | SIR_MAC_VHT_CAP_MAX_AMDU_LEN_EXPO) | |
| 300 | (pBeaconStruct->VHTCaps.vhtLinkAdaptCap << |
| 301 | SIR_MAC_VHT_CAP_LINK_ADAPT_CAP) | |
| 302 | (pBeaconStruct->VHTCaps.rxAntPattern << |
| 303 | SIR_MAC_VHT_CAP_RX_ANTENNA_PATTERN) | |
| 304 | (pBeaconStruct->VHTCaps.txAntPattern << |
| 305 | SIR_MAC_VHT_CAP_TX_ANTENNA_PATTERN) | |
| 306 | (pBeaconStruct->VHTCaps.reserved1 << |
| 307 | SIR_MAC_VHT_CAP_RESERVED2)); |
| 308 | } else { |
| 309 | pAddBssParams->vhtCapable = 0; |
| 310 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 311 | |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 312 | pe_debug("SIR_HAL_ADD_BSS_REQ with channel: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 313 | pAddBssParams->currentOperChannel); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 314 | |
| 315 | /* Populate the STA-related parameters here */ |
| 316 | /* Note that the STA here refers to the AP */ |
| 317 | { |
| 318 | pAddBssParams->staContext.staType = STA_ENTRY_OTHER; |
| 319 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 320 | qdf_mem_copy(pAddBssParams->staContext.bssId, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 321 | bssDescription->bssId, sizeof(tSirMacAddr)); |
| 322 | pAddBssParams->staContext.listenInterval = |
| 323 | bssDescription->beaconInterval; |
| 324 | |
| 325 | pAddBssParams->staContext.assocId = 0; |
| 326 | pAddBssParams->staContext.uAPSD = 0; |
| 327 | pAddBssParams->staContext.maxSPLen = 0; |
| 328 | pAddBssParams->staContext.shortPreambleSupported = |
| 329 | (uint8_t) pBeaconStruct->capabilityInfo.shortPreamble; |
| 330 | pAddBssParams->staContext.updateSta = updateEntry; |
| 331 | pAddBssParams->staContext.encryptType = |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 332 | ft_session->encryptType; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 333 | #ifdef WLAN_FEATURE_11W |
| 334 | pAddBssParams->staContext.rmfEnabled = |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 335 | ft_session->limRmfEnabled; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 336 | #endif |
| 337 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 338 | if (IS_DOT11_MODE_HT(ft_session->dot11mode) && |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 339 | (pBeaconStruct->HTCaps.present)) { |
| 340 | pAddBssParams->staContext.us32MaxAmpduDuration = 0; |
| 341 | pAddBssParams->staContext.htCapable = 1; |
| 342 | pAddBssParams->staContext.greenFieldCapable = |
| 343 | (uint8_t) pBeaconStruct->HTCaps.greenField; |
| 344 | pAddBssParams->staContext.lsigTxopProtection = |
| 345 | (uint8_t) pBeaconStruct->HTCaps.lsigTXOPProtection; |
| 346 | if ((pBeaconStruct->HTCaps.supportedChannelWidthSet) && |
| 347 | (chanWidthSupp)) { |
| 348 | pAddBssParams->staContext.ch_width = (uint8_t) |
| 349 | pBeaconStruct->HTInfo.recommendedTxWidthSet; |
| 350 | } else { |
| 351 | pAddBssParams->staContext.ch_width = |
| 352 | CH_WIDTH_20MHZ; |
| 353 | } |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 354 | if (ft_session->vhtCapability && |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 355 | IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps)) { |
| 356 | pAddBssParams->staContext.vhtCapable = 1; |
| 357 | if ((pBeaconStruct->VHTCaps.suBeamFormerCap || |
| 358 | pBeaconStruct->VHTCaps.muBeamformerCap) && |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 359 | ft_session->vht_config.su_beam_formee) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 360 | sta_ctx->vhtTxBFCapable |
| 361 | = 1; |
| 362 | if (pBeaconStruct->VHTCaps.suBeamformeeCap && |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 363 | ft_session->vht_config.su_beam_former) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 364 | sta_ctx->enable_su_tx_bformer = 1; |
| 365 | } |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 366 | if (lim_is_session_he_capable(ft_session) && |
Naveen Rawat | d8feac1 | 2017-09-08 15:08:39 -0700 | [diff] [blame] | 367 | pBeaconStruct->he_cap.present) |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 368 | lim_intersect_ap_he_caps(ft_session, |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 369 | pAddBssParams, pBeaconStruct, NULL); |
| 370 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 371 | if ((pBeaconStruct->HTCaps.supportedChannelWidthSet) && |
| 372 | (chanWidthSupp)) { |
| 373 | sta_ctx->ch_width = (uint8_t) |
| 374 | pBeaconStruct->HTInfo.recommendedTxWidthSet; |
| 375 | if (pAddBssParams->staContext.vhtCapable && |
| 376 | pBeaconStruct->VHTOperation.chanWidth) |
| 377 | sta_ctx->ch_width = |
| 378 | pBeaconStruct->VHTOperation.chanWidth |
| 379 | + 1; |
| 380 | } else { |
| 381 | pAddBssParams->staContext.ch_width = |
| 382 | CH_WIDTH_20MHZ; |
| 383 | } |
| 384 | pAddBssParams->staContext.mimoPS = |
| 385 | (tSirMacHTMIMOPowerSaveState) pBeaconStruct->HTCaps. |
| 386 | mimoPowerSave; |
| 387 | pAddBssParams->staContext.maxAmsduSize = |
| 388 | (uint8_t) pBeaconStruct->HTCaps.maximalAMSDUsize; |
| 389 | pAddBssParams->staContext.maxAmpduDensity = |
| 390 | pBeaconStruct->HTCaps.mpduDensity; |
| 391 | pAddBssParams->staContext.fDsssCckMode40Mhz = |
| 392 | (uint8_t) pBeaconStruct->HTCaps.dsssCckMode40MHz; |
| 393 | pAddBssParams->staContext.fShortGI20Mhz = |
| 394 | (uint8_t) pBeaconStruct->HTCaps.shortGI20MHz; |
| 395 | pAddBssParams->staContext.fShortGI40Mhz = |
| 396 | (uint8_t) pBeaconStruct->HTCaps.shortGI40MHz; |
| 397 | pAddBssParams->staContext.maxAmpduSize = |
| 398 | pBeaconStruct->HTCaps.maxRxAMPDUFactor; |
| 399 | |
| 400 | if (pBeaconStruct->HTInfo.present) |
| 401 | pAddBssParams->staContext.rifsMode = |
| 402 | pBeaconStruct->HTInfo.rifsMode; |
| 403 | } |
| 404 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 405 | if ((ft_session->limWmeEnabled |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 406 | && pBeaconStruct->wmeEdcaPresent) |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 407 | || (ft_session->limQosEnabled |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | && pBeaconStruct->edcaPresent)) |
| 409 | pAddBssParams->staContext.wmmEnabled = 1; |
| 410 | else |
| 411 | pAddBssParams->staContext.wmmEnabled = 0; |
| 412 | |
| 413 | pAddBssParams->staContext.wpa_rsn = pBeaconStruct->rsnPresent; |
| 414 | /* For OSEN Connection AP does not advertise RSN or WPA IE |
| 415 | * so from the IEs we get from supplicant we get this info |
| 416 | * so for FW to transmit EAPOL message 4 we shall set |
| 417 | * wpa_rsn |
| 418 | */ |
| 419 | pAddBssParams->staContext.wpa_rsn |= |
| 420 | (pBeaconStruct->wpaPresent << 1); |
| 421 | if ((!pAddBssParams->staContext.wpa_rsn) |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 422 | && (ft_session->isOSENConnection)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 423 | pAddBssParams->staContext.wpa_rsn = 1; |
| 424 | /* Update the rates */ |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 425 | lim_populate_peer_rate_set(mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 426 | &pAddBssParams->staContext. |
| 427 | supportedRates, |
| 428 | pBeaconStruct->HTCaps.supportedMCSSet, |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 429 | false, ft_session, |
Krishna Kumaar Natarajan | d1cd56e | 2016-09-30 08:43:03 -0700 | [diff] [blame] | 430 | &pBeaconStruct->VHTCaps, |
Naveen Rawat | d8feac1 | 2017-09-08 15:08:39 -0700 | [diff] [blame] | 431 | &pBeaconStruct->he_cap); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 432 | } |
| 433 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 434 | pAddBssParams->maxTxPower = ft_session->maxTxPower; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 435 | |
| 436 | #ifdef WLAN_FEATURE_11W |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 437 | if (ft_session->limRmfEnabled) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 438 | pAddBssParams->rmfEnabled = 1; |
| 439 | pAddBssParams->staContext.rmfEnabled = 1; |
| 440 | } |
| 441 | #endif |
| 442 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 443 | pAddBssParams->status = QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 444 | pAddBssParams->respReqd = true; |
| 445 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 446 | pAddBssParams->staContext.sessionId = ft_session->peSessionId; |
| 447 | pAddBssParams->staContext.smesessionId = ft_session->smeSessionId; |
| 448 | pAddBssParams->sessionId = ft_session->peSessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 449 | |
| 450 | /* Set a new state for MLME */ |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 451 | if (!lim_is_roam_synch_in_progress(ft_session)) { |
| 452 | ft_session->limMlmState = |
Varun Reddy Yeturu | d5939f8 | 2015-12-24 18:14:02 -0800 | [diff] [blame] | 453 | eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE; |
| 454 | MTRACE(mac_trace |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 455 | (mac, TRACE_CODE_MLM_STATE, |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 456 | ft_session->peSessionId, |
Varun Reddy Yeturu | d5939f8 | 2015-12-24 18:14:02 -0800 | [diff] [blame] | 457 | eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE)); |
| 458 | } |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 459 | pAddBssParams->halPersona = (uint8_t) ft_session->pePersona; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 460 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 461 | ft_session->ftPEContext.pAddBssReq = pAddBssParams; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 462 | |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 463 | pe_debug("Saving SIR_HAL_ADD_BSS_REQ for pre-auth ap"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 464 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 465 | qdf_mem_free(pBeaconStruct); |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 466 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 467 | } |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 468 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 469 | |
Paul Zhang | c3fc0a8 | 2018-01-09 16:38:20 +0800 | [diff] [blame] | 470 | #if defined(WLAN_FEATURE_ROAM_OFFLOAD) |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 471 | /** |
| 472 | * lim_fill_dot11mode() - to fill 802.11 mode in FT session |
| 473 | * @mac_ctx: pointer to mac ctx |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 474 | * @ft_session: FT session |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 475 | * @pe_session: PE session |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 476 | * |
| 477 | * This API fills FT session's dot11mode either from pe session or |
| 478 | * from CFG depending on the condition. |
| 479 | * |
| 480 | * Return: none |
| 481 | */ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 482 | static void lim_fill_dot11mode(struct mac_context *mac_ctx, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 483 | struct pe_session *ft_session, struct pe_session *pe_session) |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 484 | { |
| 485 | uint32_t self_dot11_mode; |
| 486 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 487 | if (pe_session->ftPEContext.pFTPreAuthReq && |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 488 | !mac_ctx->roam.configParam.isRoamOffloadEnabled) { |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 489 | ft_session->dot11mode = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 490 | pe_session->ftPEContext.pFTPreAuthReq->dot11mode; |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 491 | } else { |
| 492 | wlan_cfg_get_int(mac_ctx, WNI_CFG_DOT11_MODE, &self_dot11_mode); |
| 493 | pe_debug("selfDot11Mode: %d", self_dot11_mode); |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 494 | ft_session->dot11mode = self_dot11_mode; |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 495 | } |
| 496 | } |
Paul Zhang | c3fc0a8 | 2018-01-09 16:38:20 +0800 | [diff] [blame] | 497 | #elif defined(WLAN_FEATURE_HOST_ROAM) |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 498 | /** |
| 499 | * lim_fill_dot11mode() - to fill 802.11 mode in FT session |
| 500 | * @mac_ctx: pointer to mac ctx |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 501 | * @ft_session: FT session |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 502 | * @pe_session: PE session |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 503 | * |
| 504 | * This API fills FT session's dot11mode either from pe session. |
| 505 | * |
| 506 | * Return: none |
| 507 | */ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 508 | static void lim_fill_dot11mode(struct mac_context *mac_ctx, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 509 | struct pe_session *ft_session, struct pe_session *pe_session) |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 510 | { |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 511 | ft_session->dot11mode = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 512 | pe_session->ftPEContext.pFTPreAuthReq->dot11mode; |
Krunal Soni | 4bfecf6 | 2017-06-05 15:26:35 -0700 | [diff] [blame] | 513 | } |
| 514 | #endif |
| 515 | |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 516 | #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 517 | /*------------------------------------------------------------------ |
| 518 | * |
| 519 | * Setup the new session for the pre-auth AP. |
| 520 | * Return the newly created session entry. |
| 521 | * |
| 522 | *------------------------------------------------------------------*/ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 523 | void lim_fill_ft_session(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 524 | tpSirBssDescription pbssDescription, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 525 | struct pe_session *ft_session, struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 526 | { |
| 527 | uint8_t currentBssUapsd; |
Amar Singhal | a297bfa | 2015-10-15 15:07:29 -0700 | [diff] [blame] | 528 | int8_t localPowerConstraint; |
| 529 | int8_t regMax; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 530 | tSchBeaconStruct *pBeaconStruct; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 531 | ePhyChanBondState cbEnabledMode; |
| 532 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 533 | pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 534 | if (!pBeaconStruct) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 535 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 536 | |
Deepak Dhamdhere | 26bda45 | 2016-01-09 22:54:48 -0800 | [diff] [blame] | 537 | /* Retrieve the session that was already created and update the entry */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 538 | ft_session->limWmeEnabled = pe_session->limWmeEnabled; |
| 539 | ft_session->limQosEnabled = pe_session->limQosEnabled; |
| 540 | ft_session->limWsmEnabled = pe_session->limWsmEnabled; |
| 541 | ft_session->lim11hEnable = pe_session->lim11hEnable; |
| 542 | ft_session->isOSENConnection = pe_session->isOSENConnection; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 543 | |
| 544 | /* Fields to be filled later */ |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 545 | ft_session->pLimJoinReq = NULL; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 546 | ft_session->smeSessionId = pe_session->smeSessionId; |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 547 | ft_session->transactionId = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 548 | |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 549 | lim_extract_ap_capabilities(mac, (uint8_t *) pbssDescription->ieFields, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 550 | lim_get_ielen_from_bss_description(pbssDescription), |
| 551 | pBeaconStruct); |
| 552 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 553 | ft_session->rateSet.numRates = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 554 | pBeaconStruct->supportedRates.numRates; |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 555 | qdf_mem_copy(ft_session->rateSet.rate, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 556 | pBeaconStruct->supportedRates.rate, |
| 557 | pBeaconStruct->supportedRates.numRates); |
| 558 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 559 | ft_session->extRateSet.numRates = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 560 | pBeaconStruct->extendedRates.numRates; |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 561 | qdf_mem_copy(ft_session->extRateSet.rate, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 562 | pBeaconStruct->extendedRates.rate, |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 563 | ft_session->extRateSet.numRates); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 564 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 565 | ft_session->ssId.length = pBeaconStruct->ssId.length; |
| 566 | qdf_mem_copy(ft_session->ssId.ssId, pBeaconStruct->ssId.ssId, |
| 567 | ft_session->ssId.length); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 568 | lim_fill_dot11mode(mac, ft_session, pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 569 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 570 | pe_debug("dot11mode: %d", ft_session->dot11mode); |
| 571 | ft_session->vhtCapability = |
| 572 | (IS_DOT11_MODE_VHT(ft_session->dot11mode) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 573 | && IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps)); |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 574 | ft_session->htCapability = |
| 575 | (IS_DOT11_MODE_HT(ft_session->dot11mode) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 576 | && pBeaconStruct->HTCaps.present); |
| 577 | |
| 578 | /* Copy The channel Id to the session Table */ |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 579 | ft_session->limReassocChannelId = pbssDescription->channelId; |
| 580 | ft_session->currentOperChannel = pbssDescription->channelId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 581 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 582 | ft_session->limRFBand = lim_get_rf_band( |
| 583 | ft_session->currentOperChannel); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 584 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 585 | if (ft_session->limRFBand == BAND_2G) { |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 586 | cbEnabledMode = mac->roam.configParam.channelBondingMode24GHz; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 587 | } else { |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 588 | cbEnabledMode = mac->roam.configParam.channelBondingMode5GHz; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 589 | } |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 590 | ft_session->htSupportedChannelWidthSet = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 591 | (pBeaconStruct->HTInfo.present) ? |
| 592 | (cbEnabledMode && pBeaconStruct->HTInfo.recommendedTxWidthSet) : 0; |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 593 | ft_session->htRecommendedTxWidthSet = |
| 594 | ft_session->htSupportedChannelWidthSet; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 595 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 596 | if (IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps) && |
| 597 | pBeaconStruct->VHTOperation.present && |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 598 | ft_session->vhtCapability) { |
| 599 | ft_session->vhtCapabilityPresentInBeacon = 1; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 600 | } else { |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 601 | ft_session->vhtCapabilityPresentInBeacon = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 602 | } |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 603 | if (ft_session->htRecommendedTxWidthSet) { |
| 604 | ft_session->ch_width = CH_WIDTH_40MHZ; |
| 605 | if (ft_session->vhtCapabilityPresentInBeacon && |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 606 | pBeaconStruct->VHTOperation.chanWidth) { |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 607 | ft_session->ch_width = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 608 | pBeaconStruct->VHTOperation.chanWidth + 1; |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 609 | ft_session->ch_center_freq_seg0 = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 610 | pBeaconStruct->VHTOperation.chanCenterFreqSeg1; |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 611 | ft_session->ch_center_freq_seg1 = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 612 | pBeaconStruct->VHTOperation.chanCenterFreqSeg2; |
| 613 | } else { |
| 614 | if (pBeaconStruct->HTInfo.secondaryChannelOffset == |
| 615 | PHY_DOUBLE_CHANNEL_LOW_PRIMARY) |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 616 | ft_session->ch_center_freq_seg0 = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 617 | pbssDescription->channelId + 2; |
| 618 | else if (pBeaconStruct->HTInfo.secondaryChannelOffset == |
| 619 | PHY_DOUBLE_CHANNEL_HIGH_PRIMARY) |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 620 | ft_session->ch_center_freq_seg0 = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 621 | pbssDescription->channelId - 2; |
| 622 | else |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 623 | pe_warn("Invalid sec ch offset"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 624 | } |
| 625 | } else { |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 626 | ft_session->ch_width = CH_WIDTH_20MHZ; |
| 627 | ft_session->ch_center_freq_seg0 = 0; |
| 628 | ft_session->ch_center_freq_seg1 = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 629 | } |
| 630 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 631 | sir_copy_mac_addr(ft_session->selfMacAddr, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 632 | pe_session->selfMacAddr); |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 633 | sir_copy_mac_addr(ft_session->limReAssocbssId, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 634 | pbssDescription->bssId); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 635 | sir_copy_mac_addr(ft_session->prev_ap_bssid, pe_session->bssId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 636 | |
| 637 | /* Store beaconInterval */ |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 638 | ft_session->beaconParams.beaconInterval = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 639 | pbssDescription->beaconInterval; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 640 | ft_session->bssType = pe_session->bssType; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 641 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 642 | ft_session->statypeForBss = STA_ENTRY_PEER; |
| 643 | ft_session->nwType = pbssDescription->nwType; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 644 | |
| 645 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 646 | if (ft_session->bssType == eSIR_INFRASTRUCTURE_MODE) { |
| 647 | ft_session->limSystemRole = eLIM_STA_ROLE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 648 | } else { |
Rajeev Kumar | 005895d | 2016-04-15 14:17:47 -0700 | [diff] [blame] | 649 | /* Throw an error & return & make sure to delete the session */ |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 650 | pe_warn("Invalid bss type"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 651 | } |
| 652 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 653 | ft_session->limCurrentBssCaps = pbssDescription->capabilityInfo; |
| 654 | ft_session->limReassocBssCaps = pbssDescription->capabilityInfo; |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 655 | if (mac->mlme_cfg->ht_caps.short_slot_time_enabled && |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 656 | SIR_MAC_GET_SHORT_SLOT_TIME(ft_session->limReassocBssCaps)) { |
| 657 | ft_session->shortSlotTimeSupported = true; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 658 | } |
| 659 | |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 660 | regMax = cfg_get_regulatory_max_transmit_power(mac, |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 661 | ft_session-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 662 | currentOperChannel); |
| 663 | localPowerConstraint = regMax; |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 664 | lim_extract_ap_capability(mac, (uint8_t *) pbssDescription->ieFields, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 665 | lim_get_ielen_from_bss_description(pbssDescription), |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 666 | &ft_session->limCurrentBssQosCaps, |
| 667 | &ft_session->limCurrentBssPropCap, ¤tBssUapsd, |
| 668 | &localPowerConstraint, ft_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 669 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 670 | ft_session->limReassocBssQosCaps = |
| 671 | ft_session->limCurrentBssQosCaps; |
| 672 | ft_session->limReassocBssPropCap = |
| 673 | ft_session->limCurrentBssPropCap; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 674 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 675 | ft_session->is11Rconnection = pe_session->is11Rconnection; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 676 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 677 | ft_session->isESEconnection = pe_session->isESEconnection; |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 678 | ft_session->is_ese_version_ie_present = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 679 | pBeaconStruct->is_ese_ver_ie_present; |
| 680 | #endif |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 681 | ft_session->isFastTransitionEnabled = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 682 | pe_session->isFastTransitionEnabled; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 683 | |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 684 | ft_session->isFastRoamIniFeatureEnabled = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 685 | pe_session->isFastRoamIniFeatureEnabled; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 686 | |
| 687 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 688 | ft_session->maxTxPower = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 689 | lim_get_max_tx_power(regMax, localPowerConstraint, |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 690 | mac->roam.configParam.nTxPowerCap); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 691 | #else |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 692 | ft_session->maxTxPower = QDF_MIN(regMax, (localPowerConstraint)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 693 | #endif |
| 694 | |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 695 | pe_debug("Reg max: %d local pwr: %d, ini tx pwr: %d max tx pwr: %d", |
Deepak Dhamdhere | 26bda45 | 2016-01-09 22:54:48 -0800 | [diff] [blame] | 696 | regMax, localPowerConstraint, |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 697 | mac->roam.configParam.nTxPowerCap, |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 698 | ft_session->maxTxPower); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 699 | if (!lim_is_roam_synch_in_progress(pe_session)) { |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 700 | ft_session->limPrevSmeState = ft_session->limSmeState; |
| 701 | ft_session->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 702 | MTRACE(mac_trace(mac, |
Varun Reddy Yeturu | d5939f8 | 2015-12-24 18:14:02 -0800 | [diff] [blame] | 703 | TRACE_CODE_SME_STATE, |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 704 | ft_session->peSessionId, |
| 705 | ft_session->limSmeState)); |
Varun Reddy Yeturu | d5939f8 | 2015-12-24 18:14:02 -0800 | [diff] [blame] | 706 | } |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 707 | ft_session->encryptType = pe_session->encryptType; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 708 | #ifdef WLAN_FEATURE_11W |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 709 | ft_session->limRmfEnabled = pe_session->limRmfEnabled; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 710 | #endif |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 711 | if ((ft_session->limRFBand == BAND_2G) && |
| 712 | (ft_session->htSupportedChannelWidthSet == |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 713 | eHT_CHANNEL_WIDTH_40MHZ)) |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 714 | lim_init_obss_params(mac, ft_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 715 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 716 | ft_session->enableHtSmps = pe_session->enableHtSmps; |
| 717 | ft_session->htSmpsvalue = pe_session->htSmpsvalue; |
Archana Ramachandran | 5482d6a | 2016-03-29 17:09:22 -0700 | [diff] [blame] | 718 | /* |
| 719 | * By default supported NSS 1x1 is set to true |
| 720 | * and later on updated while determining session |
| 721 | * supported rates which is the intersection of |
| 722 | * self and peer rates |
| 723 | */ |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 724 | ft_session->supported_nss_1x1 = true; |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 725 | pe_debug("FT enable smps: %d mode: %d supported nss 1x1: %d", |
Jeff Johnson | f3408a6 | 2018-12-01 22:47:27 -0800 | [diff] [blame] | 726 | ft_session->enableHtSmps, |
| 727 | ft_session->htSmpsvalue, |
| 728 | ft_session->supported_nss_1x1); |
Archana Ramachandran | 5482d6a | 2016-03-29 17:09:22 -0700 | [diff] [blame] | 729 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 730 | qdf_mem_free(pBeaconStruct); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 731 | } |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 732 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 733 | |
| 734 | /*------------------------------------------------------------------ |
| 735 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 736 | * This function is called to process the update key request from SME |
| 737 | * |
| 738 | *------------------------------------------------------------------*/ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 739 | bool lim_process_ft_update_key(struct mac_context *mac, uint32_t *pMsgBuf) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 740 | { |
| 741 | tAddBssParams *pAddBssParams; |
| 742 | tSirFTUpdateKeyInfo *pKeyInfo; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 743 | struct pe_session *pe_session; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 744 | uint8_t sessionId; |
| 745 | |
| 746 | /* Sanity Check */ |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 747 | if (mac == NULL || pMsgBuf == NULL) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 748 | return false; |
| 749 | } |
| 750 | |
| 751 | pKeyInfo = (tSirFTUpdateKeyInfo *) pMsgBuf; |
| 752 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 753 | pe_session = pe_find_session_by_bssid(mac, pKeyInfo->bssid.bytes, |
Srinivas Girigowda | f9d9dd4 | 2015-12-04 13:53:58 -0800 | [diff] [blame] | 754 | &sessionId); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 755 | if (NULL == pe_session) { |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 756 | pe_err("%s: Unable to find session for the following bssid", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 757 | __func__); |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 758 | lim_print_mac_addr(mac, pKeyInfo->bssid.bytes, LOGE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 759 | return false; |
| 760 | } |
| 761 | |
| 762 | /* Nothing to be done if the session is not in STA mode */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 763 | if (!LIM_IS_STA_ROLE(pe_session)) { |
| 764 | pe_err("pe_session is not in STA mode"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 765 | return false; |
| 766 | } |
| 767 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 768 | if (NULL == pe_session->ftPEContext.pAddBssReq) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 769 | /* AddBss Req is NULL, save the keys to configure them later. */ |
| 770 | tpLimMlmSetKeysReq pMlmSetKeysReq = |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 771 | &pe_session->ftPEContext.PreAuthKeyInfo. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 772 | extSetStaKeyParam; |
| 773 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 774 | qdf_mem_zero(pMlmSetKeysReq, sizeof(tLimMlmSetKeysReq)); |
Anurag Chouhan | c554842 | 2016-02-24 18:33:27 +0530 | [diff] [blame] | 775 | qdf_copy_macaddr(&pMlmSetKeysReq->peer_macaddr, |
Srinivas Girigowda | f9d9dd4 | 2015-12-04 13:53:58 -0800 | [diff] [blame] | 776 | &pKeyInfo->bssid); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 777 | pMlmSetKeysReq->sessionId = pe_session->peSessionId; |
| 778 | pMlmSetKeysReq->smesessionId = pe_session->smeSessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 779 | pMlmSetKeysReq->edType = pKeyInfo->keyMaterial.edType; |
| 780 | pMlmSetKeysReq->numKeys = pKeyInfo->keyMaterial.numKeys; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 781 | qdf_mem_copy((uint8_t *) &pMlmSetKeysReq->key, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 782 | (uint8_t *) &pKeyInfo->keyMaterial.key, |
| 783 | sizeof(tSirKeys)); |
| 784 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 785 | pe_session->ftPEContext.PreAuthKeyInfo. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 786 | extSetStaKeyParamValid = true; |
| 787 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 788 | if (pe_session->ftPEContext.pAddStaReq == NULL) { |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 789 | pe_err("pAddStaReq is NULL"); |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 790 | lim_send_set_sta_key_req(mac, pMlmSetKeysReq, 0, 0, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 791 | pe_session, false); |
| 792 | pe_session->ftPEContext.PreAuthKeyInfo. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 793 | extSetStaKeyParamValid = false; |
| 794 | } |
| 795 | } else { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 796 | pAddBssParams = pe_session->ftPEContext.pAddBssReq; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 797 | |
| 798 | /* Store the key information in the ADD BSS parameters */ |
| 799 | pAddBssParams->extSetStaKeyParamValid = 1; |
| 800 | pAddBssParams->extSetStaKeyParam.encType = |
| 801 | pKeyInfo->keyMaterial.edType; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 802 | qdf_mem_copy((uint8_t *) &pAddBssParams->extSetStaKeyParam.key, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 803 | (uint8_t *) &pKeyInfo->keyMaterial.key, |
| 804 | sizeof(tSirKeys)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 805 | |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 806 | pAddBssParams->extSetStaKeyParam.singleTidRc = |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 807 | (uint8_t)mac->mlme_cfg->sta.single_tid; |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 808 | pe_debug("Key valid: %d keyLength: %d", |
Nishank Aggarwal | abfd70b | 2017-03-11 16:48:25 +0530 | [diff] [blame] | 809 | pAddBssParams->extSetStaKeyParamValid, |
| 810 | pAddBssParams->extSetStaKeyParam.key[0].keyLength); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 811 | |
| 812 | pAddBssParams->extSetStaKeyParam.staIdx = 0; |
| 813 | |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 814 | pe_debug("BSSID: " MAC_ADDRESS_STR, |
Nishank Aggarwal | abfd70b | 2017-03-11 16:48:25 +0530 | [diff] [blame] | 815 | MAC_ADDR_ARRAY(pKeyInfo->bssid.bytes)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 816 | |
Anurag Chouhan | c554842 | 2016-02-24 18:33:27 +0530 | [diff] [blame] | 817 | qdf_copy_macaddr(&pAddBssParams->extSetStaKeyParam.peer_macaddr, |
Srinivas Girigowda | f9d9dd4 | 2015-12-04 13:53:58 -0800 | [diff] [blame] | 818 | &pKeyInfo->bssid); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 819 | |
| 820 | pAddBssParams->extSetStaKeyParam.sendRsp = false; |
| 821 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 822 | } |
| 823 | return true; |
| 824 | } |
| 825 | |
Jeff Johnson | 4f9d4a2 | 2016-10-06 18:45:15 -0700 | [diff] [blame] | 826 | static void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 827 | lim_ft_send_aggr_qos_rsp(struct mac_context *mac, uint8_t rspReqd, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 828 | tpAggrAddTsParams aggrQosRsp, uint8_t smesessionId) |
| 829 | { |
| 830 | tpSirAggrQosRsp rsp; |
| 831 | int i = 0; |
Srinivas Girigowda | 4d65ebe | 2017-10-13 21:41:42 -0700 | [diff] [blame] | 832 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 833 | if (!rspReqd) { |
| 834 | return; |
| 835 | } |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 836 | rsp = qdf_mem_malloc(sizeof(tSirAggrQosRsp)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 837 | if (!rsp) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 838 | return; |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 839 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 840 | rsp->messageType = eWNI_SME_FT_AGGR_QOS_RSP; |
| 841 | rsp->sessionId = smesessionId; |
| 842 | rsp->length = sizeof(*rsp); |
| 843 | rsp->aggrInfo.tspecIdx = aggrQosRsp->tspecIdx; |
| 844 | for (i = 0; i < SIR_QOS_NUM_AC_MAX; i++) { |
| 845 | if ((1 << i) & aggrQosRsp->tspecIdx) { |
Naveen Rawat | 25735af | 2017-07-05 15:24:28 -0700 | [diff] [blame] | 846 | if (QDF_IS_STATUS_SUCCESS(aggrQosRsp->status[i])) |
| 847 | rsp->aggrInfo.aggrRsp[i].status = |
| 848 | eSIR_MAC_SUCCESS_STATUS; |
| 849 | else |
| 850 | rsp->aggrInfo.aggrRsp[i].status = |
| 851 | eSIR_MAC_UNSPEC_FAILURE_STATUS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 852 | rsp->aggrInfo.aggrRsp[i].tspec = aggrQosRsp->tspec[i]; |
| 853 | } |
| 854 | } |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 855 | lim_send_sme_aggr_qos_rsp(mac, rsp, smesessionId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 856 | return; |
| 857 | } |
Varun Reddy Yeturu | dbbb991 | 2016-02-10 14:32:50 -0800 | [diff] [blame] | 858 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 859 | void lim_process_ft_aggr_qo_s_rsp(struct mac_context *mac, |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 860 | struct scheduler_msg *limMsg) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 861 | { |
| 862 | tpAggrAddTsParams pAggrQosRspMsg = NULL; |
| 863 | tAddTsParams addTsParam = { 0 }; |
| 864 | tpDphHashNode pSta = NULL; |
| 865 | uint16_t assocId = 0; |
| 866 | tSirMacAddr peerMacAddr; |
| 867 | uint8_t rspReqd = 1; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 868 | struct pe_session *pe_session = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 869 | int i = 0; |
Srinivas Girigowda | 4d65ebe | 2017-10-13 21:41:42 -0700 | [diff] [blame] | 870 | |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 871 | pe_debug(" Received AGGR_QOS_RSP from HAL"); |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 872 | SET_LIM_PROCESS_DEFD_MESGS(mac, true); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 873 | pAggrQosRspMsg = (tpAggrAddTsParams) (limMsg->bodyptr); |
| 874 | if (NULL == pAggrQosRspMsg) { |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 875 | pe_err("NULL pAggrQosRspMsg"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 876 | return; |
| 877 | } |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 878 | pe_session = |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 879 | pe_find_session_by_session_id(mac, pAggrQosRspMsg->sessionId); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 880 | if (NULL == pe_session) { |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 881 | pe_err("Cant find session entry for %s", __func__); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 882 | if (pAggrQosRspMsg != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 883 | qdf_mem_free(pAggrQosRspMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 884 | } |
| 885 | return; |
| 886 | } |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 887 | if (!LIM_IS_STA_ROLE(pe_session)) { |
| 888 | pe_err("pe_session is not in STA mode"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 889 | return; |
| 890 | } |
| 891 | for (i = 0; i < HAL_QOS_NUM_AC_MAX; i++) { |
| 892 | if ((((1 << i) & pAggrQosRspMsg->tspecIdx)) && |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 893 | (pAggrQosRspMsg->status[i] != QDF_STATUS_SUCCESS)) { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 894 | sir_copy_mac_addr(peerMacAddr, pe_session->bssId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 895 | addTsParam.staIdx = pAggrQosRspMsg->staIdx; |
| 896 | addTsParam.sessionId = pAggrQosRspMsg->sessionId; |
| 897 | addTsParam.tspec = pAggrQosRspMsg->tspec[i]; |
| 898 | addTsParam.tspecIdx = pAggrQosRspMsg->tspecIdx; |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 899 | lim_send_delts_req_action_frame(mac, peerMacAddr, rspReqd, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 900 | &addTsParam.tspec.tsinfo, |
| 901 | &addTsParam.tspec, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 902 | pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 903 | pSta = |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 904 | dph_lookup_assoc_id(mac, addTsParam.staIdx, &assocId, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 905 | &pe_session->dph.dphHashTable); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 906 | if (pSta != NULL) { |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 907 | lim_admit_control_delete_ts(mac, assocId, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 908 | &addTsParam.tspec. |
| 909 | tsinfo, NULL, |
| 910 | (uint8_t *) & |
| 911 | addTsParam.tspecIdx); |
| 912 | } |
| 913 | } |
| 914 | } |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 915 | lim_ft_send_aggr_qos_rsp(mac, rspReqd, pAggrQosRspMsg, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 916 | pe_session->smeSessionId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 917 | if (pAggrQosRspMsg != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 918 | qdf_mem_free(pAggrQosRspMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 919 | } |
| 920 | return; |
| 921 | } |
Varun Reddy Yeturu | dbbb991 | 2016-02-10 14:32:50 -0800 | [diff] [blame] | 922 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 923 | QDF_STATUS lim_process_ft_aggr_qos_req(struct mac_context *mac, uint32_t *pMsgBuf) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 924 | { |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 925 | struct scheduler_msg msg = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 926 | tSirAggrQosReq *aggrQosReq = (tSirAggrQosReq *) pMsgBuf; |
| 927 | tpAggrAddTsParams pAggrAddTsParam; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 928 | struct pe_session *pe_session = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 929 | tpLimTspecInfo tspecInfo; |
| 930 | uint8_t ac; |
| 931 | tpDphHashNode pSta; |
| 932 | uint16_t aid; |
| 933 | uint8_t sessionId; |
| 934 | int i; |
| 935 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 936 | pAggrAddTsParam = qdf_mem_malloc(sizeof(tAggrAddTsParams)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 937 | if (!pAggrAddTsParam) |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 938 | return QDF_STATUS_E_NOMEM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 939 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 940 | pe_session = pe_find_session_by_bssid(mac, aggrQosReq->bssid.bytes, |
Srinivas Girigowda | 99faf48 | 2015-12-03 19:06:15 -0800 | [diff] [blame] | 941 | &sessionId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 942 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 943 | if (pe_session == NULL) { |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 944 | pe_err("psession Entry Null for sessionId: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 945 | aggrQosReq->sessionId); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 946 | qdf_mem_free(pAggrAddTsParam); |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 947 | return QDF_STATUS_E_FAILURE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 948 | } |
| 949 | |
| 950 | /* Nothing to be done if the session is not in STA mode */ |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 951 | if (!LIM_IS_STA_ROLE(pe_session)) { |
| 952 | pe_err("pe_session is not in STA mode"); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 953 | qdf_mem_free(pAggrAddTsParam); |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 954 | return QDF_STATUS_E_FAILURE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 955 | } |
| 956 | |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 957 | pSta = dph_lookup_hash_entry(mac, aggrQosReq->bssid.bytes, &aid, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 958 | &pe_session->dph.dphHashTable); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 959 | if (pSta == NULL) { |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 960 | pe_err("Station context not found - ignoring AddTsRsp"); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 961 | qdf_mem_free(pAggrAddTsParam); |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 962 | return QDF_STATUS_E_FAILURE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 963 | } |
| 964 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 965 | pAggrAddTsParam->staIdx = pe_session->staId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 966 | /* Fill in the sessionId specific to PE */ |
| 967 | pAggrAddTsParam->sessionId = sessionId; |
| 968 | pAggrAddTsParam->tspecIdx = aggrQosReq->aggrInfo.tspecIdx; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 969 | pAggrAddTsParam->vdev_id = pe_session->smeSessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 970 | |
| 971 | for (i = 0; i < HAL_QOS_NUM_AC_MAX; i++) { |
| 972 | if (aggrQosReq->aggrInfo.tspecIdx & (1 << i)) { |
| 973 | tSirMacTspecIE *pTspec = |
| 974 | &aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; |
| 975 | /* Since AddTS response was successful, check for the PSB flag |
| 976 | * and directional flag inside the TS Info field. |
| 977 | * An AC is trigger enabled AC if the PSB subfield is set to 1 |
| 978 | * in the uplink direction. |
| 979 | * An AC is delivery enabled AC if the PSB subfield is set to 1 |
| 980 | * in the downlink direction. |
| 981 | * An AC is trigger and delivery enabled AC if the PSB subfield |
| 982 | * is set to 1 in the bi-direction field. |
| 983 | */ |
| 984 | if (pTspec->tsinfo.traffic.psb == 1) { |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 985 | lim_set_tspec_uapsd_mask_per_session(mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 986 | pe_session, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 987 | &pTspec-> |
| 988 | tsinfo, |
| 989 | SET_UAPSD_MASK); |
| 990 | } else { |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 991 | lim_set_tspec_uapsd_mask_per_session(mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 992 | pe_session, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 993 | &pTspec-> |
| 994 | tsinfo, |
| 995 | CLEAR_UAPSD_MASK); |
| 996 | } |
| 997 | /* |
| 998 | * ADDTS success, so AC is now admitted. |
| 999 | * We shall now use the default |
| 1000 | * EDCA parameters as advertised by AP and |
| 1001 | * send the updated EDCA params |
| 1002 | * to HAL. |
| 1003 | */ |
| 1004 | ac = upToAc(pTspec->tsinfo.traffic.userPrio); |
| 1005 | if (pTspec->tsinfo.traffic.direction == |
| 1006 | SIR_MAC_DIRECTION_UPLINK) { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1007 | pe_session-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1008 | gAcAdmitMask |
| 1009 | [SIR_MAC_DIRECTION_UPLINK] |= |
| 1010 | (1 << ac); |
| 1011 | } else if (pTspec->tsinfo.traffic.direction == |
| 1012 | SIR_MAC_DIRECTION_DNLINK) { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1013 | pe_session-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1014 | gAcAdmitMask |
| 1015 | [SIR_MAC_DIRECTION_DNLINK] |= |
| 1016 | (1 << ac); |
| 1017 | } else if (pTspec->tsinfo.traffic.direction == |
| 1018 | SIR_MAC_DIRECTION_BIDIR) { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1019 | pe_session-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1020 | gAcAdmitMask |
| 1021 | [SIR_MAC_DIRECTION_UPLINK] |= |
| 1022 | (1 << ac); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1023 | pe_session-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1024 | gAcAdmitMask |
| 1025 | [SIR_MAC_DIRECTION_DNLINK] |= |
| 1026 | (1 << ac); |
| 1027 | } |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 1028 | lim_set_active_edca_params(mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1029 | pe_session->gLimEdcaParams, |
| 1030 | pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1031 | |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 1032 | lim_send_edca_params(mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1033 | pe_session->gLimEdcaParamsActive, |
Kiran Kumar Lokere | 27026ae | 2018-03-09 11:38:19 -0800 | [diff] [blame] | 1034 | pSta->bssId, false); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1035 | |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 1036 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 1037 | lim_tspec_add(mac, pSta->staAddr, pSta->assocId, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1038 | pTspec, 0, &tspecInfo)) { |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 1039 | pe_err("Adding entry in lim Tspec Table failed"); |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 1040 | mac->lim.gLimAddtsSent = false; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1041 | qdf_mem_free(pAggrAddTsParam); |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 1042 | return QDF_STATUS_E_FAILURE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1043 | } |
| 1044 | |
| 1045 | pAggrAddTsParam->tspec[i] = |
| 1046 | aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; |
| 1047 | } |
| 1048 | } |
| 1049 | |
| 1050 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 1051 | if (!mac->mlme_cfg->lfr.lfr3_roaming_offload || |
| 1052 | (mac->mlme_cfg->lfr.lfr3_roaming_offload && |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1053 | !pe_session->is11Rconnection)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1054 | #endif |
| 1055 | { |
| 1056 | msg.type = WMA_AGGR_QOS_REQ; |
| 1057 | msg.bodyptr = pAggrAddTsParam; |
| 1058 | msg.bodyval = 0; |
| 1059 | |
| 1060 | /* We need to defer any incoming messages until we get a |
| 1061 | * WMA_AGGR_QOS_RSP from HAL. |
| 1062 | */ |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 1063 | SET_LIM_PROCESS_DEFD_MESGS(mac, false); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1064 | MTRACE(mac_trace_msg_tx(mac, pe_session->peSessionId, msg.type)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1065 | |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 1066 | if (QDF_STATUS_SUCCESS != wma_post_ctrl_msg(mac, &msg)) { |
Nishank Aggarwal | 8b805bb | 2017-03-23 14:50:18 +0530 | [diff] [blame] | 1067 | pe_warn("wma_post_ctrl_msg() failed"); |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 1068 | SET_LIM_PROCESS_DEFD_MESGS(mac, true); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1069 | qdf_mem_free(pAggrAddTsParam); |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 1070 | return QDF_STATUS_E_FAILURE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1071 | } |
| 1072 | } |
| 1073 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
| 1074 | else { |
| 1075 | /* Implies it is a LFR3.0 based 11r connection |
Jeff Johnson | 47d7524 | 2018-05-12 15:58:53 -0700 | [diff] [blame] | 1076 | * so donot send add ts request to firmware since it |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1077 | * already has the RIC IEs */ |
| 1078 | |
| 1079 | /* Send the Aggr QoS response to SME */ |
Jeff Johnson | 35592fc | 2018-11-22 11:36:10 -0800 | [diff] [blame] | 1080 | lim_ft_send_aggr_qos_rsp(mac, true, pAggrAddTsParam, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 1081 | pe_session->smeSessionId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1082 | if (pAggrAddTsParam != NULL) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 1083 | qdf_mem_free(pAggrAddTsParam); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1084 | } |
| 1085 | } |
| 1086 | #endif |
| 1087 | |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 1088 | return QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1089 | } |