All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	linux-usb@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>
Subject: [PATCH 1/5] usb: gadget: Introduce usb_request->is_last field
Date: Mon, 27 Apr 2020 15:27:41 -0700	[thread overview]
Message-ID: <456f864b86a72ab9490ce095d5ba3f59b39d6a09.1588025916.git.thinhn@synopsys.com> (raw)
In-Reply-To: <cover.1588025916.git.thinhn@synopsys.com>

A transfer is composed of one or more usb_requests. Currently, only the
function driver knows this based on its implementation and its class
protocol. However, some usb controllers need to know this to update its
resources. For example, the DWC3 controller needs this info to update
its internal resources and initiate different streams.

Introduce a new field is_last to usb_request to inform the controller
driver whether the request is the last of its transfer.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
 include/linux/usb/gadget.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index e959c09a97c9..742c52f7e470 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -50,6 +50,7 @@ struct usb_ep;
  * @short_not_ok: When reading data, makes short packets be
  *     treated as errors (queue stops advancing till cleanup).
  * @dma_mapped: Indicates if request has been mapped to DMA (internal)
+ * @is_last: Indicates if this request is the last of a transfer.
  * @complete: Function called when request completes, so this request and
  *	its buffer may be re-used.  The function will always be called with
  *	interrupts disabled, and it must not sleep.
@@ -108,6 +109,7 @@ struct usb_request {
 	unsigned		zero:1;
 	unsigned		short_not_ok:1;
 	unsigned		dma_mapped:1;
+	unsigned		is_last:1;
 
 	void			(*complete)(struct usb_ep *ep,
 					struct usb_request *req);
-- 
2.11.0


  reply	other threads:[~2020-04-27 22:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 22:27 [PATCH 0/5] usb: dwc3: gadget: Handle streams Thinh Nguyen
2020-04-27 22:27 ` Thinh Nguyen [this message]
2020-04-29  3:15   ` [PATCH 1/5] usb: gadget: Introduce usb_request->is_last field Peter Chen
2020-04-30  1:00     ` Thinh Nguyen
2020-04-30  3:57       ` Peter Chen
2020-04-30  4:54         ` Thinh Nguyen
2020-04-30 14:21           ` Alan Stern
2020-04-30 17:17             ` Thinh Nguyen
2020-04-30 18:22               ` Alan Stern
2020-04-30 18:36                 ` Thinh Nguyen
2020-04-27 22:27 ` [PATCH 2/5] usb: gadget: f_tcm: Inform last transfer request Thinh Nguyen
2020-04-27 22:27 ` [PATCH 3/5] usb: dwc3: gadget: Continue to process pending requests Thinh Nguyen
2020-04-27 22:27 ` [PATCH 4/5] usb: dwc3: gadget: Handle transfer completion Thinh Nguyen
2020-04-29  7:48   ` Felipe Balbi
2020-04-30  1:16     ` Thinh Nguyen
2020-05-14 10:38       ` Felipe Balbi
2020-05-15  1:23         ` Thinh Nguyen
2020-04-27 22:28 ` [PATCH 5/5] usb: dwc3: gadget: Handle stream transfers Thinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=456f864b86a72ab9490ce095d5ba3f59b39d6a09.1588025916.git.thinhn@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.