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

Commit 26883861 authored by Manu Gautam's avatar Manu Gautam Committed by Matt Wagantall
Browse files

dwc3: gadget: Add support for transfer complete events counting



Add counting of USB transfers completion events/interrupts
so that it can be used to determine USB transfers or BUS usage.
This is a simple approach which gives reasonable accuracy to
avoid counting actual bytes that got transferred over USB.

Change-Id: Ib06e916ef1b3a7dbf0b3c720d306e922043a7f33
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent c3a2ae17
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2199,6 +2199,8 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
			break;
	} while (1);

	dwc->gadget.xfer_isr_count++;

	if (usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
			list_empty(&dep->req_queued)) {
		if (list_empty(&dep->request_list)) {
@@ -2380,6 +2382,7 @@ static void dwc3_disconnect_gadget(struct dwc3 *dwc)
		dwc->gadget_driver->disconnect(&dwc->gadget);
		spin_lock(&dwc->lock);
	}
	dwc->gadget.xfer_isr_count = 0;
}

static void dwc3_suspend_gadget(struct dwc3 *dwc)