aboutsummaryrefslogtreecommitdiffstats
path: root/tools/usb/usbip/libsrc
diff options
context:
space:
mode:
authorShuah Khan <shuahkh@osg.samsung.com>2018-03-07 15:42:25 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-09 12:17:08 -0500
commitc207a10d2f0bddf691920c0d73b7e8a83e6e2fb6 (patch)
tree20ba478c46899debed78866b1be198bd526b8dd9 /tools/usb/usbip/libsrc
parentf6bcbf2e24eb10275b6614ccd9cab3e7d93748de (diff)
usbip: usbip_host_common: Use new error codes to return request status
Currently ST_OK and ST_NA are the only values used to communicate status of a request from a client. Use new error codes to clearly indicate what failed. For example, when client sends request to import a device that isn't export-able, send ST_DEV_BUSY to the client. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/usb/usbip/libsrc')
-rw-r--r--tools/usb/usbip/libsrc/usbip_host_common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/usb/usbip/libsrc/usbip_host_common.c b/tools/usb/usbip/libsrc/usbip_host_common.c
index 6ff7b601f854..dc93fadbee96 100644
--- a/tools/usb/usbip/libsrc/usbip_host_common.c
+++ b/tools/usb/usbip/libsrc/usbip_host_common.c
@@ -234,14 +234,17 @@ int usbip_export_device(struct usbip_exported_device *edev, int sockfd)
234 switch (edev->status) { 234 switch (edev->status) {
235 case SDEV_ST_ERROR: 235 case SDEV_ST_ERROR:
236 dbg("status SDEV_ST_ERROR"); 236 dbg("status SDEV_ST_ERROR");
237 ret = ST_DEV_ERR;
237 break; 238 break;
238 case SDEV_ST_USED: 239 case SDEV_ST_USED:
239 dbg("status SDEV_ST_USED"); 240 dbg("status SDEV_ST_USED");
241 ret = ST_DEV_BUSY;
240 break; 242 break;
241 default: 243 default:
242 dbg("status unknown: 0x%x", edev->status); 244 dbg("status unknown: 0x%x", edev->status);
245 ret = -1;
243 } 246 }
244 return -1; 247 return ret;
245 } 248 }
246 249
247 /* only the first interface is true */ 250 /* only the first interface is true */