From patchwork Fri Nov 16 03:03:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 10685529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABE0814D6 for ; Fri, 16 Nov 2018 03:03:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E6E920408 for ; Fri, 16 Nov 2018 03:03:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 919692D471; Fri, 16 Nov 2018 03:03:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED8B62D309 for ; Fri, 16 Nov 2018 03:03:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727215AbeKPNN6 (ORCPT ); Fri, 16 Nov 2018 08:13:58 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:36660 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbeKPNN6 (ORCPT ); Fri, 16 Nov 2018 08:13:58 -0500 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 00F7B10C10A2; Thu, 15 Nov 2018 19:03:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1542337403; bh=F9KXAieUBb93KRfIJySygbuTGgypp8l4kz6d1wDPt18=; h=Date:From:Subject:To:CC:From; b=FeeFCaHT+U44VDBsNxxWbku15qnKOe3vCCt40wg2EGlXzjR+psD6ah46P6q0uJw9i mxCpkNPqV/AUlbUyJQOU7u3S/W+olW1wjrq/sdxtqe1VbTy8y9Bl4S8E1dQ7GfO2BB XkY/OBYYXZjA3xWu+68HMBaU43Ak9YtHao9+vd+uicw9anTECiwQrSy21qsyNcka0W N8ZmPONhVG/PWFfOo1fIolRhN8yrBnfyxHB514viVT9oJhl4jyb0a9Lkb84lYbv79X H192U6ia6Q2bWlgdTf3zH9CSSf+Lq+JHGL9Yw31K1mAfsh2h20puJUr3LQ0Hhxih8P 1h2+muAlRWZQQ== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id D47CE36C4; Thu, 15 Nov 2018 19:03:22 -0800 (PST) Received: from US01WEHTC1.internal.synopsys.com (10.12.239.236) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 15 Nov 2018 19:03:22 -0800 Received: from te-lab16 (10.13.184.20) by us01wehtc1.internal.synopsys.com (10.12.239.236) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 15 Nov 2018 19:03:21 -0800 Received: by te-lab16 (sSMTP sendmail emulation); Thu, 15 Nov 2018 19:03:21 -0800 Date: Thu, 15 Nov 2018 19:03:21 -0800 Message-ID: From: Thinh Nguyen Subject: [PATCH v3 1/2] usb: gadget: Introduce frame_number to usb_request To: Felipe Balbi , Greg Kroah-Hartman , CC: John Youn , Thinh Nguyen MIME-Version: 1.0 X-Originating-IP: [10.13.184.20] Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 --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; };