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

Commit 5c155834 authored by Talel Atias's avatar Talel Atias
Browse files

msm: teth_bridge + usb: add differentiation for EP config



Adds support for not configuring the IPA endpoint.
This functionality is needed by the IPA driver in
order to support sys2bam on the UL.

Adds a differentiation for endpoint config based on the
specific tethering protocol.
In case the tethering protocol is MBIM/RMNET the endpoint
will not be configured by A7 drivers.

Change-Id: Iaf4b6bc26b8b4d10fc5b0f900b7034dfc4933fcd
Signed-off-by: default avatarTalel Atias <tatias@codeaurora.org>
Signed-off-by: default avatarDov Levenglick <dovl@codeaurora.org>
Signed-off-by: default avatarGidon Studinski <gidons@codeaurora.org>
parent b1d48001
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -673,6 +673,22 @@ enum teth_tethering_mode {
	TETH_TETHERING_MODE_MAX,
};

/**
 * teth_bridge_init_params - Parameters used for in/out USB API
 * @usb_notify_cb:	Callback function which should be used by the caller.
 * Output parameter.
 * @private_data:	Data for the callback function. Should be used by the
 * caller. Output parameter.
 * @skip_ep_cfg: boolean field that determines if Apps-processor
 *  should or should not confiugre this end-point.
 */
struct teth_bridge_init_params {
	ipa_notify_cb usb_notify_cb;
	void *private_data;
	enum ipa_client_type client;
	bool skip_ep_cfg;
};

/**
 * struct teth_bridge_connect_params - Parameters used in teth_bridge_connect()
 * @ipa_usb_pipe_hdl:	IPA to USB pipe handle, returned from ipa_connect()
@@ -977,8 +993,7 @@ int a2_mux_get_client_handles(enum a2_mux_logical_channel_id lcid,
/*
 * Tethering bridge (Rmnet / MBIM)
 */
int teth_bridge_init(ipa_notify_cb *usb_notify_cb_ptr, void **private_data_ptr,
		enum ipa_client_type client);
int teth_bridge_init(struct teth_bridge_init_params *params);

int teth_bridge_disconnect(enum ipa_client_type client);

@@ -1480,9 +1495,7 @@ static inline int ipa_rm_inactivity_timer_release_resource(
/*
 * Tethering bridge (Rmnetm / MBIM)
 */
static inline int teth_bridge_init(ipa_notify_cb *usb_notify_cb_ptr,
				   void **private_data_ptr,
				   enum ipa_client_type client)
static inline int teth_bridge_init(struct teth_bridge_init_params *params)
{
	return -EPERM;
}
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ struct usb_bam_connect_ipa_params {
			unsigned long data);
	int (*activity_notify)(void *priv);
	int (*inactivity_notify)(void *priv);
	bool skip_ep_cfg;
};

/**
+11 −13
Original line number Diff line number Diff line
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, 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
@@ -2015,10 +2015,8 @@ static void a2_prod_notify_cb(void *notify_cb_data,

/**
* teth_bridge_init() - Initialize the Tethering bridge driver
* @usb_notify_cb_ptr:	Callback function which should be used by the caller.
* Output parameter.
* @private_data_ptr:	Data for the callback function. Should be used by the
* caller. Output parameter.
* @params - in/out params for USB initialization API (please look at struct
*  definition for more info)
*
* USB driver gets a pointer to a callback function (usb_notify_cb) and an
* associated data. USB driver installs this callback function in the call to
@@ -2030,8 +2028,7 @@ static void a2_prod_notify_cb(void *notify_cb_data,
*		-EINVAL - Bad parameter
*		Other negative value - Failure
*/
int teth_bridge_init(ipa_notify_cb *usb_notify_cb_ptr, void **private_data_ptr,
		enum ipa_client_type client)
int teth_bridge_init(struct teth_bridge_init_params *params)
{
	int res = 0;
	u32 lcid;
@@ -2039,7 +2036,7 @@ int teth_bridge_init(ipa_notify_cb *usb_notify_cb_ptr, void **private_data_ptr,

	TETH_DBG_FUNC_ENTRY();

	if (usb_notify_cb_ptr == NULL || private_data_ptr == NULL) {
	if (!params) {
		TETH_ERR("Bad parameter\n");
		TETH_DBG_FUNC_EXIT();
		return -EINVAL;
@@ -2047,16 +2044,17 @@ int teth_bridge_init(ipa_notify_cb *usb_notify_cb_ptr, void **private_data_ptr,

	switch (teth_ctx->ipa_hw_type) {
	case IPA_HW_v1_1:
		*usb_notify_cb_ptr = usb_notify_cb;
		lcid = get_channel_id_from_client_prod(client);
		*private_data_ptr = (void *)lcid;
		params->usb_notify_cb = usb_notify_cb;
		lcid = get_channel_id_from_client_prod(params->client);
		params->private_data = (void *)lcid;
		idx = get_ch_info_idx(lcid);
		TETH_DBG("init private data with lcid=%d\n", lcid);
		break;

	case IPA_HW_v2_0:
		*usb_notify_cb_ptr = NULL;
		*private_data_ptr = (void *)IPA_DO_NOT_CONFIGURE_THIS_EP;
		params->usb_notify_cb = NULL;
		params->private_data = NULL;
		params->skip_ep_cfg = true;
		break;

	default:
+3 −1
Original line number Diff line number Diff line
@@ -516,6 +516,7 @@ static int connect_pipe_sys2bam_ipa(u8 idx,
	sys_in_params.desc_fifo_sz = pipe_connect->desc_fifo_size;
	sys_in_params.priv = ipa_params->priv;
	sys_in_params.notify = ipa_params->notify;
	sys_in_params.skip_ep_cfg = ipa_params->skip_ep_cfg;
	memcpy(&sys_in_params.ipa_ep_cfg, &ipa_params->ipa_ep_cfg,
		   sizeof(struct ipa_ep_cfg));

@@ -578,6 +579,7 @@ static int connect_pipe_bam2bam_ipa(u8 idx,
	ipa_in_params.data_fifo_sz = pipe_connect->data_fifo_size;
	ipa_in_params.notify = ipa_params->notify;
	ipa_in_params.priv = ipa_params->priv;
	ipa_in_params.skip_ep_cfg = ipa_params->skip_ep_cfg;

	/* If BAM is using dedicated SPS pipe memory, get it */

@@ -960,7 +962,7 @@ static int usb_bam_disconnect_ipa_cons(
			return ret;
		}
	} else {
		ret = ipa_teardown_sys_pipe(ipa_params->prod_clnt_hdl);
		ret = ipa_teardown_sys_pipe(ipa_params->cons_clnt_hdl);
		if (ret) {
			pr_err("%s: src pipe disconnection failure\n",
					__func__);
+4 −0
Original line number Diff line number Diff line
@@ -444,6 +444,10 @@ void *ecm_qc_get_ipa_priv(void)
	return ipa_params.private;
}

bool ecm_qc_get_skip_ep_config(void)
{
	return ipa_params.skip_ep_cfg;
}
/*-------------------------------------------------------------------------*/


Loading