aboutsummaryrefslogtreecommitdiff
path: root/tools/usb/usbip/src/usbip_attach.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-21treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13Thomas Gleixner1-13/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details [based] [from] [clk] [highbank] [c] you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 355 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Jilayne Lovejoy <[email protected]> Reviewed-by: Steve Winslow <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-09usbip: tools: change to use new error codes in server reply messagesShuah Khan1-6/+5
Changed usbip_network, usbip_attach, usbip_list, and usbipd to use and propagate the new error codes in server reply messages. usbip_net_recv_op_common() is changed to take a pointer to status return the status returned in the op_common.status to callers. usbip_attach and usbip_list use the common interface to print error messages to indicate why the request failed. With this change the messages say why a request failed: - when a client requests a device that is already exported: usbip attach -r server_name -b 3-10.2 usbip: error: Attach Request for 3-10.2 failed - Device busy (exported) - when a client requests a device that isn't exportable, usbip attach -r server_name -b 3-10.4 usbip: error: Attach Request for 3-10.4 failed - Device not found Signed-off-by: Shuah Khan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-09usbip: tools usbip_attach: Fix cryptic error messagesShuah Khan1-1/+2
Attach device error message is cryptic and useless. Fix it to be informative. Signed-off-by: Shuah Khan <[email protected]> Reviewed-by: Krzysztof Opasiak <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-08-31usbip: auto retry for concurrent attachNobuo Iwata1-15/+20
This patch adds recovery from false busy state on concurrent attach operation. The procedure of attach operation is as below. 1) Find an unused port in /sys/devices/platform/vhci_hcd/status. (userspace) 2) Request attach found port to driver through /sys/devices/platform/vhci_hcd/attach. (userspace) 3) Lock table, reserve requested port and unlock table. (vhci driver) Attaching more than one remote devices concurrently, same unused port number will be found in step-1. Then one request will succeed and others will fail even though there are some unused ports. With this patch, driver returns EBUSY when requested port has already been used. In this case, attach command retries from step-1: finding another unused port. If there's no unused port, the attach operation will fail in step-1. Otherwise it retries automatically using another unused port. vhci-hcd's interface (only errno) is changed as following. Current errno New errno Condition EINVAL same as left specified port number is in invalid range EAGAIN same as left platform_get_drvdata() failed EINVAL same as left specified socket fd is not valid EINVAL EBUSY specified port status is not free The errno EBUSY was not used in userspace src/usbip_attach.c:import_device(). It is needed to distinguish the condition to be able to retry from other unrecoverable errors. It is possible to avoid this failure by introducing userspace exclusive control. But it's exaggerated for this special condition. The locking itself has done in driver. As an alternate solution, userspace doesn't specify port number, driver searches unused port and it returns port number to the userspace. With this solution, the interface is much different than this patch. Signed-off-by: Nobuo Iwata <[email protected]> Acked-by: Shuah Khan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-06-13usbip: vhci-hcd: Add USB3 SuperSpeed supportYuyang Du1-1/+2
This patch adds a USB3 HCD to an existing USB2 HCD and provides the support of SuperSpeed, in case the device can only be enumerated with SuperSpeed. The bulk of the added code in usb3_bos_desc and hub_control to support SuperSpeed is borrowed from the commit 1cd8fd2887e162ad ("usb: gadget: dummy_hcd: add SuperSpeed support"). With this patch, each vhci will have VHCI_HC_PORTS HighSpeed ports and VHCI_HC_PORTS SuperSpeed ports. Suggested-by: Krzysztof Opasiak <[email protected]> Signed-off-by: Yuyang Du <[email protected]> Acked-by: Shuah Khan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-06-13usb: usbip tool: Fix parse_status()Yuyang Du1-0/+2
In parse_status(), all nports number of idev's are initiated to 0 by memset(), it is simply wrong, because parse_status() reads the status sys file one by one, therefore, it can only update the according vhci_driver->idev's for it to parse. Reviewed-by: Krzysztof Opasiak <[email protected]> Signed-off-by: Yuyang Du <[email protected]> Acked-by: Shuah Khan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-04-26usbip: tools: Start using VUDC backend in usbip toolsIgor Kotrasinski1-2/+8
Modify userspace tools to allow exporting and connecting to vudc. This commit is a result of cooperation between Samsung R&D Institute Poland and Open Operating Systems Student Society at University of Warsaw (O2S3@UW) consisting of: Igor Kotrasinski <[email protected]> Karol Kosik <[email protected]> Ewelina Kosmider <[email protected]> Dawid Lazarczyk <[email protected]> Piotr Szulc <[email protected]> Tutor and project owner: Krzysztof Opasiak <[email protected]> Signed-off-by: Igor Kotrasinski <[email protected]> Signed-off-by: Ewelina Kosmider <[email protected]> [Various bug fixes and improvements] Signed-off-by: Krzysztof Opasiak <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-08-25usbip: move usbip userspace code out of stagingValentina Manea1-0/+241
At this point, USB/IP userspace code is fully functional and can be moved out of staging. Signed-off-by: Valentina Manea <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>