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

Commit e66f9f51 authored by Mayank Rana's avatar Mayank Rana
Browse files

f_gsi: Replace == check against SUPER_SPEED to >=



There is no difference in terms of supporting USB function suspend and
resume functionality between USB super speed and super speed plus. Hence
replace == check against SUPER_SPEED to >= to enable all functionality
supported with super speed to super speed plus.

Change-Id: I6226943b60e79bbb1504b2739965a5a2ff5f2a35
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 01697ba5
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ static inline bool usb_gsi_remote_wakeup_allowed(struct usb_function *f)
	bool remote_wakeup_allowed;
	struct f_gsi *gsi = func_to_gsi(f);

	if (f->config->cdev->gadget->speed == USB_SPEED_SUPER)
	if (f->config->cdev->gadget->speed >= USB_SPEED_SUPER)
		remote_wakeup_allowed = f->func_wakeup_allowed;
	else
		remote_wakeup_allowed = f->config->cdev->gadget->remote_wakeup;
@@ -172,7 +172,7 @@ static int gsi_wakeup_host(struct f_gsi *gsi)
	 * allowed to do so by the host. This is done in order to support non
	 * fully USB 3.0 compatible hosts.
	 */
	if ((gadget->speed == USB_SPEED_SUPER) && (func->func_is_suspended)) {
	if ((gadget->speed >= USB_SPEED_SUPER) && (func->func_is_suspended)) {
		log_event_dbg("%s: Calling usb_func_wakeup", __func__);
		ret = usb_func_wakeup(func);
	} else {
@@ -604,7 +604,7 @@ static int ipa_connect_channels(struct gsi_data_port *d_port)
	conn_params->teth_prot_params.max_packet_number_to_dev =
		DEFAULT_MAX_PKT_PER_XFER;
	conn_params->max_supported_bandwidth_mbps =
		(cdev->gadget->speed == USB_SPEED_SUPER) ? 3600 : 400;
		(cdev->gadget->speed >= USB_SPEED_SUPER) ? 3600 : 400;

	memset(&ipa_in_channel_out_params, 0x0,
				sizeof(ipa_in_channel_out_params));
@@ -1611,7 +1611,7 @@ static const struct file_operations gsi_ctrl_dev_fops = {
/* peak (theoretical) bulk transfer rate in bits-per-second */
static unsigned int gsi_xfer_bitrate(struct usb_gadget *g)
{
	if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER)
	if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER)
		return 13 * 1024 * 8 * 1000 * 8;
	else if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
		return 13 * 512 * 8 * 1000 * 8;
@@ -2544,7 +2544,7 @@ static void gsi_resume(struct usb_function *f)
	 * If the function is in USB3 Function Suspend state, resume is
	 * canceled. In this case resume is done by a Function Resume request.
	 */
	if ((cdev->gadget->speed == USB_SPEED_SUPER) &&
	if ((cdev->gadget->speed >= USB_SPEED_SUPER) &&
		f->func_is_suspended)
		return;