From d6ba775313cce9caaf4b336fe94db180364429f4 Mon Sep 17 00:00:00 2001 From: Gururaj Pandurangi Date: Mon, 17 May 2021 13:38:01 -0700 Subject: [PATCH] qcacld-3.0: Update Country IE to show correct number of 6G channels Update Country IE population API so that SAP uses secondary current channel list instead of primary, to advertise correct number of 6G channels. One other change is in TPC power calculation API, to add STA role check along with lim join req check, since the API was returning without calculation for SAP. Change-Id: I3fafe252b119a5b58f5382fcbff60eb4c19688c6 CRs-Fixed: 2946474 --- .../src/pe/lim/lim_process_sme_req_messages.c | 2 +- .../src/sys/legacy/src/utils/src/parser_api.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) 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 642089b638bc..203172c67fee 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 @@ -1972,7 +1972,7 @@ void lim_calculate_tpc(struct mac_context *mac, uint8_t tpe_power; bool skip_tpe = false; - if (!session->lim_join_req) { + if (LIM_IS_STA_ROLE(session) && !session->lim_join_req) { pe_err("Join Request is NULL"); return; } diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 9f47ad755a9a..5bb7c5bff2ef 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -550,7 +550,7 @@ populate_dot11f_country(struct mac_context *mac, uint8_t code[REG_ALPHA2_LEN + 1]; uint8_t cur_triplet_num_chans = 0; int chan_enum, chan_num, chan_spacing = 0; - struct regulatory_channel *cur_chan_list; + struct regulatory_channel *sec_cur_chan_list; struct regulatory_channel *cur_chan, *start, *prev; enum reg_wifi_band rf_band = REG_BAND_UNKNOWN; uint8_t buffer_triplets[81][3]; @@ -558,8 +558,9 @@ populate_dot11f_country(struct mac_context *mac, QDF_STATUS status = QDF_STATUS_SUCCESS; bool six_gig_started = false; - cur_chan_list = qdf_mem_malloc(NUM_CHANNELS * sizeof(*cur_chan_list)); - if (!cur_chan_list) + sec_cur_chan_list = qdf_mem_malloc(NUM_CHANNELS * + sizeof(*sec_cur_chan_list)); + if (!sec_cur_chan_list) return QDF_STATUS_E_NOMEM; lim_get_rf_band_new(mac, &rf_band, pe_session); @@ -577,8 +578,9 @@ populate_dot11f_country(struct mac_context *mac, goto out; } - chan_num = wlan_reg_get_band_channel_list(mac->pdev, BIT(rf_band), - cur_chan_list); + chan_num = wlan_reg_get_secondary_band_channel_list(mac->pdev, + BIT(rf_band), + sec_cur_chan_list); if (!chan_num) { pe_err("failed to get cur_chan list"); status = QDF_STATUS_E_FAILURE; @@ -594,7 +596,7 @@ populate_dot11f_country(struct mac_context *mac, start = NULL; prev = NULL; for (chan_enum = 0; chan_enum < chan_num; chan_enum++) { - cur_chan = &cur_chan_list[chan_enum]; + cur_chan = &sec_cur_chan_list[chan_enum]; if (cur_chan->chan_flags & REGULATORY_CHAN_DISABLED) continue; @@ -679,7 +681,7 @@ populate_dot11f_country(struct mac_context *mac, ctry_ie->present = 1; out: - qdf_mem_free(cur_chan_list); + qdf_mem_free(sec_cur_chan_list); return status; } /* End populate_dot11f_country. */