From 694bec3af78ec444698269c79b9f0b426e439778 Mon Sep 17 00:00:00 2001 From: Vignesh Viswanathan Date: Wed, 11 Jul 2018 14:37:39 +0530 Subject: [PATCH] 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 --- core/sap/src/sap_module.c | 19 +++++++++++++++++-- core/sme/src/csr/csr_api_roam.c | 3 +++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index f47ac2955a..86c37d07f8 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1741,6 +1741,21 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sapContext, mac_ctx = PMAC_STRUCT(hHal); phy_mode = sapContext->csr_roamProfile.phyMode; + /* Update phy_mode if the target channel is in the other band */ + if (WLAN_CHAN_IS_5GHZ(target_channel) && + ((phy_mode == eCSR_DOT11_MODE_11g) || + (phy_mode == eCSR_DOT11_MODE_11g_ONLY))) + phy_mode = eCSR_DOT11_MODE_11a; + else if (WLAN_CHAN_IS_2GHZ(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, @@ -1774,8 +1789,8 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sapContext, 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 e749da62f9..3edf17913e 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -20583,6 +20583,9 @@ QDF_STATUS csr_roam_channel_change_req(tpAniSirGlobal pMac, ¶m.operationalRateSet, sizeof(pMsg->operational_rateset)); qdf_mem_copy(&pMsg->extended_rateset, ¶m.extendedRateSet, sizeof(pMsg->extended_rateset)); + + sme_debug("target_chan %d ch_width %d dot11mode %d", + pMsg->targetChannel, pMsg->ch_width, pMsg->dot11mode); status = umac_send_mb_message_to_mac(pMsg); return status;