From dc0b7858fca3922ec05bb9b4de670f4ca194bea9 Mon Sep 17 00:00:00 2001 From: Yu Tian Date: Wed, 28 Oct 2020 13:38:18 +0800 Subject: [PATCH] qcacmn: add an ini field to control rx frame pending check Add a ini control field to control rx frame pending check logic in WoW case. In some cases, power consumption is more important than rx frame ping loss, so add a control flag Change-Id: I8c4d3725edddb82a0f06dc70c22a8dd5243209f2 CRs-Fixed: 2806786 --- dp/inc/cdp_txrx_cmn.h | 5 ++++- dp/inc/cdp_txrx_cmn_struct.h | 2 ++ dp/wifi3.0/dp_main.c | 2 ++ wlan_cfg/cfg_dp.h | 21 ++++++++++++++++++++- wlan_cfg/wlan_cfg.c | 2 ++ wlan_cfg/wlan_cfg.h | 2 ++ 6 files changed, 32 insertions(+), 2 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index b33e8a7b8c85..6ffd5433576c 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -2664,7 +2664,10 @@ cdp_rx_get_pending(ol_txrx_soc_handle soc) !soc->ol_ops->dp_rx_get_pending) return 0; - return soc->ol_ops->dp_rx_get_pending(soc); + if (cdp_cfg_get(soc, cfg_dp_wow_check_rx_pending)) + return soc->ol_ops->dp_rx_get_pending(soc); + else + return 0; } #ifdef QCA_SUPPORT_WDS_EXTENDED diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 1cf1a01241b0..feaf6ea96939 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -2345,6 +2345,7 @@ struct cdp_monitor_filter { * @cfg_dp_ce_classify_enable: get CE classify enable config * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config * @cfg_dp_pktlog_buffer_size: get packet log buffer size config + * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config */ enum cdp_dp_cfg { cfg_dp_enable_data_stall, @@ -2366,6 +2367,7 @@ enum cdp_dp_cfg { cfg_dp_ce_classify_enable, cfg_dp_disable_intra_bss_fwd, cfg_dp_pktlog_buffer_size, + cfg_dp_wow_check_rx_pending, }; /** diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 1f0bf106e11b..d22f1f076bad 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -10634,6 +10634,8 @@ static uint32_t dp_get_cfg(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg) case cfg_dp_pktlog_buffer_size: value = dpsoc->wlan_cfg_ctx->pktlog_buffer_size; break; + case cfg_dp_wow_check_rx_pending: + value = dpsoc->wlan_cfg_ctx->wow_check_rx_pending_enable; default: value = 0; } diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index 739ab79b1a8a..247ab987cfcc 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -999,6 +999,24 @@ #define CFG_DP_SWLM_ENABLE \ CFG_INI_BOOL("gEnableSWLM", false, \ "Enable/Disable DP SWLM") +/* + * + * wow_check_rx_pending_enable - control to check RX frames pending in Wow + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to control DP Software to perform RX pending check + * before entering WoW mode + * + * Usage: Internal + * + * + */ +#define CFG_DP_WOW_CHECK_RX_PENDING \ + CFG_INI_BOOL("wow_check_rx_pending_enable", \ + false, \ + "enable rx frame pending check in WoW mode") #define CFG_DP \ CFG(CFG_DP_HTT_PACKET_TYPE) \ @@ -1086,5 +1104,6 @@ CFG(CFG_DP_POLL_MODE_ENABLE) \ CFG(CFG_DP_SWLM_ENABLE) \ CFG(CFG_DP_TX_PER_PKT_VDEV_ID_CHECK) \ - CFG(CFG_DP_RX_FST_IN_CMEM) + CFG(CFG_DP_RX_FST_IN_CMEM) \ + CFG(CFG_DP_WOW_CHECK_RX_PENDING) #endif /* _CFG_DP_H_ */ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 557bba0f26cd..d33b29618ef6 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -624,6 +624,8 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM); wlan_cfg_ctx->tx_per_pkt_vdev_id_check = cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK); + wlan_cfg_ctx->wow_check_rx_pending_enable = + cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING); return wlan_cfg_ctx; } diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index d23ac9142632..1c1902a00627 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -191,6 +191,7 @@ struct wlan_srng_cfg { * @rx_pending_low_threshold: threshold of stopping pkt drop * @is_swlm_enabled: flag to enable/disable SWLM * @tx_per_pkt_vdev_id_check: Enable tx perpkt vdev id check + * @wow_check_rx_pending_enable: Enable RX frame pending check in WoW */ struct wlan_cfg_dp_soc_ctxt { int num_int_ctxts; @@ -303,6 +304,7 @@ struct wlan_cfg_dp_soc_ctxt { uint8_t is_swlm_enabled; bool fst_in_cmem; bool tx_per_pkt_vdev_id_check; + bool wow_check_rx_pending_enable; }; /**