From 5fcd718df0466ea13c9b0a31ef1925fc982e0b92 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Wed, 6 Jun 2018 13:46:18 +0530 Subject: [PATCH] qcacld-3.0: Populate correct dot11_mode during CSA When CSA is received from the firmware, dot11_mode is copied from received message . In response to the CSA message, the host invokes wma_vdev_start with isRestart flag set to restart the vdev with the new updated channel, and channel params. The dot11_mode value is copied from the CSA which will not be a problem unless the switching channel is on the same band or on different band as long as its HT/VHT 2.4GHZ to HT/VHT 5GHZ bands or vice-versa. When the channel switch occurs from a 11a to 11g band or vice-versa, wrong dot11_mode is populated without being updated for the new band. As the phy_mode is calculated from the dot11_mode value, phy_mode check fails in wma_vdev_start in this case. So the host doesn't send vdev_restart. Populate the dot11_mode correctly and pass it to lower layers upon updation. This will ensure correct phy_mode is calculated and vdev_restart is sent. Change-Id: Iaf8788d51b47190c04744b8981dd594236fbae57 CRs-Fixed: 2248980 --- .../src/pe/lim/lim_send_sme_rsp_messages.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index e86b4cef8adb..b991d2dcbe3f 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1954,6 +1954,12 @@ void lim_handle_csa_offload_msg(tpAniSirGlobal mac_ctx, return; } + csa_offload_ind = qdf_mem_malloc(sizeof(tSmeCsaOffloadInd)); + if (NULL == csa_offload_ind) { + pe_err("memalloc fail eWNI_SME_CSA_OFFLOAD_EVENT"); + goto err; + } + session_entry = pe_find_session_by_bssid(mac_ctx, csa_params->bssId, &session_id); @@ -2149,12 +2155,15 @@ void lim_handle_csa_offload_msg(tpAniSirGlobal mac_ctx, goto err; } + if (WLAN_REG_IS_24GHZ_CH(csa_params->channel) && + (session_entry->dot11mode == WNI_CFG_DOT11_MODE_11A)) + session_entry->dot11mode = WNI_CFG_DOT11_MODE_11G; + else if (WLAN_REG_IS_5GHZ_CH(csa_params->channel) && + ((session_entry->dot11mode == WNI_CFG_DOT11_MODE_11G) || + (session_entry->dot11mode == WNI_CFG_DOT11_MODE_11G_ONLY))) + session_entry->dot11mode = WNI_CFG_DOT11_MODE_11A; + lim_prepare_for11h_channel_switch(mac_ctx, session_entry); - csa_offload_ind = qdf_mem_malloc(sizeof(tSmeCsaOffloadInd)); - if (NULL == csa_offload_ind) { - pe_err("memalloc fail eWNI_SME_CSA_OFFLOAD_EVENT"); - goto err; - } csa_offload_ind->mesgType = eWNI_SME_CSA_OFFLOAD_EVENT; csa_offload_ind->mesgLen = sizeof(tSmeCsaOffloadInd);