qcacld-3.0: Replace QDF_MAX_NUM_CHAN/POLICY_MGR_MAX_CHANNEL_LIST with NUM_CHANNELS
Currently QDF_MAX_NUM_CHAN/POLICY_MGR_MAX_CHANNEL_LIST aren't aligned with NUM_CHANNELS, these unalignment may cause some potential OOB access. So replace QDF_MAX_NUM_CHAN/POLICY_MGR_MAX_CHANNEL_LIST with NUM_CHANNELS to keep unified. Change-Id: Ib6c81a3979f2fd29ba1ec678f018a6704b599385 CRs-Fixed: 2644066
This commit is contained in:

gecommit door
nshrivas

bovenliggende
12d5bdc2e2
commit
b4e2c33bab
@@ -28,8 +28,6 @@
|
||||
/* Include files */
|
||||
#include <wmi_unified_api.h>
|
||||
|
||||
#define POLICY_MGR_MAX_CHANNEL_LIST 128
|
||||
|
||||
/**
|
||||
* Some max value greater than the max length of the channel list
|
||||
*/
|
||||
@@ -1145,8 +1143,8 @@ struct policy_mgr_hw_mode {
|
||||
* @pcl_len: Number of channels in the PCL
|
||||
*/
|
||||
struct policy_mgr_pcl_list {
|
||||
uint32_t pcl_list[POLICY_MGR_MAX_CHANNEL_LIST];
|
||||
uint8_t weight_list[POLICY_MGR_MAX_CHANNEL_LIST];
|
||||
uint32_t pcl_list[NUM_CHANNELS];
|
||||
uint8_t weight_list[NUM_CHANNELS];
|
||||
uint32_t pcl_len;
|
||||
};
|
||||
|
||||
@@ -1163,12 +1161,12 @@ struct policy_mgr_pcl_list {
|
||||
* @weight_list: Weights assigned by policy manager
|
||||
*/
|
||||
struct policy_mgr_pcl_chan_weights {
|
||||
uint32_t pcl_list[POLICY_MGR_MAX_CHANNEL_LIST];
|
||||
uint32_t pcl_list[NUM_CHANNELS];
|
||||
uint32_t pcl_len;
|
||||
uint32_t saved_chan_list[POLICY_MGR_MAX_CHANNEL_LIST];
|
||||
uint32_t saved_chan_list[NUM_CHANNELS];
|
||||
uint32_t saved_num_chan;
|
||||
uint8_t weighed_valid_list[POLICY_MGR_MAX_CHANNEL_LIST];
|
||||
uint8_t weight_list[POLICY_MGR_MAX_CHANNEL_LIST];
|
||||
uint8_t weighed_valid_list[NUM_CHANNELS];
|
||||
uint8_t weight_list[NUM_CHANNELS];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -1375,8 +1375,8 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
|
||||
uint32_t op_ch_freq_list[MAX_NUMBER_OF_CONC_CONNECTIONS];
|
||||
uint8_t vdev_id[MAX_NUMBER_OF_CONC_CONNECTIONS];
|
||||
enum policy_mgr_con_mode mode;
|
||||
uint32_t pcl_channels[QDF_MAX_NUM_CHAN + 1];
|
||||
uint8_t pcl_weight[QDF_MAX_NUM_CHAN + 1];
|
||||
uint32_t pcl_channels[NUM_CHANNELS + 1];
|
||||
uint8_t pcl_weight[NUM_CHANNELS + 1];
|
||||
struct policy_mgr_conc_connection_info info = {0};
|
||||
uint8_t num_cxn_del = 0;
|
||||
QDF_STATUS status;
|
||||
|
@@ -1671,7 +1671,7 @@ static QDF_STATUS policy_mgr_get_sbs_channels(
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
uint32_t conn_index = 0, num_channels = 0;
|
||||
uint32_t num_5g_channels = 0, cur_5g_ch_freq = 0;
|
||||
uint32_t remaining_5g_ch_freqs[QDF_MAX_NUM_CHAN] = {};
|
||||
uint32_t remaining_5g_ch_freqs[NUM_CHANNELS] = {};
|
||||
uint32_t remaining_channel_index = 0;
|
||||
uint32_t j = 0, i = 0, weight1, weight2;
|
||||
|
||||
@@ -1995,7 +1995,7 @@ void policy_mgr_set_weight_of_dfs_passive_channels_to_zero(
|
||||
return;
|
||||
|
||||
if (len)
|
||||
orig_channel_count = QDF_MIN(*len, QDF_MAX_NUM_CHAN);
|
||||
orig_channel_count = QDF_MIN(*len, NUM_CHANNELS);
|
||||
else {
|
||||
policy_mgr_err("invalid number of channel length");
|
||||
return;
|
||||
@@ -3360,7 +3360,7 @@ uint32_t policy_mgr_get_sap_mandatory_chan_list_len(
|
||||
|
||||
void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
uint32_t ch_freq_list[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint32_t ch_freq_list[NUM_CHANNELS] = {0};
|
||||
uint32_t len = 0;
|
||||
int i;
|
||||
QDF_STATUS status;
|
||||
@@ -3379,7 +3379,7 @@ void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc)
|
||||
}
|
||||
pm_ctx->sap_mandatory_channels_len = 0;
|
||||
|
||||
for (i = 0; (i < len) && (i < QDF_MAX_NUM_CHAN); i++) {
|
||||
for (i = 0; (i < len) && (i < NUM_CHANNELS); i++) {
|
||||
if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq_list[i])) {
|
||||
policy_mgr_debug("Add chan %hu to mandatory list",
|
||||
ch_freq_list[i]);
|
||||
@@ -3393,7 +3393,7 @@ void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc)
|
||||
void policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t ch_freq)
|
||||
{
|
||||
uint32_t ch_freq_list[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint32_t ch_freq_list[NUM_CHANNELS] = {0};
|
||||
uint32_t num_chan = 0;
|
||||
int i;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
@@ -3404,7 +3404,7 @@ void policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc,
|
||||
return;
|
||||
}
|
||||
|
||||
if (pm_ctx->sap_mandatory_channels_len >= QDF_MAX_NUM_CHAN) {
|
||||
if (pm_ctx->sap_mandatory_channels_len >= NUM_CHANNELS) {
|
||||
policy_mgr_err("Invalid channel len %d ",
|
||||
pm_ctx->sap_mandatory_channels_len);
|
||||
return;
|
||||
|
@@ -218,8 +218,8 @@ void policy_mgr_update_with_safe_channel_list(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *weight_list,
|
||||
uint32_t weight_len)
|
||||
{
|
||||
uint32_t current_channel_list[QDF_MAX_NUM_CHAN];
|
||||
uint8_t org_weight_list[QDF_MAX_NUM_CHAN];
|
||||
uint32_t current_channel_list[NUM_CHANNELS];
|
||||
uint8_t org_weight_list[NUM_CHANNELS];
|
||||
uint8_t is_unsafe = 1;
|
||||
uint8_t i, j;
|
||||
uint32_t safe_channel_count = 0, current_channel_count = 0;
|
||||
@@ -233,7 +233,7 @@ void policy_mgr_update_with_safe_channel_list(struct wlan_objmgr_psoc *psoc,
|
||||
}
|
||||
|
||||
if (len) {
|
||||
current_channel_count = QDF_MIN(*len, QDF_MAX_NUM_CHAN);
|
||||
current_channel_count = QDF_MIN(*len, NUM_CHANNELS);
|
||||
} else {
|
||||
policy_mgr_err("invalid number of channel length");
|
||||
return;
|
||||
@@ -249,7 +249,7 @@ void policy_mgr_update_with_safe_channel_list(struct wlan_objmgr_psoc *psoc,
|
||||
qdf_mem_zero(pcl_channels,
|
||||
current_channel_count * sizeof(*pcl_channels));
|
||||
|
||||
qdf_mem_copy(org_weight_list, weight_list, QDF_MAX_NUM_CHAN);
|
||||
qdf_mem_copy(org_weight_list, weight_list, NUM_CHANNELS);
|
||||
qdf_mem_zero(weight_list, weight_len);
|
||||
|
||||
policy_mgr_get_sta_sap_scc_lte_coex_chnl(psoc, &scc_on_lte_coex);
|
||||
@@ -313,12 +313,12 @@ static QDF_STATUS policy_mgr_modify_pcl_based_on_dnbs(
|
||||
uint32_t *pcl_len_org)
|
||||
{
|
||||
uint32_t i, pcl_len = 0;
|
||||
uint32_t pcl_list[QDF_MAX_NUM_CHAN];
|
||||
uint8_t weight_list[QDF_MAX_NUM_CHAN];
|
||||
uint32_t pcl_list[NUM_CHANNELS];
|
||||
uint8_t weight_list[NUM_CHANNELS];
|
||||
bool ok;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
if (*pcl_len_org > QDF_MAX_NUM_CHAN) {
|
||||
if (*pcl_len_org > NUM_CHANNELS) {
|
||||
policy_mgr_err("Invalid PCL List Length %d", *pcl_len_org);
|
||||
return status;
|
||||
}
|
||||
@@ -444,7 +444,7 @@ static QDF_STATUS policy_mgr_modify_sap_pcl_based_on_dfs(
|
||||
policy_mgr_err("Invalid Context");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
if (*pcl_len_org > QDF_MAX_NUM_CHAN) {
|
||||
if (*pcl_len_org > NUM_CHANNELS) {
|
||||
policy_mgr_err("Invalid PCL List Length %d", *pcl_len_org);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
@@ -479,8 +479,8 @@ static QDF_STATUS policy_mgr_modify_sap_pcl_based_on_nol(
|
||||
uint32_t *pcl_len_org)
|
||||
{
|
||||
uint32_t i, pcl_len = 0;
|
||||
uint32_t pcl_list[QDF_MAX_NUM_CHAN];
|
||||
uint8_t weight_list[QDF_MAX_NUM_CHAN];
|
||||
uint32_t pcl_list[NUM_CHANNELS];
|
||||
uint8_t weight_list[NUM_CHANNELS];
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
@@ -488,7 +488,7 @@ static QDF_STATUS policy_mgr_modify_sap_pcl_based_on_nol(
|
||||
policy_mgr_err("Invalid Context");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
if (*pcl_len_org > QDF_MAX_NUM_CHAN) {
|
||||
if (*pcl_len_org > NUM_CHANNELS) {
|
||||
policy_mgr_err("Invalid PCL List Length %d", *pcl_len_org);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
@@ -517,8 +517,8 @@ policy_mgr_modify_pcl_based_on_srd(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *pcl_len_org)
|
||||
{
|
||||
uint32_t i, pcl_len = 0;
|
||||
uint32_t pcl_list[QDF_MAX_NUM_CHAN];
|
||||
uint8_t weight_list[QDF_MAX_NUM_CHAN];
|
||||
uint32_t pcl_list[NUM_CHANNELS];
|
||||
uint8_t weight_list[NUM_CHANNELS];
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
bool is_etsi13_srd_chan_allowed_in_mas_mode = true;
|
||||
|
||||
@@ -533,7 +533,7 @@ policy_mgr_modify_pcl_based_on_srd(struct wlan_objmgr_psoc *psoc,
|
||||
if (is_etsi13_srd_chan_allowed_in_mas_mode)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
if (*pcl_len_org > QDF_MAX_NUM_CHAN) {
|
||||
if (*pcl_len_org > NUM_CHANNELS) {
|
||||
policy_mgr_err("Invalid PCL List Length %d", *pcl_len_org);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
@@ -1960,8 +1960,8 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc,
|
||||
enum policy_mgr_con_mode mode,
|
||||
bool for_existing_conn)
|
||||
{
|
||||
uint32_t pcl_channels[QDF_MAX_NUM_CHAN];
|
||||
uint8_t pcl_weight[QDF_MAX_NUM_CHAN];
|
||||
uint32_t pcl_channels[NUM_CHANNELS];
|
||||
uint8_t pcl_weight[NUM_CHANNELS];
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
|
||||
/*
|
||||
@@ -2036,7 +2036,7 @@ QDF_STATUS policy_mgr_get_valid_chans_from_range(
|
||||
struct wlan_objmgr_psoc *psoc, uint32_t *ch_freq_list,
|
||||
uint32_t *ch_cnt, enum policy_mgr_con_mode mode)
|
||||
{
|
||||
uint8_t ch_weight_list[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint8_t ch_weight_list[NUM_CHANNELS] = {0};
|
||||
uint32_t ch_weight_len;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
size_t chan_index = 0;
|
||||
@@ -2198,8 +2198,8 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel(
|
||||
|
||||
for (i = 0; i < *pcl_len_org; i++) {
|
||||
found = false;
|
||||
if (i >= QDF_MAX_NUM_CHAN) {
|
||||
policy_mgr_debug("index is exceeding QDF_MAX_NUM_CHAN");
|
||||
if (i >= NUM_CHANNELS) {
|
||||
policy_mgr_debug("index is exceeding NUM_CHANNELS");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < pm_ctx->sap_mandatory_channels_len; j++) {
|
||||
@@ -2209,7 +2209,7 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel(
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found && (pcl_len < QDF_MAX_NUM_CHAN)) {
|
||||
if (found && (pcl_len < NUM_CHANNELS)) {
|
||||
pcl_list_org[pcl_len] = pcl_list_org[i];
|
||||
weight_list_org[pcl_len++] = weight_list_org[i];
|
||||
}
|
||||
@@ -2290,7 +2290,7 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
qdf_mem_set(weight->weighed_valid_list, QDF_MAX_NUM_CHAN,
|
||||
qdf_mem_set(weight->weighed_valid_list, NUM_CHANNELS,
|
||||
WEIGHT_OF_DISALLOWED_CHANNELS);
|
||||
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
|
||||
if (policy_mgr_mode_specific_connection_count(
|
||||
@@ -2365,8 +2365,8 @@ uint32_t policy_mgr_get_alternate_channel_for_sap(
|
||||
struct wlan_objmgr_psoc *psoc, uint8_t sap_vdev_id,
|
||||
uint32_t sap_ch_freq)
|
||||
{
|
||||
uint32_t pcl_channels[QDF_MAX_NUM_CHAN];
|
||||
uint8_t pcl_weight[QDF_MAX_NUM_CHAN];
|
||||
uint32_t pcl_channels[NUM_CHANNELS];
|
||||
uint8_t pcl_weight[NUM_CHANNELS];
|
||||
uint32_t ch_freq = 0;
|
||||
uint32_t pcl_len = 0;
|
||||
struct policy_mgr_conc_connection_info info;
|
||||
|
@@ -1275,7 +1275,7 @@ mlme_acs_parse_weight_list(struct wlan_objmgr_psoc *psoc,
|
||||
weight_list[index].normalize_weight =
|
||||
normalize_factor;
|
||||
} else {
|
||||
if (num_acs_weight == QDF_MAX_NUM_CHAN)
|
||||
if (num_acs_weight == NUM_CHANNELS)
|
||||
continue;
|
||||
|
||||
weight_list[num_acs_weight].chan_freq = freq1;
|
||||
|
@@ -1230,7 +1230,7 @@ struct wlan_mlme_acs {
|
||||
bool is_vendor_acs_support;
|
||||
bool is_acs_support_for_dfs_ltecoex;
|
||||
bool is_external_acs_policy;
|
||||
struct acs_weight normalize_weight_chan[QDF_MAX_NUM_CHAN];
|
||||
struct acs_weight normalize_weight_chan[NUM_CHANNELS];
|
||||
uint16_t normalize_weight_num_chan;
|
||||
struct acs_weight_range normalize_weight_range[MAX_ACS_WEIGHT_RANGE];
|
||||
uint16_t num_weight_range;
|
||||
|
@@ -2333,7 +2333,7 @@ static int wlan_hdd_sap_get_valid_channellist(struct hdd_adapter *adapter,
|
||||
{
|
||||
struct sap_config *sap_config;
|
||||
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
uint32_t pcl_freqs[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint32_t pcl_freqs[NUM_CHANNELS] = {0};
|
||||
uint32_t chan_count;
|
||||
uint32_t i;
|
||||
QDF_STATUS status;
|
||||
@@ -2351,7 +2351,7 @@ static int wlan_hdd_sap_get_valid_channellist(struct hdd_adapter *adapter,
|
||||
|
||||
*channel_count = 0;
|
||||
for (i = 0; i < chan_count; i++) {
|
||||
if (*channel_count >= QDF_MAX_NUM_CHAN)
|
||||
if (*channel_count >= NUM_CHANNELS)
|
||||
break;
|
||||
|
||||
if (band == BAND_2G &&
|
||||
@@ -2469,9 +2469,9 @@ int hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter,
|
||||
struct sk_buff *skb;
|
||||
struct sap_config *sap_config;
|
||||
uint32_t channel_count = 0, status = -EINVAL;
|
||||
uint32_t freq_list[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint32_t vendor_pcl_list[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint8_t vendor_weight_list[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint32_t freq_list[NUM_CHANNELS] = {0};
|
||||
uint32_t vendor_pcl_list[NUM_CHANNELS] = {0};
|
||||
uint8_t vendor_weight_list[NUM_CHANNELS] = {0};
|
||||
struct hdd_vendor_acs_chan_params acs_chan_params;
|
||||
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
enum band_info band = BAND_2G;
|
||||
@@ -2781,13 +2781,13 @@ static void wlan_hdd_trim_acs_channel_list(uint32_t *pcl, uint8_t pcl_count,
|
||||
{
|
||||
uint16_t i, j, ch_list_count = 0;
|
||||
|
||||
if (*org_ch_list_count >= QDF_MAX_NUM_CHAN) {
|
||||
if (*org_ch_list_count >= NUM_CHANNELS) {
|
||||
hdd_err("org_ch_list_count too big %d",
|
||||
*org_ch_list_count);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pcl_count >= QDF_MAX_NUM_CHAN) {
|
||||
if (pcl_count >= NUM_CHANNELS) {
|
||||
hdd_err("pcl_count is too big %d", pcl_count);
|
||||
return;
|
||||
}
|
||||
@@ -3093,7 +3093,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
|
||||
&sap_config->acs_cfg.pcl_ch_count,
|
||||
sap_config->acs_cfg.
|
||||
pcl_channels_weight_list,
|
||||
QDF_MAX_NUM_CHAN);
|
||||
NUM_CHANNELS);
|
||||
|
||||
sap_config->acs_cfg.band = hw_mode;
|
||||
|
||||
@@ -10009,8 +10009,8 @@ static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy,
|
||||
QDF_STATUS status;
|
||||
uint32_t pcl_len = 0;
|
||||
uint32_t pcl_len_legacy = 0;
|
||||
uint32_t freq_list[QDF_MAX_NUM_CHAN];
|
||||
uint32_t freq_list_legacy[QDF_MAX_NUM_CHAN];
|
||||
uint32_t freq_list[NUM_CHANNELS];
|
||||
uint32_t freq_list_legacy[NUM_CHANNELS];
|
||||
enum policy_mgr_con_mode intf_mode;
|
||||
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX + 1];
|
||||
struct sk_buff *reply_skb;
|
||||
@@ -10070,11 +10070,11 @@ static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy,
|
||||
pcl_len_legacy = chan_weights->pcl_len;
|
||||
for (i = 0; i < pcl_len_legacy; i++)
|
||||
freq_list_legacy[i] = chan_weights->pcl_list[i];
|
||||
chan_weights->saved_num_chan = POLICY_MGR_MAX_CHANNEL_LIST;
|
||||
chan_weights->saved_num_chan = NUM_CHANNELS;
|
||||
sme_get_valid_channels(chan_weights->saved_chan_list,
|
||||
&chan_weights->saved_num_chan);
|
||||
policy_mgr_get_valid_chan_weights(hdd_ctx->psoc, chan_weights);
|
||||
w_pcl = qdf_mem_malloc(sizeof(struct weighed_pcl) * QDF_MAX_NUM_CHAN);
|
||||
w_pcl = qdf_mem_malloc(sizeof(struct weighed_pcl) * NUM_CHANNELS);
|
||||
if (!w_pcl) {
|
||||
qdf_mem_free(chan_weights);
|
||||
return -ENOMEM;
|
||||
@@ -11102,7 +11102,7 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy,
|
||||
tb[QCA_WLAN_VENDOR_ATTR_SAP_MANDATORY_FREQUENCY_LIST])/
|
||||
sizeof(uint32_t);
|
||||
|
||||
if (freq_len > QDF_MAX_NUM_CHAN) {
|
||||
if (freq_len > NUM_CHANNELS) {
|
||||
hdd_err("insufficient space to hold channels");
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -22944,7 +22944,7 @@ void wlan_hdd_init_chan_info(struct hdd_context *hdd_ctx)
|
||||
|
||||
hdd_ctx->chan_info =
|
||||
qdf_mem_malloc(sizeof(struct scan_chan_info)
|
||||
* QDF_MAX_NUM_CHAN);
|
||||
* NUM_CHANNELS);
|
||||
if (!hdd_ctx->chan_info)
|
||||
return;
|
||||
mutex_init(&hdd_ctx->chan_info_lock);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -64,7 +64,7 @@ struct report_t {
|
||||
bool status;
|
||||
char result_code[MAX_ALLOWED_CHAR_IN_REPORT];
|
||||
char reason[MAX_ALLOWED_CHAR_IN_REPORT];
|
||||
char pcl[2 * QDF_MAX_NUM_CHAN];
|
||||
char pcl[2 * NUM_CHANNELS];
|
||||
};
|
||||
|
||||
static struct report_t report[NUMBER_OF_SCENARIO];
|
||||
@@ -230,7 +230,7 @@ void fill_report(struct hdd_context *hdd_ctx, char *title,
|
||||
if (pcl) {
|
||||
qdf_mem_zero(report[report_idx].pcl,
|
||||
sizeof(report[report_idx].pcl));
|
||||
for (i = 0; i < QDF_MAX_NUM_CHAN; i++) {
|
||||
for (i = 0; i < NUM_CHANNELS; i++) {
|
||||
if (pcl[i] == 0)
|
||||
break;
|
||||
qdf_mem_zero(buf, sizeof(buf));
|
||||
@@ -622,9 +622,9 @@ static void wlan_hdd_map_subtypes_hdd_wma(enum policy_mgr_con_mode *dst,
|
||||
void wlan_hdd_one_connection_scenario(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
enum policy_mgr_con_mode sub_type;
|
||||
uint8_t pcl[QDF_MAX_NUM_CHAN] = {0},
|
||||
weight_list[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint32_t pcl_len = 0, i, pcl_freqs[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint8_t pcl[NUM_CHANNELS] = {0},
|
||||
weight_list[NUM_CHANNELS] = {0};
|
||||
uint32_t pcl_len = 0, i, pcl_freqs[NUM_CHANNELS] = {0};
|
||||
bool status = false;
|
||||
enum policy_mgr_pcl_type pcl_type;
|
||||
char reason[20] = {0};
|
||||
@@ -678,9 +678,9 @@ void wlan_hdd_two_connections_scenario(struct hdd_context *hdd_ctx,
|
||||
{
|
||||
uint8_t vdevid = 0, tx_stream = 2, rx_stream = 2;
|
||||
uint8_t type = WMI_VDEV_TYPE_STA, channel_id = first_chnl, mac_id = 1;
|
||||
uint8_t pcl[QDF_MAX_NUM_CHAN] = {0},
|
||||
weight_list[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint32_t pcl_len = 0, i, pcl_freqs[QDF_MAX_NUM_CHAN];
|
||||
uint8_t pcl[NUM_CHANNELS] = {0},
|
||||
weight_list[NUM_CHANNELS] = {0};
|
||||
uint32_t pcl_len = 0, i, pcl_freqs[NUM_CHANNELS];
|
||||
enum policy_mgr_chain_mode chain_mask = first_chain_mask;
|
||||
enum policy_mgr_con_mode sub_type, next_sub_type, dummy_type;
|
||||
enum policy_mgr_pcl_type pcl_type;
|
||||
@@ -767,8 +767,8 @@ void wlan_hdd_three_connections_scenario(struct hdd_context *hdd_ctx,
|
||||
uint8_t channel_id_1 = first_chnl, channel_id_2 = second_chnl;
|
||||
uint8_t mac_id_1, mac_id_2;
|
||||
uint8_t type_1 = WMI_VDEV_TYPE_STA, type_2 = WMI_VDEV_TYPE_STA;
|
||||
uint8_t pcl[MAX_NUM_CHAN] = {0}, weight_list[MAX_NUM_CHAN] = {0};
|
||||
uint32_t pcl_len = 0, i, pcl_freqs[QDF_MAX_NUM_CHAN];
|
||||
uint8_t pcl[NUM_CHANNELS] = {0}, weight_list[NUM_CHANNELS] = {0};
|
||||
uint32_t pcl_len = 0, i, pcl_freqs[NUM_CHANNELS];
|
||||
enum policy_mgr_chain_mode chain_mask_1;
|
||||
enum policy_mgr_chain_mode chain_mask_2;
|
||||
enum policy_mgr_con_mode sub_type_1, sub_type_2, next_sub_type;
|
||||
|
@@ -505,7 +505,7 @@ __wlan_hdd_cfg80211_conditional_chan_switch(struct wiphy *wiphy,
|
||||
tb[QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_FREQ_LIST])/
|
||||
sizeof(uint32_t);
|
||||
|
||||
if (freq_len > QDF_MAX_NUM_CHAN) {
|
||||
if (freq_len > NUM_CHANNELS) {
|
||||
hdd_err("insufficient space to hold channels");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@@ -5149,7 +5149,7 @@ static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy,
|
||||
int status;
|
||||
bool filled = false;
|
||||
|
||||
if (idx > QDF_MAX_NUM_CHAN - 1)
|
||||
if (idx > NUM_CHANNELS - 1)
|
||||
return -EINVAL;
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
|
@@ -7542,8 +7542,8 @@ static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx,
|
||||
|
||||
case WE_POLICY_MANAGER_PCL_CMD:
|
||||
{
|
||||
uint32_t pcl[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint8_t weight_list[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint32_t pcl[NUM_CHANNELS] = {0};
|
||||
uint8_t weight_list[NUM_CHANNELS] = {0};
|
||||
uint32_t pcl_len = 0, i = 0;
|
||||
|
||||
hdd_debug("<iwpriv wlan0 pm_pcl> is called");
|
||||
|
@@ -2348,8 +2348,8 @@ struct sir_wifi_start_log {
|
||||
*/
|
||||
struct sir_pcl_list {
|
||||
uint32_t pcl_len;
|
||||
uint8_t pcl_list[128];
|
||||
uint8_t weight_list[128];
|
||||
uint8_t pcl_list[NUM_CHANNELS];
|
||||
uint8_t weight_list[NUM_CHANNELS];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -2365,12 +2365,12 @@ struct sir_pcl_list {
|
||||
* @weight_list: Weights assigned by policy manager
|
||||
*/
|
||||
struct sir_pcl_chan_weights {
|
||||
uint8_t pcl_list[128];
|
||||
uint8_t pcl_list[NUM_CHANNELS];
|
||||
uint32_t pcl_len;
|
||||
uint8_t saved_chan_list[128];
|
||||
uint8_t saved_chan_list[NUM_CHANNELS];
|
||||
uint32_t saved_num_chan;
|
||||
uint8_t weighed_valid_list[128];
|
||||
uint8_t weight_list[128];
|
||||
uint8_t weighed_valid_list[NUM_CHANNELS];
|
||||
uint8_t weight_list[NUM_CHANNELS];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -444,8 +444,8 @@ struct sap_acs_cfg {
|
||||
#endif
|
||||
|
||||
uint16_t ch_width;
|
||||
uint32_t pcl_chan_freq[QDF_MAX_NUM_CHAN];
|
||||
uint8_t pcl_channels_weight_list[QDF_MAX_NUM_CHAN];
|
||||
uint32_t pcl_chan_freq[NUM_CHANNELS];
|
||||
uint8_t pcl_channels_weight_list[NUM_CHANNELS];
|
||||
uint32_t pcl_ch_count;
|
||||
uint8_t is_ht_enabled;
|
||||
uint8_t is_vht_enabled;
|
||||
|
@@ -2790,7 +2790,7 @@ static uint32_t
|
||||
wlansap_get_safe_channel(struct sap_context *sap_ctx)
|
||||
{
|
||||
struct mac_context *mac;
|
||||
uint32_t pcl_freqs[QDF_MAX_NUM_CHAN];
|
||||
uint32_t pcl_freqs[NUM_CHANNELS];
|
||||
QDF_STATUS status;
|
||||
mac_handle_t mac_handle;
|
||||
uint32_t pcl_len = 0;
|
||||
@@ -2863,7 +2863,7 @@ wlansap_get_safe_channel_from_pcl_and_acs_range(struct sap_context *sap_ctx)
|
||||
{
|
||||
struct mac_context *mac;
|
||||
struct sir_pcl_list pcl = {0};
|
||||
uint32_t pcl_freqs[QDF_MAX_NUM_CHAN] = {0};
|
||||
uint32_t pcl_freqs[NUM_CHANNELS] = {0};
|
||||
QDF_STATUS status;
|
||||
mac_handle_t mac_handle;
|
||||
uint32_t pcl_len = 0;
|
||||
|
@@ -11146,7 +11146,7 @@ void csr_update_connect_n_roam_cmn_filter(struct mac_context *mac_ctx,
|
||||
status = policy_mgr_get_pcl(mac_ctx->psoc, pm_mode,
|
||||
pcl_freq_list, &num_entries,
|
||||
filter->pcl_weight_list,
|
||||
QDF_MAX_NUM_CHAN);
|
||||
NUM_CHANNELS);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return;
|
||||
qdf_mem_copy(filter->pcl_freq_list, pcl_freq_list,
|
||||
@@ -11307,7 +11307,7 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
|
||||
ch_info->freq_list[0]) {
|
||||
filter->num_of_channels = 0;
|
||||
for (i = 0; i < ch_info->numOfChannels; i++) {
|
||||
if (filter->num_of_channels >= QDF_MAX_NUM_CHAN) {
|
||||
if (filter->num_of_channels >= NUM_CHANNELS) {
|
||||
sme_err("max allowed channel(%d) reached",
|
||||
filter->num_of_channels);
|
||||
break;
|
||||
|
@@ -412,8 +412,8 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
|
||||
num_ch = chan_info->numOfChannels;
|
||||
if (num_ch) {
|
||||
filter->num_of_channels = num_ch;
|
||||
if (filter->num_of_channels > QDF_MAX_NUM_CHAN)
|
||||
filter->num_of_channels = QDF_MAX_NUM_CHAN;
|
||||
if (filter->num_of_channels > NUM_CHANNELS)
|
||||
filter->num_of_channels = NUM_CHANNELS;
|
||||
qdf_mem_copy(filter->chan_freq_list, chan_info->freq_list,
|
||||
filter->num_of_channels *
|
||||
sizeof(filter->chan_freq_list[0]));
|
||||
|
@@ -471,8 +471,8 @@ static QDF_STATUS sme_rrm_send_scan_result(struct mac_context *mac_ctx,
|
||||
}
|
||||
|
||||
filter->num_of_channels = num_chan;
|
||||
if (filter->num_of_channels > QDF_MAX_NUM_CHAN)
|
||||
filter->num_of_channels = QDF_MAX_NUM_CHAN;
|
||||
if (filter->num_of_channels > NUM_CHANNELS)
|
||||
filter->num_of_channels = NUM_CHANNELS;
|
||||
qdf_mem_copy(filter->chan_freq_list, freq_list,
|
||||
filter->num_of_channels *
|
||||
sizeof(filter->chan_freq_list[0]));
|
||||
|
@@ -841,7 +841,7 @@ struct wma_ini_config {
|
||||
*/
|
||||
struct wma_valid_channels {
|
||||
uint8_t num_channels;
|
||||
uint32_t ch_freq_list[MAX_NUM_CHAN];
|
||||
uint32_t ch_freq_list[NUM_CHANNELS];
|
||||
};
|
||||
|
||||
#ifdef FEATURE_WLM_STATS
|
||||
|
Verwijs in nieuw issue
Block a user