qcacmn: Sync PreCAC NOL with NOL

Problem:
1) When operating in 36VHT160 for example, if radar is hit without
bandwidth reduction dfs_radar_add_channel_list_to_nol_for_freq will add
only DFS channels (52,56,60,64) to NOL and disable them corresponding in
regulatory channel.
2)dfs_mark_precac_nol_for_freq will add all channel non-DFS(36,40,44,48)
and DFS (52,56,60,64) to preCAC nol. 3) after NOL expiry
non-DFS(36,40,44,48) will not be removed from the preCAC tree and
therefore cannot used (as part of the full 160Mhz channel) in future to
perform agile.

While processing RADAR the dfs_process_radar_ind() prepares the
list of frequencies (freq_list) to be added to NOL. This list
also contains the non-DFS channels.

Only DFS channels will be added to the NOL in
dfs_radar_add_channel_list_to_nol_for_freq() based on the channel state.
On adding to NOL, the channel state is also changed to disabled.

The subsequent APIs  that will need to process
NOL(dfs_mark_precac_nol_for_freq() for instance) will have only the
freq_list. Since the channel state is also changed for DFS channels in
freq_list, these APIs cannot differentiate a NOL channel and nonDFS
channel (as channel state is not DFS for both). Thus not adding
NOL channels to PreCAC NOL list.

Solution:
Use the NOL frequency list (nol_freq_list) that is the output
of dfs_radar_add_channel_list_to_nol_for_freq() to process NOL.

CRs-Fixed: 2655016
Change-Id: If3608405a5e8e63d93157914080dde4c01c1e0bb
This commit is contained in:
Vignesh U 2020-04-01 16:29:06 +05:30 • committed by nshrivas
commit c1c90f6115

View file

@ -152,8 +152,13 @@ int dfs_get_nol_subchannel_marking(struct wlan_dfs *dfs,
/**
* dfs_radar_add_channel_list_to_nol_for_freq()- Add given channels to nol
* @dfs: Pointer to wlan_dfs structure.
* @freq_list: Pointer to list of frequency.
* @num_channels: Number of channels in the list.
* @freq_list: Pointer to list of frequency(has both nonDFS and DFS channels).
* Input frequency list.
* @nol_freq_list: Pointer to list of NOL frequencies. Output frequency list.
* @num_channels: Pointer to number of channels in the list. It is both input
* and output to this function.
* *Input: Number of subchannels in @freq_list.
* *Output: Number of subchannels in @nol_freq_list.
*
* Add list of channels to nol, only if the channel is dfs.
*
@ -163,20 +168,20 @@ int dfs_get_nol_subchannel_marking(struct wlan_dfs *dfs,
static QDF_STATUS
dfs_radar_add_channel_list_to_nol_for_freq(struct wlan_dfs *dfs,
uint16_t *freq_list,
uint8_t num_channels)
uint16_t *nol_freq_list,
uint8_t *num_channels)
{
int i;
uint16_t last_chan_freq = 0;
uint16_t nol_freq_list[NUM_CHANNELS_160MHZ];
uint8_t num_ch = 0;
if (num_channels > NUM_CHANNELS_160MHZ) {
if (*num_channels > NUM_CHANNELS_160MHZ) {
dfs_err(dfs, WLAN_DEBUG_DFS,
"Invalid num channels: %d", num_channels);
"Invalid num channels: %d", *num_channels);
return QDF_STATUS_E_FAILURE;
}
for (i = 0; i < num_channels; i++) {
for (i = 0; i < *num_channels; i++) {
if (freq_list[i] == 0 ||
freq_list[i] == last_chan_freq)
continue;
@ -203,6 +208,7 @@ dfs_radar_add_channel_list_to_nol_for_freq(struct wlan_dfs *dfs,
"dfs channels not found in channel list");
return QDF_STATUS_E_FAILURE;
}
*num_channels = num_ch;
utils_dfs_reg_update_nol_chan_for_freq(dfs->dfs_pdev_obj,
nol_freq_list, num_ch,
@ -911,6 +917,7 @@ bool dfs_process_nol_ie_bitmap(struct wlan_dfs *dfs, uint8_t nol_ie_bandwidth,
uint8_t num_subchans;
uint8_t bits = 0x01;
uint16_t radar_subchans[NUM_CHANNELS_160MHZ];
uint16_t nol_freq_list[NUM_CHANNELS_160MHZ];
bool should_nol_ie_be_sent = true;
qdf_mem_zero(radar_subchans, sizeof(radar_subchans));
@ -946,7 +953,8 @@ bool dfs_process_nol_ie_bitmap(struct wlan_dfs *dfs, uint8_t nol_ie_bandwidth,
}
dfs_radar_add_channel_list_to_nol_for_freq(dfs, radar_subchans,
num_subchans);
nol_freq_list,
&num_subchans);
return should_nol_ie_be_sent;
}
#endif
@ -1050,6 +1058,7 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
{
bool wait_for_csa = false;
uint16_t freq_list[NUM_CHANNELS_160MHZ];
uint16_t nol_freq_list[NUM_CHANNELS_160MHZ];
uint8_t num_channels;
QDF_STATUS status = QDF_STATUS_E_FAILURE;
uint32_t freq_center;
@ -1183,7 +1192,8 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
status = dfs_radar_add_channel_list_to_nol_for_freq(dfs,
freq_list,
num_channels);
nol_freq_list,
&num_channels);
if (QDF_IS_STATUS_ERROR(status)) {
dfs_err(dfs, WLAN_DEBUG_DFS,
"radar event received on invalid channel");
@ -1197,7 +1207,8 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
(dfs->dfs_is_rcsa_ie_sent = true);
if (dfs->dfs_use_nol_subchannel_marking) {
dfs_reset_nol_ie_bitmap(dfs);
dfs_prepare_nol_ie_bitmap_for_freq(dfs, radar_found, freq_list,
dfs_prepare_nol_ie_bitmap_for_freq(dfs, radar_found,
nol_freq_list,
num_channels);
dfs->dfs_is_nol_ie_sent = true;
}
@ -1225,7 +1236,7 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
dfs_mark_precac_nol_for_freq(dfs,
dfs->is_radar_found_on_secondary_seg,
radar_found->detector_id,
freq_list,
nol_freq_list,
num_channels);
/*
* This calls into the umac DFS code, which sets the umac