Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3719bc7 authored by Michael Adisumarta's avatar Michael Adisumarta
Browse files

msm: ipa: mhi prime channels support for IPA4.1 APQ



This change enables MHI PRIME channels for IPA tethering offload support.

Change-Id: Ibacda71a3d0dfb2a19d22bf1615f554d90ddd114
Acked-by: default avatarJyothi J <jyothij@qti.qualcomm.com>
Signed-off-by: default avatarMichael Adisumarta <madisuma@codeaurora.org>
Depends-on: 2568569
parent c93d9386
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -210,6 +210,11 @@ const char *ipa_clients_strings[IPA_CLIENT_MAX] = {
	__stringify(IPA_CLIENT_WIGIG4_CONS),
	__stringify(IPA_CLIENT_AQC_ETHERNET_PROD),
	__stringify(IPA_CLIENT_AQC_ETHERNET_CONS),
	__stringify(IPA_CLIENT_MHI_PRIME_RMNET_PROD),
	__stringify(IPA_CLIENT_MHI_PRIME_RMNET_CONS),
	__stringify(IPA_CLIENT_MHI_PRIME_TETH_PROD),
	__stringify(IPA_CLIENT_MHI_PRIME_TETH_CONS),
	__stringify(IPA_CLIENT_MHI_PRIME_DPL_PROD),
};

/**
+39 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015-2018 The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2019 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1917,6 +1917,15 @@ static int ipa3_usb_xdci_connect_internal(
		goto connect_dl_fail;
	}

	/* MHIP pipe enablement */
	if (ipa3_is_mhip_offload_enabled()) {
		result = ipa_mpm_mhip_xdci_pipe_enable(params->teth_prot);
		if (result) {
			IPA_USB_ERR("failed to connect MHIP channel\n");
			goto connect_dl_fail;
		}
	}

	/* Connect tethering protocol */
	result = ipa3_usb_connect_teth_prot(params->teth_prot);
	if (result) {
@@ -2410,6 +2419,16 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
		if (orig_state != IPA_USB_SUSPENDED) {
			spin_unlock_irqrestore(&ipa3_usb_ctx->state_lock,
				flags);

			/* Stop UL MHIP channel */
			if (ipa3_is_mhip_offload_enabled()) {
				result = ipa_mpm_mhip_ul_data_stop(teth_prot);
				if (result) {
					IPA_USB_ERR("fail UL MHIPData stop\n");
					goto bad_params;
				}
			}

			/* Stop UL channel */
			result = ipa3_xdci_disconnect(ul_clnt_hdl,
				true,
@@ -2430,6 +2449,16 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
	if (result)
		goto bad_params;

	/* Stop UL/DL MHIP channels */
	if (ipa3_is_mhip_offload_enabled()) {
		result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot);
		if (result) {
			IPA_USB_ERR("failed to disconnect MHIP channel\n");
			goto bad_params;
		}
	}


	/* Disconnect tethering protocol */
	result = ipa3_usb_disconnect_teth_prot(teth_prot);
	if (result)
@@ -2740,6 +2769,15 @@ int ipa_usb_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
	}
	spin_unlock_irqrestore(&ipa3_usb_ctx->state_lock, flags);

	/* Stop MHIP channel */
	if (ipa3_is_mhip_offload_enabled()) {
		result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot);
		if (result) {
			IPA_USB_ERR("failed to disconnect MHIP channel\n");
			goto release_prod_fail;
		}
	}

	IPA_USB_DBG_LOW("exit\n");
	mutex_unlock(&ipa3_usb_ctx->general_mutex);
	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -766,7 +766,7 @@ int ipa3_xdci_start(u32 clnt_hdl, u8 xferrscidx, bool xferrscidx_valid)
	return result;
}

static int ipa3_get_gsi_chan_info(struct gsi_chan_info *gsi_chan_info,
int ipa3_get_gsi_chan_info(struct gsi_chan_info *gsi_chan_info,
	unsigned long chan_hdl)
{
	enum gsi_status gsi_res;
+35 −2
Original line number Diff line number Diff line
@@ -2789,5 +2789,38 @@ void ipa_eth_exit(void);
static inline int ipa_eth_init(void) { return 0; }
static inline void ipa_eth_exit(void) { }
#endif // CONFIG_IPA_ETH
int ipa3_get_gsi_chan_info(struct gsi_chan_info *gsi_chan_info,
	unsigned long chan_hdl);
#ifdef CONFIG_IPA3_MHI_PRIME_MANAGER
int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot prot);
int ipa_mpm_mhip_xdci_pipe_disable(enum ipa_usb_teth_prot xdci_teth_prot);
int ipa_mpm_notify_wan_state(void);
int ipa_mpm_mhip_ul_data_stop(enum ipa_usb_teth_prot xdci_teth_prot);
int ipa3_is_mhip_offload_enabled(void);
#else
static inline int ipa_mpm_mhip_xdci_pipe_enable(
	enum ipa_usb_teth_prot prot)
{
	return 0;
}
static inline int ipa_mpm_mhip_xdci_pipe_disable(
	enum ipa_usb_teth_prot xdci_teth_prot)
{
	return 0;
}
static inline int ipa_mpm_notify_wan_state(void)
{
	return 0;
}
static inline int ipa_mpm_mhip_ul_data_stop(
	enum ipa_usb_teth_prot xdci_teth_prot)
{
	return 0;
}
static inline int ipa3_is_mhip_offload_enabled(void)
{
	return 0;
}
#endif /* CONFIG_IPA3_MHI_PRIME_MANAGER */

#endif /* _IPA3_I_H_ */
+2226 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading