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

Commit cf29ff82 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_mbim: Fix incorrect repsonse available notifications"

parents c24bd15f 0a494df6
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016,2017 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
@@ -768,7 +768,6 @@ static void mbim_notify_complete(struct usb_ep *ep, struct usb_request *req)
		break;
	}

	mbim_do_notify(mbim);
	spin_unlock(&mbim->lock);

	pr_debug("dev:%pK Exit\n", mbim);
@@ -878,6 +877,17 @@ fmbim_cmd_complete(struct usb_ep *ep, struct usb_request *req)
	return;
}

static void mbim_response_complete(struct usb_ep *ep, struct usb_request *req)
{
	struct f_mbim *mbim = req->context;

	pr_debug("%s: queue notify request if any new response available\n"
			, __func__);
	spin_lock(&mbim->lock);
	mbim_do_notify(mbim);
	spin_unlock(&mbim->lock);
}

static int
mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
{
@@ -957,6 +967,8 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
		pr_debug("copied encapsulated_response %d bytes\n",
			value);

		req->complete = mbim_response_complete;
		req->context = mbim;
		break;

	case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)