Browse Source

Merge "msm: ipa4: add ipa_wigig tx callback interface"

qctecmdr 5 years ago
parent
commit
382955c771
6 changed files with 34 additions and 10 deletions
  1. 6 2
      ipa/ipa_api.c
  2. 3 1
      ipa/ipa_api.h
  3. 12 2
      ipa/ipa_clients/ipa_wigig.c
  4. 3 1
      ipa/ipa_common_i.h
  5. 4 1
      ipa/ipa_v3/ipa_i.h
  6. 6 3
      ipa/ipa_v3/ipa_wigig_i.c

+ 6 - 2
ipa/ipa_api.c

@@ -3562,11 +3562,15 @@ EXPORT_SYMBOL(ipa_conn_wigig_rx_pipe_i);
 /**
  * ipa_conn_wigig_client_i() - connect a wigig client
  */
-int ipa_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out)
+int ipa_conn_wigig_client_i(void *in,
+	struct ipa_wigig_conn_out_params *out,
+	ipa_notify_cb tx_notify,
+	void *priv)
 {
 	int ret;
 
-	IPA_API_DISPATCH_RETURN(ipa_conn_wigig_client_i, in, out);
+	IPA_API_DISPATCH_RETURN(ipa_conn_wigig_client_i, in, out,
+		tx_notify, priv);
 
 	return ret;
 }

+ 3 - 1
ipa/ipa_api.h

@@ -441,7 +441,9 @@ struct ipa_api_controller {
 		struct ipa_wigig_conn_out_params *out);
 
 	int (*ipa_conn_wigig_client_i)(void *in,
-		struct ipa_wigig_conn_out_params *out);
+		struct ipa_wigig_conn_out_params *out,
+		ipa_notify_cb tx_notify,
+		void *priv);
 
 	int (*ipa_disconn_wigig_pipe_i)(enum ipa_client_type client,
 		struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu,

+ 12 - 2
ipa/ipa_clients/ipa_wigig.c

@@ -90,6 +90,8 @@ struct ipa_wigig_context {
 	phys_addr_t int_gen_tx_pa;
 	phys_addr_t int_gen_rx_pa;
 	phys_addr_t dma_ep_misc_pa;
+	ipa_notify_cb tx_notify;
+	void *priv;
 	union pipes {
 		struct ipa_wigig_pipe_setup_info flat[IPA_WIGIG_MAX_PIPES];
 		struct ipa_wigig_pipe_setup_info_smmu
@@ -712,6 +714,9 @@ int ipa_wigig_conn_rx_pipe(struct ipa_wigig_conn_rx_in_params *in,
 		goto fail_connect_pipe;
 	}
 
+	ipa_wigig_ctx->tx_notify = in->notify;
+	ipa_wigig_ctx->priv = in->priv;
+
 	ipa_wigig_store_pipe_info(ipa_wigig_ctx->pipes.flat,
 		IPA_CLIENT_WIGIG_PROD_IDX);
 
@@ -1460,6 +1465,9 @@ int ipa_wigig_conn_rx_pipe_smmu(
 		goto fail_smmu_store;
 	}
 
+	ipa_wigig_ctx->tx_notify = in->notify;
+	ipa_wigig_ctx->priv = in->priv;
+
 	ipa_wigig_ctx->conn_pipes |=
 		ipa_wigig_pipe_to_bit_val(IPA_CLIENT_WIGIG_PROD);
 
@@ -1579,7 +1587,8 @@ int ipa_wigig_conn_client(struct ipa_wigig_conn_tx_in_params *in,
 		return -EFAULT;
 	}
 
-	if (ipa_conn_wigig_client_i(in, out)) {
+	if (ipa_conn_wigig_client_i(in, out, ipa_wigig_ctx->tx_notify,
+		ipa_wigig_ctx->priv)) {
 		IPA_WIGIG_ERR(
 			"fail to connect client. MAC [%X][%X][%X][%X][%X][%X]\n"
 		, in->client_mac[0], in->client_mac[1], in->client_mac[2]
@@ -1661,7 +1670,8 @@ int ipa_wigig_conn_client_smmu(
 		return -EFAULT;
 	}
 
-	if (ipa_conn_wigig_client_i(in, out)) {
+	if (ipa_conn_wigig_client_i(in, out, ipa_wigig_ctx->tx_notify,
+		ipa_wigig_ctx->priv)) {
 		IPA_WIGIG_ERR(
 			"fail to connect client. MAC [%X][%X][%X][%X][%X][%X]\n"
 			, in->client_mac[0], in->client_mac[1]

+ 3 - 1
ipa/ipa_common_i.h

@@ -442,7 +442,9 @@ int ipa_wigig_uc_init(
 
 int ipa_conn_wigig_rx_pipe_i(void *in, struct ipa_wigig_conn_out_params *out);
 
-int ipa_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out);
+int ipa_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out,
+	ipa_notify_cb tx_notify,
+	void *priv);
 
 int ipa_wigig_uc_msi_init(
 	bool init,

+ 4 - 1
ipa/ipa_v3/ipa_i.h

@@ -2492,7 +2492,10 @@ int ipa3_disable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx);
 int ipa3_conn_wigig_rx_pipe_i(void *in,
 	struct ipa_wigig_conn_out_params *out);
 
-int ipa3_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out);
+int ipa3_conn_wigig_client_i(void *in,
+	struct ipa_wigig_conn_out_params *out,
+	ipa_notify_cb tx_notify,
+	void *priv);
 
 int ipa3_wigig_uc_msi_init(bool init,
 	phys_addr_t periph_baddr_pa,

+ 6 - 3
ipa/ipa_v3/ipa_wigig_i.c

@@ -1131,7 +1131,10 @@ fail:
 	return result;
 }
 
-int ipa3_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out)
+int ipa3_conn_wigig_client_i(void *in,
+	struct ipa_wigig_conn_out_params *out,
+	ipa_notify_cb tx_notify,
+	void *priv)
 {
 	int ipa_ep_idx;
 	struct ipa3_ep_context *ep;
@@ -1273,8 +1276,8 @@ int ipa3_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out)
 		goto fail;
 	}
 
-	ep->client_notify = NULL;
-	ep->priv = NULL;
+	ep->client_notify = tx_notify;
+	ep->priv = priv;
 
 	memset(&ep_cfg, 0, sizeof(ep_cfg));
 	ep_cfg.nat.nat_en = IPA_DST_NAT;