Re: [PATCH v1 11/12] usb: gadget: Add configfs attribuite for controling match_existing_only

2018-12-03 Thread Krzysztof Opasiak
ason gadget should be unbound. So what this patch does in my opinion is abusing the attribute and hacking the kernel instead of creating a simple udev rule that whenever dwc3 appears and it gadget should be enabled write its name to UDC attribute. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: SV: USB Gadget driver for USB screen?

2018-07-09 Thread Krzysztof Opasiak
tion high CPU usage on both sides. On windows host things were much better esp in terms of CPU usage, I also don't remember any problems with the driver itself. Footnotes: 1 - https://github.com/kopasiak/f_dl_ffs Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung

Re: Documentation On Gadget Drivers (g_ffs)

2018-05-25 Thread Krzysztof Opasiak
t; there is more than one? > In ConfigFS it's UDC gadget attribute. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org M

Re: [PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-19 Thread Krzysztof Opasiak
igFS interface is pretty complicated and gives user many chances for "silent misconfiguration". It would be nice to protect user against stupid and very hard to debug mistakes rather than giving this child even more weapon;) Best regards, -- Krzysztof Opasiak Samsung R&D Institute

Re: [PATCH 2/3] usb: gadget: configfs: Create control_config group

2018-04-19 Thread Krzysztof Opasiak
ONTROL_ONLY which would make FunctionFS igore the descs (or allow to provide 0 of them) and make this function usable only for this purpouse (disallow linking to real config and allow only for linking to this fake one). Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Sa

Re: ConfigFS, FunctionFS, and MS XInput

2018-04-17 Thread Krzysztof Opasiak
ID devices, but not so much for XInput devices and functionfs in general, so any help would be greatly appreciated! Did you check that you provided all drivers that a physical device does? Maybe windows requires correct OS descriptors for that device? That's just some guesses... -- Kr

Re: Handling custom device control requests in userspace

2018-04-06 Thread Krzysztof Opasiak
r GadgetFS backend for umap2[2] as an example. Footnotes: 1 - https://github.com/dominicgs/USBProxy 2 - https://github.com/nccgroup/umap2 Best regards -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-us

Re: Handling custom device control requests in userspace

2018-04-06 Thread Krzysztof Opasiak
On 06.04.2018 14:35, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: On 06.04.2018 12:18, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: A few advantages over a couple options I've considered are that this mostly reuses existing functionalities and won't affect

Re: Handling custom device control requests in userspace

2018-04-06 Thread Krzysztof Opasiak
On 06.04.2018 12:18, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: A few advantages over a couple options I've considered are that this mostly reuses existing functionalities and won't affect users that haven't enabled it. Please let me know of any feedback on th

Re: Handling custom device control requests in userspace

2018-04-06 Thread Krzysztof Opasiak
essory_init(); should get the job done. Huh and what with people that are not android but need to support Android accessory in their products? Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe

libusbgx v0.2.0 released

2018-03-02 Thread Krzysztof Opasiak
OS descriptors - Fix C++ compilation issues - Many smaller fixes I encourage you to check out new release and contribute! Footnotes: 1 - https://github.com/libusbgx/libusbgx Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send

Re: [PATCH] usbip: tools usbip_attach: Fix cryptic error messages

2018-02-27 Thread Krzysztof Opasiak
(rhport < 0) { - err("query"); + err("Attach request for Device %s. Is this device exported?", + busid); return -1; } The code itself is ok and you may put my: Reviewed-by: Krzysztof Opasiak but just because

Re: [PATCH] usbip: vudc: fix null pointer dereference on udc->lock

2018-02-27 Thread Krzysztof Opasiak
- dev_err(dev, "no device or gadget not bound"); + if (!udc->driver || !udc->pullup) { + dev_err(dev, "gadget not bound"); ret = -ENODEV; goto unlock; } Thanks for the patch. Looks good to me. Acke

Re: Host & gadget transparent driver

2018-02-22 Thread Krzysztof Opasiak
On 02/22/2018 11:17 AM, Greg KH wrote: On Thu, Feb 22, 2018 at 10:42:17AM +0100, Krzysztof Opasiak wrote: On 02/22/2018 10:32 AM, Ran Shalit wrote: [...] I don't know the exact case nor I'm license specialist but I think it's doable without license violation. Take a l

Re: Host & gadget transparent driver

2018-02-22 Thread Krzysztof Opasiak
ol and provide only binary blob with it;) Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Host & gadget transparent driver

2018-02-22 Thread Krzysztof Opasiak
m/downloads/ubuntu 2 - https://github.com/DisplayLink/evdi Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Host & gadget transparent driver

2018-02-22 Thread Krzysztof Opasiak
iso transfers which I assume is required for your camera... Footnotes: 1 - https://github.com/dominicgs/USBProxy -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a mess

Re: USB gadget : generic functionfs function has no os_desc while rndis function has, why?

2018-02-15 Thread Krzysztof Opasiak
l flag to you descriptors (FFS_HAS_OS_DESC or sth similar, check ffs header for this) and then adding your os_desc to your descriptors. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb&q

Re: USB gadget : generic functionfs function has no os_desc while rndis function has, why?

2018-02-07 Thread Krzysztof Opasiak
Class Driver Windows Automatic Installation Guide v1.10.pdf?version=1&modificationDate=1507279811000&api=v2 Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the bo

Re: [PATCH] usb: gadget: f_uac2: fix bFirstInterface in composite gadget

2018-01-15 Thread Krzysztof Opasiak
face = ret; + std_ac_if_desc.bInterfaceNumber = ret; uac2->ac_intf = ret; uac2->ac_alt = 0; Reviewed-by: Krzysztof Opasiak Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in t

Re: USB gadget : generic functionfs function has no os_desc while rndis function has, why?

2018-01-04 Thread Krzysztof Opasiak
ob/master/examples/gadget-rndis-os-desc.c However, the first problem I'm having is that I can't find the os_desc/ directory for the ffs function I created. Because there is no such directory;) os_desc in case of functionfs are provided by daemon together with USB descriptors.

Re: [PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-13 Thread Krzysztof Opasiak
On 12/13/2017 10:29 AM, Felipe Balbi wrote: Hi, Alan Stern writes: Krzysztof Opasiak writes: On 12/12/2017 01:31 PM, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: Every function should have a type and instance name. Unfortunately in most cases instance name was left unused and

Re: [PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-12 Thread Krzysztof Opasiak
On 12/12/2017 02:16 PM, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: On 12/12/2017 01:31 PM, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: Every function should have a type and instance name. Unfortunately in most cases instance name was left unused and unchecked. This may

Re: [PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-12 Thread Krzysztof Opasiak
On 12/12/2017 01:31 PM, Felipe Balbi wrote: Hi, Krzysztof Opasiak writes: Every function should have a type and instance name. Unfortunately in most cases instance name was left unused and unchecked. This may lead to situations like FunctionFS device name identified by "&quo

[PATCH] usb: gadget: configfs: Disallow empty function instance name

2017-12-12 Thread Krzysztof Opasiak
7;s add a check that instance name should have at least one character. Reported-by: Stefan Agner Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/configfs.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c ind

Re: usb device implemented with functionfs - must app run as root?

2017-12-06 Thread Krzysztof Opasiak
ot and opens all epX files and pass them to the service which then can run with lower privileges. Additional benefit is that systemd doesn't close those fds so even if your demon crashes whole gadget is not going away, all other functions are still usable. Best regards, -- Krzysztof Opasiak Sam

Re: Multiple g_zero gadgets

2017-11-13 Thread Krzysztof Opasiak
On 11/13/2017 10:53 AM, Krzysztof Opasiak wrote: On 11/09/2017 12:15 PM, Felipe Balbi wrote: Hi, Hinko Kocevar writes: The way dummy was written, it can only instantiate one gadget. You either need a real USB peripheral controller, or you need to patch dummy to instantiate more than

Re: Multiple g_zero gadgets

2017-11-13 Thread Krzysztof Opasiak
connected to a separate bus but they all will be visible in the system. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org Mo

Re: [PATCH 2/2] usbip: use monotonic timestamps

2017-11-07 Thread Krzysztof Opasiak
and should be better synchronized with other machines we talk to. Signed-off-by: Arnd Bergmann Looks good to me: Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb"

Re: [PATCH 1/2] usbip: fix off-by-one frame number calculation

2017-11-07 Thread Krzysztof Opasiak
best explanation is that it was a simple typo, so I'm changing the % modulo operator into a cheaper bitmask that the other drivers use, to make it wrap after 0x7ff rather than before it. Signed-off-by: Arnd Bergmann Looks good to me: Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak S

Re: [PATCH 03/11] Creation of "usb_device_auth" LSM hook

2017-06-12 Thread Krzysztof Opasiak
dification... without matching and storing rules inside kernel.. just pure userspace which uses device/interface authorization Footnote: 1 - https://dkopecek.github.io/usbguard/ Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list:

Re: [PATCH] usb: gadget: f_mass_storage: Fix the logic to iterate all common->luns

2017-06-09 Thread Krzysztof Opasiak
d *common_) int i; down_write(&common->filesem); - for (i = 0; i < ARRAY_SIZE(common->luns); --i) { + for (i = 0; i < ARRAY_SIZE(common->luns); i++) { OMG... Totally right. I have no idea how I could wrote sth like this. R

Re: dwc3 udc driver

2017-05-07 Thread Krzysztof Opasiak
n kernel. Maybe it's just a naming problem? you are not going to see "dwc3" folder in /sys/class/udc like but only device-tree generated name for dwc3 example for my dwc2 I have 12480000.hsotg. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronic

Re: Options for improving f_fs.c performance?

2017-04-21 Thread Krzysztof Opasiak
ke a look at example[1] in kernel source. Footnotes: 1 - https://github.com/torvalds/linux/blob/master/tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from th

Re: [PATCH] usb: gadget: remove redundant self assignment

2017-04-19 Thread Krzysztof Opasiak
) goto out; ret = ep->ops->disable(ep); - if (ret) { - ret = ret; + if (ret) goto out; - } ep->enabled = false; Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Elec

Re: [PATCH 1/2] fs: configfs: make qw_sign attribute symmetric

2017-04-19 Thread Krzysztof Opasiak
ines in case of gadget/config strings. Reviewed-by: Krzysztof Opasiak Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org Mor

Re: [PATCH 2/2] fs: configfs: use hexadecimal values and new line

2017-04-19 Thread Krzysztof Opasiak
n sprintf(page, "%d\n", to_usb_os_desc_ext_prop(item)->type); } static ssize_t ext_prop_type_store(struct config_item *item, looks good to me: Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this li

Re: [PATCH v3 4/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-04-07 Thread Krzysztof Opasiak
On 04/06/2017 12:03 AM, Yuyang Du wrote: A new field ncontrollers is added to the vhci_driver structure. And this field is stored by scanning the vhci_hcd* dirs in the platform udev. Suggested-by: Krzysztof Opasiak Signed-off-by: Yuyang Du --- tools/usb/usbip/libsrc/vhci_driver.c | 36

Re: [PATCH v3 3/6] usb: usbip tool: Check the return of get_nports()

2017-04-07 Thread Krzysztof Opasiak
PORT) { + err("port number exceeds %d", MAXNPORT); + goto err; + } + if (refresh_imported_device_list()) goto err; Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To un

Re: [PATCH v2 3/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-04-05 Thread Krzysztof Opasiak
On 04/05/2017 04:03 AM, Yuyang Du wrote: On Wed, Apr 05, 2017 at 11:46:06AM +0200, Krzysztof Opasiak wrote: On 04/04/2017 09:08 PM, Yuyang Du wrote: Hi Krzysztof, On Tue, Apr 04, 2017 at 04:52:32PM +0200, Krzysztof Opasiak wrote: On 03/31/2017 02:28 AM, Yuyang Du wrote: A new field

Re: [PATCH v2 3/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-04-05 Thread Krzysztof Opasiak
On 04/04/2017 09:08 PM, Yuyang Du wrote: Hi Krzysztof, On Tue, Apr 04, 2017 at 04:52:32PM +0200, Krzysztof Opasiak wrote: On 03/31/2017 02:28 AM, Yuyang Du wrote: A new field ncontrollers is added to the vhci_driver structure. And this field is stored by scanning the vhci_hcd* dirs in the

Re: [PATCH v2 6/6] usb: usbip tool: Remove empty lines

2017-04-04 Thread Krzysztof Opasiak
() Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v2 5/6] usb: usbip tool: Fix parse_status()

2017-04-04 Thread Krzysztof Opasiak
ip_attach.c b/tools/usb/usbip/src/usbip_attach.c index 70a6b50..62a297f 100644 --- a/tools/usb/usbip/src/usbip_attach.c +++ b/tools/usb/usbip/src/usbip_attach.c @@ -108,6 +108,8 @@ static int import_device(int sockfd, struct usbip_usb_device *udev) return -1; } +

Re: [PATCH v2 4/6] usb: usbip tool: Fix refresh_imported_device_list()

2017-04-04 Thread Krzysztof Opasiak
(ret != 0) + return ret; } - return parse_status(attr_status); + return 0; } I decided to not urge here with OO programming introduction so just ignore my previous comment and add: Reviewed-by: Krzysztof Opasiak Cheers, -- Krzysztof Opasiak Samsun

Re: [PATCH v2 3/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-04-04 Thread Krzysztof Opasiak
On 03/31/2017 02:28 AM, Yuyang Du wrote: A new field ncontrollers is added to the vhci_driver structure. And this field is stored by scanning the vhci_hcd* dirs in the platform udev. Suggested-by: Krzysztof Opasiak Signed-off-by: Yuyang Du --- tools/usb/usbip/libsrc/vhci_driver.c | 32

Re: [PATCH v2 1/6] usb: usbip: Remove unnecessary get_vdev()

2017-04-04 Thread Krzysztof Opasiak
d, struct urb *urb, } out: - vhci_tx_urb(urb); + vhci_tx_urb(urb, vdev); spin_unlock_irqrestore(&vhci->lock, flags); return 0; I think that I've already gave you my reviewed by for this patch. Nevertheless: Reviewed-by: Krzysztof Opasiak -

Re: [PATCH 5/6] usb: usbip tool: Fix refresh_imported_device_list()

2017-03-27 Thread Krzysztof Opasiak
On 03/27/2017 07:25 AM, Yuyang Du wrote: On Mon, Mar 27, 2017 at 09:07:50AM +0200, Krzysztof Opasiak wrote: As now we have multiple controllers I would be more than happy if we could fix functions like this one to take a controller as a parameter and invoke commands on it instead hardcoding

Re: [PATCH 6/6] usb: usbip tool: Fix parse_status()

2017-03-27 Thread Krzysztof Opasiak
atus; + memset(&vhci_driver->idev[port], 0, sizeof(struct usbip_imported_device)); maybe just: memset(idev, 0, sizeof(*idev)); Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line &q

Re: [PATCH 5/6] usb: usbip tool: Fix refresh_imported_device_list()

2017-03-27 Thread Krzysztof Opasiak
ld fix functions like this one to take a controller as a parameter and invoke commands on it instead hardcoding loops like this one with some unclear conditions like if (i > 0). Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from

Re: [PATCH 4/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-03-27 Thread Krzysztof Opasiak
_ncontrollers) { + err("udev_device_get_sysattr_value ncontrollers failed"); + return -1; + } + + return strtoul(attr_ncontrollers, NULL, 10); +} + Why not just scandir()? Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To

Re: [PATCH 3/6] usb: usbip: Export the number of VHCI controllers in a sysfs file

2017-03-27 Thread Krzysztof Opasiak
attribute for this? Can't just cannot check content of directory using for example scandir() to learn what we have? Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in th

Re: [PATCH 2/6] usb: usbip tool: Fix get_nports()

2017-03-26 Thread Krzysztof Opasiak
return nports; - c++; - nports += 1; - } - - return nports; + return strtoul(attr_nports, NULL, 10); } As strtoul() returns long and get_nports() should return int I'd prefer to do here some explicit cast to int to avoid some potent

Re: [PATCH 1/6] usb: usbip: Remove unnecessary get_vdev()

2017-03-26 Thread Krzysztof Opasiak
+ Shuah Khan On 03/27/2017 08:41 AM, Krzysztof Opasiak wrote: On 03/23/2017 03:46 AM, Yuyang Du wrote: vhci_tx_urb() should be able to get the vhci_device from its caller vhci_urb_enqueue(), instead of brutal-force searching it. Signed-off-by: Yuyang Du Reviewed-by: Krzysztof Opasiak

Re: [PATCH 1/6] usb: usbip: Remove unnecessary get_vdev()

2017-03-26 Thread Krzysztof Opasiak
On 03/23/2017 03:46 AM, Yuyang Du wrote: vhci_tx_urb() should be able to get the vhci_device from its caller vhci_urb_enqueue(), instead of brutal-force searching it. Signed-off-by: Yuyang Du Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Sam

Re: Question: Does usbip support USB 3.0?

2017-03-08 Thread Krzysztof Opasiak
On 03/08/2017 12:36 AM, Yuyang Du wrote: Hi Krzysztof, On Tue, Mar 07, 2017 at 10:25:31AM +0100, Krzysztof Opasiak wrote: If it' not some "top secret" device maybe try to send us descriptors (lsusb -vd VID:PID)? Pasted at the end. Surprisingly, I don't see isochrono

Re: Question: Does usbip support USB 3.0?

2017-03-07 Thread Krzysztof Opasiak
e on speed - when I inserted it into a USB 2.0 port, it doesn't work. Does dmesg says sth why new device cannot be enumerated? If it' not some "top secret" device maybe try to send us descriptors (lsusb -vd VID:PID)? Best regards, -- Krzysztof Opasiak Samsung R&D Insti

Re: Question: Does usbip support USB 3.0?

2017-03-07 Thread Krzysztof Opasiak
hould work fine, right? Yeah it should or at least for now I don't see any obvious reason why it could not work. Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb"

Re: Cannot dump USB report descriptors, not even after unbinding the device

2017-03-06 Thread Krzysztof Opasiak
se excuse me Laszlo for this oversight. Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Question: Does usbip support USB 3.0?

2017-03-06 Thread Krzysztof Opasiak
you see we have a field for devid, direction and ep but we don't have a field for stream id. Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord

Re: Cannot dump USB report descriptors, not even after unbinding the device

2017-03-03 Thread Krzysztof Opasiak
using: # echo -n 2-10.3:1.X > /sys/bus/usb/drivers/usb/unbind Where X is bInterfaceNumber of one of interfaces in your device to which some driver is bound. 7) Execute lsusb -t once again to check if there are some drivers left. If yes goto 6. 8) Execute your lsusb command to get your re

Re: Cannot dump USB report descriptors, not even after unbinding the device

2017-03-03 Thread Krzysztof Opasiak
of for whole device: # echo -n 2-10.3:1.0 > /sys/bus/usb/drivers/usb/unbind Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org

Re: Cannot dump USB report descriptors, not even after unbinding the device

2017-03-03 Thread Krzysztof Opasiak
[Logitech K400 Plus] on usb-:00:14.0-10.3:1 root@spark ~ # echo -n 2-10.3 > /sys/bus/usb/drivers/usb/unbind root@spark ~ # lsusb -vd 046d:c52b Try to use strace and see what fails: strace lsusb -vd 046d:c52b Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Elec

Re: [PATCH] usb: gadget: add RNDIS configfs option for Windows rndiscmp.inf compatibility

2017-03-01 Thread Krzysztof Opasiak
s_rndiscmp attribute? So instead of having single attribute which sets the whole triple of values to some hardcoded ones I would prefer to have one attribute per each of this values and allow user to set them to his own values from userspace. Best regards, -- Krzysztof Opasiak Samsung R&D In

Re: Question: Does usbip support USB 3.0?

2017-02-28 Thread Krzysztof Opasiak
in super speed mode via usbip. So if your device supports high speed mode it will work fine. If your device doesn't work with speed lower than super speed then you won't be able to use it via usbip. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electr

Re: [PATCH v2 1/2] usbip: Fix-format-overflow

2017-02-21 Thread Krzysztof Opasiak
Best regards -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/2] Fix format overflows

2017-02-20 Thread Krzysztof Opasiak
= 30) { Please don't hardcode such values in if. use sizeof() like one line above + err("socket length %i >= 30", size); + return -1; + } ret = write_sysfs_attribute(sockfd_attr_path, sockfd_buff, st

[PATCH] usb: gadget: f_hid: fix: Don't access hidg->req without spinlock held

2017-01-31 Thread Krzysztof Opasiak
hidg->req should be accessed only with write_spinlock held as it is set to NULL when we get disabled by host. Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_hid.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/function/f_hi

Re: [PATCH 2/2] usb: gadget: function: f_fs: pass companion descriptor along

2017-01-31 Thread Krzysztof Opasiak
On 01/31/2017 04:56 PM, Felipe Balbi wrote: > > Hi, > > Krzysztof Opasiak writes: >> On 01/31/2017 02:08 PM, Felipe Balbi wrote: >>> If we're dealing with SuperSpeed endpoints, we need >>> to make sure to pass along the companion descriptor >&

Re: [PATCH 2/2] usb: gadget: function: f_fs: pass companion descriptor along

2017-01-31 Thread Krzysztof Opasiak
axBurst + 1; > + > + if (needs_comp_desc) > + ep->ep->comp_desc = comp_desc; > + Please correct me if I'm wrong but wouldn't we read rubbish here if user provided us SS ep descriptor without companion descriptor? Best regards, -- Krzyszt

[PATCH v2] usb: gadget: f_hid: fix: Move IN request allocation to set_alt()

2017-01-23 Thread Krzysztof Opasiak
nce. This commit moves allocation of IN request from bind() to set_alt() to prevent this issue. Fixes: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()") Cc: sta...@vger.kernel.org Tested-by: David Lechner Signed-off-by: Krzysztof Opasiak --- Changes since v1: - rebased on

[PATCH 2/4] usb: gadget: f_hid: fix: Prevent accessing released memory

2017-01-19 Thread Krzysztof Opasiak
ly if there is sth left when we finish with it. Fixes: 99c515005857 ("usb: gadget: hidg: register OUT INT endpoint for SET_REPORT") Cc: sta...@vger.kernel.org Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_hid.c | 24 1 file changed, 20 i

[PATCH 3/4] usb: gadget: f_hid: Use spinlock instead of mutex

2017-01-19 Thread Krzysztof Opasiak
As IN request has to be allocated in set_alt() and released in disable() we cannot use mutex to protect it as we cannot sleep in those funcitons. Let's replace this mutex with a spinlock. Cc: sta...@vger.kernel.org Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_hid.c

[PATCH 4/4] usb: gadget: f_hid: fix: Move IN request allocation to set_alt()

2017-01-19 Thread Krzysztof Opasiak
nce. This commit moves allocation of IN request from bind() to set_alt() to prevent this issue. Fixes: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()") Cc: sta...@vger.kernel.org Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_hid.c | 89

[PATCH 1/4] usb: gadget: f_hid: fix: Free out requests

2017-01-19 Thread Krzysztof Opasiak
ned-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_hid.c | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index e2966f8..ceb1d0c 100644 --- a/drivers/usb/gadge

[PATCH v3] usb: gadget: udc-core: Rescan pending list on driver unbind

2017-01-15 Thread Krzysztof Opasiak
ad first gadget: $ rmmod g_zero.ko gadget which is pending is automatically attached to that UDC (if name matches). Fixes: 855ed04a3758 ("usb: gadget: udc-core: independent registration of gadgets and gadget drivers") Cc: stable Signed-off-by: Krzysztof Opasiak --- Changes since v2:

Re: [PATCH v2 RESEND] usb: gadget: udc-core: Rescan pending list on driver unbind

2017-01-15 Thread Krzysztof Opasiak
On 12/27/2016 12:18 PM, Felipe Balbi wrote: > > Hi, > > Krzysztof Opasiak writes: >> Since: >> >> commit 855ed04a3758 ("usb: gadget: udc-core: independent registration >> of gadgets and gadget drivers") >> >> if we load gadget mo

Re: [PATCH] tools: usb usbip - update README USB/IP driver location

2017-01-15 Thread Krzysztof Opasiak
On 01/14/2017 12:38 AM, Shuah Khan wrote: > Update USB/IP driver location in README. > > Signed-off-by: Shuah Khan Reviewed-by: Krzysztof Opasiak Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line

Re: [PATCH v8 0/2] usbip: vhci number of ports extension

2017-01-13 Thread Krzysztof Opasiak
o application side daemon which introduced the > patch set. You should definitely revers the dependency as this series is way simpler and requires much less discussion so in my humble opinion it has much bigger chances of getting quick into the kernel. Best regards, -- Krzysztof Opasiak Sa

Re: [PATCH v14 00/10] usbip: exporting devices

2017-01-13 Thread Krzysztof Opasiak
t of remarks from previous series which you didn't applied nor reply to them. Please apply those remarks or at least let's make some discussion about them. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line

Re: [PATCH v14 06/10] usbip: exporting devices: modifications to attach and detach

2017-01-13 Thread Krzysztof Opasiak
hen all files had been removed > + > + return 0; > +} > diff --git a/tools/usb/usbip/libsrc/vhci_driver.h > b/tools/usb/usbip/libsrc/vhci_driver.h > index fa2316c..c85988c 100644 > --- a/tools/usb/usbip/libsrc/vhci_driver.h > +++ b/tools/usb/usbip/libsrc/vhci_driver.h

Re: [PATCH v14 02/10] usbip: exporting devices: modifications to host side libraries

2017-01-13 Thread Krzysztof Opasiak
On 01/13/2017 04:46 PM, Shuah Khan wrote: > On 01/13/2017 04:55 AM, Krzysztof Opasiak wrote: >> >> >> On 01/12/2017 10:14 PM, Shuah Khan wrote: >>> On 12/26/2016 12:08 AM, Nobuo Iwata wrote: >>>> Modifications to host driver wrapper and its

Re: [PATCH v14 02/10] usbip: exporting devices: modifications to host side libraries

2017-01-13 Thread Krzysztof Opasiak
gt; -int cnt = 0; >> >> list_for_each(i, &hdriver->edev_list) { >> edev = list_entry(i, struct usbip_exported_device, node); >> -if (num == cnt) >> +if (!strncmp(busid, edev->udev.busid, SYSFS_BUS_ID_SIZE)) >

Re: [PATCH v14 03/10] usbip: exporting devices: new connect operation

2017-01-13 Thread Krzysztof Opasiak
ust that in this new proposed model, server is exporting devices. > > Also does usbip run here in user mode. Can any user run uspip and initiate > export? If so, I don't think I can take this patch series. I don't like to > see non root being able to export and/or make attached dev

Re: [PATCH v14 09/10] usbip: exporting devices: chage to documenattion

2017-01-13 Thread Krzysztof Opasiak
) needs the same permissions as usbip bind because it uses the same kernel infrastructure. To export a device you need to bind a stub driver to it which you do using bind attribute in drivers directory which by default has permissions: --w--- 1 root root 4096 Dec 31 17:12 bind usbipa also has

Re: [PATCH v14 05/10] usbip: exporting devices: modifications to daemon

2017-01-12 Thread Krzysztof Opasiak
usbip_net_pack_usb_device(1, &pdu_udev); > + > + rc = usbip_net_send(connfd, &pdu_udev, sizeof(pdu_udev)); > + if (rc < 0) { > + dbg("usbip_net_send failed: pdu_udev"); > + return -1; > + } >

Re: [PATCH v14 04/10] usbip: exporting devices: new disconnect operation

2017-01-12 Thread Krzysztof Opasiak
gt; + case 'b': > + busid = optarg; > + break; > + case 'd': > + driver = &device_driver; > + unbind = 0; > + break; > + default: > + goto err_out; > + } > + } > + > + if (!host || !busid) > + goto err_out; > + > + ret = disconnect_device(host, busid, unbind); > + goto out; > + > +err_out: > + usbip_disconnect_usage(); > +out: > + return ret; > +} > Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v14 03/10] usbip: exporting devices: new connect operation

2017-01-12 Thread Krzysztof Opasiak
7; }, > + { "device", no_argument, NULL, 'd' }, > + { NULL, 0, NULL, 0 } > + }; > + char *host = NULL; > + char *busid = NULL; > + int opt; > + int bind = 1; Shouldn't this parameter be exposed to cmd line among remote, busid and device? > + int ret = -1; > + > + for (;;) { > + opt = getopt_long(argc, argv, "r:b:d", opts, NULL); > + > + if (opt == -1) > + break; > + > + switch (opt) { > + case 'r': > + host = optarg; > + break; > + case 'b': > + busid = optarg; > + break; > + case 'd': > + driver = &device_driver; > + bind = 0; > + break; > + default: > + goto err_out; > + } > + } > + > + if (!host || !busid) > + goto err_out; > + > + ret = connect_device(host, busid, bind); > + goto out; > + > +err_out: > + usbip_connect_usage(); > +out: > + return ret; > +} > This looks far better than previous edition. Thank you! Just a couple of minor issues and should be ok. Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v14 02/10] usbip: exporting devices: modifications to host side libraries

2017-01-12 Thread Krzysztof Opasiak
st_entry(i, struct usbip_exported_device, node); > - if (num == cnt) > + if (!strncmp(busid, edev->udev.busid, SYSFS_BUS_ID_SIZE)) does it really make sense to use strncmp() instead of strcmp() here? Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v14 01/10] usbip: exporting devices: modifications to network header

2017-01-12 Thread Krzysztof Opasiak
error when the status is other > than ST_OK. > 2) The status has a commnet "add more error code". > > They become empty struct. Other empty struct, 'op_devlist_request', > defined. > > This patch also includes string translation of the status cod

Re: [PATCH v1 1/1] usbip: auto retry for concurrent attach

2017-01-12 Thread Krzysztof Opasiak
> - usbip_vhci_driver_close(); > - return -1; > - } > + rc = usbip_vhci_attach_device(port, sockfd, udev->busnum, > + udev->devnum, udev->speed); > + if (rc < 0 && errno != EBU

Re: [PATCH v13 05/10] usbip: exporting devices: modifications to daemon

2017-01-04 Thread Krzysztof Opasiak
On 01/04/2017 12:48 AM, fx IWATA NOBUO wrote: > Dear Krzysztof, > > I posted new version and it's improved thanks to your review. I've seen it. It's on my TODO list. I'll get to this in next week (hopefully in the beginning of the week). Best regards, --

Re: [PATCH] usbip: vudc: check for NULL before use

2016-12-21 Thread Krzysztof Opasiak
should check in those callbacks if our params are NULL or not. I have also run through udc-core implementation and generally it doesn't check if params are NULL or not and just dereference some of them and pass them to our callbacks. I think that the best option is just to ask Felipe (USB

[PATCH v2 1/2] usb: gadget: ether: Add \n to each attribute of ethernet functions

2016-12-21 Thread Krzysztof Opasiak
Generally in SysFS and ConfigFS files are new line terminated. Also most of USB functions adds a trailing newline to each attribute. Let's follow this convention also in ethernet functions. Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/u_ether.c

[PATCH v2 2/2] usb: gadget: printer: Remove pnp_string static buffer

2016-12-21 Thread Krzysztof Opasiak
pnp string is usually much shorter than 1k so let's stop wasting 1k of memory for its buffer and make it dynamically alocated. This also removes 1k len limitation for pnp_string and adds a new line after string content if required. Signed-off-by: Krzysztof Opasiak --- Changes since v1: - as

[PATCH v2] tools: usb: usbip: Update README

2016-12-20 Thread Krzysztof Opasiak
Update README file: - remove outdated parts - clarify terminology and general structure - add some description of vUDC Signed-off-by: Krzysztof Opasiak --- Changes since v1: - Add server and client definition - rephrase modules description --- tools/usb/usbip/README | 57

[PATCH 1/2] usb: gadget: ether: Add \n to each attribute of ethernet functions

2016-12-20 Thread Krzysztof Opasiak
Generally in SysFS and ConfigFS files are new line terminated. Also most of USB functions adds a trailing newline to each attribute. Let's follow this convention also in ethernet functions. Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/u_ether.c

[PATCH] usb: gadget: composite: Test get_alt() presence instead of set_alt()

2016-12-20 Thread Krzysztof Opasiak
it closer to prevent future false fixes. Fixes: dd4dff8b035f ("USB: composite: Fix bug: should test set_alt function pointer before use it") Cc: stable Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/composite.c | 12 1 file changed, 8 insertions(+), 4 deletion

[PATCH 2/2] usb: gadget: printer: Remove pnp_string static buffer

2016-12-20 Thread Krzysztof Opasiak
pnp string is usually much shorter than 1k so let's stop wasting 1k of memory for its buffer and make it dynamically alocated. This also removes 1k len limitation for pnp_string and adds a new line after string content if required. Signed-off-by: Krzysztof Opasiak --- drivers/usb/g

[PATCH] tools: usb: usbip: Update README

2016-12-13 Thread Krzysztof Opasiak
Update README file: - remove outdated parts - clarify terminology and general structure - add some description of vUDC Signed-off-by: Krzysztof Opasiak --- tools/usb/usbip/README | 56 +- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git

Re: [Fwd: Emulating USB devices from userspace]

2016-12-12 Thread Krzysztof Opasiak
On 12/12/2016 09:12 PM, Fabian Vogt wrote: > Am Montag, 12. Dezember 2016, 20:55:24 CET schrieb Krzysztof Opasiak: >> >> On 12/12/2016 08:18 PM, Fabian Vogt wrote: >>> Am Montag, 12. Dezember 2016, 19:47:00 CET schrieb Krzysztof Opasiak: >>>> >>&g

  1   2   3   4   5   6   7   8   >