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

Commit 07fb24aa authored by Manu Gautam's avatar Manu Gautam
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 eab5f6f8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2467,6 +2467,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))
@@ -2643,6 +2645,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_stop_active_transfer(struct dwc3 *dwc, u32 epnum)