qcacmn: Avoid incrementing usable channel count for 0 freq

Currently if both filters are added to get usable channels
i.e FILTER_CELLULAR_COEX and FILTER_WLAN_CONCURRENCY (3) then
all channels for required band are added first and then response
is updated based on cellular coex filter and invalid and avoided
channel frequencies are removed based on provided mode but for
FILTER_WLAN_CONCURRENCY pcl list is added, if frequency is not
present in response channel list and count is incremented. As
invalid frequencies are already removed from response before concurrency
check , so some pcl frequencies will not be present in the list and
count may be updated more than valid count.

Fix is to add frequencies based on concurrency filter first and then
remove invalid frequencies based on celluar coex filter to avoid
any invalid increment of channel list count.

Change-Id: I72b13c9c1f1bdfe3616d44fe893ce306634b022e
CRs-Fixed: 3262059
This commit is contained in:
Sheenam Monga 2022-08-08 12:55:41 +05:30 • committed by Alexander Winkowski
commit f826e1aebd
No known key found for this signature in database
GPG key ID: 72762A66704CDE44

View file

@ -3338,7 +3338,7 @@ reg_update_usable_chan_resp(struct wlan_objmgr_pdev *pdev,
struct ch_params ch_params = {0};
int index = *count;
for (i = 0; i < len; i++) {
for (i = 0; i < len && index < NUM_CHANNELS; i++) {
/* In case usable channels are required for multiple filter
* mask, Some frequencies may present in res_msg . To avoid
* frequency duplication, only mode mask is updated for
@ -3690,6 +3690,8 @@ reg_get_usable_channel_coex_filter(struct wlan_objmgr_pdev *pdev,
chan_list[chan_enum].center_freq &&
freq_range.end_freq >=
chan_list[chan_enum].center_freq) {
reg_debug("avoid freq %d",
chan_list[chan_enum].center_freq);
reg_remove_freq(res_msg, chan_enum);
}
}
@ -3808,16 +3810,15 @@ wlan_reg_get_usable_channel(struct wlan_objmgr_pdev *pdev,
}
}
if (req_msg.filter_mask & 1 << FILTER_CELLULAR_COEX)
status =
reg_get_usable_channel_coex_filter(pdev, req_msg, res_msg,
chan_list, usable_channels);
if (req_msg.filter_mask & 1 << FILTER_WLAN_CONCURRENCY)
status =
reg_get_usable_channel_con_filter(pdev, req_msg, res_msg,
usable_channels);
if (req_msg.filter_mask & 1 << FILTER_CELLULAR_COEX)
status =
reg_get_usable_channel_coex_filter(pdev, req_msg, res_msg,
chan_list, usable_channels);
if (!(req_msg.filter_mask & 1 << FILTER_CELLULAR_COEX) &&
!(req_msg.filter_mask & 1 << FILTER_WLAN_CONCURRENCY))
status =