From patchwork Mon Jul 27 09:16:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 6871261 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 46963C05AC for ; Mon, 27 Jul 2015 09:34:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7417C2066F for ; Mon, 27 Jul 2015 09:34:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1E4920638 for ; Mon, 27 Jul 2015 09:34:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753265AbbG0JRf (ORCPT ); Mon, 27 Jul 2015 05:17:35 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:47434 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752566AbbG0JRd (ORCPT ); Mon, 27 Jul 2015 05:17:33 -0400 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NS502EWK357YWB0@mailout1.samsung.com>; Mon, 27 Jul 2015 18:17:31 +0900 (KST) X-AuditID: cbfee61a-f79a06d000005c6f-ee-55b5f72ab28b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 98.98.23663.A27F5B55; Mon, 27 Jul 2015 18:17:31 +0900 (KST) Received: from AMDC2122.DIGITAL.local ([106.120.53.17]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NS500L1Z34BGGA0@mmp1.samsung.com>; Mon, 27 Jul 2015 18:17:30 +0900 (KST) From: Robert Baldyga To: balbi@ti.com Cc: gregkh@linuxfoundation.org, Peter.Chen@freescale.com, johnyoun@synopsys.com, dahlmann.thomas@arcor.de, nicolas.ferre@atmel.com, cernekee@gmail.com, leoli@freescale.com, daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, michal.simek@xilinx.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-geode@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, andrzej.p@samsung.com, m.szyprowski@samsung.com, stern@rowland.harvard.edu, petr.cvek@tul.cz, Robert Baldyga Subject: [PATCH v4 02/46] usb: gadget: add endpoint capabilities flags Date: Mon, 27 Jul 2015 11:16:12 +0200 Message-id: <1437988616-6962-3-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1437988616-6962-1-git-send-email-r.baldyga@samsung.com> References: <1437988616-6962-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLIsWRmVeSWpSXmKPExsVy+t9jAV3t71tDDZZO5bWY9bKdxeLg/XqL vQvuMlp03j/MbNH09xWLxZ4zv9gtmhevZ7O4sM7cYvfpS4wWvx4IWWx6fI3Vov/caRaLy7vm sFnMXtLPYrFoWSuzxe/v/1gt1h65y27x7mWExbfLzewWx2b/ZbKY3zGV1eLB4Z3sFrPeCFtM +H2BzUHCY/KTjUweC35tZfG4t+8wi0f/us+sHv8O9zN57Jx1l91j/9w17B6bl9R7nJ+xkNFj 9t0fjB59W1YxemzZ/5nR4/iN7UweM1f2snl83iTnsffzb5YAwSgum5TUnMyy1CJ9uwSujFUL JrEUdAlVTH+2mLmB8QlfFyMnh4SAicTCrc2sELaYxIV769m6GLk4hASWMkp090+Ecn4ySqy8 cZ4RpIpNQEdiy/cJYLaIgIDE+heX2EGKmAV+sEicndfNDpIQFnCTODn3PxOIzSKgKjG1u4EF xOYVcJFoXPGQDWKdnMTJY5PBVnMKuEosmbYVqJ4DaJuLxJHrWhMYeRcwMqxilEgtSC4oTkrP NcxLLdcrTswtLs1L10vOz93ECI60Z1I7GA/ucj/EKMDBqMTDe0Fla6gQa2JZcWXuIUYJDmYl Ed7HUUAh3pTEyqrUovz4otKc1OJDjNIcLErivLIbNocKCaQnlqRmp6YWpBbBZJk4OKUaGHUq J/8OitEPP9Dxf++U2IVCy991ZOwocy3fy83i/aXtcq3e513Ja4yW2771lr5VPV/7l+f9iy6O r47NqU37qOMtpMH4tvDqt/te71v6mQtD/yxLOLWVifHKI7Z5Z+wso0x92HZEn3gmGnj07cXI bXvV/xkw6+ZevdJ9P70xx/PYxwamLycublZiKc5INNRiLipOBADZQJlesAIAAA== Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Introduce struct usb_ep_caps which contains information about capabilities of usb endpoints - supported transfer types and directions. This structure should be filled by UDC driver for each of its endpoints, and will be used in epautoconf in new ep matching mechanism which will replace ugly guessing of endpoint capabilities basing on its name. Signed-off-by: Robert Baldyga --- include/linux/usb/gadget.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 9c5e486..2e85b86 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -141,10 +141,29 @@ struct usb_ep_ops { }; /** + * struct usb_ep_caps - endpoint capabilities description + * @type_control:Endpoint supports control type (reserved for ep0). + * @type_iso:Endpoint supports isochronous transfers. + * @type_bulk:Endpoint supports bulk transfers. + * @type_int:Endpoint supports interrupt transfers. + * @dir_in:Endpoint supports IN direction. + * @dir_out:Endpoint supports OUT direction. + */ +struct usb_ep_caps { + unsigned type_control:1; + unsigned type_iso:1; + unsigned type_bulk:1; + unsigned type_int:1; + unsigned dir_in:1; + unsigned dir_out:1; +}; + +/** * struct usb_ep - device side representation of USB endpoint * @name:identifier for the endpoint, such as "ep-a" or "ep9in-bulk" * @ops: Function pointers used to access hardware-specific operations. * @ep_list:the gadget's ep_list holds all of its endpoints + * @caps:The structure describing types and directions supported by endoint. * @maxpacket:The maximum packet size used on this endpoint. The initial * value can sometimes be reduced (hardware allowing), according to * the endpoint descriptor used to configure the endpoint. @@ -167,12 +186,14 @@ struct usb_ep_ops { * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, * and is accessed only in response to a driver setup() callback. */ + struct usb_ep { void *driver_data; const char *name; const struct usb_ep_ops *ops; struct list_head ep_list; + struct usb_ep_caps caps; bool claimed; unsigned maxpacket:16; unsigned maxpacket_limit:16;