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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
_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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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):
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
, 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
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
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
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
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
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
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
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
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 ++
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
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.
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
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
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
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
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
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
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
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
101 - 200 of 1290 matches
Mail list logo