qcacld-3.0: Update ini param g_auto_detect_power_failure_mode

Update ini param g_auto_detect_power_failure_mode to incorporate below
values,
0 - Don't register wow wakeup event and FW crashes on power failure
1 - Register wow wakeup event and FW sends failure event to host on
    power failure
2 - Don't register wow wakeup event and FW silently rejuvenate on
    power failure
3 - Don't register wow wakeup event and the auto power failure detect
    feature is disabled in FW.

Change-Id: I8a704954ecbacadbc035c1523fa41a18b6300f66
CRs-Fixed: 2087144
This commit is contained in:
Hanumanth Reddy Pothula
2017-09-05 19:12:26 +05:30
committed by snandini
parent d1dee0e5ee
commit ab3959506f
7 changed files with 53 additions and 13 deletions

View File

@@ -37,16 +37,31 @@ void pmo_register_wow_wakeup_events(struct wlan_objmgr_vdev *vdev)
uint8_t vdev_id;
enum tQDF_ADAPTER_MODE vdev_opmode;
const char *iface_type;
struct pmo_psoc_priv_obj *psoc_ctx;
pmo_is_device_in_low_pwr_mode is_low_pwr_mode;
vdev_opmode = pmo_get_vdev_opmode(vdev);
vdev_id = pmo_vdev_get_id(vdev);
pmo_info("vdev_opmode %d vdev_id %d", vdev_opmode, vdev_id);
switch (vdev_opmode) {
case QDF_STA_MODE:
case QDF_P2P_CLIENT_MODE:
/* set power on failure event only for STA and P2P_CLI mode*/
psoc_ctx = pmo_vdev_get_psoc_priv(vdev);
if (psoc_ctx->psoc_cfg.auto_power_save_fail_mode ==
PMO_FW_TO_SEND_WOW_IND_ON_PWR_FAILURE){
qdf_spin_lock(&psoc_ctx->lock);
is_low_pwr_mode = psoc_ctx->is_device_in_low_pwr_mode;
qdf_spin_unlock(&psoc_ctx->lock);
if (is_low_pwr_mode && is_low_pwr_mode(vdev_id))
pmo_set_wow_event_bitmap(
WOW_CHIP_POWER_FAILURE_DETECT_EVENT,
PMO_WOW_MAX_EVENT_BM_LEN,
event_bitmap);
}
case QDF_P2P_DEVICE_MODE:
case QDF_OCB_MODE:
case QDF_STA_MODE:
case QDF_MONITOR_MODE:
iface_type = "STA";
pmo_set_sta_wow_bitmask(event_bitmap, PMO_WOW_MAX_EVENT_BM_LEN);

View File

@@ -256,7 +256,8 @@ void pmo_core_configure_dynamic_wake_events(struct wlan_objmgr_psoc *psoc)
psoc_ctx = pmo_psoc_get_priv(psoc);
if (psoc_ctx->psoc_cfg.auto_power_save_fail_mode &&
if (psoc_ctx->psoc_cfg.auto_power_save_fail_mode ==
PMO_FW_TO_SEND_WOW_IND_ON_PWR_FAILURE &&
(adapter_type == QDF_STA_MODE ||
adapter_type == QDF_P2P_CLIENT_MODE)
) {

View File

@@ -239,6 +239,24 @@ enum pmo_offload_trigger {
pmo_offload_trigger_max,
};
/**
* enum pmo_auto_pwr_detect_failure_mode_t - auto detect failure modes
* @PMO_FW_TO_CRASH_ON_PWR_FAILURE: Don't register wow wakeup event and FW
* crashes on power failure
* @PMO_FW_TO_SEND_WOW_IND_ON_PWR_FAILURE: Register wow wakeup event and FW
* sends failure event to host on power failure
* @PMO_FW_TO_REJUVENATE_ON_PWR_FAILURE: Don't register wow wakeup event and
* FW silently rejuvenate on power failure
* @PMO_AUTO_PWR_FAILURE_DETECT_DISABLE: Don't register wow wakeup event and the
* auto power failure detect feature is disabled in FW.
*/
enum pmo_auto_pwr_detect_failure_mode {
PMO_FW_TO_CRASH_ON_PWR_FAILURE,
PMO_FW_TO_SEND_WOW_IND_ON_PWR_FAILURE,
PMO_FW_TO_REJUVENATE_ON_PWR_FAILURE,
PMO_AUTO_PWR_FAILURE_DETECT_DISABLE
};
/**
* struct pmo_psoc_cfg - user configuration required for pmo
* @ptrn_match_enable_all_vdev: true when pattern match is enable for all vdev
@@ -293,7 +311,7 @@ struct pmo_psoc_cfg {
uint8_t sta_mod_dtim;
uint8_t sta_max_li_mod_dtim;
uint8_t power_save_mode;
bool auto_power_save_fail_mode;
enum pmo_auto_pwr_detect_failure_mode auto_power_save_fail_mode;
};
#endif /* end of _WLAN_PMO_COMMONP_STRUCT_H_ */

View File

@@ -29,6 +29,7 @@
#include "osdep.h"
#include "cdp_txrx_mob_def.h"
#include "wlan_pmo_common_public_struct.h"
/**
* enum cfg_sub_20_channel_width: ini values for su 20 mhz channel width
@@ -162,7 +163,7 @@ struct cds_config_info {
struct ol_tx_sched_wrr_ac_specs_t ac_specs[TX_WMM_AC_NUM];
enum active_bpf_mode active_uc_bpf_mode;
enum active_bpf_mode active_mc_bc_bpf_mode;
bool auto_power_save_fail_mode;
enum pmo_auto_pwr_detect_failure_mode auto_power_save_fail_mode;
uint8_t ito_repeat_count;
bool force_target_assert_enabled;
};

View File

@@ -7755,9 +7755,9 @@ enum hdd_link_speed_rpt_type {
/*
* <ini>
* g_auto_detect_power_failure_mode - auto detect power save failure mode
* @Min: 0 : Recovery
* @Max: 1 : WMI
* @Default: 0
* @Min: PMO_FW_TO_CRASH_ON_PWR_FAILURE
* @Max: PMO_AUTO_PWR_FAILURE_DETECT_DISABLE
* @Default: PMO_FW_TO_CRASH_ON_PWR_FAILURE
*
* This ini specifies the behavior of FW in case of
* CHIP_POWER_SAVE_FAIL_DETECTED event
@@ -7766,10 +7766,11 @@ enum hdd_link_speed_rpt_type {
*
* </ini>
*/
#define CFG_AUTO_DETECT_POWER_FAIL_MODE_NAME "g_auto_detect_power_failure_mode"
#define CFG_AUTO_DETECT_POWER_FAIL_MODE_DEFAULT (0)
#define CFG_AUTO_DETECT_POWER_FAIL_MODE_MIN (0)
#define CFG_AUTO_DETECT_POWER_FAIL_MODE_MAX (1)
#define CFG_AUTO_DETECT_POWER_FAIL_MODE_NAME "g_auto_detect_power_failure_mode"
#define CFG_AUTO_DETECT_POWER_FAIL_MODE_DEFAULT (PMO_FW_TO_CRASH_ON_PWR_FAILURE)
#define CFG_AUTO_DETECT_POWER_FAIL_MODE_MIN (PMO_FW_TO_CRASH_ON_PWR_FAILURE)
#define CFG_AUTO_DETECT_POWER_FAIL_MODE_MAX \
(PMO_AUTO_PWR_FAILURE_DETECT_DISABLE)
/*
* <ini>
* gMaxAmsduNum - Max number of MSDU's in aggregate
@@ -13007,7 +13008,7 @@ struct hdd_config {
uint8_t enable_rts_sifsbursting;
uint8_t max_mpdus_inampdu;
uint16_t sap_max_mcs_txdata;
uint8_t auto_pwr_save_fail_mode;
enum pmo_auto_pwr_detect_failure_mode auto_pwr_save_fail_mode;
uint16_t num_11b_tx_chains;
uint16_t num_11ag_tx_chains;
uint8_t ito_repeat_count;

View File

@@ -9419,6 +9419,9 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter)
if (0 != wlan_hdd_set_wow_pulse(hdd_ctx, true))
hdd_debug("Failed to set wow pulse");
sme_cli_set_command(0, WMI_PDEV_AUTO_DETECT_POWER_FAILURE,
hdd_ctx->config->auto_pwr_save_fail_mode, PDEV_CMD);
return 0;
cds_disable:

View File

@@ -2865,7 +2865,8 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
wma_handle->ito_repeat_count = cds_cfg->ito_repeat_count;
/* Register PWR_SAVE_FAIL event only in case of recovery(1) */
if (cds_cfg->auto_power_save_fail_mode) {
if (cds_cfg->auto_power_save_fail_mode ==
PMO_FW_TO_SEND_WOW_IND_ON_PWR_FAILURE) {
wmi_unified_register_event_handler(wma_handle->wmi_handle,
WMI_PDEV_CHIP_POWER_SAVE_FAILURE_DETECTED_EVENTID,
wma_chip_power_save_failure_detected_handler,