Эх сурвалжийг харах

qcacld-3.0: Remove legacy IPA code from HDD

As part of converged driver model remove IPA from
HDD and create a new IPA CLD component. Remove the
legacy code from the HDD.

Change-Id: Id4691e0f490c2f9bd9ccc8d5225be32002a5df9e
CRs-Fixed: 2177925
Sravan Kumar Kairam 7 жил өмнө
parent
commit
62765edc62

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

@@ -391,5 +391,70 @@ void wlan_ipa_uc_rt_debug_deinit(struct wlan_ipa_priv *ipa_ctx);
  */
 void wlan_ipa_uc_rt_debug_init(struct wlan_ipa_priv *ipa_ctx);
 
+/**
+ * wlan_ipa_reg_sap_xmit_cb() - Register upper layer SAP cb to transmit
+ * @ipa_ctx: IPA context
+ * @cb: callback
+ *
+ * Return: None
+ */
+static inline
+void wlan_ipa_reg_sap_xmit_cb(struct wlan_ipa_priv *ipa_ctx, void *cb)
+{
+	ipa_ctx->softap_xmit = cb;
+}
+
+/**
+ * wlan_ipa_reg_send_to_nw_cb() - Register cb to send IPA Rx packet to network
+ * @ipa_ctx: IPA context
+ * @cb: callback
+ *
+ * Return: None
+ */
+static inline
+void wlan_ipa_reg_send_to_nw_cb(struct wlan_ipa_priv *ipa_ctx, void *cb)
+{
+	ipa_ctx->send_to_nw = cb;
+}
+
+/**
+ * wlan_ipa_set_mcc_mode() - Set MCC mode
+ * @ipa_ctx: IPA context
+ * @mcc_mode: 0=MCC/1=SCC
+ *
+ * Return: void
+ */
+static inline
+void wlan_ipa_set_mcc_mode(struct wlan_ipa_priv *ipa_ctx, bool mcc_mode)
+{
+	ipa_ctx->mcc_mode = mcc_mode;
+}
+
+/**
+ * wlan_ipa_set_dfs_cac_tx() - Set DFS cac tx block
+ * @ipa_ctx: IPA context
+ * @tx_block: dfs cac tx block
+ *
+ * Return: void
+ */
+static inline
+void wlan_ipa_set_dfs_cac_tx(struct wlan_ipa_priv *ipa_ctx, bool tx_block)
+{
+	ipa_ctx->dfs_cac_block_tx = tx_block;
+}
+
+/**
+ * wlan_ipa_set_ap_ibss_fwd() - Set AP intra bss forward
+ * @ipa_ctx: IPA context
+ * @intra_bss: enable or disable ap intra bss forward
+ *
+ * Return: void
+ */
+static inline
+void wlan_ipa_set_ap_ibss_fwd(struct wlan_ipa_priv *ipa_ctx, bool intra_bss)
+{
+	ipa_ctx->ap_intrabss_fwd = intra_bss;
+}
+
 #endif /* IPA_OFFLOAD */
 #endif /* _WLAN_IPA_CORE_H_ */

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

@@ -221,5 +221,57 @@ void ipa_uc_stat_request(struct wlan_objmgr_pdev *pdev,
 void ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev,
 		       uint32_t *ipa_tx_diff, uint32_t *ipa_rx_diff);
 
+/**
+ * ipa_reg_sap_xmit_cb() - Register upper layer SAP cb to transmit
+ * @pdev: pdev obj
+ * @cb: callback
+ *
+ * Return: None
+ */
+void ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb);
+
+/**
+ * ipa_reg_send_to_nw_cb() - Register cb to send IPA Rx packet to network
+ * @pdev: pdev obj
+ * @cb: callback
+ *
+ * Return: None
+ */
+void ipa_reg_send_to_nw_cb(struct wlan_objmgr_pdev *pdev, void *cb);
+
+/**
+ * ipa_set_mcc_mode() - Set MCC mode
+ * @pdev: pdev obj
+ * @mcc_mode: 0=MCC/1=SCC
+ *
+ * Return: void
+ */
+void ipa_set_mcc_mode(struct wlan_objmgr_pdev *pdev, bool mcc_mode);
+
+/**
+ * ipa_set_dfs_cac_tx() - Set DFS cac tx block
+ * @pdev: pdev obj
+ * @tx_block: dfs cac tx block
+ *
+ * Return: void
+ */
+void ipa_set_dfs_cac_tx(struct wlan_objmgr_pdev *pdev, bool tx_block);
+
+/**
+ * ipa_set_ap_ibss_fwd() - Set AP intra bss forward
+ * @pdev: pdev obj
+ * @intra_bss: enable or disable ap intra bss forward
+ *
+ * Return: void
+ */
+void ipa_set_ap_ibss_fwd(struct wlan_objmgr_pdev *pdev, bool intra_bss);
+
+/**
+ * ipa_uc_force_pipe_shutdown() - Force IPA pipe shutdown
+ * @pdev: pdev obj
+ *
+ * Return: void
+ */
+void ipa_uc_force_pipe_shutdown(struct wlan_objmgr_pdev *pdev);
 #endif /* IPA_OFFLOAD */
 #endif /* end  of _WLAN_IPA_MAIN_H_ */

+ 3 - 1
ipa/core/inc/wlan_ipa_priv.h

@@ -555,6 +555,7 @@ struct wlan_ipa_tx_desc {
 };
 
 typedef int (*wlan_ipa_softap_xmit)(qdf_nbuf_t skb, qdf_netdev_t dev);
+typedef int (*wlan_ipa_send_to_nw)(qdf_nbuf_t skb, qdf_netdev_t dev);
 
 /* IPA private context structure definition */
 struct wlan_ipa_priv {
@@ -629,7 +630,7 @@ struct wlan_ipa_priv {
 	uint8_t vdev_to_iface[WLAN_IPA_MAX_SESSION];
 	bool vdev_offload_enabled[WLAN_IPA_MAX_SESSION];
 	bool mcc_mode;
-	bool ap_disable_ibss_fwd;
+	bool ap_intrabss_fwd;
 	bool dfs_cac_block_tx;
 #ifdef FEATURE_METERING
 	struct ipa_uc_sharing_stats ipa_sharing_stats;
@@ -640,6 +641,7 @@ struct wlan_ipa_priv {
 #endif
 
 	wlan_ipa_softap_xmit softap_xmit;
+	wlan_ipa_send_to_nw send_to_nw;
 	ipa_uc_offload_control_req ipa_tx_op;
 
 	qdf_event_t ipa_resource_comp;

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

@@ -285,3 +285,111 @@ void ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev,
 
 	return wlan_ipa_uc_stat_query(ipa_obj, ipa_tx_diff, ipa_rx_diff);
 }
+
+void ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb)
+{
+	struct wlan_ipa_priv *ipa_obj;
+
+	if (!g_ipa_hw_support) {
+		ipa_info("ipa hw not present");
+		return;
+	}
+
+	ipa_obj = ipa_pdev_get_priv_obj(pdev);
+	if (!ipa_obj) {
+		ipa_err("IPA object is NULL");
+		return;
+	}
+
+	return wlan_ipa_reg_sap_xmit_cb(ipa_obj, cb);
+}
+
+void ipa_reg_send_to_nw_cb(struct wlan_objmgr_pdev *pdev, void *cb)
+{
+	struct wlan_ipa_priv *ipa_obj;
+
+	if (!g_ipa_hw_support) {
+		ipa_info("ipa hw not present");
+		return;
+	}
+
+	ipa_obj = ipa_pdev_get_priv_obj(pdev);
+	if (!ipa_obj) {
+		ipa_err("IPA object is NULL");
+		return;
+	}
+
+	return wlan_ipa_reg_send_to_nw_cb(ipa_obj, cb);
+}
+
+void ipa_set_mcc_mode(struct wlan_objmgr_pdev *pdev, bool mcc_mode)
+{
+	struct wlan_ipa_priv *ipa_obj;
+
+	if (!g_ipa_hw_support) {
+		ipa_info("ipa hw not present");
+		return;
+	}
+
+	ipa_obj = ipa_pdev_get_priv_obj(pdev);
+	if (!ipa_obj) {
+		ipa_err("IPA object is NULL");
+		return;
+	}
+
+	return wlan_ipa_set_mcc_mode(ipa_obj, mcc_mode);
+}
+
+void ipa_set_dfs_cac_tx(struct wlan_objmgr_pdev *pdev, bool tx_block)
+{
+	struct wlan_ipa_priv *ipa_obj;
+
+	if (!g_ipa_hw_support) {
+		ipa_info("ipa hw not present");
+		return;
+	}
+
+	ipa_obj = ipa_pdev_get_priv_obj(pdev);
+	if (!ipa_obj) {
+		ipa_err("IPA object is NULL");
+		return;
+	}
+
+	return wlan_ipa_set_dfs_cac_tx(ipa_obj, tx_block);
+}
+
+void ipa_set_ap_ibss_fwd(struct wlan_objmgr_pdev *pdev, bool intra_bss)
+{
+	struct wlan_ipa_priv *ipa_obj;
+
+	if (!g_ipa_hw_support) {
+		ipa_info("ipa hw not present");
+		return;
+	}
+
+	ipa_obj = ipa_pdev_get_priv_obj(pdev);
+	if (!ipa_obj) {
+		ipa_err("IPA object is NULL");
+		return;
+	}
+
+	return wlan_ipa_set_ap_ibss_fwd(ipa_obj, intra_bss);
+}
+
+void ipa_uc_force_pipe_shutdown(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_ipa_priv *ipa_obj;
+
+	if (!g_ipa_hw_support) {
+		ipa_info("ipa hw not present");
+		return;
+	}
+
+	ipa_obj = ipa_pdev_get_priv_obj(pdev);
+	if (!ipa_obj) {
+		ipa_err("IPA object is NULL");
+		return;
+	}
+
+	wlan_ipa_uc_disable_pipes(ipa_obj);
+}

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

@@ -133,6 +133,58 @@ void ucfg_ipa_uc_stat_request(struct wlan_objmgr_pdev *pdev,
 void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev,
 			    uint32_t *ipa_tx_diff, uint32_t *ipa_rx_diff);
 
+/**
+ * ucfg_ipa_reg_sap_xmit_cb() - Register upper layer SAP cb to transmit
+ * @pdev: pdev obj
+ * @cb: callback
+ *
+ * Return: None
+ */
+void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb);
+
+/**
+ * ucfg_ipa_reg_send_to_nw_cb() - Register cb to send IPA Rx packet to network
+ * @pdev: pdev obj
+ * @cb: callback
+ *
+ * Return: None
+ */
+void ucfg_ipa_reg_send_to_nw_cb(struct wlan_objmgr_pdev *pdev, void *cb);
+
+/**
+ * ucfg_ipa_set_mcc_mode() - Set MCC mode
+ * @pdev: pdev obj
+ * @mcc_mode: 0=MCC/1=SCC
+ *
+ * Return: void
+ */
+void ucfg_ipa_set_mcc_mode(struct wlan_objmgr_pdev *pdev, bool mcc_mode);
+
+/**
+ * ucfg_ipa_set_dfs_cac_tx() - Set DFS cac tx block
+ * @pdev: pdev obj
+ * @tx_block: dfs cac tx block
+ *
+ * Return: void
+ */
+void ucfg_ipa_set_dfs_cac_tx(struct wlan_objmgr_pdev *pdev, bool tx_block);
+
+/**
+ * ucfg_ipa_set_ap_ibss_fwd() - Set AP intra bss forward
+ * @pdev: pdev obj
+ * @intra_bss: enable or disable ap intra bss forward
+ *
+ * Return: void
+ */
+void ucfg_ipa_set_ap_ibss_fwd(struct wlan_objmgr_pdev *pdev, bool intra_bss);
+
+/**
+ * ucfg_ipa_uc_force_pipe_shutdown() - Force shutdown IPA pipe
+ * @pdev: pdev obj
+ *
+ * Return: void
+ */
+void ucfg_ipa_uc_force_pipe_shutdown(struct wlan_objmgr_pdev *pdev);
 #else
 
 static inline bool ucfg_ipa_is_present(void)
@@ -196,5 +248,35 @@ void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev,
 			    uint32_t *ipa_tx_diff, uint32_t *ipa_rx_diff)
 {
 }
+
+static inline
+void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb)
+{
+}
+
+static inline
+void ucfg_ipa_reg_send_to_nw_cb(struct wlan_objmgr_pdev *pdev, void *cb)
+{
+}
+
+static inline
+void ucfg_ipa_set_mcc_mode(struct wlan_objmgr_pdev *pdev, bool mcc_mode)
+{
+}
+
+static inline
+void ucfg_ipa_set_dfs_cac_tx(struct wlan_objmgr_pdev *pdev, bool tx_block)
+{
+}
+
+static inline
+void ucfg_ipa_set_ap_ibss_fwd(struct wlan_objmgr_pdev *pdev, bool intra_bss)
+{
+}
+
+static inline
+void ucfg_ipa_uc_force_pipe_shutdown(struct wlan_objmgr_pdev *pdev)
+{
+}
 #endif /* IPA_OFFLOAD */
 #endif /* _WLAN_IPA_UCFG_API_H_ */

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

@@ -81,3 +81,34 @@ void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev,
 {
 	return ipa_uc_stat_query(pdev, ipa_tx_diff, ipa_rx_diff);
 }
+
+void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb)
+{
+	return ipa_reg_sap_xmit_cb(pdev, cb);
+}
+
+void ucfg_ipa_reg_send_to_nw_cb(struct wlan_objmgr_pdev *pdev, void *cb)
+{
+	return ipa_reg_send_to_nw_cb(pdev, cb);
+
+}
+
+void ucfg_ipa_set_mcc_mode(struct wlan_objmgr_pdev *pdev, bool mcc_mode)
+{
+	return ipa_set_mcc_mode(pdev, mcc_mode);
+}
+
+void ucfg_ipa_set_dfs_cac_tx(struct wlan_objmgr_pdev *pdev, bool tx_block)
+{
+	return ipa_set_dfs_cac_tx(pdev, tx_block);
+}
+
+void ucfg_ipa_set_ap_ibss_fwd(struct wlan_objmgr_pdev *pdev, bool intra_bss)
+{
+	return ipa_set_ap_ibss_fwd(pdev, intra_bss);
+}
+
+void ucfg_ipa_uc_force_pipe_shutdown(struct wlan_objmgr_pdev *pdev)
+{
+	return ipa_uc_force_pipe_shutdown(pdev);
+}