Browse Source

qcacld-3.0: Get Vote level and High threshold from dp context

Currently we are getting current vote level and bus bandwidth
high threshold from hdd context. But these are moved to dp
context under dp component.
So to fix issue add and call ucfg api to get and set values.

Change-Id: I2c36b2df76c5932dc0d1bdbdec21ce2da5f537bc
CRs-Fixed: 3252743
Amit Mehta 2 years ago
parent
commit
8208a54eb1

+ 20 - 0
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 */

+ 8 - 0
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_ */

+ 10 - 0
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)

+ 4 - 3
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;