[PATCHv3 06/14] usb: gadget: tcm: use strtobool for a boolean value

2015-10-27 Thread Andrzej Pietrasiewicz
Simplify the function. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c index a60ef8f

[PATCHv3 07/14] usb: gadget: tcm: simplify attribute store function

2015-10-27 Thread Andrzej Pietrasiewicz
Simplify function code. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c index

[PATCHv3 12/14] usb: gadget: f_tcm: remove redundant singleton

2015-10-27 Thread Andrzej Pietrasiewicz
The only instance is guaranteed with TPG_INSTANCES defined to 1. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c | 9 - drivers/usb/gadget/function/tcm.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers

[PATCHv3 11/14] usb: gadget: f_tcm: remove compatibility layer

2015-10-27 Thread Andrzej Pietrasiewicz
There are no old function interface users left. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c | 87 +++-- 1 file changed, 6 insertions(+), 81 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget

[PATCHv3 10/14] usb: gadget: tcm: convert to use new function registration interface

2015-10-27 Thread Andrzej Pietrasiewicz
Convert the only user of old tcm function interface so that the old interface can be removed. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/Kconfig | 1 + drivers/usb/gadget/legacy/tcm_usb_gadget.c | 62 +- 2 files changed, 53

[PATCHv3 03/14] tcm_usb_gadget: Fix enabled attribute failure

2015-10-27 Thread Andrzej Pietrasiewicz
From: Nicholas Bellinger Fix up tcm_usbg_tpg_store_enable() return value to propagate usbg_attach() failure up to user-space if no HDC is found. Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicholas Bellinger [split unrelated

[PATCHv3 14/14] usb: gadget: f_tcm: add configfs support

2015-10-27 Thread Andrzej Pietrasiewicz
Allow using the tcm function as a component of a gadget composed with ConfigFS. Signed-off-by: Andrzej Pietrasiewicz --- Documentation/ABI/testing/configfs-usb-gadget-tcm | 6 ++ drivers/usb/gadget/Kconfig| 14 + drivers/usb/gadget/function/f_tcm.c

[PATCHv3 09/14] usb: gadget: f_tcm: convert to new function interface with backward compatibility

2015-10-27 Thread Andrzej Pietrasiewicz
ns of preprocessor conditional directives. After all users are converted, the old interface can be removed. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/Kconfig | 3 + drivers/usb/gadget/function/Makefile | 2 + drivers/usb/gadget/function/f_tcm.c

[PATCHv3 04/14] usb: gadget: tcm: split string definitions into function and device

2015-10-27 Thread Andrzej Pietrasiewicz
Prepare for factoring out f_tcm from a legacy gadget. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 25 + drivers/usb/gadget/legacy/tcm_usb_gadget.h | 3 +-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers

[PATCHv3 01/14] tcm_usb_gadget: Don't strip off nexus WWPN prefix

2015-10-27 Thread Andrzej Pietrasiewicz
ffect host side code. Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicholas Bellinger --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/legacy/tcm_us

[PATCHv3 05/14] usb: gadget: tcm: follow naming conventions

2015-10-27 Thread Andrzej Pietrasiewicz
Prepare for splitting tcm_usb_gadget into legacy gadget proper and f_tcm. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/legacy

[PATCHv3 08/14] usb: gadget: tcm: factor out f_tcm

2015-10-27 Thread Andrzej Pietrasiewicz
Prepare for converting tcm to new function registration interface. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c| 2168 drivers/usb/gadget/function/tcm.h | 132 ++ drivers/usb/gadget/legacy/tcm_usb_gadget.c | 2150

[PATCHv3 00/14] Equivalent of tcm_usb_gadget with configfs

2015-10-27 Thread Andrzej Pietrasiewicz
RODUCT_ID > idProduct # echo 1240.dwc3 > UDC TESTING THE FUNCTION The most basic testing device: run the script above host: see the gadget enumerated Andrzej Pietrasiewicz (11): usb: gadget: tcm: split string definitions into function and device usb: gadget: tcm: f

[PATCHv3 02/14] tcm_usb_gadget: Fix nexus leak

2015-10-27 Thread Andrzej Pietrasiewicz
From: Nicholas Bellinger This patch adds the missing tcm_usbg_drop_nexus() to properly release tcm_usbg_nexus memory during typical ->fabric_drop_tpg() callback shutdown. Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicho

Re: [PATCHv2 01/15] fs: configfs: Add unlocked version of configfs_depend_item()

2015-10-23 Thread Andrzej Pietrasiewicz
W dniu 22.10.2015 o 17:22, Christoph Hellwig pisze: Hi Andrzej, please find a way to share code between the two depend function. And also drop the duplicate undepend version and just stop passing the unused subsystem argument. Not only do we not keep unused argument in Linux in general, but in

[PATCHv2 02/15] tcm_usb_gadget: Don't strip off nexus WWPN prefix

2015-10-22 Thread Andrzej Pietrasiewicz
ffect host side code. Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicholas Bellinger --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/legacy/tcm_us

[PATCHv2 07/15] usb: gadget: tcm: use strtobool for a boolean value

2015-10-22 Thread Andrzej Pietrasiewicz
Simplify the function. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c index a60ef8f

[PATCHv2 08/15] usb: gadget: tcm: simplify attribute store function

2015-10-22 Thread Andrzej Pietrasiewicz
Simplify function code. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c index

[PATCHv2 01/15] fs: configfs: Add unlocked version of configfs_depend_item()

2015-10-22 Thread Andrzej Pietrasiewicz
root of configfs to avoid unregistration of target's subsystem. As it is other than caller's subsystem, there may be nothing what protects us against unregistration of that subsystem. Signed-off-by: Krzysztof Opasiak Signed-off-by: Andrzej Pietrasiewicz --- fs/configfs/dir.c

[PATCHv2 13/15] usb: gadget: f_tcm: remove redundant singleton

2015-10-22 Thread Andrzej Pietrasiewicz
The only instance is guaranteed with TPG_INSTANCES defined to 1. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c | 9 - drivers/usb/gadget/function/tcm.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers

[PATCHv2 09/15] usb: gadget: tcm: factor out f_tcm

2015-10-22 Thread Andrzej Pietrasiewicz
Prepare for converting tcm to new function registration interface. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c| 2168 drivers/usb/gadget/function/tcm.h | 132 ++ drivers/usb/gadget/legacy/tcm_usb_gadget.c | 2150

[PATCHv2 11/15] usb: gadget: tcm: convert to use new function registration interface

2015-10-22 Thread Andrzej Pietrasiewicz
Convert the only user of old tcm function interface so that the old interface can be removed. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/Kconfig | 1 + drivers/usb/gadget/legacy/tcm_usb_gadget.c | 62 +- 2 files changed, 53

[PATCHv2 04/15] tcm_usb_gadget: Fix enabled attribute failure

2015-10-22 Thread Andrzej Pietrasiewicz
From: Nicholas Bellinger Fix up tcm_usbg_tpg_store_enable() return value to propagate usbg_attach() failure up to user-space if no HDC is found. Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicholas Bellinger [split unrelated

[PATCHv2 05/15] usb: gadget: tcm: split string definitions into function and device

2015-10-22 Thread Andrzej Pietrasiewicz
Prepare for factoring out f_tcm from a legacy gadget. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 25 + drivers/usb/gadget/legacy/tcm_usb_gadget.h | 3 +-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers

[PATCHv2 00/15] Equivalent of tcm_usb_gadget with configfs

2015-10-22 Thread Andrzej Pietrasiewicz
_gadget/tcm # mkdir configs/c.1 # ln -s functions/tcm.0 configs/c.1 # echo $VENDOR_ID > idVendor # echo $PRODUCT_ID > idProduct # echo 1240.dwc3 > UDC TESTING THE FUNCTION The most basic testing device: run the script above host: see the gadget enumerated Andrz

[PATCHv2 12/15] usb: gadget: f_tcm: remove compatibility layer

2015-10-22 Thread Andrzej Pietrasiewicz
There are no old function interface users left. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c | 87 +++-- 1 file changed, 6 insertions(+), 81 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget

[PATCHv2 03/15] tcm_usb_gadget: Fix nexus leak

2015-10-22 Thread Andrzej Pietrasiewicz
From: Nicholas Bellinger This patch adds the missing tcm_usbg_drop_nexus() to properly release tcm_usbg_nexus memory during typical ->fabric_drop_tpg() callback shutdown. Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicho

[PATCHv2 14/15] usb: gadget: f_tcm: use usb_gstrings_attach

2015-10-22 Thread Andrzej Pietrasiewicz
Do not directly use file static strings definitions in instances of f_tcm. Instead use usb_gstrings_attach. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/usb/gadget

[PATCHv2 15/15] usb: gadget: f_tcm: add configfs support

2015-10-22 Thread Andrzej Pietrasiewicz
Allow using the tcm function as a component of a gadget composed with ConfigFS. Signed-off-by: Andrzej Pietrasiewicz [adapt to new prototype of configfs_(un)depend_item())] Signed-off-by: Krzysztof Opasiak --- Documentation/ABI/testing/configfs-usb-gadget-tcm | 6 ++ drivers/usb/gadget

[PATCHv2 06/15] usb: gadget: tcm: follow naming conventions

2015-10-22 Thread Andrzej Pietrasiewicz
Prepare for splitting tcm_usb_gadget into legacy gadget proper and f_tcm. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/legacy

[PATCHv2 10/15] usb: gadget: f_tcm: convert to new function interface with backward compatibility

2015-10-22 Thread Andrzej Pietrasiewicz
ns of preprocessor conditional directives. After all users are converted, the old interface can be removed. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/Kconfig | 3 + drivers/usb/gadget/function/Makefile | 2 + drivers/usb/gadget/function/f_tcm.c

Re: [PATCH 00/15] Equivalent of tcm_usb_gadget with configfs

2015-10-20 Thread Andrzej Pietrasiewicz
W dniu 20.10.2015 o 14:40, Sebastian Andrzej Siewior pisze: On 10/20/2015 02:32 PM, Andrzej Pietrasiewicz wrote: Dear All, This series adds support to tcm usb gadget for composing it with configfs. oh great. With this you could have two tcm functions right? (that was one of the limitations

[PATCH 09/15] usb: gadget: tcm: factor out f_tcm

2015-10-20 Thread Andrzej Pietrasiewicz
Prepare for converting tcm to new function registration interface. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c| 2168 drivers/usb/gadget/function/tcm.h | 132 ++ drivers/usb/gadget/legacy/tcm_usb_gadget.c | 2150

[PATCH 05/15] usb: gadget: tcm: split string definitions into function and device

2015-10-20 Thread Andrzej Pietrasiewicz
Prepare for factoring out f_tcm from a legacy gadget. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 25 + drivers/usb/gadget/legacy/tcm_usb_gadget.h | 3 +-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers

[PATCH 12/15] usb: gadget: f_tcm: remove compatibility layer

2015-10-20 Thread Andrzej Pietrasiewicz
There are no old function interface users left. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c | 87 +++-- 1 file changed, 6 insertions(+), 81 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget

[PATCH 14/15] usb: gadget: f_tcm: use usb_gstrings_attach

2015-10-20 Thread Andrzej Pietrasiewicz
Do not directly use file static strings definitions in instances of f_tcm. Instead use usb_gstrings_attach. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/usb/gadget

[PATCH 11/15] usb: gadget: tcm: convert to use new function registration interface

2015-10-20 Thread Andrzej Pietrasiewicz
Convert the only user of old tcm function interface so that the old interface can be removed. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/Kconfig | 1 + drivers/usb/gadget/legacy/tcm_usb_gadget.c | 61 +- 2 files changed, 52

[PATCH 06/15] usb: gadget: tcm: follow naming conventions

2015-10-20 Thread Andrzej Pietrasiewicz
Prepare for splitting tcm_usb_gadget into legacy gadget proper and f_tcm. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/legacy

[PATCH 03/15] tcm_usb_gadget: Fix nexus leak

2015-10-20 Thread Andrzej Pietrasiewicz
From: Nicholas Bellinger This patch adds the missing tcm_usbg_drop_nexus() to properly release tcm_usbg_nexus memory during typical ->fabric_drop_tpg() callback shutdown. Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicho

[PATCH 13/15] usb: gadget: f_tcm: remove redundant singleton

2015-10-20 Thread Andrzej Pietrasiewicz
The only instance is guaranteed with TPG_INSTANCES defined to 1. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_tcm.c | 9 - drivers/usb/gadget/function/tcm.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers

[PATCH 15/15] usb: gadget: f_tcm: add configfs support

2015-10-20 Thread Andrzej Pietrasiewicz
Allow using the tcm function as a component of a gadget composed with ConfigFS. Signed-off-by: Andrzej Pietrasiewicz --- Documentation/ABI/testing/configfs-usb-gadget-tcm | 6 ++ drivers/usb/gadget/Kconfig| 14 + drivers/usb/gadget/function/f_tcm.c

[PATCH 01/15] fs: configfs: Add unlocked version of configfs_depend_item()

2015-10-20 Thread Andrzej Pietrasiewicz
other kernel subsystem happens to be another subsystem in configfs, so this patch adds unlocked versions meant for configfs callbacks. Signed-off-by: Krzysztof Opasiak [updated the commit log] Signed-off-by: Andrzej Pietrasiewicz --- fs/configfs/dir.c| 29

[PATCH 07/15] usb: gadget: tcm: use strtobool for a boolean value

2015-10-20 Thread Andrzej Pietrasiewicz
Simplify the function. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c index a60ef8f

[PATCH 00/15] Equivalent of tcm_usb_gadget with configfs

2015-10-20 Thread Andrzej Pietrasiewicz
configs/c.1 # ln -s functions/tcm.0 configs/c.1 # echo $VENDOR_ID > idVendor # echo $PRODUCT_ID > idProduct # echo 1240.dwc3 > UDC TESTING THE FUNCTION The most basic testing device: run the script above host: see the gadget enumerated Andrzej Pietrasiewicz (11):

[PATCH 08/15] usb: gadget: tcm: simplify attribute store function

2015-10-20 Thread Andrzej Pietrasiewicz
Simplify function code. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c index

[PATCH 02/15] tcm_usb_gadget: Don't strip off nexus WWPN prefix

2015-10-20 Thread Andrzej Pietrasiewicz
ffect host side code. Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicholas Bellinger --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/legacy/tcm_us

[PATCH 10/15] usb: gadget: f_tcm: convert to new function interface with backward compatibility

2015-10-20 Thread Andrzej Pietrasiewicz
ns of preprocessor conditional directives. After all users are converted, the old interface can be removed. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/Kconfig | 3 + drivers/usb/gadget/function/Makefile | 2 + drivers/usb/gadget/function/f_tcm.c

[PATCH 04/15] tcm_usb_gadget: Fix enabled attribute failure

2015-10-20 Thread Andrzej Pietrasiewicz
From: Nicholas Bellinger Fix up tcm_usbg_tpg_store_enable() return value to propagate usbg_attach() failure up to user-space if no HDC is found. Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicholas Bellinger [split unrelated

Re: Configfs composite gadget with CCID and mass storage

2015-10-06 Thread Andrzej Pietrasiewicz
W dniu 06.10.2015 o 14:38, Frans-Pieter van Wyk pisze: Hi, My question is, is it possible to setup a USB composite device consisting of a smart card CCID and a mass storage device using Configfs? ConfigFS is used to compose a gadget of existing functions. As far as I can tell there is no smar

Re: [PATCH 2/2] tcm_usb_gadget: Fix nexus leak + enabled attribute failure

2015-09-28 Thread Andrzej Pietrasiewicz
urn value to propigate usbg_attach() failure up to user-space if no HDC is found. Are these two changes related? If not, maybe a separate patch? Reported-by: Andrzej Pietrasiewicz Cc: Andrzej Pietrasiewicz Cc: Sebastian Andrzej Siewior Signed-off-by: Nicholas Bellinger --- drivers/usb/gad

Re: [PATCH 07/23] usb-gadget/f_loopback: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
Hi, W dniu 28.09.2015 o 15:41, Christoph Hellwig pisze: On Mon, Sep 28, 2015 at 01:46:57PM +0200, Andrzej Pietrasiewicz wrote: } -static struct f_lb_opts_attribute f_lb_opts_qlen = - __CONFIGFS_ATTR(qlen, S_IRUGO | S_IWUSR, - f_lb_opts_qlen_show

Re: simplify configfs attributes

2015-09-28 Thread Andrzej Pietrasiewicz
Hi Christoph, W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: This series consolidates the code to implement configfs attributes by providing the ->show and ->store method in common code and using container_of in the methods to access the containing structure. This reduces source and binary

Re: [PATCH 23/23] configfs: remove old API

2015-09-28 Thread Andrzej Pietrasiewicz
Hi Christoph, Please see inline. W dniu 25.09.2015 o 15:50, Christoph Hellwig pisze: Remove the old show_attribute and store_attribute methods and update the documentation. Also replace the two C samples with a single new one in the proper samples directory where people expect to find it. Sig

Re: [PATCH 16/23] usb-gadget/f_serial: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig Reviewed-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_serial.c | 26 -- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/drivers/usb/gadget/function

Re: [PATCH 15/23] usb-gadget/f_phonet: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig Reviewed-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_phonet.c | 25 - 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/usb/gadget/function

Re: [PATCH 13/23] usb-gadget/f_uac2: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig Reviewed-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_uac2.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/usb/gadget/function

Re: [PATCH 14/23] usb-gadget/f_obex: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig Reviewed-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_obex.c | 26 -- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/drivers/usb/gadget/function

Re: [PATCH 12/23] usb-gadget/f_ac1: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
Hi Christoph, The commit title should be " usb-gadget/f_uac1 ..." instead of " f_ac1 ..." Reviewed-by: Andrzej Pietrasiewicz W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig --- drivers/usb/gadget/fu

Re: [PATCH 11/23] usb-gadget/f_mass_storage: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
Hi Christoph, The same remark as for f_loopback (__CONFIGFS_ATTR location vs CONFIGFS_ATTR location after applying) If addressed Reviewed-by: Andrzej Pietrasiewicz W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig --- drivers/usb/gadget/function

Re: [PATCH 10/23] usb-gadget/f_sourcesink: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
Hi Christoph, The same remark as for f_loopback (__CONFIGFS_ATTR location vs CONFIGFS_ATTR location after applying) If addressed Reviewed-by: Andrzej Pietrasiewicz W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig --- drivers/usb/gadget/function

Re: [PATCH 09/23] usb-gadget/f_printer: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
Hi Christoph, The same remark as for f_loopback (__CONFIGFS_ATTR location vs CONFIGFS_ATTR location after applying) If addressed Reviewed-by: Andrzej Pietrasiewicz W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig --- drivers/usb/gadget/function

Re: [PATCH 07/23] usb-gadget/f_loopback: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
Hi Christoph, Please see comments inline. With the issue addressed you can add Reviewed-by: Andrzej Pietrasiewicz W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig --- drivers/usb/gadget/function/f_loopback.c | 32 1

Re: [PATCH 08/23] usb-gadget/f_midi: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig Reviewed-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_midi.c | 37 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/drivers/usb/gadget

Re: [PATCH 06/23] usb-gadget/ether: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig Reviewed-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_ecm.c| 8 ++--- drivers/usb/gadget/function/f_eem.c| 8 ++--- drivers/usb/gadget/function/f_ncm.c

Re: [PATCH 05/23] usb-gadget/f_acm: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig Reviewed-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_acm.c | 26 -- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/drivers/usb/gadget/function

Re: [PATCH 04/23] usb-gadget/f_hid: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig Reviewed-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_hid.c | 34 ++ 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/drivers/usb/gadget

Re: [PATCH 03/23] usb-gadget/uvc: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
Hi Christoph, please see my comments inline. With the issues addressed you can add Reviewed-by: Andrzej Pietrasiewicz W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: UVC is a little different from other configfs consumers in that it wants different function and field names from the

Re: [PATCH 02/23] usb-gadget: use per-attribute show and store methods

2015-09-28 Thread Andrzej Pietrasiewicz
W dniu 25.09.2015 o 15:49, Christoph Hellwig pisze: Signed-off-by: Christoph Hellwig Reviewed-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/configfs.c | 295 ++-- include/linux/usb/gadget_configfs.h | 19 +-- 2 files changed, 118 insertions

Re: [PATCH] usb: gadget: uvc: fix returnvar.cocci warnings

2015-09-17 Thread Andrzej Pietrasiewicz
1 Remove unneeded variable used to store return value. Generated by: scripts/coccinelle/misc/returnvar.cocci CC: Andrzej Pietrasiewicz Signed-off-by: Fengguang Wu --- Please take the patch only if it's a positive warning. Thanks! uvc_configfs.c |3 +-- 1 file changed, 1 insertio

[PATCHv2 2/2] usb: gadget: f_printer: actually limit the number of instances

2015-07-24 Thread Andrzej Pietrasiewicz
limit is enforced at directory creation time. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_printer.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index

[PATCHv2 1/2] usb: gadget: f_hid: actually limit the number of instances

2015-07-24 Thread Andrzej Pietrasiewicz
enforced at directory creation time. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_hid.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index f7f35a3..6df9715 100644 --- a/drivers/usb/gadget

[PATCHv2 0/2] hid & printer fixes

2015-07-24 Thread Andrzej Pietrasiewicz
v1..v2: - addressed Sergei's comment Users should not be able to create more function instances than minor numbers allocated for the functions. The problem is in hid and printer functions. This short series fixes it by enforcing the maximum number of function directories created. An

Re: [PATCH] usb/gadget: make composite gadget meet usb compliance for vbus draw

2015-07-24 Thread Andrzej Pietrasiewicz
Hi, W dniu 24.07.2015 o 06:11, Du, Changbin pisze: Thanks, Pietrasiewicz. From: Andrzej Pietrasiewicz [mailto:andrze...@samsung.com] W dniu 23.07.2015 o 14:34, Du, Changbin pisze: >From 0a8e0d63a9887735c6782d7b0c15c2c1fdf1952a Mon Sep 17 00:00:00 void composite_disconnect(struct usb_gad

Re: [PATCH] usb/gadget: make composite gadget meet usb compliance for vbus draw

2015-07-23 Thread Andrzej Pietrasiewicz
Hi Changbin, (I assume I address your name properly, if not please excuse) W dniu 23.07.2015 o 14:34, Du, Changbin pisze: From 0a8e0d63a9887735c6782d7b0c15c2c1fdf1952a Mon Sep 17 00:00:00 2001 void composite_disconnect(struct usb_gadget *gadget) { struct usb_composite_dev

[PATCH 2/2] usb: gadget: f_printer: actually limit the number of instances

2015-07-23 Thread Andrzej Pietrasiewicz
limit is enforced at directory creation time. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_printer.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index

[PATCH 1/2] usb: gadget: f_hid: actually limit the number of instances

2015-07-23 Thread Andrzej Pietrasiewicz
enforced at directory creation time. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_hid.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index f7f35a3..b02be06 100644 --- a/drivers/usb/gadget

[PATCH 0/2] hid & printer fixes

2015-07-23 Thread Andrzej Pietrasiewicz
Users should not be able to create more function instances than minor numbers allocated for the functions. The problem is in hid and printer functions. This short series fixes it by enforcing the maximum number of function directories created. Andrzej Pietrasiewicz (2): usb: gadget: f_hid

[PATCH] usb: gadget: f_midi: fix error recovery path

2015-07-03 Thread Andrzej Pietrasiewicz
In case kstrdup() fails the resources to release are midi->in_port[] and midi. No cards have been registered, so no need to unregister any. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/f_midi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --gi

Re: Locking issues w/ functionfs gadget and aio?

2015-07-01 Thread Andrzej Pietrasiewicz
W dniu 22.06.2015 o 19:20, John Stultz pisze: On Sat, Jun 20, 2015 at 10:24 PM, Al Viro wrote: On Fri, Jun 12, 2015 at 05:51:12PM -0700, John Stultz wrote: I'm not super sure what the right fix is, but if do something like the following (sorry, whitespace corrupted via copy/paste), I don't se

[PATCH 0/3] Fixes for rndis

2015-05-18 Thread Andrzej Pietrasiewicz
This short series fixes three bugs in rndis. Patches 1/3 and 3/3 fix problems indicated by kbuild test robot. Andrzej Pietrasiewicz (3): usb: gadget: rndis: change the value passed to rndis_signal_(dis)connect() usb: gadget: rndis: don't duplicate the "i" variable usb

[PATCH] usb: gadget: f_printer: fix dependencies

2015-03-24 Thread Andrzej Pietrasiewicz
If f_printer is selected without legacy g_printer, it should depend on USB_CONFIGFS which pulls in libcomposite. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index

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

2015-03-20 Thread Andrzej Pietrasiewicz
, otherwise checkpatch complains that the patch has style problems. Signed-off-by: Andrzej Pietrasiewicz --- @Felipe: For some reason the original version was missing an opening "(" at the prototype of rndis_free_response() in rndis.h. Now it should be fine. drivers/usb/gadge

Re: FunctionFS with OS descriptors 'Oops'

2015-03-13 Thread Andrzej Pietrasiewicz
W dniu 13.03.2015 o 12:25, Andrzej Pietrasiewicz pisze: Hi Wojciech, W dniu 13.03.2015 o 12:05, Wojciech Zając pisze: Hello, I was trying to create FunctionFS based, WinUSB gadget driver on EBV SoCrates board (Altera Cyclone V SoC, dwc2 UDC), running 4.0-rc3 Kernel, but this attempt

Re: FunctionFS with OS descriptors 'Oops'

2015-03-13 Thread Andrzej Pietrasiewicz
Hi Wojciech, W dniu 13.03.2015 o 12:05, Wojciech Zając pisze: Hello, I was trying to create FunctionFS based, WinUSB gadget driver on EBV SoCrates board (Altera Cyclone V SoC, dwc2 UDC), running 4.0-rc3 Kernel, but this attempt ultimately failed with 'Oops'. I wrote my own application fo

[PATCH] usb: gadget: f_printer: use non-zero flag for bitwise and

2015-03-13 Thread Andrzej Pietrasiewicz
USB_DIR_OUT happens to be zero, so the result of bitwise and is always 0. Consequently, break will never happen in the SOFT_RESET case. This patch uses a compatible condition with a non-zero USB_DIR_IN, which might or might not evaluate to zero. Reported-by: Dan Carpenter Signed-off-by: Andrzej

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

2015-03-03 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 --- drivers/usb/gadget/l

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

2015-03-03 Thread Andrzej Pietrasiewicz
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 --- drivers/usb/gadget/legacy/printer.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff

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

2015-03-03 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 --- drivers/usb/gadget/legacy/printer.c | 46 + 1 file changed, 31 insertions(+), 15 deletions(-) diff --git

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

2015-03-03 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 --- drivers/usb/gadget/legacy/printer.c | 58

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

2015-03-03 Thread Andrzej Pietrasiewicz
xfff...ff. And the argument to list_del() 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 --- drivers/usb/gadget/legacy/printer.c | 6 ++

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

2015-03-03 Thread Andrzej Pietrasiewicz
ction is found. 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 --- driv

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

2015-03-03 Thread Andrzej Pietrasiewicz
Legacy gadgets, before converting them to the new function framework, used to use the name _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 --- drivers/usb/gadget/legacy/printer.

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

2015-03-03 Thread Andrzej Pietrasiewicz
gt;function; +} + +DECLARE_USB_FUNCTION_INIT(printer, gprinter_alloc_inst, gprinter_alloc); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Craig Nadler"); + +#endif static int gprinter_setup(int count) { diff --git a/drivers/usb/gadget/function/u_printer.h b/drivers/usb/gadget/functio

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

2015-03-03 Thread Andrzej Pietrasiewicz
The printer_dev can be recovered from printer_func_unbind() function's parameters. Signed-off-by: Andrzej Pietrasiewicz --- 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/usb/gadget/l

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

2015-03-03 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 --- drivers/usb/gadget/legacy/printer.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb

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

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

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

2015-03-03 Thread Andrzej Pietrasiewicz
Avoid using magic numbers. Signed-off-by: Andrzej Pietrasiewicz --- 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..db5e2f0 100644 --- a

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

2015-03-03 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 Pietrasi

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

2015-03-03 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 --- drivers/usb/gadget/legacy/printer.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/usb/gadget/legacy

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

2015-03-03 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 --- drivers/usb/gadget/legacy/printer.c | 14 -- 1 file changed, 8 insertions(+), 6

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