All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: dummy-hcd: use configurable endpoint naming scheme
@ 2020-05-13 20:52 Andrey Konovalov
  2020-05-14 14:17 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Konovalov @ 2020-05-13 20:52 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: linux-usb, linux-kernel, Greg Kroah-Hartman, Alan Stern,
	Dmitry Vyukov, Andrey Konovalov, Andrey Konovalov

From: Andrey Konovalov <andreyknvl@gmail.com>

USB gadget subsystem uses the following naming convention for UDC
endpoints:

- "ep-a" names for fully configurable endpoints (address, direction and
  transfer type can be changed);

- "ep1in", "ep12out-bulk" names for fixed function endpoints (fixed
  address, direction and/or transfer type).

Dummy UDC endpoints are capable of full configuration, but named using
the second scheme.

This patch changes the names of generic Dummy UDC endpoints to "ep-aout",
"ep-bin", etc., to advertise that they have configurable addresses and
transfer types (except that Dummy UDC doesn't support ISO transfers), but
fixed direction.

This is required for Raw Gadget (and perhaps for some other drivers),
that reasons about whether an endpoint has configurable address based
on its name.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
---
 drivers/usb/gadget/udc/dummy_hcd.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
index 6e3e3ebf715f..7402ef0d66d2 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -187,31 +187,31 @@ static const struct {
 		USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)),
 
 	/* and now some generic EPs so we have enough in multi config */
-	EP_INFO("ep3out",
+	EP_INFO("ep-aout",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
-	EP_INFO("ep4in",
+	EP_INFO("ep-bin",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
-	EP_INFO("ep5out",
+	EP_INFO("ep-cout",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
-	EP_INFO("ep6out",
+	EP_INFO("ep-dout",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
-	EP_INFO("ep7in",
+	EP_INFO("ep-ein",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
-	EP_INFO("ep8out",
+	EP_INFO("ep-fout",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
-	EP_INFO("ep9in",
+	EP_INFO("ep-gin",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
-	EP_INFO("ep10out",
+	EP_INFO("ep-hout",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
-	EP_INFO("ep11out",
+	EP_INFO("ep-iout",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
-	EP_INFO("ep12in",
+	EP_INFO("ep-jin",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
-	EP_INFO("ep13out",
+	EP_INFO("ep-kout",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
-	EP_INFO("ep14in",
+	EP_INFO("ep-lin",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
-	EP_INFO("ep15out",
+	EP_INFO("ep-mout",
 		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
 
 #undef EP_INFO
-- 
2.26.2.645.ge9eca65c58-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] USB: dummy-hcd: use configurable endpoint naming scheme
  2020-05-13 20:52 [PATCH] USB: dummy-hcd: use configurable endpoint naming scheme Andrey Konovalov
@ 2020-05-14 14:17 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2020-05-14 14:17 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Felipe Balbi, linux-usb, linux-kernel, Greg Kroah-Hartman,
	Dmitry Vyukov, Andrey Konovalov

On Wed, May 13, 2020 at 10:52:56PM +0200, Andrey Konovalov wrote:
> From: Andrey Konovalov <andreyknvl@gmail.com>
> 
> USB gadget subsystem uses the following naming convention for UDC
> endpoints:
> 
> - "ep-a" names for fully configurable endpoints (address, direction and
>   transfer type can be changed);
> 
> - "ep1in", "ep12out-bulk" names for fixed function endpoints (fixed
>   address, direction and/or transfer type).
> 
> Dummy UDC endpoints are capable of full configuration, but named using
> the second scheme.
> 
> This patch changes the names of generic Dummy UDC endpoints to "ep-aout",
> "ep-bin", etc., to advertise that they have configurable addresses and
> transfer types (except that Dummy UDC doesn't support ISO transfers), but
> fixed direction.
> 
> This is required for Raw Gadget (and perhaps for some other drivers),
> that reasons about whether an endpoint has configurable address based
> on its name.
> 
> Suggested-by: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  drivers/usb/gadget/udc/dummy_hcd.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
> index 6e3e3ebf715f..7402ef0d66d2 100644
> --- a/drivers/usb/gadget/udc/dummy_hcd.c
> +++ b/drivers/usb/gadget/udc/dummy_hcd.c
> @@ -187,31 +187,31 @@ static const struct {
>  		USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)),
>  
>  	/* and now some generic EPs so we have enough in multi config */
> -	EP_INFO("ep3out",
> +	EP_INFO("ep-aout",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
> -	EP_INFO("ep4in",
> +	EP_INFO("ep-bin",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
> -	EP_INFO("ep5out",
> +	EP_INFO("ep-cout",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
> -	EP_INFO("ep6out",
> +	EP_INFO("ep-dout",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
> -	EP_INFO("ep7in",
> +	EP_INFO("ep-ein",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
> -	EP_INFO("ep8out",
> +	EP_INFO("ep-fout",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
> -	EP_INFO("ep9in",
> +	EP_INFO("ep-gin",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
> -	EP_INFO("ep10out",
> +	EP_INFO("ep-hout",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
> -	EP_INFO("ep11out",
> +	EP_INFO("ep-iout",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
> -	EP_INFO("ep12in",
> +	EP_INFO("ep-jin",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
> -	EP_INFO("ep13out",
> +	EP_INFO("ep-kout",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
> -	EP_INFO("ep14in",
> +	EP_INFO("ep-lin",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_IN)),
> -	EP_INFO("ep15out",
> +	EP_INFO("ep-mout",
>  		USB_EP_CAPS(TYPE_BULK_OR_INT, USB_EP_CAPS_DIR_OUT)),
>  
>  #undef EP_INFO

Acked-by: Alan Stern <stern@rowland.harvard.edu>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-14 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 20:52 [PATCH] USB: dummy-hcd: use configurable endpoint naming scheme Andrey Konovalov
2020-05-14 14:17 ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.