|
@@ -136,46 +136,6 @@ QDF_STATUS wlan_dcs_cmd_send(struct wlan_objmgr_psoc *psoc,
|
|
return QDF_STATUS_SUCCESS;
|
|
return QDF_STATUS_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
-/**
|
|
|
|
- * wlan_dcs_disable_cmd_send() - send dcs disable command to target_if layer
|
|
|
|
- * @psoc: psoc pointer
|
|
|
|
- * @pdev_id: pdev_id
|
|
|
|
- * @is_host_pdev_id: pdev_id is host id or not
|
|
|
|
- *
|
|
|
|
- * The function gets called to send dcs disable command to FW
|
|
|
|
- *
|
|
|
|
- * return: QDF_STATUS_SUCCESS for success or error code
|
|
|
|
- */
|
|
|
|
-static QDF_STATUS wlan_dcs_disable_cmd_send(struct wlan_objmgr_psoc *psoc,
|
|
|
|
- uint32_t pdev_id,
|
|
|
|
- bool is_host_pdev_id)
|
|
|
|
-{
|
|
|
|
- struct wlan_target_if_dcs_tx_ops *dcs_tx_ops;
|
|
|
|
- struct dcs_pdev_priv_obj *dcs_pdev_priv;
|
|
|
|
-
|
|
|
|
- if (!psoc) {
|
|
|
|
- dcs_err("psoc is null");
|
|
|
|
- return QDF_STATUS_E_NULL_VALUE;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- dcs_pdev_priv = wlan_dcs_get_pdev_private_obj(psoc, pdev_id);
|
|
|
|
- if (!dcs_pdev_priv) {
|
|
|
|
- dcs_err("dcs pdev private object is null");
|
|
|
|
- return QDF_STATUS_E_NULL_VALUE;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- dcs_tx_ops = target_if_dcs_get_tx_ops(psoc);
|
|
|
|
- if (dcs_tx_ops->dcs_cmd_send) {
|
|
|
|
- dcs_info("dcs_enable: %u, pdev_id: %u", 0, pdev_id);
|
|
|
|
- return dcs_tx_ops->dcs_cmd_send(psoc,
|
|
|
|
- pdev_id,
|
|
|
|
- is_host_pdev_id,
|
|
|
|
- 0);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* wlan_dcs_im_copy_stats() - dcs target interference mitigation statistics copy
|
|
* wlan_dcs_im_copy_stats() - dcs target interference mitigation statistics copy
|
|
* @prev_stats: previous statistics pointer
|
|
* @prev_stats: previous statistics pointer
|
|
@@ -325,11 +285,7 @@ wlan_dcs_wlan_interference_process(
|
|
(curr_stats->reg_tsf32 <= prev_stats->reg_tsf32)) {
|
|
(curr_stats->reg_tsf32 <= prev_stats->reg_tsf32)) {
|
|
if (unlikely(dcs_host_params.dcs_debug >= DCS_DEBUG_VERBOSE))
|
|
if (unlikely(dcs_host_params.dcs_debug >= DCS_DEBUG_VERBOSE))
|
|
dcs_debug("ignoring due to negative TSF value");
|
|
dcs_debug("ignoring due to negative TSF value");
|
|
-
|
|
|
|
- /* Copy the current stats to previous stats for next run */
|
|
|
|
- wlan_dcs_im_copy_stats(prev_stats, curr_stats);
|
|
|
|
-
|
|
|
|
- goto end;
|
|
|
|
|
|
+ goto copy_stats;
|
|
}
|
|
}
|
|
|
|
|
|
reg_tsf_delta = curr_stats->reg_tsf32 - prev_stats->reg_tsf32;
|
|
reg_tsf_delta = curr_stats->reg_tsf32 - prev_stats->reg_tsf32;
|
|
@@ -342,11 +298,7 @@ wlan_dcs_wlan_interference_process(
|
|
curr_stats->mib_stats.reg_rxclr_cnt) {
|
|
curr_stats->mib_stats.reg_rxclr_cnt) {
|
|
if (unlikely(dcs_host_params.dcs_debug >= DCS_DEBUG_VERBOSE))
|
|
if (unlikely(dcs_host_params.dcs_debug >= DCS_DEBUG_VERBOSE))
|
|
dcs_debug("ignoring due to negative rxclr count");
|
|
dcs_debug("ignoring due to negative rxclr count");
|
|
-
|
|
|
|
- /* Copy the current stats to previous stats for next run */
|
|
|
|
- wlan_dcs_im_copy_stats(prev_stats, curr_stats);
|
|
|
|
-
|
|
|
|
- goto end;
|
|
|
|
|
|
+ goto copy_stats;
|
|
}
|
|
}
|
|
|
|
|
|
rxclr_delta = curr_stats->mib_stats.reg_rxclr_cnt -
|
|
rxclr_delta = curr_stats->mib_stats.reg_rxclr_cnt -
|
|
@@ -368,13 +320,21 @@ wlan_dcs_wlan_interference_process(
|
|
tx_frame_delta, rx_frame_delta, cycle_count_delta);
|
|
tx_frame_delta, rx_frame_delta, cycle_count_delta);
|
|
|
|
|
|
if (0 == (cycle_count_delta >> 8)) {
|
|
if (0 == (cycle_count_delta >> 8)) {
|
|
- wlan_dcs_im_copy_stats(prev_stats, curr_stats);
|
|
|
|
if (unlikely(dcs_host_params.dcs_debug >= DCS_DEBUG_VERBOSE))
|
|
if (unlikely(dcs_host_params.dcs_debug >= DCS_DEBUG_VERBOSE))
|
|
dcs_debug("cycle count NULL --Investigate--");
|
|
dcs_debug("cycle count NULL --Investigate--");
|
|
-
|
|
|
|
- goto end;
|
|
|
|
|
|
+ goto copy_stats;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * For below scenario, will ignore dcs event data and won't do
|
|
|
|
+ * interference detection algorithm calculation:
|
|
|
|
+ * 1: Current SAP channel isn't on 5G band
|
|
|
|
+ * 2: In the process of ACS
|
|
|
|
+ * 3: In the process of dcs disabling dcs_restart_delay time duration
|
|
|
|
+ */
|
|
|
|
+ if (!dcs_host_params.dcs_algorithm_process)
|
|
|
|
+ goto copy_stats;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Total channel utiliztaion is the amount of time RXCLR is
|
|
* Total channel utiliztaion is the amount of time RXCLR is
|
|
* counted. RXCLR is counted, when 'RX is NOT clear', please
|
|
* counted. RXCLR is counted, when 'RX is NOT clear', please
|
|
@@ -549,14 +509,13 @@ wlan_dcs_wlan_interference_process(
|
|
/* Count the current run too */
|
|
/* Count the current run too */
|
|
p_dcs_im_stats->im_samp_cnt++;
|
|
p_dcs_im_stats->im_samp_cnt++;
|
|
|
|
|
|
- /* Copy the stats for next cycle */
|
|
|
|
- wlan_dcs_im_copy_stats(prev_stats, curr_stats);
|
|
|
|
-
|
|
|
|
if (unlikely(dcs_host_params.dcs_debug >= DCS_DEBUG_VERBOSE))
|
|
if (unlikely(dcs_host_params.dcs_debug >= DCS_DEBUG_VERBOSE))
|
|
dcs_debug("intfr_count: %u, sample_count: %u",
|
|
dcs_debug("intfr_count: %u, sample_count: %u",
|
|
p_dcs_im_stats->im_intfr_cnt,
|
|
p_dcs_im_stats->im_intfr_cnt,
|
|
p_dcs_im_stats->im_samp_cnt);
|
|
p_dcs_im_stats->im_samp_cnt);
|
|
-
|
|
|
|
|
|
+copy_stats:
|
|
|
|
+ /* Copy the stats for next cycle */
|
|
|
|
+ wlan_dcs_im_copy_stats(prev_stats, curr_stats);
|
|
end:
|
|
end:
|
|
return start_dcs_cbk_handler;
|
|
return start_dcs_cbk_handler;
|
|
}
|
|
}
|
|
@@ -586,13 +545,10 @@ void wlan_dcs_disable_timer_fn(void *dcs_timer_args)
|
|
}
|
|
}
|
|
|
|
|
|
dcs_pdev_priv = &dcs_psoc_priv->dcs_pdev_priv[pdev_id];
|
|
dcs_pdev_priv = &dcs_psoc_priv->dcs_pdev_priv[pdev_id];
|
|
-
|
|
|
|
- qdf_mem_set(&dcs_pdev_priv->dcs_im_stats,
|
|
|
|
- sizeof(dcs_pdev_priv->dcs_im_stats), 0);
|
|
|
|
dcs_pdev_priv->dcs_freq_ctrl_params.disable_delay_process = false;
|
|
dcs_pdev_priv->dcs_freq_ctrl_params.disable_delay_process = false;
|
|
|
|
|
|
dcs_info("dcs disable timeout, enable dcs detection again");
|
|
dcs_info("dcs disable timeout, enable dcs detection again");
|
|
- wlan_dcs_cmd_send(psoc, pdev_id, true);
|
|
|
|
|
|
+ wlan_dcs_set_algorithm_process(psoc, pdev_id, true);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -649,9 +605,10 @@ static void wlan_dcs_frequency_control(struct wlan_objmgr_psoc *psoc,
|
|
|
|
|
|
/*
|
|
/*
|
|
* Before start dcs callback handler or disable dcs for some time,
|
|
* Before start dcs callback handler or disable dcs for some time,
|
|
- * need to send dcs command to disable dcs detection firstly.
|
|
|
|
|
|
+ * need to ignore dcs event data and won't do interference detection
|
|
|
|
+ * algorithm calculation for disabling dcs detection firstly.
|
|
*/
|
|
*/
|
|
- wlan_dcs_disable_cmd_send(psoc, event->dcs_param.pdev_id, true);
|
|
|
|
|
|
+ wlan_dcs_set_algorithm_process(psoc, event->dcs_param.pdev_id, false);
|
|
|
|
|
|
if (disable_dcs_sometime) {
|
|
if (disable_dcs_sometime) {
|
|
dcs_freq_ctrl_params->disable_delay_process = true;
|
|
dcs_freq_ctrl_params->disable_delay_process = true;
|
|
@@ -698,9 +655,10 @@ wlan_dcs_process(struct wlan_objmgr_psoc *psoc, struct dcs_stats_event *event)
|
|
|
|
|
|
if (unlikely(dcs_pdev_priv->dcs_host_params.dcs_debug
|
|
if (unlikely(dcs_pdev_priv->dcs_host_params.dcs_debug
|
|
>= DCS_DEBUG_VERBOSE))
|
|
>= DCS_DEBUG_VERBOSE))
|
|
- dcs_debug("dcs_enable: %u, interference_type: %u",
|
|
|
|
|
|
+ dcs_debug("dcs_enable: %u, interference_type: %u, pdev_id: %u",
|
|
dcs_pdev_priv->dcs_host_params.dcs_enable,
|
|
dcs_pdev_priv->dcs_host_params.dcs_enable,
|
|
- event->dcs_param.interference_type);
|
|
|
|
|
|
+ event->dcs_param.interference_type,
|
|
|
|
+ event->dcs_param.pdev_id);
|
|
|
|
|
|
if (!dcs_pdev_priv->dcs_host_params.dcs_enable)
|
|
if (!dcs_pdev_priv->dcs_host_params.dcs_enable)
|
|
return QDF_STATUS_SUCCESS;
|
|
return QDF_STATUS_SUCCESS;
|
|
@@ -749,4 +707,21 @@ void wlan_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id)
|
|
MAX_DCS_TIME_RECORD * sizeof(unsigned long), 0);
|
|
MAX_DCS_TIME_RECORD * sizeof(unsigned long), 0);
|
|
dcs_pdev_priv->dcs_freq_ctrl_params.dcs_happened_count = 0;
|
|
dcs_pdev_priv->dcs_freq_ctrl_params.dcs_happened_count = 0;
|
|
dcs_pdev_priv->dcs_freq_ctrl_params.disable_delay_process = false;
|
|
dcs_pdev_priv->dcs_freq_ctrl_params.disable_delay_process = false;
|
|
|
|
+ wlan_dcs_set_algorithm_process(psoc, pdev_id, false);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void wlan_dcs_set_algorithm_process(struct wlan_objmgr_psoc *psoc,
|
|
|
|
+ uint32_t pdev_id,
|
|
|
|
+ bool dcs_algorithm_process)
|
|
|
|
+{
|
|
|
|
+ struct dcs_pdev_priv_obj *dcs_pdev_priv;
|
|
|
|
+
|
|
|
|
+ dcs_pdev_priv = wlan_dcs_get_pdev_private_obj(psoc, pdev_id);
|
|
|
|
+ if (!dcs_pdev_priv) {
|
|
|
|
+ dcs_err("dcs pdev private object is null");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dcs_pdev_priv->dcs_host_params.dcs_algorithm_process =
|
|
|
|
+ dcs_algorithm_process;
|
|
}
|
|
}
|