From 7b2aef50f2c1b991b7b0538785dfba5126a68639 Mon Sep 17 00:00:00 2001 From: hqu Date: Mon, 15 Jul 2019 17:50:29 +0800 Subject: [PATCH] qcacld-3.0: Add op_freq in csr_roam_profile Add op_freq in csr_roam_profile. Finally remove operationChannel from csr_roam_profile in next few changes. Change-Id: I7a3d7fe7e77b18424f487429aaa19ca1a97b8aba CRs-Fixed: 2489914 --- core/sap/src/sap_fsm.c | 4 ++++ core/sme/inc/csr_api.h | 1 + core/sme/src/csr/csr_api_roam.c | 11 ++++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index b647b91ed0..8d6e816ef3 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2296,6 +2296,10 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx, &sap_ctx->csr_roamProfile.operationChannel; sap_ctx->csr_roamProfile.operationChannel = (uint8_t)sap_ctx->channel; + sap_ctx->csr_roamProfile.op_freq = + wlan_reg_chan_to_freq(mac_ctx->pdev, + (uint8_t)sap_ctx->channel); + sap_ctx->csr_roamProfile.ch_params.ch_width = sap_ctx->ch_params.ch_width; sap_ctx->csr_roamProfile.ch_params.center_freq_seg0 = diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index d7d70a9e09..829ab61fa7 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -762,6 +762,7 @@ struct csr_roam_profile { tCsrKeys Keys; tCsrChannelInfo ChannelInfo; uint8_t operationChannel; + uint32_t op_freq; struct ch_params ch_params; /* If this is 0, SME will fill in for caller. */ uint16_t beaconInterval; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 87837c2a58..72bd40a746 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -14146,7 +14146,7 @@ void csr_roam_prepare_bss_params(struct mac_context *mac, uint32_t sessionId, struct bss_config_param *pBssConfig, tDot11fBeaconIEs *pIes) { - uint8_t Channel; + uint8_t channel; ePhyChanBondState cbMode = PHY_SINGLE_CHANNEL_CENTERED; struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId); bool skip_hostapd_rate = !pProfile->chan_switch_hostapd_rate_enabled; @@ -14181,20 +14181,21 @@ void csr_roam_prepare_bss_params(struct mac_context *mac, uint32_t sessionId, qdf_mem_zero(&pSession->bssParams.bssid, sizeof(struct qdf_mac_addr)); } - Channel = pSession->bssParams.operationChn; + channel = pSession->bssParams.operationChn; /* Set operating channel in pProfile which will be used */ /* in csr_roam_set_bss_config_cfg() to determine channel bonding */ /* mode and will be configured in CFG later */ - pProfile->operationChannel = Channel; + pProfile->operationChannel = channel; + pProfile->op_freq = wlan_reg_chan_to_freq(mac->pdev, channel); - if (Channel == 0) + if (channel == 0) sme_err("CSR cannot find a channel to start IBSS"); else { csr_roam_determine_max_rate_for_ad_hoc(mac, &pSession->bssParams. operationalRateSet); if (CSR_IS_INFRA_AP(pProfile) || CSR_IS_START_IBSS(pProfile)) { - if (WLAN_REG_IS_24GHZ_CH(Channel)) { + if (WLAN_REG_IS_24GHZ_CH(channel)) { cbMode = mac->roam.configParam. channelBondingMode24GHz;