mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] More error codes for usbip request/reply messages
@ 2018-03-07 20:42 Shuah Khan
  2018-03-07 20:42 ` [PATCH 1/3] usbip: tools: add more " Shuah Khan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shuah Khan @ 2018-03-07 20:42 UTC (permalink / raw)
  To: valentina.manea.m, shuah, gregkh
  Cc: Shuah Khan, yuyang.du, k.opasiak, nobuo.iwata, julien.boibessot,
	jdieter, peter.senna, linux-usb, linux-kernel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-07 20:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07 20:42 [PATCH 0/3] More error codes for usbip request/reply messages Shuah Khan
2018-03-07 20:42 ` [PATCH 1/3] usbip: tools: add more " Shuah Khan
2018-03-07 20:42 ` [PATCH 2/3] usbip: usbip_host_common: Use new error codes to return request status Shuah Khan
2018-03-07 20:42 ` [PATCH 3/3] usbip: tools: change to use new error codes in server reply messages Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®