mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
qcacmn: Pass the argument of a correct type to the DFS API
utils_dfs_reg_update_nol_history_ch is invoked with an argument of (void *)chan_list. However, the usage of utils_dfs_reg_update_nol_history_ch() assumes (void *)chan_list to be a uint8_t *ch_ieee but (void *)chan_list is a (void *) pointer of struct dfs_channel. Similarly, the equivalent freq API utils_dfs_reg_update_nol_history_chan_for_freq() also has a mismatch in its usage of (void *)chan_list. Modify the arguments of utils_dfs_reg_update_nol_history_ch() and utils_dfs_reg_update_nol_history_chan_for_freq() API to match its usage. Change-Id: Ic0b88606ea81bde1f7065c16dfac008b737b705c CRs-Fixed: 2484771
This commit is contained in:
parent
b673dae57f
commit
b4dda82e98
2 changed files with 73 additions and 10 deletions
|
|
@ -2156,7 +2156,14 @@ int dfs_override_cac_timeout(struct wlan_dfs *dfs,
|
|||
* all the channels in dfs_ch_channels.
|
||||
* @dfs: Pointer to wlan_dfs structure.
|
||||
*/
|
||||
#if !defined(QCA_MCL_DFS_SUPPORT)
|
||||
void dfs_clear_nolhistory(struct wlan_dfs *dfs);
|
||||
#else
|
||||
static inline void
|
||||
dfs_clear_nolhistory(struct wlan_dfs *dfs)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ol_if_dfs_configure() - Initialize the RADAR table for offload chipsets.
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "../dfs_process_radar_found_ind.h"
|
||||
#include "../dfs_partial_offload_radar.h"
|
||||
#endif
|
||||
#include <qdf_types.h>
|
||||
|
||||
void dfs_set_update_nol_flag(struct wlan_dfs *dfs, bool val)
|
||||
{
|
||||
|
|
@ -763,12 +764,16 @@ void dfs_getnol(struct wlan_dfs *dfs, void *dfs_nolinfo)
|
|||
DFS_GET_NOL_LOCKED(dfs, nolinfo->dfs_nol, &(nolinfo->dfs_ch_nchans));
|
||||
}
|
||||
|
||||
#if !defined(QCA_MCL_DFS_SUPPORT)
|
||||
#ifdef CONFIG_CHAN_FREQ_API
|
||||
void dfs_clear_nolhistory(struct wlan_dfs *dfs)
|
||||
{
|
||||
struct dfs_channel *chan_list;
|
||||
int nchans = 0;
|
||||
int nchans;
|
||||
bool sta_opmode;
|
||||
int i;
|
||||
qdf_freq_t *nol_freq_list = NULL;
|
||||
int num_nol_history_chans;
|
||||
|
||||
if (!dfs->dfs_is_stadfs_enabled)
|
||||
return;
|
||||
|
|
@ -779,31 +784,57 @@ void dfs_clear_nolhistory(struct wlan_dfs *dfs)
|
|||
|
||||
nchans = dfs_get_num_chans();
|
||||
|
||||
if (!nchans) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "zero chans");
|
||||
return;
|
||||
}
|
||||
|
||||
chan_list = qdf_mem_malloc(nchans * sizeof(*chan_list));
|
||||
if (!chan_list)
|
||||
return;
|
||||
|
||||
utils_dfs_get_nol_history_chan_list(dfs->dfs_pdev_obj,
|
||||
(void *)chan_list, &nchans);
|
||||
if (!nchans) {
|
||||
(void *)chan_list,
|
||||
&num_nol_history_chans);
|
||||
|
||||
if (!num_nol_history_chans) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "zero chans");
|
||||
qdf_mem_free(chan_list);
|
||||
return;
|
||||
}
|
||||
|
||||
utils_dfs_reg_update_nol_history_chan_for_freq(dfs->dfs_pdev_obj,
|
||||
(void *)chan_list, nchans,
|
||||
DFS_NOL_HISTORY_RESET);
|
||||
if (num_nol_history_chans > nchans)
|
||||
num_nol_history_chans = nchans;
|
||||
|
||||
nol_freq_list =
|
||||
qdf_mem_malloc(num_nol_history_chans * sizeof(qdf_freq_t));
|
||||
|
||||
if (!nol_freq_list) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "Unable to alloc memory for freq list");
|
||||
qdf_mem_free(chan_list);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_nol_history_chans; i++)
|
||||
nol_freq_list[i] = chan_list[i].dfs_ch_freq;
|
||||
|
||||
utils_dfs_reg_update_nol_history_chan_for_freq(dfs->dfs_pdev_obj,
|
||||
nol_freq_list,
|
||||
num_nol_history_chans,
|
||||
DFS_NOL_HISTORY_RESET);
|
||||
qdf_mem_free(chan_list);
|
||||
qdf_mem_free(nol_freq_list);
|
||||
}
|
||||
#else
|
||||
#ifdef CONFIG_CHAN_NUM_API
|
||||
void dfs_clear_nolhistory(struct wlan_dfs *dfs)
|
||||
{
|
||||
struct dfs_channel *chan_list;
|
||||
int nchans = 0;
|
||||
int nchans;
|
||||
bool sta_opmode;
|
||||
int i;
|
||||
uint8_t *nol_chan_ieee_list = NULL;
|
||||
int num_nol_history_chans;
|
||||
|
||||
if (!dfs->dfs_is_stadfs_enabled)
|
||||
return;
|
||||
|
|
@ -814,26 +845,51 @@ void dfs_clear_nolhistory(struct wlan_dfs *dfs)
|
|||
|
||||
nchans = dfs_get_num_chans();
|
||||
|
||||
if (!nchans) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "zero chans");
|
||||
return;
|
||||
}
|
||||
|
||||
chan_list = qdf_mem_malloc(nchans * sizeof(*chan_list));
|
||||
if (!chan_list)
|
||||
return;
|
||||
|
||||
utils_dfs_get_nol_history_chan_list(dfs->dfs_pdev_obj,
|
||||
(void *)chan_list, &nchans);
|
||||
if (!nchans) {
|
||||
(void *)chan_list,
|
||||
&num_nol_history_chans);
|
||||
|
||||
if (!num_nol_history_chans) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "zero chans");
|
||||
qdf_mem_free(chan_list);
|
||||
return;
|
||||
}
|
||||
|
||||
if (num_nol_history_chans > nchans)
|
||||
num_nol_history_chans = nchans;
|
||||
|
||||
nol_chan_ieee_list =
|
||||
qdf_mem_malloc(num_nol_history_chans * sizeof(uint8_t));
|
||||
|
||||
if (!nol_chan_ieee_list) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "Unable to alloc memory for ieee list");
|
||||
qdf_mem_free(chan_list);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_nol_history_chans; i++)
|
||||
nol_chan_ieee_list[i] = chan_list[i].dfs_ch_ieee;
|
||||
|
||||
utils_dfs_reg_update_nol_history_ch(dfs->dfs_pdev_obj,
|
||||
(void *)chan_list, nchans,
|
||||
nol_chan_ieee_list,
|
||||
num_nol_history_chans,
|
||||
DFS_NOL_HISTORY_RESET);
|
||||
|
||||
qdf_mem_free(chan_list);
|
||||
qdf_mem_free(nol_chan_ieee_list);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) && \
|
||||
defined(CONFIG_CHAN_FREQ_API)
|
||||
|
|
|
|||
Loading…
Reference in a new issue