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

Commit 5504e8ed authored by Praveen Kurapati's avatar Praveen Kurapati
Browse files

msm: ipa3: Add low-level IPA client support



Add low-level IPA client connect and disconnect
support.

Change-Id: Icb0aa110e2cbf71d9a5a19b88bb261667599461e
Signed-off-by: default avatarPraveen Kurapati <pkurapat@codeaurora.org>
Signed-off-by: default avatarChetan C R <cchinnad@codeaurora.org>
parent eae6f3d0
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
@@ -399,6 +399,55 @@ int ipa_smmu_free_sgt(struct sg_table **out_sgt_ptr)
	return 0;
}

/**
 * ipa_connect() - low-level IPA client connect
 * @in: [in] input parameters from client
 * @sps:	[out] sps output from IPA needed by client for sps_connect
 * @clnt_hdl:   [out] opaque client handle assigned by IPA to client
 *
 * Should be called by the driver of the peripheral that wants to connect to
 * IPA in BAM-BAM mode. these peripherals are USB and HSIC. this api
 * expects caller to take responsibility to add any needed headers, routing
 * and filtering tables and rules as needed.
 *
 * Returns:     0 on success, negative on failure
 *
 * Note:	Should not be called from atomic context
 */
int ipa_connect(const struct ipa_connect_params *in, struct ipa_sps_params *sps,
	u32 *clnt_hdl)
{
	int ret;

	IPA_API_DISPATCH_RETURN(ipa_connect, in, sps, clnt_hdl);

	return ret;
}
EXPORT_SYMBOL(ipa_connect);

/**
 * ipa_disconnect() - low-level IPA client disconnect
 * @clnt_hdl:   [in] opaque client handle assigned by IPA to client
 *
 * Should be called by the driver of the peripheral that wants to disconnect
 * from IPA in BAM-BAM mode. this api expects caller to take responsibility to
 * free any needed headers, routing and filtering tables and rules as needed.
 *
 * Returns:     0 on success, negative on failure
 *
 * Note:	Should not be called from atomic context
 */
int ipa_disconnect(u32 clnt_hdl)
{
	int ret;

	IPA_API_DISPATCH_RETURN(ipa_disconnect, clnt_hdl);

	return ret;
}
EXPORT_SYMBOL(ipa_disconnect);


/**
 * ipa_clear_endpoint_delay() - Clear ep_delay.
 * @clnt_hdl:	[in] IPA client handle
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2018,2020 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
@@ -603,7 +603,8 @@ int rndis_ipa_init(struct ipa_usb_init_params *params)
	}
	RNDIS_IPA_DEBUG("Device Ethernet address set %pM\n", net->dev_addr);

	if (ipa_is_vlan_mode(IPA_VLAN_IF_RNDIS,
	if ((ipa_get_hw_type() >= IPA_HW_v3_0) &&
		ipa_is_vlan_mode(IPA_VLAN_IF_RNDIS,
		&rndis_ipa_ctx->is_vlan_mode)) {
		RNDIS_IPA_ERROR("couldn't acquire vlan mode, is ipa ready?\n");
		goto fail_get_vlan_mode;