diff mbox series

[v3,1/2] usb: gadget: Introduce frame_number to usb_request

Message ID b7e89ae44cdd7c7c07b4007943d4bf49357ad80e.1542336692.git.thinhn@synopsys.com (mailing list archive)
State Mainlined
Commit 6b69753fa0078c5222d6b4aeb5017c5503e0dc8e
Headers show
Series [v3,1/2] usb: gadget: Introduce frame_number to usb_request | expand

Commit Message

Thinh Nguyen Nov. 16, 2018, 3:03 a.m. UTC
Add a field frame_number to the usb_request to report the interval
number in (micro)frames in which the isochronous transfer was
transmitted or received. The gadget driver can use this knowledge to
synchronize with the host. Also, this option is useful for debugging
purposes.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
Change in v3:
- Rename the "start_frame" field to "frame_number"
- Redefine the frame_number meaning and purpose
Change in v2:
- None


 include/linux/usb/gadget.h | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index e5cd84a0f84a..7595056b96c1 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -61,6 +61,8 @@  struct usb_ep;
  *	invalidated by the error may first be dequeued.
  * @context: For use by the completion callback
  * @list: For use by the gadget driver.
+ * @frame_number: Reports the interval number in (micro)frame in which the
+ *	isochronous transfer was transmitted or received.
  * @status: Reports completion code, zero or a negative errno.
  *	Normally, faults block the transfer queue from advancing until
  *	the completion callback returns.
@@ -112,6 +114,8 @@  struct usb_request {
 	void			*context;
 	struct list_head	list;
 
+	unsigned		frame_number;		/* ISO ONLY */
+
 	int			status;
 	unsigned		actual;
 };