Re: [PATCH v13 10/10] usbip: exporting devices: modifications to protocol text

2016-12-02 Thread Krzysztof Opasiak


On 11/22/2016 07:48 AM, Nobuo Iwata wrote:
> This patch adds export and un-export request/response to 
> Documentation/usb/usbip_protocol.txt.
> 
> The definition of the structs has been defined in original code of 
> tools/usb/usbip/usbip_network.h but not described in the document.
> 
> Adding the request and response, words 'server' and 'client' are 
> ambiguous in several place. To avoid confusion, 'device-side' and 
> 'application-side' are written together with 'server' and 'client'.
> 
> 'export' was used in the counter side of 'import' request. This patch 
> organizes usage of 'import' and 'export'.
> 

I would be very happy if we could avoid device and application side
terms like I described in previous email.

> Signed-off-by: Nobuo Iwata 
> ---
>  Documentation/usb/usbip_protocol.txt | 204 ---
>  1 file changed, 181 insertions(+), 23 deletions(-)
> 
> diff --git a/Documentation/usb/usbip_protocol.txt 
> b/Documentation/usb/usbip_protocol.txt
> index 16b6fe2..d4be5b6 100644
> --- a/Documentation/usb/usbip_protocol.txt
> +++ b/Documentation/usb/usbip_protocol.txt
> @@ -1,20 +1,26 @@
>  PRELIMINARY DRAFT, MAY CONTAIN MISTAKES!
>  28 Jun 2011
> +MODIFIED FOR CONNECT AND DISCONNECT OPERARION.
> +07 March 2016
>  
> -The USB/IP protocol follows a server/client architecture. The server exports 
> the
> -USB devices and the clients imports them. The device driver for the exported
> -USB device runs on the client machine.
> +The USB/IP protocol follows a server/client architecture between two 
> computers
> +one has USB devices and the other runs application using the devices. There 
> are
> +two ways for initiation.
>  
> -The client may ask for the list of the exported USB devices. To get the list 
> the
> -client opens a TCP/IP connection towards the server, and sends an 
> OP_REQ_DEVLIST
> -packet on top of the TCP/IP connection (so the actual OP_REQ_DEVLIST may be 
> sent
> -in one or more pieces at the low level transport layer). The server sends 
> back
> -the OP_REP_DEVLIST packet which lists the exported USB devices. Finally the
> -TCP/IP connection is closed.
> +The first way is to import devices from application-side. In this way, the
> +server runs in device-side and the client runs in application-side. In device
> +side user makes devices importable with 'bind' operation.
>  
> +The client may ask for the list of the importable USB devices. To get the 
> list
> +the client opens a TCP/IP connection towards the server, and sends an
> +OP_REQ_DEVLIST packet on top of the TCP/IP connection (so the actual
> +OP_REQ_DEVLIST may be sent in one or more pieces at the low level transport
> +layer). The server sends back the OP_REP_DEVLIST packet which lists the
> +importable USB devices. Finally the TCP/IP connection is closed.
> +
> +   application-sidedevice-side
>   virtual host controller usb host
> -  "client"   "server"
> -  (imports USB devices) (exports USB devices)
> +  "client" (lists importable devices)"server"
>| |
>|  OP_REQ_DEVLIST |
>| --> |
> @@ -23,18 +29,13 @@ TCP/IP connection is closed.
>| <-- |
>| |
>  
> -Once the client knows the list of exported USB devices it may decide to use 
> one
> -of them. First the client opens a TCP/IP connection towards the server and
> -sends an OP_REQ_IMPORT packet. The server replies with OP_REP_IMPORT. If the
> -import was successful the TCP/IP connection remains open and will be used
> -to transfer the URB traffic between the client and the server. The client may
> -send two types of packets: the USBIP_CMD_SUBMIT to submit an URB, and
> -USBIP_CMD_UNLINK to unlink a previously submitted URB. The answers of the
> -server may be USBIP_RET_SUBMIT and USBIP_RET_UNLINK respectively.
> +Once the client knows the list of importable USB devices it may decide to use
> +one of them. First the client opens a TCP/IP connection towards the server 
> and
> +sends an OP_REQ_IMPORT packet. The server replies with OP_REP_IMPORT.
>  
> +   application-sidedevice-side
>   virtual host controller usb host
> -  "client"   "server"
> -  (imports USB devices) (exports USB devices)
> +  "client"   (imports a USB device)  "server"
>| |
>|  OP_REQ_IMPORT  |
>| --> |
> @@ 

[PATCH v13 10/10] usbip: exporting devices: modifications to protocol text

2016-11-21 Thread Nobuo Iwata
This patch adds export and un-export request/response to 
Documentation/usb/usbip_protocol.txt.

The definition of the structs has been defined in original code of 
tools/usb/usbip/usbip_network.h but not described in the document.

Adding the request and response, words 'server' and 'client' are 
ambiguous in several place. To avoid confusion, 'device-side' and 
'application-side' are written together with 'server' and 'client'.

'export' was used in the counter side of 'import' request. This patch 
organizes usage of 'import' and 'export'.

Signed-off-by: Nobuo Iwata 
---
 Documentation/usb/usbip_protocol.txt | 204 ---
 1 file changed, 181 insertions(+), 23 deletions(-)

diff --git a/Documentation/usb/usbip_protocol.txt 
b/Documentation/usb/usbip_protocol.txt
index 16b6fe2..d4be5b6 100644
--- a/Documentation/usb/usbip_protocol.txt
+++ b/Documentation/usb/usbip_protocol.txt
@@ -1,20 +1,26 @@
 PRELIMINARY DRAFT, MAY CONTAIN MISTAKES!
 28 Jun 2011
+MODIFIED FOR CONNECT AND DISCONNECT OPERARION.
+07 March 2016
 
-The USB/IP protocol follows a server/client architecture. The server exports 
the
-USB devices and the clients imports them. The device driver for the exported
-USB device runs on the client machine.
+The USB/IP protocol follows a server/client architecture between two computers
+one has USB devices and the other runs application using the devices. There are
+two ways for initiation.
 
-The client may ask for the list of the exported USB devices. To get the list 
the
-client opens a TCP/IP connection towards the server, and sends an 
OP_REQ_DEVLIST
-packet on top of the TCP/IP connection (so the actual OP_REQ_DEVLIST may be 
sent
-in one or more pieces at the low level transport layer). The server sends back
-the OP_REP_DEVLIST packet which lists the exported USB devices. Finally the
-TCP/IP connection is closed.
+The first way is to import devices from application-side. In this way, the
+server runs in device-side and the client runs in application-side. In device
+side user makes devices importable with 'bind' operation.
 
+The client may ask for the list of the importable USB devices. To get the list
+the client opens a TCP/IP connection towards the server, and sends an
+OP_REQ_DEVLIST packet on top of the TCP/IP connection (so the actual
+OP_REQ_DEVLIST may be sent in one or more pieces at the low level transport
+layer). The server sends back the OP_REP_DEVLIST packet which lists the
+importable USB devices. Finally the TCP/IP connection is closed.
+
+   application-sidedevice-side
  virtual host controller usb host
-  "client"   "server"
-  (imports USB devices) (exports USB devices)
+  "client" (lists importable devices)"server"
   | |
   |  OP_REQ_DEVLIST |
   | --> |
@@ -23,18 +29,13 @@ TCP/IP connection is closed.
   | <-- |
   | |
 
-Once the client knows the list of exported USB devices it may decide to use one
-of them. First the client opens a TCP/IP connection towards the server and
-sends an OP_REQ_IMPORT packet. The server replies with OP_REP_IMPORT. If the
-import was successful the TCP/IP connection remains open and will be used
-to transfer the URB traffic between the client and the server. The client may
-send two types of packets: the USBIP_CMD_SUBMIT to submit an URB, and
-USBIP_CMD_UNLINK to unlink a previously submitted URB. The answers of the
-server may be USBIP_RET_SUBMIT and USBIP_RET_UNLINK respectively.
+Once the client knows the list of importable USB devices it may decide to use
+one of them. First the client opens a TCP/IP connection towards the server and
+sends an OP_REQ_IMPORT packet. The server replies with OP_REP_IMPORT.
 
+   application-sidedevice-side
  virtual host controller usb host
-  "client"   "server"
-  (imports USB devices) (exports USB devices)
+  "client"   (imports a USB device)  "server"
   | |
   |  OP_REQ_IMPORT  |
   | --> |
@@ -42,6 +43,32 @@ server may be USBIP_RET_SUBMIT and USBIP_RET_UNLINK 
respectively.
   |  OP_REP_IMPORT  |
   | <-- |
   | |
+
+The second way is to export devices from device-side. In this way, the server
+runs