diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 65712b9dee19..af6e91398180 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -2725,6 +2725,26 @@ QDF_STATUS wlansap_update_owe_info(struct sap_context *sap_ctx, return status; } +static bool wlansap_is_channel_present_in_acs_list(uint8_t ch, + uint8_t *ch_list, + uint8_t ch_count) +{ + uint8_t i; + + for(i = 0; i < ch_count; i++) { + if (ch_list[i] == ch) { + /* + * channel was given by hostpad for ACS, and is present + * in PCL. + */ + sap_debug("channel present in ACS channel list %d", ch); + return true; + } + } + + return false; +} + QDF_STATUS wlansap_filter_ch_based_acs(struct sap_context *sap_ctx, uint8_t *ch_list, uint32_t *ch_cnt) @@ -2738,8 +2758,9 @@ QDF_STATUS wlansap_filter_ch_based_acs(struct sap_context *sap_ctx, } for (ch_index = 0; ch_index < *ch_cnt; ch_index++) { - if (ch_list[ch_index] >= sap_ctx->acs_cfg->start_ch && - ch_list[ch_index] <= sap_ctx->acs_cfg->end_ch) + if (wlansap_is_channel_present_in_acs_list(ch_list[ch_index], + sap_ctx->acs_cfg->ch_list, + sap_ctx->acs_cfg->ch_list_count)) ch_list[target_ch_cnt++] = ch_list[ch_index]; }