mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 16:46:15 -04:00
qcacmn: Account for gaps in subchannels list
The radar affected subchannels list that is sent along with RCSA was not built properly due to unreliable (contained 0s) subchannels list provided by subchannel marking function. The implementation used a single iterated loop to traverse through the subchannel array elements, not counting 0s as possible inputs. Search through each element of the list to find if the subchannel is present and break if successful. Change-Id: I5cd5ce7b6a334247c7d8733ee8433f957480c1dd CRs-Fixed: 2364640
This commit is contained in:
parent
30ed5c4456
commit
1e3cb514eb
1 changed files with 13 additions and 12 deletions
|
|
@ -577,7 +577,8 @@ static inline void dfs_reset_bangradar(struct wlan_dfs *dfs)
|
|||
*/
|
||||
static void dfs_prepare_nol_ie_bitmap(struct wlan_dfs *dfs,
|
||||
struct radar_found_info *radar_found,
|
||||
uint8_t *in_sub_channels)
|
||||
uint8_t *in_sub_channels,
|
||||
uint8_t n_in_sub_channels)
|
||||
{
|
||||
uint8_t cur_subchans[NUM_CHANNELS_160MHZ];
|
||||
uint8_t n_cur_subchans;
|
||||
|
|
@ -592,17 +593,16 @@ static void dfs_prepare_nol_ie_bitmap(struct wlan_dfs *dfs,
|
|||
dfs->dfs_nol_ie_startfreq =
|
||||
(uint16_t)utils_dfs_chan_to_freq(cur_subchans[0]);
|
||||
|
||||
/* To fill the bitmap, only one loop is required
|
||||
* since both the arrays (current channel's subchannel list
|
||||
* and radar affected subchannels list) are sorted.
|
||||
|
||||
* We're doing a sorted search, please change it to O(n^2)
|
||||
* if the arrays ever become non sorted.
|
||||
/* Search through the array list of radar affected subchannels
|
||||
* to find if the subchannel in our current channel has radar hit.
|
||||
* Break if found to reduce loop count.
|
||||
*/
|
||||
for (i = 0, j = 0; i < n_cur_subchans; i++) {
|
||||
if (cur_subchans[i] == in_sub_channels[j]) {
|
||||
j++;
|
||||
dfs->dfs_nol_ie_bitmap |= bits;
|
||||
for (i = 0; i < n_cur_subchans; i++) {
|
||||
for (j = 0; j < n_in_sub_channels; j++) {
|
||||
if (cur_subchans[i] == in_sub_channels[j]) {
|
||||
dfs->dfs_nol_ie_bitmap |= bits;
|
||||
break;
|
||||
}
|
||||
}
|
||||
bits <<= 1;
|
||||
}
|
||||
|
|
@ -812,7 +812,8 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
|
|||
(dfs->dfs_is_rcsa_ie_sent = false) :
|
||||
(dfs->dfs_is_rcsa_ie_sent = true);
|
||||
if (dfs->dfs_use_nol_subchannel_marking) {
|
||||
dfs_prepare_nol_ie_bitmap(dfs, radar_found, channels);
|
||||
dfs_prepare_nol_ie_bitmap(dfs, radar_found, channels,
|
||||
num_channels);
|
||||
dfs->dfs_is_nol_ie_sent = true;
|
||||
}
|
||||
dfs_mlme_start_rcsa(dfs->dfs_pdev_obj, &wait_for_csa);
|
||||
|
|
|
|||
Loading…
Reference in a new issue