From eb88acdd2711054f5364f9c2180267b7ca15bf6f Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Wed, 12 Feb 2020 11:28:03 -0800 Subject: [PATCH] qcacld-3.0: Correctly check for frequency in an operating class Use the country and operating class information to check for a given frequency. Change-Id: Ib154b7f292c2623673063ebe5f0d4f76eb4e99e1 CRs-Fixed: 2619355 --- core/sme/src/rrm/sme_rrm.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/core/sme/src/rrm/sme_rrm.c b/core/sme/src/rrm/sme_rrm.c index d60fb2eca544..e25fa4292e00 100644 --- a/core/sme/src/rrm/sme_rrm.c +++ b/core/sme/src/rrm/sme_rrm.c @@ -36,6 +36,7 @@ #include "rrm_global.h" #include #include +#include #include /* Roam score for a neighbor AP will be calculated based on the below @@ -961,31 +962,28 @@ free_ch_lst: static QDF_STATUS sme_rrm_fill_scan_channels(struct mac_context *mac, uint8_t *country, tpRrmSMEContext sme_rrm_context, - uint8_t reg_class, + uint8_t op_class, uint32_t num_channels) { uint32_t num_chan = 0; uint32_t i; uint32_t *freq_list; - uint16_t op_class; - - /* List all the channels in the requested RC */ - wlan_reg_dmn_print_channels_in_opclass(country, reg_class); + bool found; freq_list = sme_rrm_context->channelList.freq_list; - + found = false; for (i = 0; i < num_channels; i++) { - uint8_t chan = (uint8_t)wlan_reg_freq_to_chan(mac->pdev, - freq_list[i]); - op_class = wlan_reg_dmn_get_opclass_from_channel(country, - chan, - BWALL); - - if (op_class == reg_class) { + found = wlan_reg_country_opclass_freq_check(mac->pdev, + country, + op_class, + freq_list[i]); + if (found) { freq_list[num_chan] = freq_list[i]; num_chan++; } + found = false; } + sme_rrm_context->channelList.numOfChannels = num_chan; if (sme_rrm_context->channelList.numOfChannels == 0) { qdf_mem_free(sme_rrm_context->channelList.freq_list);