diff --git a/components/dp/core/src/wlan_dp_bus_bandwidth.h b/components/dp/core/src/wlan_dp_bus_bandwidth.h index 07ce5b3236..64397fe8ba 100644 --- a/components/dp/core/src/wlan_dp_bus_bandwidth.h +++ b/components/dp/core/src/wlan_dp_bus_bandwidth.h @@ -349,6 +349,20 @@ void dp_bus_bw_compute_prev_txrx_stats(struct wlan_objmgr_vdev *vdev); * Return: None */ void dp_bus_bw_compute_reset_prev_txrx_stats(struct wlan_objmgr_vdev *vdev); + +/** + * dp_get_bus_bw_high_threshold() - Get the bus bw high threshold + * level + * @dp_ctx: DP Context handle + * + * Return: bus bw high threshold + */ +static inline uint32_t +dp_get_bus_bw_high_threshold(struct wlan_dp_psoc_context *dp_ctx) +{ + return dp_ctx->dp_cfg.bus_bw_high_threshold; +} + #else static inline void dp_reset_tcp_delack(struct wlan_objmgr_psoc *psoc) @@ -429,5 +443,11 @@ void dp_bus_bw_compute_reset_prev_txrx_stats(struct wlan_objmgr_vdev *vdev) { } +static inline uint32_t +dp_get_bus_bw_high_threshold(struct wlan_dp_psoc_context *dp_ctx) +{ + return 0; +} + #endif /* WLAN_FEATURE_DP_BUS_BANDWIDTH */ #endif /* WLAN_DP_BUS_BANDWIDTH_H */ diff --git a/components/dp/dispatcher/inc/wlan_dp_ucfg_api.h b/components/dp/dispatcher/inc/wlan_dp_ucfg_api.h index ee3a4e7bae..f7ebff1db7 100644 --- a/components/dp/dispatcher/inc/wlan_dp_ucfg_api.h +++ b/components/dp/dispatcher/inc/wlan_dp_ucfg_api.h @@ -1190,4 +1190,12 @@ bool ucfg_dp_nud_fail_data_stall_evt_enabled(void); */ uint32_t ucfg_dp_fw_data_stall_evt_enabled(void); +/** + * ucfg_dp_get_bus_bw_high_threshold() - Get the bus bw high threshold + * @psoc: psoc handle + * + * Return: current bus bw high threshold + */ +uint32_t ucfg_dp_get_bus_bw_high_threshold(struct wlan_objmgr_psoc *psoc); + #endif /* _WLAN_DP_UCFG_API_H_ */ diff --git a/components/dp/dispatcher/src/wlan_dp_ucfg_api.c b/components/dp/dispatcher/src/wlan_dp_ucfg_api.c index 224cdc3bf2..beb786ff5e 100644 --- a/components/dp/dispatcher/src/wlan_dp_ucfg_api.c +++ b/components/dp/dispatcher/src/wlan_dp_ucfg_api.c @@ -1815,6 +1815,16 @@ int ucfg_dp_get_current_throughput_level(struct wlan_objmgr_psoc *psoc) return dp_get_current_throughput_level(dp_ctx); } +uint32_t ucfg_dp_get_bus_bw_high_threshold(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_dp_psoc_context *dp_ctx = dp_psoc_get_priv(psoc); + + if (!dp_ctx) + return 0; + + return dp_get_bus_bw_high_threshold(dp_ctx); +} + QDF_STATUS ucfg_dp_req_get_arp_stats(struct wlan_objmgr_psoc *psoc, struct dp_get_arp_stats_params *params) diff --git a/core/hdd/src/wlan_hdd_napi.c b/core/hdd/src/wlan_hdd_napi.c index 58025c2bfe..8d9f3f2bd8 100644 --- a/core/hdd/src/wlan_hdd_napi.c +++ b/core/hdd/src/wlan_hdd_napi.c @@ -370,7 +370,7 @@ int hdd_napi_apply_throughput_policy(struct hdd_context *hddctx, napi_tput_policy_delay--; /* make sure the next timer call calls us */ - hddctx->cur_vote_level = -1; + ucfg_dp_set_current_throughput_level(hddctx->psoc, -1); return rc; } @@ -386,7 +386,7 @@ int hdd_napi_apply_throughput_policy(struct hdd_context *hddctx, return rc; } - if (packets > hddctx->config->bus_bw_high_threshold) + if (packets > ucfg_dp_get_bus_bw_high_threshold(hddctx->psoc)) req_state = QCA_NAPI_TPUT_HI; else req_state = QCA_NAPI_TPUT_LO; @@ -434,7 +434,8 @@ int hdd_napi_serialize(int is_on) /* make sure that bus_bandwidth trigger is executed */ hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (hdd_ctx) - hdd_ctx->cur_vote_level = -1; + ucfg_dp_set_current_throughput_level(hdd_ctx->psoc, + -1); } return rc;