[PATCH 25/29] usb: gadget: f_printer: convert to new function interface with backward compatibility

2015-02-23 Thread Andrzej Pietrasiewicz
@@ -0,0 +1,33 @@ +/* + * u_printer.h + * + * Utility definitions for the printer function + * + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Author: Andrzej Pietrasiewicz andrze...@samsung.com + * + * This program is free software; you can

[PATCH 01/29] usb: gadget: composite: don't try standard handling for non-standard requests

2015-02-23 Thread Andrzej Pietrasiewicz
If a non-standard request is processed and its parameters just happen to match those of some standard request, the logic of composite_setup() can be fooled, so don't even try any switch cases, just go to the proper place where unknown requests are handled. Signed-off-by: Andrzej Pietrasiewicz

[PATCH 29/29] usb: gadget: printer: add configfs support

2015-02-23 Thread Andrzej Pietrasiewicz
Add support for configfs interface so that f_printer can be used as a component of usb gadgets composed with it. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- .../ABI/testing/configfs-usb-gadget-printer| 9 ++ Documentation/usb/gadget-testing.txt | 47

[PATCH 14/29] usb: gadget: printer: don't access file global pnp_string in function's code

2015-02-23 Thread Andrzej Pietrasiewicz
In order to factor out a reusable f_printer, the function's code should not use file global variables related to legacy printer gadget's implementation. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 14 -- 1 file changed, 8

[PATCH 20/29] usb: gadget: composite: add req_match method to usb_function

2015-02-23 Thread Andrzej Pietrasiewicz
. If a function uses req_match(), it should try as hard as possible to determine if the request is meant for it. If no functions in a configuration provide req_match or none of them returns true, then fall back to the usual approach. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com

[PATCH 27/29] usb: gadget: f_printer: remove compatibility layer

2015-02-23 Thread Andrzej Pietrasiewicz
There are no old interface users left, so it can be removed. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/f_printer.c | 113 1 file changed, 113 deletions(-) diff --git a/drivers/usb/gadget/function/f_printer.c b

[PATCH 04/29] usb: gadget: printer: eliminate random pointer dereference

2015-02-23 Thread Andrzej Pietrasiewicz
() dereferences such a pointer which causes a disaster. This patch moves respective INIT_LIST_HEAD() invocations to a point before goto fail branch can be taken. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 6 +++--- 1 file changed, 3 insertions

[PATCH 10/29] usb: gadget: printer: move function-related bind code to function's bind

2015-02-23 Thread Andrzej Pietrasiewicz
In order to factor out a reusable f_printer.c, the code related to the function should be placed in functions related to the function. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 114 +--- 1 file changed, 66

[PATCH 24/29] usb: gadget: printer: factor out f_printer

2015-02-23 Thread Andrzej Pietrasiewicz
The legacy printer gadget now contains both a reusable printer function and legacy gadget proper implementations interwoven, but logically separate. This patch factors out a reusable f_printer. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/f_printer.c

[PATCH 17/29] usb: gadget: printer: eliminate file global printer_mutex

2015-02-23 Thread Andrzej Pietrasiewicz
The mutex is a legacy after semi-automatic Big Kernel Lock removal. printer_open() does its own locking, so no need to duplicate it. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers

[PATCH 11/29] usb: gadget: printer: call usb_add_function() last

2015-02-23 Thread Andrzej Pietrasiewicz
to the new interface. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c index c857044..5dbb93a

[PATCH 00/29] Equivalent of g_printer with configfs

2015-02-23 Thread Andrzej Pietrasiewicz
with the prn_example described in Documentation/usb/gadget-printer.txt. Andrzej Pietrasiewicz (29): usb: gadget: composite: don't try standard handling for non-standard requests usb: gadget: printer: enqueue printer's response for setup request usb: gadget: printer: remove unused and empty

[PATCH 07/29] usb: gadget: printer: eliminate pdev member of struct printer_dev

2015-02-23 Thread Andrzej Pietrasiewicz
The pdev member of struct printer_dev is not used outside printer_bind_config(), so it can just as well be a local variable there. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 8 1 file changed, 4 insertions(+), 4 deletions

[PATCH 22/29] usb: gadget: printer: add req_match for printer function

2015-02-23 Thread Andrzej Pietrasiewicz
meant for this function iff the decoded interface number matches dev-interface. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 36 1 file changed, 36 insertions(+) diff --git a/drivers/usb/gadget/legacy

[PATCH 28/29] usb: gadget: printer: use module_usb_composite_driver helper macro

2015-02-23 Thread Andrzej Pietrasiewicz
Substitute some boilerplate code with a dedicated macro. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget

[PATCH 21/29] usb: gadget: printer: name class specific requests

2015-02-23 Thread Andrzej Pietrasiewicz
Avoid using magic numbers. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c index f103c11

[PATCH 19/29] usb: gadget: printer: add container_of helper for printer_dev

2015-02-23 Thread Andrzej Pietrasiewicz
5 uses of container_of() in the same context justify wrapping it in a static inline function. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget

[PATCH 15/29] usb: gadget: printer: add setup and cleanup functions

2015-02-23 Thread Andrzej Pietrasiewicz
Factor out gprinter_setup() and gprinter_cleanup() so that it is easy to change the place they are called from. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 46 + 1 file changed, 31 insertions(+), 15

[PATCH 13/29] usb: gadget: printer: define pnp string buffer length

2015-02-23 Thread Andrzej Pietrasiewicz
Avoid using magic numbers. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c index 84e6cdd

[PATCH 18/29] usb: gadget: printer: don't access file global usb_printer_gadget in function's code

2015-02-23 Thread Andrzej Pietrasiewicz
The printer_dev can be recovered from printer_func_unbind() function's parameters. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers

[PATCH 09/29] usb: gadget: printer: standardize printer_do_config

2015-02-23 Thread Andrzej Pietrasiewicz
Follow the convention of distributing source code between something_do_config() and something_bind_config(). Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 39 +++-- 1 file changed, 24 insertions(+), 15

[PATCH 26/29] usb: gadget: printer: convert to new interface of f_printer

2015-02-23 Thread Andrzej Pietrasiewicz
The goal is to remove the old function interface, so its (only) user must be converted to the new interface. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/Kconfig | 1 + drivers/usb/gadget/legacy/printer.c | 50

[PATCH 12/29] usb: gadget: printer: move function-related unbind code to function's unbind

2015-02-23 Thread Andrzej Pietrasiewicz
In order to factor out a reusable f_printer.c, the code related to the function should be placed in functions related to the function. printer_cfg_unbind() becomes empty, so it is removed. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 58

[PATCH 02/29] usb: gadget: printer: enqueue printer's response for setup request

2015-02-23 Thread Andrzej Pietrasiewicz
+ Fixes: 2e87edf49227: usb: gadget: make g_printer use composite Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c

[PATCH 03/29] usb: gadget: printer: remove unused and empty printer_unbind

2015-02-23 Thread Andrzej Pietrasiewicz
The unbind() method is optional is usb_composite_driver. In this particular driver the method does nothing so it can be removed. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/usb

[PATCH 08/29] usb: gadget: printer: follow the naming convention for usb_add_config callback

2015-02-23 Thread Andrzej Pietrasiewicz
Legacy gadgets, before converting them to the new function framework, used to use the name something_do_config() for usb_add_config()'s callback. This patch changes the name so that it is easier to follow the convention. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb

[PATCH 05/29] usb: gadget: printer: revert usb_add_function() effect in error recovery

2015-02-23 Thread Andrzej Pietrasiewicz
Whenever the goto fail branch is taken, the effect of usb_add_function() should be reverted. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb

[PATCH 16/29] usb: gadget: printer: call gprinter_setup() from gadget's bind

2015-02-23 Thread Andrzej Pietrasiewicz
Call gprinter_setup() from gadget's bind instead of module's init. Call gprinter_cleaup() corerspondingly. This detaches printer function's logic from legacy printer gadget's implementation. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 35

[PATCH 06/29] usb: gadget: printer: add missing error handling

2015-02-23 Thread Andrzej Pietrasiewicz
. This patch changes error handling so that at least as much cleanup is done as when a failure happens before printer_req_alloc() invocations. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 23 +-- 1 file changed, 5 insertions

Re: [PATCH 00/29] Equivalent of g_printer with configfs

2015-02-23 Thread Andrzej Pietrasiewicz
W dniu 23.02.2015 o 16:01, Andrzej Pietrasiewicz pisze: This series aims at integrating configfs into hid, the way Of course I meant printer. Sorry about confusion. AP -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org

Re: [PATCH 1/2] usb: gadget: udc-core: independent registration of gadgets and gadget drivers

2015-02-17 Thread Andrzej Pietrasiewicz
W dniu 17.02.2015 o 22:02, Ruslan Bilovol pisze: Hi Andrzej, On Mon, Feb 16, 2015 at 10:07 AM, Andrzej Pietrasiewicz andrze...@samsung.com wrote: W dniu 15.02.2015 o 23:43, Ruslan Bilovol pisze: snip In my opinion all things which you have described are working out-of-box when you use

Re: [PATCH 1/2] usb: gadget: udc-core: independent registration of gadgets and gadget drivers

2015-02-16 Thread Andrzej Pietrasiewicz
W dniu 15.02.2015 o 23:43, Ruslan Bilovol pisze: snip In my opinion all things which you have described are working out-of-box when you use configfs interface. It's mostly ready so you may create equivalent of most legacy gadgets (apart from printer and tcm) and just bind from one udc to

Re: usb: gadget: configfs: OS Extended Compatibility descriptors support

2015-02-13 Thread Andrzej Pietrasiewicz
W dniu 13.02.2015 o 09:06, Dan Carpenter pisze: Hello Andrzej Pietrasiewicz, Hello Dan, Thank you for finding the problem. The patch da4243145fb1: usb: gadget: configfs: OS Extended Compatibility descriptors support from May 8, 2014, leads to the following Smatch warning: drivers

[PATCH] usb: gadget: configfs: don't NUL-terminate (sub)compatible ids

2015-02-13 Thread Andrzej Pietrasiewicz
...@oracle.com Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/configfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 7564814..c42765b3a0 100644 --- a/drivers/usb/gadget/configfs.c +++ b

[PATCH 1/3] usb: gadget: rndis: use rndis_params instead of configNr

2015-02-06 Thread Andrzej Pietrasiewicz
, otherwise checkpatch complains that the patch has style problems. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/f_rndis.c | 38 +++--- drivers/usb/gadget/function/rndis.c | 213 +++--- drivers/usb/gadget/function/rndis.h

[PATCH 2/3] usb: gadget: rndis: style correction

2015-02-06 Thread Andrzej Pietrasiewicz
Don't use a space between function name and parameter list opening bracket. All other functions in this file comply wich checkpatch rules. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/rndis.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 3/3] usb: gadget: rndis: remove the limit of available rndis connections

2015-02-06 Thread Andrzej Pietrasiewicz
is delayed until struct rndis_params is actually allocated. rnids_init() and rndis_exit() have nothing to do, so they are eliminated. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 2 - drivers/usb/gadget/function/f_rndis.c | 22

[PATCH 0/3] Eliminate limitation on the number of RNDIS instances

2015-02-06 Thread Andrzej Pietrasiewicz
is passed around. The second patch is a small style correction and the third does the conversion proper by changing the way instances of struct rndis_params are allocated: instead of a predefined array they are now allocated on demand. Rebased onto Felipe's testing/next. Andrzej Pietrasiewicz (3

Re: f_hid, f_mass_storage, and f_rdnis via configfs on platform/intel-mid

2015-02-05 Thread Andrzej Pietrasiewicz
finding information on FunctionFS and the required daemons. On Thu, Jan 22, 2015 at 7:33 AM, Andrzej Pietrasiewicz andrze...@samsung.com wrote: These days instead of gadgetfs one should probably use FunctionFS. The purpose of the two is delegating actual usb function implementation to userspace

Re: [PATCH v2] usb: gadget: OS desc type unicode multi

2015-02-04 Thread Andrzej Pietrasiewicz
Hi Mario, sorry about the delay but I was busy with other things yesterday. W dniu 02.02.2015 o 21:37, Mario Schuknecht pisze: Hi Andrzej, thank you for the comment. snip I'm not sure I understand the logic of the below function well. +static inline int

Re: [PATCH v2] usb: gadget: OS desc type unicode multi

2015-02-02 Thread Andrzej Pietrasiewicz
Hi Mario, W dniu 01.02.2015 o 21:07, Mario Schuknecht pisze: A popular proprietary operating system expects that USB devices provide extra information via OS descriptors. An introduction to the subject can be found here: snip This patch adds support for property data type 0x7 multiple

Re: [PATCH] usb: gadget: nokia: Add mass storage driver to g_nokia

2015-02-02 Thread Andrzej Pietrasiewicz
Hello Pali, W dniu 31.01.2015 o 10:53, Pali Rohár pisze: This patch adds removable mass storage support to g_nokia gadget (for N900). It means that at runtime block device can be exported or unexported. For a hint please see this thread: http://www.spinics.net/lists/linux-usb/msg119669.html

Re: [PATCH] usb: gadget: Fix os desc test

2015-01-26 Thread Andrzej Pietrasiewicz
W dniu 26.01.2015 o 12:47, Mario Schuknecht pisze: USB vendor type is encoded in field bmRequestType. Make test USB_TYPE_VENDOR with bRequestType instead of bRequest. Signed-off-by: Mario Schuknecht mario.schukne...@dresearch-fe.de Acked-by: Andrzej Pietrasiewicz andrze...@samsung.com

Re: [PATCH] usb: gadget: os desc fix

2015-01-26 Thread Andrzej Pietrasiewicz
Hi Mario, W dniu 23.01.2015 o 21:52, Mario Schuknecht pisze: Add missing case USB_EXT_PROP_UNICODE_MULTI to fill_ext_prop. Type vendor is coded in bRequestType. Compare USB_TYPE_VENDOR with bRequestType instead of bRequest. The above seem to be unrelated changes. Please split into two

Re: f_hid, f_mass_storage, and f_rdnis via configfs on platform/intel-mid

2015-01-22 Thread Andrzej Pietrasiewicz
Hello Chris, W dniu 22.01.2015 o 15:37, Chris McClimans pisze: The devices in embedded space accept kernel updates at various speeds. The raspberry pi is at 3.18, and the Intel Edison is bit lagging at 3.10. I thought it would probably be useful to the embedded community if I at least took a

Re: [PATCHv2 3/4] usb: gadget: uvc: use explicit type instead of void *

2015-01-19 Thread Andrzej Pietrasiewicz
W dniu 19.01.2015 o 22:30, Laurent Pinchart pisze: Hi Andrzej, On Monday 19 January 2015 23:27:28 Laurent Pinchart wrote: On Monday 19 January 2015 13:52:57 Andrzej Pietrasiewicz wrote: The first parameter of __uvcg_iter_strm_cls() is always used in the context of struct uvcg_streaming_header

[PATCHv2 4/4] usb: gadget: uvc: comments for iterating over streaming hierarchy

2015-01-19 Thread Andrzej Pietrasiewicz
The purpose of the functions and their parametrs might not be obvious to the reader, so explain it. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/uvc_configfs.c | 34 ++ 1 file changed, 34 insertions(+) diff --git

[PATCHv2 0/4] Fixes for configfs support in uvc

2015-01-19 Thread Andrzej Pietrasiewicz
it can be used Andrzej Pietrasiewicz (4): Revert usb: gadget: uvc: cleanup __uvcg_fill_strm() usb: gadget: uvc: preserve the address passed to kfree() usb: gadget: uvc: use explicit type instead of void * usb: gadget: uvc: comments for iterating over streaming hierarchy drivers/usb/gadget

[PATCHv2 2/4] usb: gadget: uvc: preserve the address passed to kfree()

2015-01-19 Thread Andrzej Pietrasiewicz
__uvcg_fill_strm() called from __uvcg_iter_stream_cls() might have advanced the data even if __uvcg_iter_stream_cls() returns an error, so use a backup copy as an argument to kfree(). Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com Acked-by: Laurent Pinchart laurent.pinch

[PATCHv2 3/4] usb: gadget: uvc: use explicit type instead of void *

2015-01-19 Thread Andrzej Pietrasiewicz
The first parameter of __uvcg_iter_strm_cls() is always used in the context of struct uvcg_streaming_header, so change the function prototype accordingly. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/uvc_configfs.c | 4 ++-- 1 file changed, 2

Re: [PATCH 1/3] Revert usb: gadget: uvc: cleanup __uvcg_fill_strm()

2015-01-19 Thread Andrzej Pietrasiewicz
W dniu 19.01.2015 o 01:05, Laurent Pinchart pisze: Hi Andrzej, Thank you for the patch. On Friday 16 January 2015 15:14:26 Andrzej Pietrasiewicz wrote: This reverts commit c0b53cb16250 (usb: gadget: uvc: cleanup __uvcg_fill_strm()). I can't find that commit in Linus' master, next/master

Re: [patch 1/6] usb: gadget: uvc: fix some error codes

2015-01-16 Thread Andrzej Pietrasiewicz
W dniu 14.01.2015 o 21:59, Dan Carpenter pisze: We're basically saying ERR_CAST(NULL) and PTR_ERR(NULL) here, which is nonsensical. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Acked-by: Andrzej Pietrasiewicz andrze...@samsung.com diff --git a/drivers/usb/gadget/function

Re: [patch 6/6] usb: gadget: uvc: cleanup UVCG_FRAME_ATTR macro

2015-01-16 Thread Andrzej Pietrasiewicz
and the str2u parameters. 4) The kstrtou##bits() conversion does not need to be done under the mutex so move it to the start of the function. 5) Change the name of identity_conv to noop_conversion. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Acked-by: Andrzej Pietrasiewicz

Re: [patch 3/6] usb: gadget: uvc: remove an impossible condition

2015-01-16 Thread Andrzej Pietrasiewicz
W dniu 14.01.2015 o 22:02, Dan Carpenter pisze: num is a u32 so (num 0x) is never true. Also the range is already checked in kstrtou32(). Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Acked-by: Andrzej Pietrasiewicz andrze...@samsung.com diff --git a/drivers/usb/gadget

Re: [patch 4/6] usb: gadget: uvc: memory leak in uvcg_frame_make()

2015-01-16 Thread Andrzej Pietrasiewicz
W dniu 14.01.2015 o 22:03, Dan Carpenter pisze: We need to add a kfree(h) on an error path. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Acked-by: Andrzej Pietrasiewicz andrze...@samsung.com diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function

Re: [patch 2/6] usb: gadget: uvc: cleanup __uvcg_fill_strm()

2015-01-16 Thread Andrzej Pietrasiewicz
W dniu 14.01.2015 o 22:01, Dan Carpenter pisze: Static checkers complain about this API: drivers/usb/gadget/function/uvc_configfs.c:2139 uvcg_streaming_class_allow_link() warn: did you really mean to pass the address of 'data'? Indeed, the code is cleaner when

Re: [patch 2/6] usb: gadget: uvc: cleanup __uvcg_fill_strm()

2015-01-16 Thread Andrzej Pietrasiewicz
W dniu 16.01.2015 o 13:12, Dan Carpenter pisze: Oh, yeah. You're right. I should have been more careful and I should have seen that. Sorry. But the problem is the original code is still a bit buggy. We call: data = kzalloc(); Inside __uvcg_fill_strm() we do data += something;

[PATCH 3/3] usb: gadget: uvc: comments for iterating over streaming hierarchy

2015-01-16 Thread Andrzej Pietrasiewicz
The purpose of the functions and their parametrs might not be obvious to the reader, so explain it. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/uvc_configfs.c | 34 ++ 1 file changed, 34 insertions(+) diff --git

[PATCH 2/3] usb: gadget: uvc: preserve the address passed to kfree()

2015-01-16 Thread Andrzej Pietrasiewicz
__uvcg_fill_strm() called from __uvcg_iter_stream_cls() might have advanced the data even if __uvcg_iter_stream_cls() returns an error, so use a backup copy as an argument to kfree(). Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/uvc_configfs.c | 10

[PATCH 1/3] Revert usb: gadget: uvc: cleanup __uvcg_fill_strm()

2015-01-16 Thread Andrzej Pietrasiewicz
be visible outside this function, so that the next time it is called, the current position corresponds to the place where it was the last time rather than again at the beginning of some block of data. In other words priv2 is an out parameter. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com

[PATCH 0/3] Fixes for configfs support in uvc

2015-01-16 Thread Andrzej Pietrasiewicz
This short series reverts a commit which, at a first glance, simplifies the code but in fact makes it not work correctly, and then applies a small fix and adds some comments to functions. Andrzej Pietrasiewicz (3): Revert usb: gadget: uvc: cleanup __uvcg_fill_strm() usb: gadget: uvc: preserve

Re: [patch 5/6] usb: gadget: uvc: make a bunch of stuff static

2015-01-15 Thread Andrzej Pietrasiewicz
W dniu 14.01.2015 o 23:45, Felipe Balbi pisze: On Thu, Jan 15, 2015 at 12:03:52AM +0300, Dan Carpenter wrote: Sparse rightly complains that these things should be static since they are only used in the one .c file. There has already been a patch for this:

Re: [PATCH next] usb: gadget: uvc: to_uvcg_control_header() can be static

2015-01-13 Thread Andrzej Pietrasiewicz
it be static? Signed-off-by: Fengguang Wu fengguang...@intel.com Reviewed-by: Andrzej Pietrasiewicz andrze...@samsung.com --- uvc_configfs.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/usb/gadget/function/uvc_configfs.c b

Re: Is g_multi with g_hid possible?

2015-01-13 Thread Andrzej Pietrasiewicz
W dniu 13.01.2015 o 16:10, Felipe Balbi pisze: Hi, On Tue, Jan 13, 2015 at 07:05:37AM -0800, Chris McClimans wrote: Is it possible to appear as a USB gadget hid (kb + mouse), mass_storage, and ethernet at the same time? yes, that's called a composite device. My goal is to try and create a

Re: USB HID Gadget Support for Intel Edison

2015-01-09 Thread Andrzej Pietrasiewicz
W dniu 08.01.2015 o 18:09, Felipe Balbi pisze: Hi, On Thu, Jan 08, 2015 at 09:05:24AM -0800, Chris McClimans wrote: I'm trying to get the g_hid module working with the Intel Edison. I tried just compiling intel's patch(1) to 3.10.17 with CONFIG_USB_GADGETFS=m CONFIG_USB_G_HID=m but I get an

Re: State of gadget driver gadgetfs and functionfs

2014-12-18 Thread Andrzej Pietrasiewicz
W dniu 18.12.2014 o 09:16, Mario Schuknecht pisze: Hi, we use gadget driver gadgetfs and implement a high-level protocol over USB. Our hardware provides an USB WCID device [1]. But the recent state of gadgetfs is unclear. There are a couple of problems and gadgetfs does not support USB3

[PATCHv3 00/19] USB gadget functions testing

2014-12-16 Thread Andrzej Pietrasiewicz
the above v2..v3: - extended uac2 testing as suggested by Peter - added uvc testing after Laurent's ACK for adding configfs support Andrzej Pietrasiewicz (19): Documentation: usb: gadget_serial: update generic serial setup instruction Documentation: usb: ACM function testing Documentation

[PATCHv3 03/19] Documentation: usb: ECM function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test ECM function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 34 ++ 1 file changed, 34 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv3 07/19] Documentation: usb: HID function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test HID function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 47 1 file changed, 47 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation

[PATCHv3 06/19] Documentation: usb: FFS function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test FFS (FunctionFS) function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 24 1 file changed, 24 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation

[PATCHv3 19/19] Documentation: usb: UVC function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test UVC function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 73 1 file changed, 73 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation

[PATCHv3 14/19] Documentation: usb: RNDIS function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test RNDIS function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 36 1 file changed, 36 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation

[PATCHv3 10/19] Documentation: usb: MIDI function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test MIDI function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 84 1 file changed, 84 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation

[PATCHv3 08/19] Documentation: usb: LOOPBACK function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test LOOPBACK function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 23 +++ 1 file changed, 23 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv3 12/19] Documentation: usb: OBEX function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test OBEX function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 29 + 1 file changed, 29 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv3 05/19] Documentation: usb: EEM function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test EEM function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 34 ++ 1 file changed, 34 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv3 15/19] Documentation: usb: SERIAL function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test SERIAL function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 31 +++ 1 file changed, 31 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv3 16/19] Documentation: usb: SOURCESINK function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test SOURCESINK function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 27 +++ 1 file changed, 27 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv3 09/19] Documentation: usb: MASS STORAGE function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test MASS STORAGE function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 54 1 file changed, 54 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b

[PATCHv3 13/19] Documentation: usb: PHONET function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test PHONET function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 64 1 file changed, 64 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b

[PATCHv3 01/19] Documentation: usb: gadget_serial: update generic serial setup instruction

2014-12-16 Thread Andrzej Pietrasiewicz
Using module parameters to specify accepted Vendor ID, Product ID is considered legacy now. Update the documentation to reflect it. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget_serial.txt | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[PATCHv3 11/19] Documentation: usb: NCM function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test NCM function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 34 ++ 1 file changed, 34 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv3 04/19] Documentation: usb: ECM subset function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test ECM subset function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 34 ++ 1 file changed, 34 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b

[PATCHv3 17/19] Documentation: usb: UAC1 function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test UAC1 function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 27 +++ 1 file changed, 27 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv3 18/19] Documentation: usb: UAC2 function testing

2014-12-16 Thread Andrzej Pietrasiewicz
Summary of how to test UAC2 function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 39 1 file changed, 39 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation

[PATCH] usb: gadget: hid: consistently use 2^n - 1 for max values

2014-12-15 Thread Andrzej Pietrasiewicz
A maximum value which fits in 16 bits, unsigned, is 65535. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/f_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function

Re: How do I begin?

2014-12-14 Thread Andrzej Pietrasiewicz
W dniu 13.12.2014 o 18:53, Vedant Nevetia pisze: Thanks a lot! How would you recommend I then go on to submit full-scale drivers? Should I read through the whole of LDD3 or is there another means to acquire the knowledge? What about this: http://eudyptula-challenge.org ? A quote from the

Re: Query regarding USB gadget driver

2014-12-11 Thread Andrzej Pietrasiewicz
Hello, W dniu 11.12.2014 o 11:38, Sanchayan Maity pisze: Hello, I am working on a Freescale Cortex-A5 Vybrid Processor. The chip core is clocked at 500MHz and the USB IP core for this is by Chip-idea. I am running a 3.18-rc5 kernel on it and trying to use the USB gadget functionality. To be

Re: [PATCH 2/2] usb: gadget: uvc: configfs support in uvc function

2014-12-10 Thread Andrzej Pietrasiewicz
W dniu 07.12.2014 o 21:25, Laurent Pinchart pisze: Hi Andrzej, snip + mutex_lock(opts-lock); What does the mutex protect against ? Modifications of opts- uvc_*_streaming_cls by configfs ? You only copy pointers around, what prevents the descriptors from being modified after you

[PATCHv3 0/3] Equivalent of g_webcam with configfs.

2014-12-10 Thread Andrzej Pietrasiewicz
, $ ./uvc-gadget -u /dev/videouvc video node # -v /dev/videovivid video node # I used Laurent's program: http://git.ideasonboard.org/uvc-gadget.git with these patches: http://www.spinics.net/lists/linux-usb/msg99220.html host: luvcview -f yuv Andrzej Pietrasiewicz (3): usb: gadget: f_uvc: rename

[PATCHv3 1/3] usb: gadget: f_uvc: rename a macro to avoid conflicts

2014-12-10 Thread Andrzej Pietrasiewicz
When configfs is integrated, CONFIGFS_ATTR_STRUCT and CONFIGFS_ATTR_OPS macros should be used, but the latter expects that tere is a to_f_uvc_opts function accepting a config_item, whereas the macro being changed can be applied to a different type of argument. Signed-off-by: Andrzej Pietrasiewicz

[PATCHv3 2/3] usb: gadget: uvc: verify descriptors presence

2014-12-10 Thread Andrzej Pietrasiewicz
If the caller of uvc_alloc() does not provide enough descriptors, binding the function should fail, so appropriate code is returned from uvc_copy_descriptors(). uvc_function_bind() is modified accordingly to account for possible errors from uvc_copy_descriptors(). Signed-off-by: Andrzej

[PATCHv3 3/3] usb: gadget: uvc: configfs support in uvc function

2014-12-10 Thread Andrzej Pietrasiewicz
Add support for using the uvc function as a component of USB gadgets composed with configfs. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/ABI/testing/configfs-usb-gadget-uvc | 265 +++ drivers/usb/gadget/Kconfig| 11 + drivers/usb/gadget

[PATCHv2 00/18] USB gadget functions testing

2014-12-10 Thread Andrzej Pietrasiewicz
convert functions and gadgets to configfs. I think it could be useful to anyone whishing to use the gadgets. v1..v2: - corrected a typo found by Jeremiah - updated the instruction on how to configure usbserial for generic serial - patched gadget_serial.txt documentation to reflect the above Andrzej

[PATCHv2 02/18] Documentation: usb: ACM function testing

2014-12-10 Thread Andrzej Pietrasiewicz
The newly added file will be used to provide descriptions of how to test the functions of USB gadgets. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 34 ++ 1 file changed, 34 insertions(+) create mode 100644

[PATCHv2 01/18] Documentation: usb: gadget_serial: update generic serial setup instruction

2014-12-10 Thread Andrzej Pietrasiewicz
Using module parameters to specify accepted Vendor ID, Product ID is considered legacy now. Update the documentation to reflect it. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget_serial.txt | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[PATCHv2 04/18] Documentation: usb: ECM subset function testing

2014-12-10 Thread Andrzej Pietrasiewicz
Summary of how to test ECM subset function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 34 ++ 1 file changed, 34 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b

[PATCHv2 12/18] Documentation: usb: OBEX function testing

2014-12-10 Thread Andrzej Pietrasiewicz
Summary of how to test OBEX function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 29 + 1 file changed, 29 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv2 15/18] Documentation: usb: SERIAL function testing

2014-12-10 Thread Andrzej Pietrasiewicz
Summary of how to test SERIAL function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 31 +++ 1 file changed, 31 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb

[PATCHv2 07/18] Documentation: usb: HID function testing

2014-12-10 Thread Andrzej Pietrasiewicz
Summary of how to test HID function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- Documentation/usb/gadget-testing.txt | 47 1 file changed, 47 insertions(+) diff --git a/Documentation/usb/gadget-testing.txt b/Documentation

<    1   2   3   4   5   6   7   8   9   10   >