summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVignesh Viswanathan <viswanat@codeaurora.org>2018-07-11 14:37:39 +0530
committernshrivas <nshrivas@codeaurora.org>2018-07-12 05:54:58 -0700
commit0016c88b5210938c9a88fffb751b0766dab4b8e2 (patch)
tree9d9ef219c97dae4c00c131bff60b13c6f14f0ff5
parent8f8783e9404dc938b0f837f3ae4fdfd1505390a7 (diff)
qcacld-3.0: Update dot11_mode based on target channel during chan switch
Currently if the dot11_mode is set to eCSR_DOT11_MODE_11g or eCSR_DOT11_MODE_11g_ONLY and a channel switch is triggered with target channel in 5Ghz band, then an invalid combination of dot11_mode and channel occurs which fails the vdev_restart for channel switch. Update the dot11_mode based on the target channel and the current dot11_mode before sending the channel change request to SME. Change-Id: I2b0fa4a36f137150ee0506d62be29ede4f4e604c CRs-Fixed: 2276876
-rw-r--r--core/mac/src/pe/lim/lim_send_messages.c5
-rw-r--r--core/sap/src/sap_module.c19
-rw-r--r--core/sme/src/csr/csr_api_roam.c4
3 files changed, 24 insertions, 4 deletions
diff --git a/core/mac/src/pe/lim/lim_send_messages.c b/core/mac/src/pe/lim/lim_send_messages.c
index ddd81924f2f3..621e55a23590 100644
--- a/core/mac/src/pe/lim/lim_send_messages.c
+++ b/core/mac/src/pe/lim/lim_send_messages.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -227,7 +227,8 @@ tSirRetStatus lim_send_switch_chnl_params(tpAniSirGlobal pMac,
pChnlParams->vhtCapable = pSessionEntry->vhtCapability;
pChnlParams->dot11_mode = pSessionEntry->dot11mode;
pChnlParams->nss = pSessionEntry->nss;
- pe_debug("nss value: %d", pChnlParams->nss);
+ pe_debug("nss value: %d dot11_mode %d",
+ pChnlParams->nss, pChnlParams->dot11_mode);
/*Set DFS flag for DFS channel */
if (ch_width == CH_WIDTH_160MHZ) {
diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c
index 751aff480ec8..58fd382e8f7e 100644
--- a/core/sap/src/sap_module.c
+++ b/core/sap/src/sap_module.c
@@ -2691,6 +2691,21 @@ wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
mac_ctx = PMAC_STRUCT(hHal);
phy_mode = sapContext->csr_roamProfile.phyMode;
+ /* Update phy_mode if the target channel is in the other band */
+ if (CDS_IS_CHANNEL_5GHZ(target_channel) &&
+ ((phy_mode == eCSR_DOT11_MODE_11g) ||
+ (phy_mode == eCSR_DOT11_MODE_11g_ONLY)))
+ phy_mode = eCSR_DOT11_MODE_11a;
+ else if (CDS_IS_CHANNEL_24GHZ(target_channel) &&
+ (phy_mode == eCSR_DOT11_MODE_11a))
+ phy_mode = eCSR_DOT11_MODE_11g;
+
+ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
+ "%s: phy_mode: %d, target_channel: %d new phy_mode: %d",
+ __func__, sapContext->csr_roamProfile.phyMode,
+ target_channel, phy_mode);
+ sapContext->csr_roamProfile.phyMode = phy_mode;
+
if (sapContext->csr_roamProfile.ChannelInfo.numOfChannels == 0 ||
sapContext->csr_roamProfile.ChannelInfo.ChannelList == NULL) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -2722,8 +2737,8 @@ wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
ch_params, &sapContext->csr_roamProfile);
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
- "%s: chan:%d width:%d offset:%d seg0:%d seg1:%d",
- __func__, sapContext->channel, ch_params->ch_width,
+ "%s: chan:%d phy_mode %d width:%d offset:%d seg0:%d seg1:%d",
+ __func__, sapContext->channel, phy_mode, ch_params->ch_width,
ch_params->sec_ch_offset, ch_params->center_freq_seg0,
ch_params->center_freq_seg1);
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index a298f5f0ed44..ad65f39037d3 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -21470,6 +21470,10 @@ QDF_STATUS csr_roam_channel_change_req(tpAniSirGlobal pMac,
&param.operationalRateSet, sizeof(pMsg->operational_rateset));
qdf_mem_copy(&pMsg->extended_rateset,
&param.extendedRateSet, sizeof(pMsg->extended_rateset));
+
+ sme_debug("target_chan %d ch_width %d dot11mode %d",
+ pMsg->targetChannel, pMsg->ch_width, pMsg->dot11mode);
+
status = cds_send_mb_message_to_mac(pMsg);
return status;