Переглянути джерело

qcacld-3.0: Add tcp param update API

Add TCP param update APIs to DP component

Change-Id: Idc2574c3ab0b3bf1632954bc907b720fcd17675d
CRs-Fixed: 3165026
Amit Mehta 3 роки тому
батько
коміт
2695c694c4

+ 109 - 2
components/dp/core/src/wlan_dp_bus_bandwidth.c

@@ -27,6 +27,7 @@
 #include <wlan_objmgr_psoc_obj_i.h>
 #include "pld_common.h"
 #include "cds_api.h"
+#include <wlan_nlink_common.h>
 
 #ifdef FEATURE_BUS_BANDWIDTH_MGR
 /**
@@ -481,7 +482,8 @@ void dp_bbm_context_deinit(struct wlan_objmgr_psoc *psoc)
 	qdf_mem_free(bbm_ctx);
 }
 #endif /* FEATURE_BUS_BANDWIDTH_MGR */
-#if defined(WLAN_FEATURE_DP_BUS_BANDWIDTH) && defined(FEATURE_RUNTIME_PM)
+#ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
+#ifdef FEATURE_RUNTIME_PM
 void dp_rtpm_tput_policy_init(struct wlan_objmgr_psoc *psoc)
 {
 	struct wlan_dp_psoc_context *dp_ctx;
@@ -592,4 +594,109 @@ int dp_rtpm_tput_policy_get_vote(struct wlan_dp_psoc_context *dp_ctx)
 	ctx = &dp_ctx->rtpm_tput_policy_ctx;
 	return qdf_atomic_read(&ctx->high_tput_vote);
 }
-#endif
+#endif /* FEATURE_RUNTIME_PM */
+
+void dp_reset_tcp_delack(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_dp_psoc_context *dp_ctx = dp_psoc_get_priv(psoc);
+
+	enum wlan_tp_level next_level = WLAN_SVC_TP_LOW;
+	struct wlan_rx_tp_data rx_tp_data = {0};
+
+	if (!dp_ctx->en_tcp_delack_no_lro)
+		return;
+
+	rx_tp_data.rx_tp_flags |= TCP_DEL_ACK_IND;
+	rx_tp_data.level = next_level;
+	dp_ctx->rx_high_ind_cnt = 0;
+	wlan_dp_update_tcp_rx_param(dp_ctx, &rx_tp_data);
+}
+
+/**
+ * dp_reset_tcp_adv_win_scale() - Reset TCP advance window scaling
+ * value to default
+ * @dp_ctx: pointer to DP context (Should not be NULL)
+ *
+ * Function used to reset TCP advance window scaling
+ * value to its default value
+ *
+ * Return: None
+ */
+static void dp_reset_tcp_adv_win_scale(struct wlan_dp_psoc_context *dp_ctx)
+{
+	enum wlan_tp_level next_level = WLAN_SVC_TP_NONE;
+	struct wlan_rx_tp_data rx_tp_data = {0};
+
+	if (!dp_ctx->dp_cfg.enable_tcp_adv_win_scale)
+		return;
+
+	rx_tp_data.rx_tp_flags |= TCP_ADV_WIN_SCL;
+	rx_tp_data.level = next_level;
+	dp_ctx->cur_rx_level = WLAN_SVC_TP_NONE;
+	wlan_dp_update_tcp_rx_param(dp_ctx, &rx_tp_data);
+}
+
+void wlan_dp_update_tcp_rx_param(struct wlan_dp_psoc_context *dp_ctx,
+				 struct wlan_rx_tp_data *data)
+{
+	struct wlan_dp_psoc_callbacks *dp_ops = &dp_ctx->dp_ops;
+
+	if (!dp_ctx) {
+		dp_err("psoc is null");
+		return;
+	}
+
+	if (!data) {
+		dp_err("Data is null");
+		return;
+	}
+
+	if (dp_ctx->dp_cfg.enable_tcp_param_update)
+		dp_ops->osif_dp_send_tcp_param_update_event(dp_ctx->psoc,
+							    (union wlan_tp_data *)data,
+							    1);
+	else
+		dp_ops->dp_send_svc_nlink_msg(cds_get_radio_index(),
+					      WLAN_SVC_WLAN_TP_IND,
+					      (void *)data,
+					      sizeof(struct wlan_rx_tp_data));
+}
+
+/**
+ * wlan_dp_update_tcp_tx_param() - update TCP param in Tx dir
+ * @dp_ctx: Pointer to DP context
+ * @data: Parameters to update
+ *
+ * Return: None
+ */
+static void wlan_dp_update_tcp_tx_param(struct wlan_dp_psoc_context *dp_ctx,
+					struct wlan_tx_tp_data *data)
+{
+	enum wlan_tp_level next_tx_level;
+	struct wlan_tx_tp_data *tx_tp_data;
+	struct wlan_dp_psoc_callbacks *dp_ops = &dp_ctx->dp_ops;
+
+	if (!dp_ctx) {
+		dp_err("psoc is null");
+		return;
+	}
+
+	if (!data) {
+		dp_err("Data is null");
+		return;
+	}
+
+	tx_tp_data = (struct wlan_tx_tp_data *)data;
+	next_tx_level = tx_tp_data->level;
+
+	if (dp_ctx->dp_cfg.enable_tcp_param_update)
+		dp_ops->osif_dp_send_tcp_param_update_event(dp_ctx->psoc,
+							    (union wlan_tp_data *)data,
+							    0);
+	else
+		dp_ops->dp_send_svc_nlink_msg(cds_get_radio_index(),
+					      WLAN_SVC_WLAN_TP_TX_IND,
+					      &next_tx_level,
+					      sizeof(next_tx_level));
+}
+#endif /* WLAN_FEATURE_DP_BUS_BANDWIDTH */

+ 33 - 0
components/dp/core/src/wlan_dp_bus_bandwidth.h

@@ -29,6 +29,7 @@
 #include <qca_vendor.h>
 #include <wlan_objmgr_psoc_obj.h>
 #include "wlan_dp_public_struct.h"
+#include "wlan_dp_priv.h"
 
 typedef const enum bus_bw_level
 	bus_bw_table_type[QCA_WLAN_802_11_MODE_INVALID][TPUT_LEVEL_MAX];
@@ -152,4 +153,36 @@ dp_rtpm_tput_policy_get_vote(struct wlan_dp_psoc_context *dp_ctx)
 	return -EINVAL;
 }
 #endif /* WLAN_FEATURE_DP_BUS_BANDWIDTH && FEATURE_RUNTIME_PM */
+#ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
+/**
+ * dp_reset_tcp_delack() - Reset tcp delack value to default
+ * @psoc: psoc handle
+ *
+ * Function used to reset TCP delack value to its default value
+ *
+ * Return: None
+ */
+void dp_reset_tcp_delack(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * wlan_dp_update_tcp_rx_param() - update TCP param in RX dir
+ * @dp_ctx: Pointer to DP context
+ * @data: Parameters to update
+ *
+ * Return: None
+ */
+void wlan_dp_update_tcp_rx_param(struct wlan_dp_psoc_context *dp_ctx,
+				 struct wlan_rx_tp_data *data);
+#else
+static inline
+void dp_reset_tcp_delack(struct wlan_objmgr_psoc *psoc);
+{
+}
+
+static inline
+void wlan_dp_update_tcp_rx_param(struct wlan_dp_psoc_context *dp_ctx,
+				 struct wlan_rx_tp_data *data)
+{
+}
+#endif /* WLAN_FEATURE_DP_BUS_BANDWIDTH */
 #endif /* WLAN_DP_BUS_BANDWIDTH_H */

+ 2 - 0
components/dp/core/src/wlan_dp_main.c

@@ -513,6 +513,7 @@ void dp_set_rps(uint8_t vdev_id, bool enable)
 
 	dp_intf = dp_get_vdev_priv_obj(vdev);
 	if (!dp_intf) {
+		dp_comp_vdev_put_ref(vdev);
 		dp_err_rl("DP interface not found for vdev_id: %d", vdev_id);
 		return;
 	}
@@ -524,6 +525,7 @@ void dp_set_rps(uint8_t vdev_id, bool enable)
 		else
 			dp_send_rps_disable_ind(dp_intf);
 	}
+	dp_comp_vdev_put_ref(vdev);
 }
 #endif