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

Commit 9478cceb authored by Manu Gautam's avatar Manu Gautam
Browse files

usb: f_gsi: Fix typecasting of usb_prot_id



usb_prot_id enum extends ipa_usb_teth_prot enum for
various USB functions using F_GSI driver. Perform
appropriate type-casting when using usb_prot_id as
ipa_usb_teth_prot.

Change-Id: Ie148bc5038e0de3fc0056d9f61ebf1c12185a8d1
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 77dd6ca0
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015-2018, Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2019, 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
@@ -556,7 +556,7 @@ static int ipa_connect_channels(struct gsi_data_port *d_port)
		(gsi->prot_id != USB_PROT_DIAG_IPA) ? IPA_CLIENT_USB_CONS :
						IPA_CLIENT_USB_DPL_CONS;
	in_params->ipa_ep_cfg.mode.mode = IPA_BASIC;
	in_params->teth_prot = gsi->prot_id;
	in_params->teth_prot = (enum ipa_usb_teth_prot)gsi->prot_id;
	in_params->gevntcount_low_addr =
		gsi_channel_info.gevntcount_low_addr;
	in_params->gevntcount_hi_addr =
@@ -597,7 +597,7 @@ static int ipa_connect_channels(struct gsi_data_port *d_port)
		log_event_dbg("%s: USB GSI OUT OPS Completed", __func__);
		out_params->client = IPA_CLIENT_USB_PROD;
		out_params->ipa_ep_cfg.mode.mode = IPA_BASIC;
		out_params->teth_prot = gsi->prot_id;
		out_params->teth_prot = (enum ipa_usb_teth_prot)gsi->prot_id;
		out_params->gevntcount_low_addr =
			gsi_channel_info.gevntcount_low_addr;
		out_params->gevntcount_hi_addr =
@@ -639,7 +639,7 @@ static int ipa_connect_channels(struct gsi_data_port *d_port)
	conn_params->usb_to_ipa_xferrscidx_valid =
			(gsi->prot_id != USB_PROT_DIAG_IPA) ? true : false;
	conn_params->ipa_to_usb_xferrscidx_valid = true;
	conn_params->teth_prot = gsi->prot_id;
	conn_params->teth_prot = (enum ipa_usb_teth_prot)gsi->prot_id;
	conn_params->teth_prot_params.max_xfer_size_bytes_to_dev = 23700;
	conn_params->teth_prot_params.max_xfer_size_bytes_to_dev
				= d_port->out_aggr_size;
@@ -760,7 +760,8 @@ static void ipa_disconnect_work_handler(struct gsi_data_port *d_port)
	log_event_dbg("%s: Calling xdci_disconnect", __func__);

	ret = ipa_usb_xdci_disconnect(gsi->d_port.out_channel_handle,
			gsi->d_port.in_channel_handle, gsi->prot_id);
				gsi->d_port.in_channel_handle,
				(enum ipa_usb_teth_prot)gsi->prot_id);
	if (ret)
		log_event_err("%s: IPA disconnect failed %d",
				__func__, ret);
@@ -803,7 +804,8 @@ static int ipa_suspend_work_handler(struct gsi_data_port *d_port)

	log_event_dbg("%s: Calling xdci_suspend", __func__);
	ret = ipa_usb_xdci_suspend(gsi->d_port.out_channel_handle,
				gsi->d_port.in_channel_handle, gsi->prot_id,
				gsi->d_port.in_channel_handle,
				(enum ipa_usb_teth_prot)gsi->prot_id,
				usb_gsi_remote_wakeup_allowed(f));
	if (!ret) {
		d_port->sm_state = STATE_SUSPENDED;
@@ -837,7 +839,7 @@ static void ipa_resume_work_handler(struct gsi_data_port *d_port)

	ret = ipa_usb_xdci_resume(gsi->d_port.out_channel_handle,
					gsi->d_port.in_channel_handle,
					gsi->prot_id);
					(enum ipa_usb_teth_prot)gsi->prot_id);
	if (ret)
		log_event_dbg("%s: xdci_resume ret %d", __func__, ret);

@@ -3248,7 +3250,7 @@ static int gsi_bind(struct usb_configuration *c, struct usb_function *f)
	}

	gsi->d_port.ipa_usb_notify_cb = ipa_usb_notify_cb;
	status = ipa_usb_init_teth_prot(gsi->prot_id,
	status = ipa_usb_init_teth_prot((enum ipa_usb_teth_prot)gsi->prot_id,
		&gsi->d_port.ipa_init_params, gsi->d_port.ipa_usb_notify_cb,
		gsi);
	if (status) {
@@ -3298,7 +3300,7 @@ static void gsi_unbind(struct usb_configuration *c, struct usb_function *f)
	 * with ipa driver shall not fail due to unexpected state.
	 */
	drain_workqueue(gsi->d_port.ipa_usb_wq);
	ipa_usb_deinit_teth_prot(gsi->prot_id);
	ipa_usb_deinit_teth_prot((enum ipa_usb_teth_prot)gsi->prot_id);

skip_ipa_dinit:
	if (gsi->prot_id == USB_PROT_RNDIS_IPA) {