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

Commit ee3638b8 authored by Felipe Balbi's avatar Felipe Balbi
Browse files

usb: dwc3: gadget: update dep->frame_number from XferInprogress too



We will need an up-to-date frame_number from XferInProgress too when
future patches improve our handling of Isoc endpoints.

Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 5828cada
Loading
Loading
Loading
Loading
+13 −6
Original line number Original line Diff line number Diff line
@@ -2417,6 +2417,16 @@ static int dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep,
	return 1;
	return 1;
}
}


static void dwc3_gadget_endpoint_frame_from_event(struct dwc3_ep *dep,
		const struct dwc3_event_depevt *event)
{
	u32 cur_uf, mask;

	mask = ~(dep->interval - 1);
	cur_uf = event->parameters & mask;
	dep->frame_number = cur_uf;
}

static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
		const struct dwc3_event_depevt *event)
		const struct dwc3_event_depevt *event)
{
{
@@ -2424,6 +2434,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
	unsigned		status = 0;
	unsigned		status = 0;
	int			clean_busy;
	int			clean_busy;


	dwc3_gadget_endpoint_frame_from_event(dep, event);

	if (event->status & DEPEVT_STATUS_BUSERR)
	if (event->status & DEPEVT_STATUS_BUSERR)
		status = -ECONNRESET;
		status = -ECONNRESET;


@@ -2462,12 +2474,7 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
static void dwc3_gadget_endpoint_transfer_not_ready(struct dwc3_ep *dep,
static void dwc3_gadget_endpoint_transfer_not_ready(struct dwc3_ep *dep,
		const struct dwc3_event_depevt *event)
		const struct dwc3_event_depevt *event)
{
{
	u32 cur_uf, mask;
	dwc3_gadget_endpoint_frame_from_event(dep, event);

	mask = ~(dep->interval - 1);
	cur_uf = event->parameters & mask;
	dep->frame_number = cur_uf;

	__dwc3_gadget_start_isoc(dep);
	__dwc3_gadget_start_isoc(dep);
}
}