From patchwork Thu Jan 21 05:04:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8077641 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A0B189F1CC for ; Thu, 21 Jan 2016 05:06:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0940A205DC for ; Thu, 21 Jan 2016 05:06:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5796A205E7 for ; Thu, 21 Jan 2016 05:05:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aM7RV-0000w8-QM; Thu, 21 Jan 2016 05:05:57 +0000 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aM7R9-0000ZA-6j for linux-rockchip@lists.infradead.org; Thu, 21 Jan 2016 05:05:44 +0000 Received: by mail-pf0-x234.google.com with SMTP id 65so16896572pff.2 for ; Wed, 20 Jan 2016 21:05:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JizWITF0gnvHIk6DoAzTxBtLn+gRbS2p8YLmmiQ8GIs=; b=eZTewh30Sb/tkJjcRaYqZ6yYZaP1tdbrZAKjLfPcavqp1BcdDZUTpQAi607wMtYJFB MxIZG10GL8arJF9A7ObYngWX2vXmIT8X5+G4FwaUK4P+0JaXAAJ/B21XwxiyGz2+W5FT Ky87e87GIsBAktT6kKyLS4nHEBVwAwr4Jdmqc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JizWITF0gnvHIk6DoAzTxBtLn+gRbS2p8YLmmiQ8GIs=; b=d7VmVOeibntIJIBMsIhk3s5SRXYW2k0zGrCQdlsYxDshjmt6VB9EtHevi9UK00iyDx BrNZq/wuhqGtIObre76nNGUYax/Rtbox69/rKSKJSSeL4F8aY0AcbTdEy6tJ8zfHfwBn G+WniR+m9+VJ/H+vmfULYDxTDTisoaFDypry+lt3Fz7cDOZLsDRlGdV2DLEIFzyL2N01 OsaCZwsNPkUocL2pWvdNicvUtKbhQdd2dNxGD6fWFxouHzYPXywICZZyfsbDKQHReQBd y04B0vRseQ6Tk0dJReSZxDw2WlnuewBDyqIaD7VpbN9gTAccBKJI9glbmzcN9PyQ5sdU 9Lxg== X-Gm-Message-State: ALoCoQk82ZD2S3Am+A127JlAy2SWnd3yDpt7QfRXzw8SmG2sL8mW+x/Y4d+zGxh4jETVpXzaAKFRceK4FsmyqRefV2Np3iQVKQ== X-Received: by 10.98.71.93 with SMTP id u90mr58237026pfa.165.1453352714626; Wed, 20 Jan 2016 21:05:14 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id z28sm52255589pfi.19.2016.01.20.21.05.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jan 2016 21:05:14 -0800 (PST) From: Douglas Anderson To: John Youn , balbi@ti.com, kever.yang@rock-chips.com Subject: [PATCH v4 12/21] usb: dwc2: host: Rename some fields in struct dwc2_qh Date: Wed, 20 Jan 2016 21:04:23 -0800 Message-Id: <1453352672-27890-13-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1453352672-27890-1-git-send-email-dianders@chromium.org> References: <1453352672-27890-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160120_210535_506145_6B5ED3A2 X-CRM114-Status: GOOD ( 21.83 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gregory.herrero@intel.com, =?UTF-8?q?Heiko=20St=C3=BCbner?= , johnyoun@synopsys.com, gregkh@linuxfoundation.org, ming.lei@canonical.com, linux-usb@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, yousaf.kaukab@intel.com, stern@rowland.harvard.edu, Julius Werner , dinguyen@opensource.altera.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This no-op change just does some renames to simplify a future patch. 1. The "interval" field is renamed to "host_interval" to make it more obvious that this interval may be 8 times the interval that the device sees (if we're doing split transactions). A future patch will also add the "device_interval" field. 2. The "usecs" field is renamed to "host_us" again to make it more obvious that this is the time for the transaction as seen by the host. For split transactions the device may see a much longer transaction time. A future patch will also add "device_us". 3. The "sched_frame" field is renamed to "next_active_frame". The name "sched_frame" kept confusing me because it felt like something more permament (the QH's reservation or something). The name "next_active_frame" makes it more obvious that this field is constantly changing. Signed-off-by: Douglas Anderson --- Changes in v4: - Rename some fields in struct dwc2_qh new for v4. Changes in v3: None Changes in v2: None drivers/usb/dwc2/hcd.h | 20 ++++---- drivers/usb/dwc2/hcd_ddma.c | 37 ++++++++------- drivers/usb/dwc2/hcd_intr.c | 10 ++-- drivers/usb/dwc2/hcd_queue.c | 107 ++++++++++++++++++++++--------------------- 4 files changed, 92 insertions(+), 82 deletions(-) diff --git a/drivers/usb/dwc2/hcd.h b/drivers/usb/dwc2/hcd.h index 79473ea35bd6..10c35585a2bd 100644 --- a/drivers/usb/dwc2/hcd.h +++ b/drivers/usb/dwc2/hcd.h @@ -236,10 +236,14 @@ enum dwc2_transaction_type { * @do_split: Full/low speed endpoint on high-speed hub requires split * @td_first: Index of first activated isochronous transfer descriptor * @td_last: Index of last activated isochronous transfer descriptor - * @usecs: Bandwidth in microseconds per (micro)frame - * @interval: Interval between transfers in (micro)frames - * @sched_frame: (Micro)frame to initialize a periodic transfer. - * The transfer executes in the following (micro)frame. + * @host_us: Bandwidth in microseconds per transfer as seen by host + * @host_interval: Interval between transfers as seen by the host. If + * the host is high speed and the device is low speed this + * will be 8 times device interval. + * @next_active_frame: (Micro)frame before we next need to put something on + * the bus. We'll move the qh to active here. If the + * host is in high speed mode this will be a uframe. If + * the host is in low speed mode this will be a full frame. * @frame_usecs: Internal variable used by the microframe scheduler * @start_split_frame: (Micro)frame at which last start split was initialized * @ntd: Actual number of transfer descriptors in a list @@ -272,9 +276,9 @@ struct dwc2_qh { u8 do_split; u8 td_first; u8 td_last; - u16 usecs; - u16 interval; - u16 sched_frame; + u16 host_us; + u16 host_interval; + u16 next_active_frame; u16 frame_usecs[8]; u16 start_split_frame; u16 ntd; @@ -651,7 +655,7 @@ static inline u16 dwc2_hcd_get_ep_bandwidth(struct dwc2_hsotg *hsotg, return 0; } - return qh->usecs; + return qh->host_us; } extern void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg, diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c index 16b261cfa92d..26b00270ca0b 100644 --- a/drivers/usb/dwc2/hcd_ddma.c +++ b/drivers/usb/dwc2/hcd_ddma.c @@ -81,7 +81,7 @@ static u16 dwc2_max_desc_num(struct dwc2_qh *qh) static u16 dwc2_frame_incr_val(struct dwc2_qh *qh) { return qh->dev_speed == USB_SPEED_HIGH ? - (qh->interval + 8 - 1) / 8 : qh->interval; + (qh->host_interval + 8 - 1) / 8 : qh->host_interval; } static int dwc2_desc_list_alloc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, @@ -252,7 +252,7 @@ static void dwc2_update_frame_list(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, chan = qh->channel; inc = dwc2_frame_incr_val(qh); if (qh->ep_type == USB_ENDPOINT_XFER_ISOC) - i = dwc2_frame_list_idx(qh->sched_frame); + i = dwc2_frame_list_idx(qh->next_active_frame); else i = 0; @@ -278,13 +278,13 @@ static void dwc2_update_frame_list(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, return; chan->schinfo = 0; - if (chan->speed == USB_SPEED_HIGH && qh->interval) { + if (chan->speed == USB_SPEED_HIGH && qh->host_interval) { j = 1; /* TODO - check this */ - inc = (8 + qh->interval - 1) / qh->interval; + inc = (8 + qh->host_interval - 1) / qh->host_interval; for (i = 0; i < inc; i++) { chan->schinfo |= j; - j = j << qh->interval; + j = j << qh->host_interval; } } else { chan->schinfo = 0xff; @@ -431,7 +431,10 @@ static u16 dwc2_calc_starting_frame(struct dwc2_hsotg *hsotg, hsotg->frame_number = dwc2_hcd_get_frame_number(hsotg); - /* sched_frame is always frame number (not uFrame) both in FS and HS! */ + /* + * next_active_frame is always frame number (not uFrame) both in FS + * and HS! + */ /* * skip_frames is used to limit activated descriptors number @@ -514,13 +517,13 @@ static u16 dwc2_recalc_initial_desc_idx(struct dwc2_hsotg *hsotg, */ fr_idx_tmp = dwc2_frame_list_idx(frame); fr_idx = (FRLISTEN_64_SIZE + - dwc2_frame_list_idx(qh->sched_frame) - fr_idx_tmp) - % dwc2_frame_incr_val(qh); + dwc2_frame_list_idx(qh->next_active_frame) - + fr_idx_tmp) % dwc2_frame_incr_val(qh); fr_idx = (fr_idx + fr_idx_tmp) % FRLISTEN_64_SIZE; } else { - qh->sched_frame = dwc2_calc_starting_frame(hsotg, qh, + qh->next_active_frame = dwc2_calc_starting_frame(hsotg, qh, &skip_frames); - fr_idx = dwc2_frame_list_idx(qh->sched_frame); + fr_idx = dwc2_frame_list_idx(qh->next_active_frame); } qh->td_first = qh->td_last = dwc2_frame_to_desc_idx(qh, fr_idx); @@ -583,7 +586,7 @@ static void dwc2_init_isoc_dma_desc(struct dwc2_hsotg *hsotg, u16 next_idx; idx = qh->td_last; - inc = qh->interval; + inc = qh->host_interval; hsotg->frame_number = dwc2_hcd_get_frame_number(hsotg); cur_idx = dwc2_frame_list_idx(hsotg->frame_number); next_idx = dwc2_desclist_idx_inc(qh->td_last, inc, qh->dev_speed); @@ -605,11 +608,11 @@ static void dwc2_init_isoc_dma_desc(struct dwc2_hsotg *hsotg, } } - if (qh->interval) { - ntd_max = (dwc2_max_desc_num(qh) + qh->interval - 1) / - qh->interval; + if (qh->host_interval) { + ntd_max = (dwc2_max_desc_num(qh) + qh->host_interval - 1) / + qh->host_interval; if (skip_frames && !qh->channel) - ntd_max -= skip_frames / qh->interval; + ntd_max -= skip_frames / qh->host_interval; } max_xfer_size = qh->dev_speed == USB_SPEED_HIGH ? @@ -1029,7 +1032,7 @@ static void dwc2_complete_isoc_xfer_ddma(struct dwc2_hsotg *hsotg, idx); if (rc < 0) return; - idx = dwc2_desclist_idx_inc(idx, qh->interval, + idx = dwc2_desclist_idx_inc(idx, qh->host_interval, chan->speed); if (!rc) continue; @@ -1039,7 +1042,7 @@ static void dwc2_complete_isoc_xfer_ddma(struct dwc2_hsotg *hsotg, /* rc == DWC2_CMPL_STOP */ - if (qh->interval >= 32) + if (qh->host_interval >= 32) goto stop_scan; qh->td_first = idx; diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index 5d25a5ec9736..b54a0c41d34f 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c @@ -138,9 +138,11 @@ static void dwc2_sof_intr(struct dwc2_hsotg *hsotg) while (qh_entry != &hsotg->periodic_sched_inactive) { qh = list_entry(qh_entry, struct dwc2_qh, qh_list_entry); qh_entry = qh_entry->next; - if (dwc2_frame_num_le(qh->sched_frame, hsotg->frame_number)) { - dwc2_sch_vdbg(hsotg, "QH=%p ready fn=%04x, sch=%04x\n", - qh, hsotg->frame_number, qh->sched_frame); + if (dwc2_frame_num_le(qh->next_active_frame, + hsotg->frame_number)) { + dwc2_sch_vdbg(hsotg, "QH=%p ready fn=%04x, nxt=%04x\n", + qh, hsotg->frame_number, + qh->next_active_frame); /* * Move QH to the ready list to be executed next @@ -1350,7 +1352,7 @@ static void dwc2_hc_nyet_intr(struct dwc2_hsotg *hsotg, int frnum = dwc2_hcd_get_frame_number(hsotg); if (dwc2_full_frame_num(frnum) != - dwc2_full_frame_num(chan->qh->sched_frame)) { + dwc2_full_frame_num(chan->qh->next_active_frame)) { /* * No longer in the same full speed frame. * Treat this as a transaction error. diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c index b9e4867e1afd..39f4de6279f8 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c @@ -78,7 +78,7 @@ static void dwc2_do_unreserve(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) list_del_init(&qh->qh_list_entry); /* Update claimed usecs per (micro)frame */ - hsotg->periodic_usecs -= qh->usecs; + hsotg->periodic_usecs -= qh->host_us; if (hsotg->core_params->uframe_sched > 0) { int i; @@ -193,40 +193,40 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, int bytecount = dwc2_hb_mult(qh->maxp) * dwc2_max_packet(qh->maxp); - qh->usecs = NS_TO_US(usb_calc_bus_time(qh->do_split ? - USB_SPEED_HIGH : dev_speed, qh->ep_is_in, - qh->ep_type == USB_ENDPOINT_XFER_ISOC, - bytecount)); + qh->host_us = NS_TO_US(usb_calc_bus_time(qh->do_split ? + USB_SPEED_HIGH : dev_speed, qh->ep_is_in, + qh->ep_type == USB_ENDPOINT_XFER_ISOC, + bytecount)); /* Ensure frame_number corresponds to the reality */ hsotg->frame_number = dwc2_hcd_get_frame_number(hsotg); /* Start in a slightly future (micro)frame */ - qh->sched_frame = dwc2_frame_num_inc(hsotg->frame_number, + qh->next_active_frame = dwc2_frame_num_inc(hsotg->frame_number, SCHEDULE_SLOP); - qh->interval = urb->interval; - dwc2_sch_dbg(hsotg, "QH=%p init sch=%04x, fn=%04x, int=%#x\n", - qh, qh->sched_frame, hsotg->frame_number, - qh->interval); + qh->host_interval = urb->interval; + dwc2_sch_dbg(hsotg, "QH=%p init nxt=%04x, fn=%04x, int=%#x\n", + qh, qh->next_active_frame, hsotg->frame_number, + qh->host_interval); #if 0 /* Increase interrupt polling rate for debugging */ if (qh->ep_type == USB_ENDPOINT_XFER_INT) - qh->interval = 8; + qh->host_interval = 8; #endif hprt = dwc2_readl(hsotg->regs + HPRT0); prtspd = (hprt & HPRT0_SPD_MASK) >> HPRT0_SPD_SHIFT; if (prtspd == HPRT0_SPD_HIGH_SPEED && (dev_speed == USB_SPEED_LOW || dev_speed == USB_SPEED_FULL)) { - qh->interval *= 8; - qh->sched_frame |= 0x7; - qh->start_split_frame = qh->sched_frame; + qh->host_interval *= 8; + qh->next_active_frame |= 0x7; + qh->start_split_frame = qh->next_active_frame; dwc2_sch_dbg(hsotg, - "QH=%p init*8 sch=%04x, fn=%04x, int=%#x\n", - qh, qh->sched_frame, hsotg->frame_number, - qh->interval); + "QH=%p init*8 nxt=%04x, fn=%04x, int=%#x\n", + qh, qh->next_active_frame, + hsotg->frame_number, qh->host_interval); } - dev_dbg(hsotg->dev, "interval=%d\n", qh->interval); + dev_dbg(hsotg->dev, "interval=%d\n", qh->host_interval); } dev_vdbg(hsotg->dev, "DWC OTG HCD QH Initialized\n"); @@ -277,9 +277,9 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, if (qh->ep_type == USB_ENDPOINT_XFER_INT) { dev_vdbg(hsotg->dev, "DWC OTG HCD QH - usecs = %d\n", - qh->usecs); + qh->host_us); dev_vdbg(hsotg->dev, "DWC OTG HCD QH - interval = %d\n", - qh->interval); + qh->host_interval); } } @@ -404,19 +404,19 @@ static int dwc2_check_periodic_bandwidth(struct dwc2_hsotg *hsotg, * High speed mode * Max periodic usecs is 80% x 125 usec = 100 usec */ - max_claimed_usecs = 100 - qh->usecs; + max_claimed_usecs = 100 - qh->host_us; } else { /* * Full speed mode * Max periodic usecs is 90% x 1000 usec = 900 usec */ - max_claimed_usecs = 900 - qh->usecs; + max_claimed_usecs = 900 - qh->host_us; } if (hsotg->periodic_usecs > max_claimed_usecs) { dev_err(hsotg->dev, "%s: already claimed usecs %d, required usecs %d\n", - __func__, hsotg->periodic_usecs, qh->usecs); + __func__, hsotg->periodic_usecs, qh->host_us); status = -ENOSPC; } @@ -443,7 +443,7 @@ void dwc2_hcd_init_usecs(struct dwc2_hsotg *hsotg) static int dwc2_find_single_uframe(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) { - unsigned short utime = qh->usecs; + unsigned short utime = qh->host_us; int i; for (i = 0; i < 8; i++) { @@ -462,7 +462,7 @@ static int dwc2_find_single_uframe(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) */ static int dwc2_find_multi_uframe(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) { - unsigned short utime = qh->usecs; + unsigned short utime = qh->host_us; unsigned short xtime; int t_left; int i; @@ -608,11 +608,11 @@ static int dwc2_schedule_periodic(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) /* Set the new frame up */ if (frame >= 0) { - qh->sched_frame &= ~0x7; - qh->sched_frame |= (frame & 7); + qh->next_active_frame &= ~0x7; + qh->next_active_frame |= (frame & 7); dwc2_sch_dbg(hsotg, - "QH=%p sched_p sch=%04x, uf=%d\n", - qh, qh->sched_frame, frame); + "QH=%p sched_p nxt=%04x, uf=%d\n", + qh, qh->next_active_frame, frame); } if (status > 0) @@ -641,7 +641,7 @@ static int dwc2_schedule_periodic(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) hsotg->periodic_channels++; /* Update claimed usecs per (micro)frame */ - hsotg->periodic_usecs += qh->usecs; + hsotg->periodic_usecs += qh->host_us; } qh->unreserve_pending = 0; @@ -716,7 +716,7 @@ int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) /* QH already in a schedule */ return 0; - if (!dwc2_frame_num_le(qh->sched_frame, hsotg->frame_number) && + if (!dwc2_frame_num_le(qh->next_active_frame, hsotg->frame_number) && !hsotg->frame_number) { u16 new_frame; @@ -725,9 +725,9 @@ int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) new_frame = dwc2_frame_num_inc(hsotg->frame_number, SCHEDULE_SLOP); - dwc2_sch_vdbg(hsotg, "QH=%p reset sch=%04x=>%04x\n", - qh, qh->sched_frame, new_frame); - qh->sched_frame = new_frame; + dwc2_sch_vdbg(hsotg, "QH=%p reset nxt=%04x=>%04x\n", + qh, qh->next_active_frame, new_frame); + qh->next_active_frame = new_frame; } /* Add the new QH to the appropriate schedule */ @@ -793,10 +793,10 @@ static void dwc2_sched_periodic_split(struct dwc2_hsotg *hsotg, int sched_next_periodic_split) { u16 incr; - u16 old_frame = qh->sched_frame; + u16 old_frame = qh->next_active_frame; if (sched_next_periodic_split) { - qh->sched_frame = frame_number; + qh->next_active_frame = frame_number; incr = dwc2_frame_num_inc(qh->start_split_frame, 1); if (dwc2_frame_num_le(frame_number, incr)) { /* @@ -807,23 +807,24 @@ static void dwc2_sched_periodic_split(struct dwc2_hsotg *hsotg, */ if (qh->ep_type != USB_ENDPOINT_XFER_ISOC || qh->ep_is_in != 0) { - qh->sched_frame = - dwc2_frame_num_inc(qh->sched_frame, 1); + qh->next_active_frame = dwc2_frame_num_inc( + qh->next_active_frame, 1); } } } else { - qh->sched_frame = dwc2_frame_num_inc(qh->start_split_frame, - qh->interval); - if (dwc2_frame_num_le(qh->sched_frame, frame_number)) - qh->sched_frame = frame_number; - qh->sched_frame |= 0x7; - qh->start_split_frame = qh->sched_frame; + qh->next_active_frame = + dwc2_frame_num_inc(qh->start_split_frame, + qh->host_interval); + if (dwc2_frame_num_le(qh->next_active_frame, frame_number)) + qh->next_active_frame = frame_number; + qh->next_active_frame |= 0x7; + qh->start_split_frame = qh->next_active_frame; } - dwc2_sch_vdbg(hsotg, "QH=%p next(%d) fn=%04x, sch=%04x=>%04x (%+d)\n", + dwc2_sch_vdbg(hsotg, "QH=%p next(%d) fn=%04x, nxt=%04x=>%04x (%+d)\n", qh, sched_next_periodic_split, frame_number, old_frame, - qh->sched_frame, - dwc2_frame_num_dec(qh->sched_frame, old_frame)); + qh->next_active_frame, + dwc2_frame_num_dec(qh->next_active_frame, old_frame)); } /* @@ -861,10 +862,10 @@ void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, dwc2_sched_periodic_split(hsotg, qh, frame_number, sched_next_periodic_split); } else { - qh->sched_frame = dwc2_frame_num_inc(qh->sched_frame, - qh->interval); - if (dwc2_frame_num_le(qh->sched_frame, frame_number)) - qh->sched_frame = frame_number; + qh->next_active_frame = dwc2_frame_num_inc( + qh->next_active_frame, qh->host_interval); + if (dwc2_frame_num_le(qh->next_active_frame, frame_number)) + qh->next_active_frame = frame_number; } if (list_empty(&qh->qtd_list)) { @@ -876,9 +877,9 @@ void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, * appropriate queue */ if ((hsotg->core_params->uframe_sched > 0 && - dwc2_frame_num_le(qh->sched_frame, frame_number)) || + dwc2_frame_num_le(qh->next_active_frame, frame_number)) || (hsotg->core_params->uframe_sched <= 0 && - qh->sched_frame == frame_number)) + qh->next_active_frame == frame_number)) list_move_tail(&qh->qh_list_entry, &hsotg->periodic_sched_ready); else