mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Robert Baldyga <r.baldyga@samsung.com>, <balbi@ti.com>,
	<gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <mina86@mina86.com>,
	<m.szyprowski@samsung.com>, <andrzej.p@samsung.com>,
	<k.opasiak@samsung.com>
Subject: Re: [PATCH v3 2/3] usb: gadget: f_fs: add ioctl returning ep descriptor
Date: Tue, 19 Aug 2014 09:16:13 -0500	[thread overview]
Message-ID: <20140819141613.GD16085@saruman.home> (raw)
In-Reply-To: <53D90F18.3050709@cogentembedded.com>

[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]

On Wed, Jul 30, 2014 at 07:28:24PM +0400, Sergei Shtylyov wrote:
> On 07/30/2014 01:43 PM, Robert Baldyga wrote:
> 
> >This patch introduces ioctl named FUNCTIONFS_ENDPOINT_DESC, which
> >returns endpoint descriptor to userspace. It works only if function
> >is active.
> 
> >Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> >---
> >  drivers/usb/gadget/f_fs.c           | 17 +++++++++++++++++
> >  include/uapi/linux/usb/functionfs.h |  6 ++++++
> >  2 files changed, 23 insertions(+)
> 
> >diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
> >index 6b806be..7f16c5a 100644
> >--- a/drivers/usb/gadget/f_fs.c
> >+++ b/drivers/usb/gadget/f_fs.c
> >@@ -1031,6 +1031,23 @@ static long ffs_epfile_ioctl(struct file *file, unsigned code,
> >  		case FUNCTIONFS_ENDPOINT_REVMAP:
> >  			ret = epfile->ep->num;
> >  			break;
> >+		case FUNCTIONFS_ENDPOINT_DESC:
> >+		{
> >+			int desc_idx;
> >+			struct usb_endpoint_descriptor *desc;
> >+
> >+			if (epfile->ffs->gadget->speed == USB_SPEED_SUPER)
> >+				desc_idx = 2;
> >+			else if (epfile->ffs->gadget->speed == USB_SPEED_HIGH)
> >+				desc_idx = 1;
> >+			else
> >+				desc_idx = 0;
> 
>    I think the above is asking to be a *switch* statement instead.

agreed.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-08-19 14:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  9:43 [PATCH v3 0/3] usb: gadget: f_fs: userspace API fixes and improvements Robert Baldyga
2014-07-30  9:43 ` [PATCH v3 1/3] usb: gadget: f_fs: fix the redundant ep files problem Robert Baldyga
2014-07-30  9:43 ` [PATCH v3 2/3] usb: gadget: f_fs: add ioctl returning ep descriptor Robert Baldyga
2014-07-30 15:28   ` Sergei Shtylyov
2014-08-19 14:16     ` Felipe Balbi [this message]
2014-07-30  9:43 ` [PATCH v3 3/3] usb: gadget: f_fs: virtual endpoint address mapping Robert Baldyga
2014-08-19 14:53 ` [PATCH v3 0/3] usb: gadget: f_fs: userspace API fixes and improvements Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140819141613.GD16085@saruman.home \
    --to=balbi@ti.com \
    --cc=andrzej.p@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=k.opasiak@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mina86@mina86.com \
    --cc=r.baldyga@samsung.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®