summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorSecurityBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2020-02-07 14:21:49 -0800
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2020-02-07 14:21:49 -0800
commit6c63b2b2b5ab9a12e9e2c34c9171ad60861635e2 (patch)
tree8b648e10b50708f6eae3b8298ec46d497c5da9c4 /core
parent51cdc18fb7b51ed9024bc14a69aa708637c9ed9a (diff)
parent19b06765244a678967f6688595fd73f22800d2e3 (diff)
downloadqcacld-6c63b2b2b5ab9a12e9e2c34c9171ad60861635e2.tar.gz
SBMerger: 284775313 Change-Id: I16ea4d301133808d9420fef27e57461df72e1377 Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
Diffstat (limited to 'core')
-rw-r--r--core/mac/src/pe/rrm/rrm_api.c24
-rw-r--r--core/sap/inc/sap_api.h9
-rw-r--r--core/sap/src/sap_ch_select.c242
-rw-r--r--core/sap/src/sap_fsm.c21
-rw-r--r--core/sap/src/sap_internal.h6
5 files changed, 20 insertions, 282 deletions
diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c
index a1f2586feb..5854929c25 100644
--- a/core/mac/src/pe/rrm/rrm_api.c
+++ b/core/mac/src/pe/rrm/rrm_api.c
@@ -1054,28 +1054,30 @@ tSirRetStatus rrm_process_beacon_req(tpAniSirGlobal mac_ctx, tSirMacAddr peer,
*/
static
tSirRetStatus update_rrm_report(tpAniSirGlobal mac_ctx,
- tpSirMacRadioMeasureReport report,
+ tpSirMacRadioMeasureReport *report,
tDot11fRadioMeasurementRequest *rrm_req,
uint8_t *num_report, int index)
{
- if (report == NULL) {
+ tpSirMacRadioMeasureReport rrm_report;
+
+ if (!*report) {
/*
* Allocate memory to send reports for
* any subsequent requests.
*/
- report = qdf_mem_malloc(sizeof(*report) *
+ *report = qdf_mem_malloc(sizeof(tSirMacRadioMeasureReport) *
(rrm_req->num_MeasurementRequest - index));
- if (NULL == report) {
- pe_err("Unable to allocate memory during RRM Req processing");
+ if (!*report) {
+ pe_err("Fail to alloc mem during RRM Req processing");
return eSIR_MEM_ALLOC_FAILED;
}
- pe_debug("rrm beacon type incapable of %d report",
- *num_report);
+ pe_debug("rrm beacon type incapable of %d report", *num_report);
}
- report[*num_report].incapable = 1;
- report[*num_report].type =
+ rrm_report = *report;
+ rrm_report[*num_report].incapable = 1;
+ rrm_report[*num_report].type =
rrm_req->MeasurementRequest[index].measurement_type;
- report[*num_report].token =
+ rrm_report[*num_report].token =
rrm_req->MeasurementRequest[index].measurement_token;
(*num_report)++;
return eSIR_SUCCESS;
@@ -1157,7 +1159,7 @@ rrm_process_radio_measurement_request(tpAniSirGlobal mac_ctx,
break;
default:
/* Send a report with incapabale bit set. */
- status = update_rrm_report(mac_ctx, report, rrm_req,
+ status = update_rrm_report(mac_ctx, &report, rrm_req,
&num_report, i);
if (eSIR_SUCCESS != status)
return status;
diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h
index cc6252caa6..28d98eab5d 100644
--- a/core/sap/inc/sap_api.h
+++ b/core/sap/inc/sap_api.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -874,13 +874,6 @@ typedef struct sap_SoftapStats_s {
#endif
} tSap_SoftapStats, *tpSap_SoftapStats;
-#ifdef FEATURE_WLAN_CH_AVOID
-/* Store channel safety information */
-typedef struct {
- uint16_t channelNumber;
- bool isSafe;
-} sapSafeChannelType;
-#endif /* FEATURE_WLAN_CH_AVOID */
void sap_cleanup_channel_list(void *sapContext);
void sapCleanupAllChannelList(void);
diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c
index f8352dc541..7cecd4b4ab 100644
--- a/core/sap/src/sap_ch_select.c
+++ b/core/sap/src/sap_ch_select.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -128,52 +128,6 @@
#define ACS_WEIGHT_SOFTAP_TX_POWER_THROUGHPUT_CFG(weights) \
(((weights) & 0xf00000) >> 20)
-#ifdef FEATURE_WLAN_CH_AVOID
-sapSafeChannelType safe_channels[NUM_CHANNELS] = {
- {1, true},
- {2, true},
- {3, true},
- {4, true},
- {5, true},
- {6, true},
- {7, true},
- {8, true},
- {9, true},
- {10, true},
- {11, true},
- {12, true},
- {13, true},
- {14, true},
- {36, true},
- {40, true},
- {44, true},
- {48, true},
- {52, true},
- {56, true},
- {60, true},
- {64, true},
- {100, true},
- {104, true},
- {108, true},
- {112, true},
- {116, true},
- {120, true},
- {124, true},
- {128, true},
- {132, true},
- {136, true},
- {140, true},
- {144, true},
- {149, true},
- {153, true},
- {157, true},
- {161, true},
- {165, true},
- {169, true},
- {173, true},
-};
-#endif
-
typedef struct {
uint16_t chStartNum;
uint32_t weight;
@@ -401,81 +355,6 @@ static void sap_process_avoid_ie(tHalHandle hal,
}
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
-#ifdef FEATURE_WLAN_CH_AVOID
-/*==========================================================================
- FUNCTION sap_update_unsafe_channel_list
-
- DESCRIPTION
- Function Undate unsafe channel list table
-
- DEPENDENCIES
- NA.
-
- IN
- SapContext pointer
-
- RETURN VALUE
- NULL
- ============================================================================*/
-void sap_update_unsafe_channel_list(ptSapContext pSapCtx)
-{
- uint16_t i, j;
- uint16_t unsafe_channel_list[NUM_CHANNELS];
- uint16_t unsafe_channel_count = 0;
- qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
-
- if (!qdf_ctx) {
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_FATAL,
- "qdf_ctx is NULL");
- return;
- }
-
- /* Flush, default set all channel safe */
- for (i = 0; i < NUM_CHANNELS; i++) {
- safe_channels[i].isSafe = true;
- }
-
- /* Try to find unsafe channel */
-#if defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE)
- for (i = 0; i < NUM_CHANNELS; i++) {
- if (pSapCtx->dfs_ch_disable == true) {
- if (CDS_IS_DFS_CH(safe_channels[i].channelNumber)) {
- safe_channels[i].isSafe = false;
- QDF_TRACE(QDF_MODULE_ID_SAP,
- QDF_TRACE_LEVEL_DEBUG,
- "%s: DFS Ch %d is not safe in"
- " Concurrent mode",
- __func__,
- safe_channels[i].channelNumber);
- }
- }
- }
-#endif
- pld_get_wlan_unsafe_channel(qdf_ctx->dev,
- unsafe_channel_list,
- &unsafe_channel_count,
- sizeof(unsafe_channel_list));
-
- for (i = 0; i < unsafe_channel_count; i++) {
- for (j = 0; j < NUM_CHANNELS; j++) {
- if (safe_channels[j].channelNumber ==
- unsafe_channel_list[i]) {
- /* Found unsafe channel, update it */
- safe_channels[j].isSafe = false;
- QDF_TRACE(QDF_MODULE_ID_SAP,
- QDF_TRACE_LEVEL_DEBUG,
- FL("CH %d is not safe"),
- unsafe_channel_list[i]);
- break;
- }
- }
- }
-
- return;
-}
-
-#endif /* FEATURE_WLAN_CH_AVOID */
-
/*==========================================================================
FUNCTION sap_cleanup_channel_list
@@ -635,9 +514,6 @@ static bool sap_chan_sel_init(tHalHandle halHandle,
uint16_t channelnum = 0;
tpAniSirGlobal pMac = PMAC_STRUCT(halHandle);
bool chSafe = true;
-#ifdef FEATURE_WLAN_CH_AVOID
- uint16_t i;
-#endif
uint32_t dfs_master_cap_enabled;
bool include_dfs_ch = true;
bool sta_sap_scc_on_dfs_chan =
@@ -714,19 +590,8 @@ static bool sap_chan_sel_init(tHalHandle halHandle,
}
}
-#ifdef FEATURE_WLAN_CH_AVOID
- for (i = 0; i < NUM_CHANNELS; i++) {
- if ((safe_channels[i].channelNumber == *pChans) &&
- (false == safe_channels[i].isSafe)) {
- QDF_TRACE(QDF_MODULE_ID_SAP,
- QDF_TRACE_LEVEL_DEBUG,
- "In %s, Ch %d is not safe", __func__,
- *pChans);
- chSafe = false;
- break;
- }
- }
-#endif /* FEATURE_WLAN_CH_AVOID */
+ if (!cds_is_safe_channel(*pChans))
+ chSafe = false;
/* OFDM rates are not supported on channel 14 */
if (*pChans == 14 &&
@@ -2564,101 +2429,6 @@ static bool sap_is_ch_non_overlap(ptSapContext sap_ctx, uint16_t ch)
return false;
}
-#ifdef FEATURE_WLAN_CH_AVOID
-/**
- * sap_select_channel_no_scan_result() - select SAP channel when no scan results
- * are available.
- * @sap_ctx: Sap context
- *
- * Returns: channel number if success, 0 otherwise
- */
-static uint8_t sap_select_channel_no_scan_result(tHalHandle hal,
- ptSapContext sap_ctx)
-{
- enum channel_state ch_type;
- uint8_t i, first_safe_ch_in_range = SAP_CHANNEL_NOT_SELECTED;
- uint32_t dfs_master_cap_enabled;
- uint32_t start_ch_num = sap_ctx->acs_cfg->start_ch;
- uint32_t end_ch_num = sap_ctx->acs_cfg->end_ch;
-
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
- FL("start - end: %d - %d"), start_ch_num, end_ch_num);
-
- sme_cfg_get_int(hal, WNI_CFG_DFS_MASTER_ENABLED,
- &dfs_master_cap_enabled);
-
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
- "%s: dfs_master %x", __func__, dfs_master_cap_enabled);
-
- /* get a channel in PCL and within the range */
- for (i = 0; i < sap_ctx->acs_cfg->pcl_ch_count; i++) {
- if ((sap_ctx->acs_cfg->pcl_channels[i] < start_ch_num) ||
- (sap_ctx->acs_cfg->pcl_channels[i] > end_ch_num))
- continue;
-
- first_safe_ch_in_range = sap_ctx->acs_cfg->pcl_channels[i];
- break;
- }
-
- if (SAP_CHANNEL_NOT_SELECTED != first_safe_ch_in_range)
- return first_safe_ch_in_range;
-
- for (i = 0; i < NUM_CHANNELS; i++) {
- if ((safe_channels[i].channelNumber < start_ch_num) ||
- (safe_channels[i].channelNumber > end_ch_num))
- continue;
-
- ch_type = cds_get_channel_state(safe_channels[i].channelNumber);
-
- if ((ch_type == CHANNEL_STATE_DISABLE) ||
- (ch_type == CHANNEL_STATE_INVALID))
- continue;
- if ((!dfs_master_cap_enabled) &&
- (CHANNEL_STATE_DFS == ch_type)) {
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
- "%s: DFS master mode disabled. Skip DFS channel %d",
- __func__, safe_channels[i].channelNumber);
- continue;
- }
- if ((sap_ctx->dfs_mode == ACS_DFS_MODE_DISABLE) &&
- (CHANNEL_STATE_DFS == ch_type))
- continue;
-
- if (safe_channels[i].isSafe == true) {
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
- FL("channel %d in the configuration is safe"),
- safe_channels[i].channelNumber);
- first_safe_ch_in_range = safe_channels[i].channelNumber;
- break;
- }
-
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
- FL("channel %d in the configuration is unsafe"),
- safe_channels[i].channelNumber);
- }
-
- /* if no channel selected return SAP_CHANNEL_NOT_SELECTED */
- return first_safe_ch_in_range;
-}
-#else
-static uint8_t sap_select_channel_no_scan_result(tHalHandle hal,
- ptSapContext sap_ctx)
-{
- uint32_t start_ch_num = sap_ctx->acs_cfg->start_ch;
-
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
- FL("start - end: %d - %d"),
- start_ch_num,
- sap_ctx->acs_cfg->end_ch);
-
- sap_ctx->acs_cfg->pri_ch = start_ch_num;
- sap_ctx->acs_cfg->ht_sec_ch = 0;
-
- /* pick the first channel in configured range */
- return start_ch_num;
-}
-#endif /* FEATURE_WLAN_CH_AVOID */
-
/**
* sap_select_channel() - select SAP channel
* @hal: Pointer to HAL handle
@@ -2685,10 +2455,6 @@ uint8_t sap_select_channel(tHalHandle hal, ptSapContext sap_ctx,
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
"In %s, Running SAP Ch Select", __func__);
-#ifdef FEATURE_WLAN_CH_AVOID
- sap_update_unsafe_channel_list(sap_ctx);
-#endif
-
/*
* If ACS weight is not enabled on noise_floor/channel_free/tx_power,
* then skip acs process if no bss found.
@@ -2701,7 +2467,7 @@ uint8_t sap_select_channel(tHalHandle hal, ptSapContext sap_ctx,
#ifndef SOFTAP_CHANNEL_RANGE
return SAP_CHANNEL_NOT_SELECTED;
#else
- return sap_select_channel_no_scan_result(hal, sap_ctx);
+ return sap_select_default_oper_chan(sap_ctx->acs_cfg);
#endif
}
diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c
index cf0f9787ff..614ebd8103 100644
--- a/core/sap/src/sap_fsm.c
+++ b/core/sap/src/sap_fsm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -67,10 +67,6 @@
/*----------------------------------------------------------------------------
* External declarations for global context
* -------------------------------------------------------------------------*/
-#ifdef FEATURE_WLAN_CH_AVOID
-extern sapSafeChannelType safe_channels[];
-#endif /* FEATURE_WLAN_CH_AVOID */
-
/*----------------------------------------------------------------------------
* Static Variable Definitions
* -------------------------------------------------------------------------*/
@@ -4878,9 +4874,7 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
uint8_t end_ch_num, band_end_ch;
uint32_t en_lte_coex;
tHalHandle hal = CDS_GET_HAL_CB(sap_ctx->p_cds_gctx);
-#ifdef FEATURE_WLAN_CH_AVOID
uint8_t i;
-#endif
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
tSapChSelSpectInfo spect_info_obj = { NULL, 0 };
uint16_t ch_width;
@@ -4989,13 +4983,6 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
continue;
}
-#ifdef FEATURE_WLAN_CH_AVOID
- for (i = 0; i < NUM_CHANNELS; i++) {
- if (safe_channels[i].channelNumber ==
- CDS_CHANNEL_NUM(loop_count)) {
- /* Check if channel is safe */
- if (true == safe_channels[i].isSafe) {
-#endif
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
uint8_t ch;
@@ -5032,12 +5019,6 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
list[ch_count] = CDS_CHANNEL_NUM(loop_count);
ch_count++;
#endif
-#ifdef FEATURE_WLAN_CH_AVOID
- }
- break;
- }
- }
-#endif
}
for (i = 0; i < ch_count; i++) {
diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h
index 24991f1550..5ad7c5f2c3 100644
--- a/core/sap/src/sap_internal.h
+++ b/core/sap/src/sap_internal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -374,10 +374,6 @@ QDF_STATUS sap_acquire_global_lock(ptSapContext pSapCtx);
QDF_STATUS sap_release_global_lock(ptSapContext pSapCtx);
-#ifdef FEATURE_WLAN_CH_AVOID
-void sap_update_unsafe_channel_list(ptSapContext pSapCtx);
-#endif /* FEATURE_WLAN_CH_AVOID */
-
uint8_t
sap_indicate_radar(ptSapContext sapContext,
tSirSmeDfsEventInd *dfs_event);