From patchwork Wed Jul 15 06:31:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 6793491 Return-Path: X-Original-To: patchwork-linux-omap@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 EA8369F2F0 for ; Wed, 15 Jul 2015 06:52:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 215532046F for ; Wed, 15 Jul 2015 06:52:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C6562047C for ; Wed, 15 Jul 2015 06:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752455AbbGOGdg (ORCPT ); Wed, 15 Jul 2015 02:33:36 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:56391 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751585AbbGOGde (ORCPT ); Wed, 15 Jul 2015 02:33:34 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NRI01EV9NJCFO80@mailout1.samsung.com>; Wed, 15 Jul 2015 15:33:12 +0900 (KST) X-AuditID: cbfee61b-f79416d0000014c0-2c-55a5fea7067e Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 61.A3.05312.7AEF5A55; Wed, 15 Jul 2015 15:33:12 +0900 (KST) Received: from AMDC2122.DIGITAL.local ([106.120.53.17]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NRI0074INICS890@mmp2.samsung.com>; Wed, 15 Jul 2015 15:33:11 +0900 (KST) From: Robert Baldyga To: gregkh@linuxfoundation.org, balbi@ti.com Cc: 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, Robert Baldyga Subject: [PATCH v3 02/46] usb: gadget: add endpoint capabilities flags Date: Wed, 15 Jul 2015 08:31:49 +0200 Message-id: <1436941953-1327-3-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1436941953-1327-1-git-send-email-r.baldyga@samsung.com> References: <1436941953-1327-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmkeLIzCtJLcpLzFFi42I5/e+xoO6Kf0tDDXr/clvMetnOYnHwfr3F 3gV3GS067x9mtmj6+4rFYs+ZX+wWzYvXs1lcWGdusfv0JUaLXw+ELDY9vsZq0X/uNIvF5V1z 2CxmL+lnsVi0rJXZ4vf3f6wWa4/cZbd49zLC4tvlZnaLY7P/Mlk8OLyT3WLWG2EHMY/JTzYy eSz4tZXF496+wywe/es+s3r8O9zP5LFz1l12j/1z17B7bF5S73F+xkJGj74tqxg9tuz/zOhx /MZ2Jo/Pm+Q89n7+zeKxffdylgD+KC6blNSczLLUIn27BK6MLc17WAq6hCre/7nG2MD4hK+L kZNDQsBE4uWL+8wQtpjEhXvr2boYuTiEBKYzSrRtvMkM4fxklLh5uoUFpIpNQEdiy/cJjCC2 CJC97u8OsA5mgbUsErfeLAArEhZwk3gx7SKQzcHBIqAqce9LNEiYV8BFYsObFjaIbXISJ49N ZgWxOQVcJab3/AK7Qgio5umuD0wTGHkXMDKsYhRNLUguKE5KzzXSK07MLS7NS9dLzs/dxAiO omfSOxhXNVgcYhTgYFTi4W1YtDRUiDWxrLgy9xCjBAezkgjv7I9AId6UxMqq1KL8+KLSnNTi Q4zSHCxK4rwn831ChQTSE0tSs1NTC1KLYLJMHJxSDYwa4d80Xx6S9Nwivcrti3vS9dL3xy2v nTgWfvga2/HJPx/YHVhj/+2k0bqb60TfJih12+z+KdQzjW/GjznLpXZuul/JtPdmrmfRE/8H i6a76az+yLK9N3Jq1Vxllom8acyBM+Zp3f5uubLK0umFFctBvS8qF5oc/hhyydx3nf30/tK6 Utt1MU8MlFiKMxINtZiLihMBZiAqq54CAAA= 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.3 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 fcb0a4e..6f3e0fb 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;