lkml.org 
[lkml]   [2014]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 1/3] usb: gadget: f_fs: virtual address mapping
Date
On Fri, Jul 25 2014, Robert Baldyga wrote:
> This patch adds virtual endpoint address mapping to functionfs.
>
> So far endpoint addresses given by user through endpoint descriptors
> were ignored, and replaced by physical endpoint addresses. Endpoint
> address in wIndex field of setup requesti, addressed to endpoint, was
> the physical endpoint address, and names of files in functionfs
> directory was numered in order, and were the same as indexes of
> ffs_epfile in epfile array. In result user has no way to indicate
> which file in functionfs is associated with which particular
> requested endpoint. He also didn't know which endpoint is recipient
> of setup request.

Couldn't that be solved by simply providing the mapping to user space?

> There was also one more problem - if endpoint addresses in descriptors
> were non-consecutive, there were created redundant files, which could
> cause problems in kernel, when user tryed to read/write to them.
> It was result of fact that maximum endpoint address was taken as
> total number of endpoints in funciton.

This is kinda unrelated though. I mean it's a separate bug.

> This patch solves this problems by introducing virtual endpoint address
> mapping. Now each function has separate endpoint address space. Numbers
> of endpoint files in functionfs and addresses in setup requests are
> mapped to addresses choosen by user in endpoint descriptors.
>
> It also introduces additional testing if desctiptors given by user are
> consistent - if number of endpoints and their addresses in each speed
> are the same.
>
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
> drivers/usb/gadget/f_fs.c | 78 +++++++++++++++++++++++++++++++++++++++--------
> drivers/usb/gadget/u_fs.h | 2 ++
> 2 files changed, 68 insertions(+), 12 deletions(-)

--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--
--
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/

\
 
 \ /
  Last update: 2014-07-25 17:01    [W:0.119 / U:1.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site