Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753619AbbGaOBh (ORCPT ); Fri, 31 Jul 2015 10:01:37 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:56217 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753564AbbGaOBe (ORCPT ); Fri, 31 Jul 2015 10:01:34 -0400 X-AuditID: cbfee61a-f79a06d000005c6f-0c-55bb7fbc9bdd 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 v5 02/46] usb: gadget: add endpoint capabilities flags Date: Fri, 31 Jul 2015 16:00:14 +0200 Message-id: <1438351258-31578-3-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1438351258-31578-1-git-send-email-r.baldyga@samsung.com> References: <1438351258-31578-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzXRXUhTYRjA8d6ds53jaHE6Sr5paQw16MMyIt+LCLvI3qCim1F4Y1MPam5z bNNSEJdm6sQmaOC3My1NyqnT/JjfUyu/Mi2LYDpwiYbUxUptU8lNuvs/PD94Lh6aYKtJPzpR oeFUCqlMLBCSEztLzOneTLPkbGstROWruSQaWsxEfQYrQPmLFgJlbf8gUe+kk0LZdUYBmmkO R+aJWYCcNha1Lc3zkX56gkRzPZUCVFGvJ9GzFzkEcm3s8NHrESuFfq7eQetz2RQaq9jmoZq8 p3xks3RTqHzNGxW5ZgQREBfbW3nY4Owg8UK/hcT6Zgcf71j0PNxdbqXwQNUrCpvqM/GH0lqA K6ybAD9pbwK4fcAB8NuvnTxc9rJQgB1tAbjP4SJvHYwSXozjZImpnOrMpbvChDe6TqDUsQ8a P2fztcB+QAe8aMich3n5a/y9PgRnFowCHRDSLPMcwNEqA7E3/AVw+3cX5VYC5hRs3ygC7vZh GGhcmaXciGA2SThVXeBB3kwkLM0zeZpkguGIw064W8RcgQ+1ZrB3LgC+Hyv2nPba9X+MUx7P 7pqRsXGiCIgMYF8TgJwyVqmOiZeHKbj7oWqpXJ2iiA+NTZa3Ac/Xlv26wFDP1WHA0EC8X8TU 9UhYvjRVnSYfBpAmxD6ixRCzhBXFSdPSOVVytCpFxqmHgT9Nin1FR1tMEpaJl2q4JI5Tcqr/ Wx7t5acF+utf5u2aLPu7oBLt1JYtKbww4/DqpCvu1k18ri7wk7l7cNr5yFt/O5run1wvs64M 5Hd0Hvf9WK/xKWgYjS04FmVOFgZrZBnF34yyC13mCBHvZIP/Edp/3fY94pegjHrMpqXn1IRE Lm+ZKhOSWhpL+gMHY2puBF1Ll1+ezR2/JybVCdKwE4RKLf0HI4CS4bECAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2496 Lines: 68 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 68fb5e8..a9a4959 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; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/