From 987377e3ea3a2991b223c620bb858c1bf70c9e4f Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Thu, 29 Aug 2019 12:27:14 -0700 Subject: [PATCH] qcacld-3.0: Refactor start bss request to channel frequency Refactor the start bss request to use channel frequency instead of channel number. Change-Id: Ic936fe060a5b2bc8d058709950417f3939a3c3d4 CRs-Fixed: 2518026 --- core/mac/inc/sir_api.h | 2 +- core/mac/src/pe/lim/lim_ibss_peer_mgmt.c | 3 +-- core/mac/src/pe/lim/lim_process_mlm_req_messages.c | 13 ++++++------- core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 3 ++- core/mac/src/pe/lim/lim_process_sme_req_messages.c | 14 ++++++-------- core/mac/src/pe/lim/lim_sme_req_utils.c | 4 ++-- core/mac/src/pe/lim/lim_types.h | 2 +- core/sme/src/csr/csr_api_roam.c | 6 +++--- 8 files changed, 22 insertions(+), 25 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 15f3378b02b4..43f33ca89e1f 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -580,7 +580,7 @@ struct start_bss_req { #endif enum bss_type bssType; tSirMacSSid ssId; - uint8_t channelId; + uint32_t oper_ch_freq; ePhyChanBondState cbMode; uint8_t vht_channel_width; uint8_t center_freq_seg0; diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c index db497ab441e4..149e48762455 100644 --- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c +++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c @@ -568,8 +568,7 @@ void ibss_bss_add(struct mac_context *mac, struct pe_session *pe_session) mlmStartReq.txChannelWidthSet = pe_session->htRecommendedTxWidthSet; /* reading the channel num from session Table */ - mlmStartReq.channelNumber = wlan_reg_freq_to_chan( - mac->pdev, pe_session->curr_op_freq); + mlmStartReq.oper_ch_freq = pe_session->curr_op_freq; mlmStartReq.cbMode = pe_session->pLimStartBssReq->cbMode; diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index 7a195b76e57b..14446afa7e51 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -302,6 +302,7 @@ lim_mlm_add_bss(struct mac_context *mac_ctx, struct bss_params *addbss_param = NULL; uint32_t retcode; bool is_ch_dfs = false; + uint32_t chan_num; /* Package WMA_ADD_BSS_REQ message parameters */ addbss_param = qdf_mem_malloc(sizeof(struct bss_params)); @@ -338,9 +339,9 @@ lim_mlm_add_bss(struct mac_context *mac_ctx, wlan_reg_chan_to_freq(mac_ctx->pdev, session->ch_center_freq_seg1); - addbss_param->op_chan_freq = - wlan_reg_chan_to_freq(mac_ctx->pdev, - mlm_start_req->channelNumber); + addbss_param->op_chan_freq = mlm_start_req->oper_ch_freq; + chan_num = wlan_reg_freq_to_chan(mac_ctx->pdev, + addbss_param->op_chan_freq); #ifdef WLAN_FEATURE_11W addbss_param->rmfEnabled = session->limRmfEnabled; #endif @@ -376,8 +377,7 @@ lim_mlm_add_bss(struct mac_context *mac_ctx, if (session->ch_width == CH_WIDTH_160MHZ) { is_ch_dfs = true; } else if (session->ch_width == CH_WIDTH_80P80MHZ) { - if (wlan_reg_get_channel_state(mac_ctx->pdev, - mlm_start_req->channelNumber) == + if (wlan_reg_get_channel_state(mac_ctx->pdev, chan_num) == CHANNEL_STATE_DFS || wlan_reg_get_channel_state(mac_ctx->pdev, session->ch_center_freq_seg1 - @@ -385,8 +385,7 @@ lim_mlm_add_bss(struct mac_context *mac_ctx, CHANNEL_STATE_DFS) is_ch_dfs = true; } else { - if (wlan_reg_get_channel_state(mac_ctx->pdev, - mlm_start_req->channelNumber) == + if (wlan_reg_get_channel_state(mac_ctx->pdev, chan_num) == CHANNEL_STATE_DFS) is_ch_dfs = true; } diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index d6c2f38a5898..afe7df6f9c22 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -207,7 +207,8 @@ void lim_process_mlm_start_cnf(struct mac_context *mac, uint32_t *msg_buf) pe_session, smesessionId); if (pe_session && (((tLimMlmStartCnf *)msg_buf)->resultCode == eSIR_SME_SUCCESS)) { - channelId = pe_session->pLimStartBssReq->channelId; + channelId = wlan_reg_freq_to_chan(mac->pdev, + pe_session->pLimStartBssReq->oper_ch_freq); lim_ndi_mlme_vdev_up_transition(pe_session); /* We should start beacon transmission only if the channel diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 388019c5aa83..604fb9f3e11b 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -544,7 +544,8 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu ret_code = eSIR_SME_INVALID_PARAMETERS; goto free; } - + channel_number = wlan_reg_freq_to_chan(mac_ctx->pdev, + sme_start_bss_req->oper_ch_freq); /* * This is the place where PE is going to create a session. * If session is not existed, then create a new session @@ -571,7 +572,7 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu /* Update the beacon/probe filter in mac_ctx */ lim_set_bcn_probe_filter(mac_ctx, session, &sme_start_bss_req->ssId, - sme_start_bss_req->channelId); + channel_number); } if (QDF_NDI_MODE != sme_start_bss_req->bssPersona) { @@ -623,8 +624,7 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu sme_start_bss_req->beaconInterval; /* Store the oper freq in session Table */ - session->curr_op_freq = wlan_reg_chan_to_freq( - mac_ctx->pdev, sme_start_bss_req->channelId); + session->curr_op_freq = sme_start_bss_req->oper_ch_freq; /* Store Persona */ session->opmode = sme_start_bss_req->bssPersona; @@ -741,13 +741,12 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu } } - if (!sme_start_bss_req->channelId && + if (!sme_start_bss_req->oper_ch_freq && sme_start_bss_req->bssType != eSIR_NDI_MODE) { pe_err("Received invalid eWNI_SME_START_BSS_REQ"); ret_code = eSIR_SME_INVALID_PARAMETERS; goto free; } - channel_number = sme_start_bss_req->channelId; #ifdef QCA_HT_2040_COEX if (sme_start_bss_req->obssEnabled) session->htSupportedChannelWidthSet = @@ -880,8 +879,7 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu } } /* store the channel num in mlmstart req structure */ - mlm_start_req->channelNumber = wlan_reg_freq_to_chan( - mac_ctx->pdev, session->curr_op_freq); + mlm_start_req->oper_ch_freq = session->curr_op_freq; mlm_start_req->cbMode = sme_start_bss_req->cbMode; mlm_start_req->beaconPeriod = session->beaconParams.beaconInterval; diff --git a/core/mac/src/pe/lim/lim_sme_req_utils.c b/core/mac/src/pe/lim/lim_sme_req_utils.c index b40e51e7b85d..7033144832f2 100644 --- a/core/mac/src/pe/lim/lim_sme_req_utils.c +++ b/core/mac/src/pe/lim/lim_sme_req_utils.c @@ -358,9 +358,9 @@ bool lim_is_sme_start_bss_req_valid(struct mac_context *mac_ctx, uint8_t i = 0; tSirMacRateSet *opr_rates = &start_bss_req->operationalRateSet; - pe_debug("Parsed START_BSS_REQ fields are bssType: %s (%d) channelId: %d SSID len: %d rsnIE len: %d nwType: %d rateset len: %d", + pe_debug("Parsed START_BSS_REQ fields are bssType: %s (%d) chan_freq: %d SSID len: %d rsnIE len: %d nwType: %d rateset len: %d", lim_bss_type_to_string(start_bss_req->bssType), - start_bss_req->bssType, start_bss_req->channelId, + start_bss_req->bssType, start_bss_req->oper_ch_freq, start_bss_req->ssId.length, start_bss_req->rsnIE.length, start_bss_req->nwType, opr_rates->numRates); diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 24274500a5d4..4fdd3a5378ab 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -157,7 +157,7 @@ typedef struct sLimMlmStartReq { tSirMacBeaconInterval beaconPeriod; uint8_t dtimPeriod; tSirMacCfParamSet cfParamSet; - tSirMacChanNum channelNumber; + uint32_t oper_ch_freq; ePhyChanBondState cbMode; tSirMacRateSet rateSet; uint8_t sessionId; /* Added For BT-AMP Support */ diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index f742dcdd9413..6b4ead51724c 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -16640,8 +16640,7 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(struct mac_context *mac, uint32_t #endif pMsg->bssType = csr_translate_bsstype_to_mac_type(bssType); qdf_mem_copy(&pMsg->ssId, &pParam->ssId, sizeof(pParam->ssId)); - pMsg->channelId = - wlan_reg_freq_to_chan(mac->pdev, pParam->operation_chan_freq); + pMsg->oper_ch_freq = pParam->operation_chan_freq; /* What should we really do for the cbmode. */ pMsg->cbMode = (ePhyChanBondState) pParam->cbMode; pMsg->vht_channel_width = pParam->ch_params.ch_width; @@ -16671,7 +16670,8 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(struct mac_context *mac, uint32_t if (eSIR_IBSS_MODE == pMsg->bssType || !policy_mgr_is_dbs_enable(mac->psoc)) csr_set_ldpc_exception(mac, pSession, - pMsg->channelId, + wlan_reg_freq_to_chan(mac->pdev, + pParam->operation_chan_freq), mac->mlme_cfg->ht_caps. ht_cap_info.adv_coding_cap);