From 9cd688df06b52b18686db0ce285bb8a0d1377089 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Thu, 13 Jun 2019 14:47:26 -0700 Subject: [PATCH] qcacld-3.0: Fix dot11mode setting in roaming session The roaming FT session dot11mode value is set with self configuration, peer capability from beacon is not checked to set the value. Check peer AP beacon capabilities along with self configuration to set the dot11mode setting in FT session. Change-Id: Idd0edafccc6664b3b0f41ba7ca3dd8d59094ff3e CRs-Fixed: 2467600 --- core/mac/src/pe/lim/lim_ft.c | 62 ++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/core/mac/src/pe/lim/lim_ft.c b/core/mac/src/pe/lim/lim_ft.c index e4fc72200d51..a784dafdd501 100644 --- a/core/mac/src/pe/lim/lim_ft.c +++ b/core/mac/src/pe/lim/lim_ft.c @@ -472,6 +472,7 @@ void lim_ft_prepare_add_bss_req(struct mac_context *mac, * @mac_ctx: pointer to mac ctx * @ft_session: FT session * @pe_session: PE session + * @bcn: AP beacon pointer * * This API fills FT session's dot11mode either from pe session or * from CFG depending on the condition. @@ -480,7 +481,8 @@ void lim_ft_prepare_add_bss_req(struct mac_context *mac, */ static void lim_fill_dot11mode(struct mac_context *mac_ctx, struct pe_session *ft_session, - struct pe_session *pe_session) + struct pe_session *pe_session, + tSchBeaconStruct *bcn) { uint32_t self_dot11_mode; @@ -488,10 +490,39 @@ static void lim_fill_dot11mode(struct mac_context *mac_ctx, !csr_is_roam_offload_enabled(mac_ctx)) { ft_session->dot11mode = pe_session->ftPEContext.pFTPreAuthReq->dot11mode; - } else { - self_dot11_mode = mac_ctx->mlme_cfg->dot11_mode.dot11_mode; - pe_debug("selfDot11Mode: %d", self_dot11_mode); - ft_session->dot11mode = self_dot11_mode; + return; + } + self_dot11_mode = mac_ctx->mlme_cfg->dot11_mode.dot11_mode; + pe_debug("selfDot11Mode: %d", self_dot11_mode); + if (ft_session->limRFBand == BAND_2G) + ft_session->dot11mode = MLME_DOT11_MODE_11G; + else + ft_session->dot11mode = MLME_DOT11_MODE_11A; + switch (self_dot11_mode) { + case MLME_DOT11_MODE_11AX: + case MLME_DOT11_MODE_11AX_ONLY: + if (bcn->he_cap.present) + ft_session->dot11mode = MLME_DOT11_MODE_11AX; + else if (bcn->VHTCaps.present) + ft_session->dot11mode = MLME_DOT11_MODE_11AC; + else if (bcn->HTCaps.present) + ft_session->dot11mode = MLME_DOT11_MODE_11N; + break; + case MLME_DOT11_MODE_11AC: + case MLME_DOT11_MODE_11AC_ONLY: + if (bcn->VHTCaps.present) + ft_session->dot11mode = MLME_DOT11_MODE_11AC; + else if (bcn->HTCaps.present) + ft_session->dot11mode = MLME_DOT11_MODE_11N; + break; + case MLME_DOT11_MODE_11N: + case MLME_DOT11_MODE_11N_ONLY: + if (bcn->HTCaps.present) + ft_session->dot11mode = MLME_DOT11_MODE_11N; + + break; + default: + break; } } #elif defined(WLAN_FEATURE_HOST_ROAM) @@ -500,13 +531,16 @@ static void lim_fill_dot11mode(struct mac_context *mac_ctx, * @mac_ctx: pointer to mac ctx * @ft_session: FT session * @pe_session: PE session + * @bcn: AP beacon pointer * * This API fills FT session's dot11mode either from pe session. * * Return: none */ static void lim_fill_dot11mode(struct mac_context *mac_ctx, - struct pe_session *ft_session, struct pe_session *pe_session) + struct pe_session *ft_session, + struct pe_session *pe_session, + tSchBeaconStruct *bcn) { ft_session->dot11mode = pe_session->ftPEContext.pFTPreAuthReq->dot11mode; @@ -566,7 +600,14 @@ void lim_fill_ft_session(struct mac_context *mac, ft_session->ssId.length = pBeaconStruct->ssId.length; qdf_mem_copy(ft_session->ssId.ssId, pBeaconStruct->ssId.ssId, ft_session->ssId.length); - lim_fill_dot11mode(mac, ft_session, pe_session); + /* Copy The channel Id to the session Table */ + ft_session->limReassocChannelId = pbssDescription->channelId; + ft_session->currentOperChannel = pbssDescription->channelId; + + ft_session->limRFBand = lim_get_rf_band( + ft_session->currentOperChannel); + + lim_fill_dot11mode(mac, ft_session, pe_session, pBeaconStruct); pe_debug("dot11mode: %d", ft_session->dot11mode); ft_session->vhtCapability = @@ -576,13 +617,6 @@ void lim_fill_ft_session(struct mac_context *mac, (IS_DOT11_MODE_HT(ft_session->dot11mode) && pBeaconStruct->HTCaps.present); - /* Copy The channel Id to the session Table */ - ft_session->limReassocChannelId = pbssDescription->channelId; - ft_session->currentOperChannel = pbssDescription->channelId; - - ft_session->limRFBand = lim_get_rf_band( - ft_session->currentOperChannel); - /* Assign default configured nss value in the new session */ if (IS_5G_CH(ft_session->currentOperChannel)) ft_session->vdev_nss = mac->vdev_type_nss_5g.sta;