Sfoglia il codice sorgente

qcacmn: Implement ucfg API to get alternate TX pipe

Implement ucfg API to get IPA alternate TX pipe for the target interface
by vdev id.

Change-Id: Icaf24ce32db01b29770f6a2123d41c13cfa15456
CRs-Fixed: 3599450
Jia Ding 1 anno fa
parent
commit
536dd3af2c

+ 24 - 0
ipa/core/inc/wlan_ipa_core.h

@@ -939,5 +939,29 @@ int wlan_ipa_wdi_opt_dpath_flt_rsrv_rel_cb(void *ipa_ctx);
 void wlan_ipa_wdi_opt_dpath_notify_flt_rlsd(int result0, int result1);
 
 #endif /* IPA_OPT_WIFI_DP */
+
+#ifdef IPA_WDI3_TX_TWO_PIPES
+/**
+ * wlan_ipa_get_alt_pipe() - Get alt_pipe for vdev_id
+ * @ipa_ctx: IPA context
+ * @vdev_id: vdev_id of the target interface
+ * @alt_pipe: Boolean output to indicate if interface with @vdev_id
+ *	      is using alternate TX pipe or not.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_ipa_get_alt_pipe(struct wlan_ipa_priv *ipa_ctx,
+				 uint8_t vdev_id,
+				 bool *alt_pipe);
+#else /* !IPA_WDI3_TX_TWO_PIPES */
+static inline
+QDF_STATUS wlan_ipa_get_alt_pipe(struct wlan_ipa_priv *ipa_ctx,
+				 uint8_t vdev_id,
+				 bool *alt_pipe)
+{
+	return QDF_STATUS_E_INVAL;
+}
+#endif /* IPA_WDI3_TX_TWO_PIPES */
+
 #endif /* IPA_OFFLOAD */
 #endif /* _WLAN_IPA_CORE_H_ */

+ 13 - 0
ipa/core/inc/wlan_ipa_main.h

@@ -605,6 +605,19 @@ void ipa_init_deinit_unlock(void);
  */
 bool ipa_is_wds_enabled(void);
 
+/**
+ * ipa_get_alt_pipe() - Get alt_pipe for vdev_id
+ * @pdev: pdev obj
+ * @vdev_id: vdev_id of the target interface
+ * @alt_pipe: Boolean output to indicate if interface with @vdev_id
+ *	      is using alternate TX pipe or not.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ipa_get_alt_pipe(struct wlan_objmgr_pdev *pdev,
+			    uint8_t vdev_id,
+			    bool *alt_pipe);
+
 #else /* Not IPA_OFFLOAD */
 typedef QDF_STATUS (*wlan_ipa_softap_xmit)(qdf_nbuf_t nbuf, qdf_netdev_t dev);
 typedef void (*wlan_ipa_send_to_nw)(qdf_nbuf_t nbuf, qdf_netdev_t dev);

+ 33 - 0
ipa/core/src/wlan_ipa_core.c

@@ -5631,3 +5631,36 @@ void wlan_ipa_wdi_opt_dpath_notify_flt_add_rem_cb(int flt0_rslt, int flt1_rslt)
 	qdf_event_set(&ipa_obj->ipa_flt_evnt);
 }
 #endif /* IPA_OPT_WIFI_DP */
+
+#ifdef IPA_WDI3_TX_TWO_PIPES
+QDF_STATUS wlan_ipa_get_alt_pipe(struct wlan_ipa_priv *ipa_ctx,
+				 uint8_t vdev_id,
+				 bool *alt_pipe)
+{
+	struct wlan_ipa_iface_context *ctxt;
+	uint8_t iface_id;
+
+	if (qdf_unlikely(!ipa_ctx || !alt_pipe))
+		return QDF_STATUS_E_INVAL;
+
+	iface_id = ipa_ctx->vdev_to_iface[vdev_id];
+	if (qdf_unlikely(iface_id >= WLAN_IPA_MAX_IFACE)) {
+		ipa_err("Invalid iface_id %u from vdev_id %d", iface_id,
+			vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	ctxt = &ipa_ctx->iface_context[iface_id];
+	if (qdf_unlikely(ctxt->session_id >= WLAN_IPA_MAX_SESSION)) {
+		ipa_err("Invalid session_id %u from iface_id %d",
+			ctxt->session_id, iface_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*alt_pipe = ctxt->alt_pipe;
+	ipa_info("vdev_id %d alt_pipe %d", vdev_id, *alt_pipe);
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif /* IPA_WDI3_TX_TWO_PIPES */
+

+ 22 - 0
ipa/core/src/wlan_ipa_main.c

@@ -947,3 +947,25 @@ bool ipa_is_wds_enabled(void)
 {
 	return g_ipa_config ? g_ipa_config->ipa_wds : 0;
 }
+
+QDF_STATUS ipa_get_alt_pipe(struct wlan_objmgr_pdev *pdev,
+			    uint8_t vdev_id,
+			    bool *alt_pipe)
+{
+	struct wlan_ipa_priv *ipa_obj;
+
+	if (!ipa_config_is_enabled())
+		return QDF_STATUS_E_INVAL;
+
+	if (!ipa_cb_is_ready())
+		return QDF_STATUS_E_INVAL;
+
+	ipa_obj = ipa_pdev_get_priv_obj(pdev);
+	if (!ipa_obj) {
+		ipa_err("IPA object is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return wlan_ipa_get_alt_pipe(ipa_obj, vdev_id, alt_pipe);
+}
+

+ 22 - 0
ipa/dispatcher/inc/wlan_ipa_ucfg_api.h

@@ -472,6 +472,20 @@ void ucfg_ipa_flush_pending_vdev_events(struct wlan_objmgr_pdev *pdev,
  *         false - WDS is not enabled
  */
 bool ucfg_ipa_is_wds_enabled(void);
+
+/**
+ * ucfg_ipa_get_alt_pipe() - Get alt_pipe for vdev_id
+ * @pdev: pdev obj
+ * @vdev_id: vdev_id of the target interface
+ * @alt_pipe: Boolean output to indicate if interface with @vdev_id
+ *	      is using alternate TX pipe or not.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ucfg_ipa_get_alt_pipe(struct wlan_objmgr_pdev *pdev,
+				 uint8_t vdev_id,
+				 bool *alt_pipe);
+
 #else
 static inline void ucfg_ipa_set_pld_enable(bool flag)
 {
@@ -735,5 +749,13 @@ bool ucfg_ipa_is_wds_enabled(void)
 {
 	return false;
 }
+
+static inline
+QDF_STATUS ucfg_ipa_get_alt_pipe(struct wlan_objmgr_pdev *pdev,
+				 uint8_t vdev_id,
+				 bool *alt_pipe)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif /* IPA_OFFLOAD */
 #endif /* _WLAN_IPA_UCFG_API_H_ */

+ 9 - 0
ipa/dispatcher/src/wlan_ipa_ucfg_api.c

@@ -361,3 +361,12 @@ bool ucfg_ipa_is_wds_enabled(void)
 }
 
 qdf_export_symbol(ucfg_ipa_is_wds_enabled);
+
+QDF_STATUS ucfg_ipa_get_alt_pipe(struct wlan_objmgr_pdev *pdev,
+				 uint8_t vdev_id,
+				 bool *alt_pipe)
+{
+	return ipa_get_alt_pipe(pdev, vdev_id, alt_pipe);
+}
+
+qdf_export_symbol(ucfg_ipa_get_alt_pipe);