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
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
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
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
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
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
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
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
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
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
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
(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
- 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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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"
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
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:
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
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
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
)
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
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
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
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
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
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
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
()
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
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;
}
+
(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
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
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
-
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
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
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
_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
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
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
+ 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
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
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
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
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"
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
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
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
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
[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
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
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
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
= 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
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
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
>&
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
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
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
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
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
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
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:
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
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
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
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
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
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
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))
>
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
) 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
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;
> + }
>
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
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
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
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
> - usbip_vhci_driver_close();
> - return -1;
> - }
> + rc = usbip_vhci_attach_device(port, sockfd, udev->busnum,
> + udev->devnum, udev->speed);
> + if (rc < 0 && errno != EBU
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,
--
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
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
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
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
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
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
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
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
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 - 100 of 785 matches
Mail list logo