From fbf576a8fac68d6c6d2f48a946939c719b7ccbd8 Mon Sep 17 00:00:00 2001 From: wadesong Date: Thu, 28 Nov 2019 20:17:33 +0800 Subject: [PATCH] qcacld-3.0: Convert CSR legacy channel ID usage Remove wlan_reg_freq_to_chan within function csr_update_op_class_array and use channel frequencies directly to retrieve opclass. To utilize the new channel frequency function, regional opclass table will be used unconditionally, given no OTA packets' country IEs will be populated here(and thus no need to carry global opclass). Change-Id: Ida9831e7e74223455089770744222185ae3cb1d3 CRs-Fixed: 2576285 --- core/sme/src/csr/csr_api_roam.c | 40 ++++++++++++++------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index d205830b6ae8..cf117afc6a94 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -20915,35 +20915,29 @@ csr_update_op_class_array(struct mac_context *mac_ctx, uint8_t j = 0, idx = 0, class = 0; bool found = false; uint8_t num_channels = channel_info->numChannels; - uint8_t ch_bandwidth; + uint8_t ch_num; - sme_debug("Num of %s channels, %d", - ch_name, num_channels); + sme_debug("Num of %s channels, %d", ch_name, num_channels); for (idx = 0; idx < num_channels && - *i < (REG_MAX_SUPP_OPER_CLASSES - 1); idx++) { - for (ch_bandwidth = BW20; ch_bandwidth < BWALL; - ch_bandwidth++) { - class = wlan_reg_dmn_get_opclass_from_channel( - mac_ctx->scan.countryCodeCurrent, - wlan_reg_freq_to_chan(mac_ctx->pdev, channel_info->channel_freq_list[idx]), - ch_bandwidth); - sme_debug("for chan freq %d, op class: %d", - channel_info->channel_freq_list[idx], class); + *i < (REG_MAX_SUPP_OPER_CLASSES - 1); idx++) { + wlan_reg_freq_to_chan_op_class( + mac_ctx->pdev, channel_info->channel_freq_list[idx], + false, BIT(BEHAV_NONE), &class, &ch_num); + sme_debug("for chan freq %d, op class: %d", + channel_info->channel_freq_list[idx], class); - found = false; - for (j = 0; j < REG_MAX_SUPP_OPER_CLASSES - 1; - j++) { - if (op_classes[j] == class) { - found = true; - break; - } + found = false; + for (j = 0; j < REG_MAX_SUPP_OPER_CLASSES - 1; j++) { + if (op_classes[j] == class) { + found = true; + break; } + } - if (!found) { - op_classes[*i] = class; - *i = *i + 1; - } + if (!found) { + op_classes[*i] = class; + *i = *i + 1; } } }