Received: by 10.223.185.116 with SMTP id b49csp5492940wrg; Wed, 7 Mar 2018 12:44:21 -0800 (PST) X-Google-Smtp-Source: AG47ELsHoq5TVAy9A5bipkMpuIvrX986AWjkoOSb3PSOhb38eFs50f4KfB6jh1ZdzfWMpyse/MUl X-Received: by 10.101.83.199 with SMTP id z7mr19545344pgr.105.1520455461524; Wed, 07 Mar 2018 12:44:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520455461; cv=none; d=google.com; s=arc-20160816; b=QQLwP7fxk40+FBEivMWpK5MD+9MdE9O9VK4tRECcWEm49wTHITFkrzjnRzP71+YQXW oW2HzSkigXBk1nLGFuCQXXRoEYppCWaRMNJCm+7cX7cJn9/sCsPtLb+27sZH9PK/oD4X YwNxsOD5lFpRIhdN8czJG1PUwYSlMsTzDicFcUzdl3w7E6aQd2nOzql1jS8gX8TSmY4f vAlSACslJiFEyVbmmCgT/9FfmBCFaf5J6NY6dBBP1MUJvdzs9M9LlwAbUM2GXarOv4Pf CoeyXWPLJUTKwK9vS0gj5tQLsIiBkAnbu6OgO9e8LKCHNOShD/JFLMM1ubeD9le/kXkK xdmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=m7DvfFGtdL2nZoTeND/Rlre/uyRuPLuNRdxr3GAjA2A=; b=iFa68F96CyFTwBj0nhKguCBAMNfugm6J/bncse+8HWsvXhyxmsELwCmfR3q6Ft7iRw O4h1n7zhMGsgStJHW7qZeDJImfAbAy/6Z0bEt18rIdkZ17DECBPDNvHJ5weXIgdKVryq c5eMxKkuKzIofKOuT0+fGjvTE2FQ5niqngLuwmr3xZf1ftzcNpx1aEnaeAF+0QVkO38v qg+QOGLui6WdKxuemEMRCGAuErHdVmkzgAODzWJC6X1UJZ/hZNwBHesZ8QrQUHn6jm83 I82Ac0zIQzD3m8VXQc1VqjW6/3Q2DeQ334t8x+OdHZ8cY0ED5fkWJKO9OZuAKN5/n+9+ p6Ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 126si4700828pgj.673.2018.03.07.12.44.06; Wed, 07 Mar 2018 12:44:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935192AbeCGUm6 (ORCPT + 99 others); Wed, 7 Mar 2018 15:42:58 -0500 Received: from osg.samsung.com ([64.30.133.232]:48621 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933736AbeCGUmu (ORCPT ); Wed, 7 Mar 2018 15:42:50 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 7357A3FBB1; Wed, 7 Mar 2018 12:42:49 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XbscB3UyWbJO; Wed, 7 Mar 2018 12:42:48 -0800 (PST) Received: from localhost.localdomain (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) by osg.samsung.com (Postfix) with ESMTPSA id 9F9253FBA2; Wed, 7 Mar 2018 12:42:47 -0800 (PST) From: Shuah Khan To: valentina.manea.m@gmail.com, shuah@kernel.org, gregkh@linuxfoundation.org Cc: Shuah Khan , yuyang.du@intel.com, k.opasiak@samsung.com, nobuo.iwata@fujixerox.co.jp, julien.boibessot@armadeus.com, jdieter@lesbg.com, peter.senna@gmail.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] More error codes for usbip request/reply messages Date: Wed, 7 Mar 2018 13:42:23 -0700 Message-Id: X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently ST_OK and ST_NA are the only values defined to communicate status of a request from a client. Client doesn't know what failed and prints a cryptic error message that something failed. This patch series adds more error codes to clearly indicate what failed. For example, when client sends request to import a device that isn't export-able, server can send a specific error code to the client. The first patch moves existing error codes to a common library header and adds more codes. It also adds an interface to map the code to a string to print messages from tools. The second patch changes the server/host to return the right codes in reply messages when client request fails. The third patch changes the clinet tools to recognize the new error codes and print messages. 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 Shuah Khan (3): usbip: tools: add more error codes for usbip request/reply messages usbip: usbip_host_common: Use new error codes to return request status usbip: tools: change to use new error codes in server reply messages tools/usb/usbip/libsrc/usbip_common.c | 23 +++++++++++++++++++++++ tools/usb/usbip/libsrc/usbip_common.h | 11 +++++++++++ tools/usb/usbip/libsrc/usbip_host_common.c | 5 ++++- tools/usb/usbip/src/usbip_attach.c | 11 +++++------ tools/usb/usbip/src/usbip_list.c | 6 ++++-- tools/usb/usbip/src/usbip_network.c | 6 +++++- tools/usb/usbip/src/usbip_network.h | 6 ++---- tools/usb/usbip/src/usbipd.c | 18 +++++++++--------- 8 files changed, 63 insertions(+), 23 deletions(-) -- 2.14.1