Browse Source

qcacld-3.0: Add skeleton code for direct link datapath

Add skeleton code for direct link datapath in DP
component.

Change-Id: I1279abfe573017258b13043d779d0ddc41ee8dd2
CRs-Fixed: 3295346
Yeshwanth Sriram Guntuka 2 years ago
parent
commit
f263f50933

+ 28 - 0
components/dp/core/inc/wlan_dp_main.h

@@ -657,4 +657,32 @@ void dp_clear_net_dev_stats(struct wlan_dp_intf *dp_intf)
 	qdf_mem_set(&dp_intf->stats, sizeof(dp_intf->stats), 0);
 }
 
+#ifdef FEATURE_DIRECT_LINK
+/**
+ * dp_direct_link_init() - Initializes Direct Link datapath
+ * @dp_ctx: DP private context
+ *
+ * Return: QDF status
+ */
+QDF_STATUS dp_direct_link_init(struct wlan_dp_psoc_context *dp_ctx);
+
+/**
+ * dp_direct_link_deinit() - De-initializes Direct Link datapath
+ * @dp_ctx: DP private context
+ *
+ * Return: None
+ */
+void dp_direct_link_deinit(struct wlan_dp_psoc_context *dp_ctx);
+#else
+static inline
+QDF_STATUS dp_direct_link_init(struct wlan_dp_psoc_context *dp_ctx)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline
+void dp_direct_link_deinit(struct wlan_dp_psoc_context *dp_ctx)
+{
+}
+#endif
 #endif

+ 14 - 0
components/dp/core/inc/wlan_dp_priv.h

@@ -360,6 +360,16 @@ enum RX_OFFLOAD {
 	CFG_GRO_ENABLED,
 };
 
+#ifdef FEATURE_DIRECT_LINK
+/**
+ * struct dp_direct_link_context - Datapath Direct Link context
+ * @dp_ctx: pointer to DP psoc priv context
+ */
+struct dp_direct_link_context {
+	struct wlan_dp_psoc_context *dp_ctx;
+};
+#endif
+
 /**
  * struct wlan_dp_psoc_context - psoc related data required for DP
  * @pdev: object manager pdev context
@@ -375,6 +385,7 @@ enum RX_OFFLOAD {
  * @rtpm_tput_policy_ctx: Runtime Tput policy context
  * @txrx_hist: TxRx histogram
  * @bbm_ctx: bus bandwidth manager context
+ * @dp_direct_link_ctx: DP Direct Link context
  */
 struct wlan_dp_psoc_context {
 	struct wlan_objmgr_psoc *psoc;
@@ -459,6 +470,9 @@ struct wlan_dp_psoc_context {
 	qdf_wake_lock_t rx_wake_lock;
 
 	enum RX_OFFLOAD ol_enable;
+#ifdef FEATURE_DIRECT_LINK
+	struct dp_direct_link_context *dp_direct_link_ctx;
+#endif
 };
 
 #endif /* end  of _WLAN_DP_PRIV_STRUCT_H_ */

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

@@ -1539,3 +1539,29 @@ bool dp_is_data_stall_event_enabled(uint32_t evt)
 
 	return false;
 }
+
+#ifdef FEATURE_DIRECT_LINK
+QDF_STATUS dp_direct_link_init(struct wlan_dp_psoc_context *dp_ctx)
+{
+	struct dp_direct_link_context *dp_direct_link_ctx;
+
+	/* ToDo: Check for FW direct_link capability */
+
+	dp_direct_link_ctx = qdf_mem_malloc(sizeof(*dp_direct_link_ctx));
+	if (!dp_direct_link_ctx) {
+		dp_err("Failed to allocate memory for DP Direct Link context");
+		return QDF_STATUS_E_NOMEM;
+	}
+
+	dp_ctx->dp_direct_link_ctx = dp_direct_link_ctx;
+	dp_direct_link_ctx->dp_ctx = dp_ctx;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+void dp_direct_link_deinit(struct wlan_dp_psoc_context *dp_ctx)
+{
+	qdf_mem_free(dp_ctx->dp_direct_link_ctx);
+	dp_ctx->dp_direct_link_ctx = NULL;
+}
+#endif

+ 30 - 1
components/dp/dispatcher/inc/wlan_dp_ucfg_api.h

@@ -1341,4 +1341,33 @@ void *ucfg_dp_prealloc_get_consistent_mem_unaligned(qdf_size_t size,
  */
 void ucfg_dp_prealloc_put_consistent_mem_unaligned(void *va_unaligned);
 #endif
-#endif /* _WLAN_DP_UCFGi_API_H_ */
+
+#ifdef FEATURE_DIRECT_LINK
+/**
+ * ucfg_dp_direct_link_init() - Initializes Direct Link datapath
+ * @psoc: psoc handle
+ *
+ * Return: QDF status
+ */
+QDF_STATUS ucfg_dp_direct_link_init(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * ucfg_dp_direct_link_deinit() - De-initializes Direct Link datapath
+ * @psoc: psoc handle
+ *
+ * Return: None
+ */
+void ucfg_dp_direct_link_deinit(struct wlan_objmgr_psoc *psoc);
+#else
+static inline
+QDF_STATUS ucfg_dp_direct_link_init(struct wlan_objmgr_psoc *psoc)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline
+void ucfg_dp_direct_link_deinit(struct wlan_objmgr_psoc *psoc)
+{
+}
+#endif
+#endif /* _WLAN_DP_UCFG_API_H_ */

+ 26 - 0
components/dp/dispatcher/src/wlan_dp_ucfg_api.c

@@ -2325,3 +2325,29 @@ void ucfg_dp_rx_skip_fisa(uint32_t value)
 		dp_rx_skip_fisa(dp_soc, value);
 }
 #endif
+
+#ifdef FEATURE_DIRECT_LINK
+QDF_STATUS ucfg_dp_direct_link_init(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_dp_psoc_context *dp_ctx = dp_psoc_get_priv(psoc);
+
+	if (!dp_ctx) {
+		dp_err("DP context not found");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return dp_direct_link_init(dp_ctx);
+}
+
+void ucfg_dp_direct_link_deinit(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_dp_psoc_context *dp_ctx = dp_psoc_get_priv(psoc);
+
+	if (!dp_ctx) {
+		dp_err("DP context not found");
+		return;
+	}
+
+	dp_direct_link_deinit(dp_ctx);
+}
+#endif