Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp727678pxf; Wed, 24 Mar 2021 14:36:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxncR0EoLul35cdT0f8sn0cPSbx5GjHCk9Smu6i5BrbADwKC5sGdMfK2VBozAWOuxG5cgT X-Received: by 2002:a17:907:2093:: with SMTP id pv19mr6007589ejb.134.1616621766536; Wed, 24 Mar 2021 14:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616621766; cv=none; d=google.com; s=arc-20160816; b=Yfwl+sq2tIqONkSGvF0hX0Cz+hgVbgAxxR74B2iGh9/F8tBqbO6GNILvr3TbJsv908 kQvS63/YylktckdpE3HZNKjur15Mk79l1XyQrcU3tJy1qmUfeNo7YlWaIU7bn9jvkL9d AxX1VGRlcKM7eExfR2iEVLmDaQJS5dmiJHwx8K0PnZ/TWark7g8VooIgLEb6rBx7804y hfM2aoKuBLmJNvme6TFcd/Kx/9P2oBB5a2i7UnFAHyvgXvollvVNcY89TpuBo1299Mvr 7QMobG40WLoHjp0utdc8AG8+Hr2o+4GlVN3APlNjA44SfnKW0q80ALF/9IPCJFPhcO3N PaJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=0CTkCP7eh5JThTr8jIH1qDmyEvNCPXGfv16BaMHqRms=; b=cTHRmotV91DYjYWjt1rCOBBYSO1S1uU8SgNDNkujbv9eT6C8iAmH5zaEW+mutxaJlH S1uIIgpqp7TiiBc3a3S7nj8OJEEGnFWuOJyiwqcEpVKjCDaiX5WW1FlkxgLM4KlGn6aN 7bR7EJ98F4AGYxE+H5F5wFkyS6yFS8AKmHc7hbVEEwOjPjYTYXVd+AfcAUEXDDKp+MCG QVEn+X2zk6XM+3WEzM2EqrLXnFmB+t+cJ5v/jej+520zv1yD5qVLwmgjti7Afws5UvyR 8wPGDKhedl0T/4QjYhy3jDiOdCakk0qN8xmRkXE2lEi64UGVtjOnljzdpatLLnm5sCag ZBXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=G+HRAoEB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si2571891ejd.654.2021.03.24.14.35.42; Wed, 24 Mar 2021 14:36:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=G+HRAoEB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234254AbhCWXMa (ORCPT + 99 others); Tue, 23 Mar 2021 19:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234252AbhCWXMD (ORCPT ); Tue, 23 Mar 2021 19:12:03 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20AE6C061763 for ; Tue, 23 Mar 2021 16:12:03 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id j26so19528287iog.13 for ; Tue, 23 Mar 2021 16:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0CTkCP7eh5JThTr8jIH1qDmyEvNCPXGfv16BaMHqRms=; b=G+HRAoEBftiZViB1W9yjFGzhCO8zCpuDbTwdqm/XGLcphKdTuhO8hpKuEGztPMNjH4 BK78t12o0bz41KzLUGsF1JKgf6FIBd52ul0eqkkWTCrn/L2EpLbi+i1+Bz3XCdJDfQ7y tpFup7b1C+lZDCytyJMp9k7yDIH8uhiU213e0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0CTkCP7eh5JThTr8jIH1qDmyEvNCPXGfv16BaMHqRms=; b=sFk5BDkNvfW8ClYOBTstIel8sv+5wUDteAVCxjbnWr2Pws5ohoKid3k/yu+zeyg52W 0ayxNuQwwr8gicTLa+BDsYnDl2I02RbCFzFUsNAbTQH5lHG9w5PNH85HESuPq4xns5I4 EBhhicYwr0Rbd8ZEIlE44se17w4uK4RCJJYdbAu+8S9MT7uXNYHcr4owp/43+zOr6AFu r1UQDrlUJcu2eqs2OCe2PhPOflwFwAR+hYFFYqoevseCwNQYnq96bRARifxnue/KLr/B ZGu3iPKJcRKbr5T7d1I56v3DtqEPjr4h+E3kzJLGnK2Zd6BAu/rlf9NJlqkgGkppP/4W 4A9g== X-Gm-Message-State: AOAM530nI094X3EQCfdLdAj7EYg/QuoAC6kIfHabiCRAniDqwMN4+aVa uW7fS1JV3Xsyt9akdHVGUKqzQ1S9EUANCw== X-Received: by 2002:a05:6638:144e:: with SMTP id l14mr343367jad.76.1616541122241; Tue, 23 Mar 2021 16:12:02 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id r3sm151608ilq.42.2021.03.23.16.12.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Mar 2021 16:12:01 -0700 (PDT) Subject: Re: [PATCH v4 1/2] usbip: tools: add options and examples in man page related to device mode To: "Hongren Zheng (Zenithal)" , Valentina Manea , Shuah Khan , Antonio Borneo , Greg Kroah-Hartman , matt mooney , linux-usb@vger.kernel.org, Shuah Khan Cc: linux-kernel@vger.kernel.org References: From: Shuah Khan Message-ID: <1a2c79b7-1cc0-9ddd-f2ec-fa7b222113ec@linuxfoundation.org> Date: Tue, 23 Mar 2021 17:12:00 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/23/21 6:55 AM, Hongren Zheng (Zenithal) wrote: > The commit e0546fd8b748 ("usbip: tools: Start using VUDC backend in > usbip tools") implemented device mode for user space tools, however the > corresponding options are not documented in man page. > > This commit documents the options and provides examples on device mode. > > Signed-off-by: Hongren Zheng > --- > tools/usb/usbip/doc/usbip.8 | 25 +++++++++++++++++++++++++ > tools/usb/usbip/doc/usbipd.8 | 22 ++++++++++++++++++++++ > 2 files changed, 47 insertions(+) > > PATCH v2: > Add signed-off-by line > > PATCH v3: > Move patch changelog after the marker line > Remove nickname in signed-off-by line > > PATCH v4: > Use commit short hash and message instead of long hash only when > referring to commit in the kernel > Thank you for the patch. Please see comments below: > diff --git a/tools/usb/usbip/doc/usbip.8 b/tools/usb/usbip/doc/usbip.8 > index a15d20063b98..385b0eda8746 100644 > --- a/tools/usb/usbip/doc/usbip.8 > +++ b/tools/usb/usbip/doc/usbip.8 > @@ -49,6 +49,13 @@ then exit. > Attach a remote USB device. > .PP > > +.HP > +\fBattach\fR \-\-remote=<\fIhost\fR> \-\-device=<\fdev_id\fR> > +.IP > +Attach a remote USB gadget. > +Only used when the remote usbipd is in device mode. > +.PP > + > .HP > \fBdetach\fR \-\-port=<\fIport\fR> > .IP This is a bit confusing. Please add a separate section for Attach a remote USB gadget complete with attach and detach instructions. > @@ -73,6 +80,14 @@ Stop exporting a device so it can be used by a local driver. > List USB devices exported by a remote host. > .PP > > +.HP > +\fBlist\fR \-\-device > +.IP > +List USB gadgets of local usbip-vudc. > +Only used when the local usbipd is in device mode. > +This can not list usbip-vudc USB gadgets of the remote device mode usbipd. > +.PP > + > .HP > \fBlist\fR \-\-local > .IP > @@ -93,5 +108,15 @@ List local USB devices. > client:# usbip detach --port=0 > - Detach the usb device. > > +The following example shows the use of device mode > + > + server:# usbip list --device > + - Note this is the server side > + > + client:# modprobe vhci-hcd > + > + client:# usbip attach --remote=server --device=usbip-vudc.0 > + - Connect the remote USB gadget > + > .SH "SEE ALSO" > \fBusbipd\fP\fB(8)\fB\fP > diff --git a/tools/usb/usbip/doc/usbipd.8 b/tools/usb/usbip/doc/usbipd.8 > index fb62a756893b..53c8d5792de6 100644 > --- a/tools/usb/usbip/doc/usbipd.8 > +++ b/tools/usb/usbip/doc/usbipd.8 > @@ -29,6 +29,12 @@ Bind to IPv4. Default is both. > Bind to IPv6. Default is both. > .PP > > +.HP > +\fB\-e\fR, \fB\-\-device\fR > +.IP > +Run in device mode. Rather than drive an attached device, create a virtual UDC to bind gadgets to. > +.PP > + > .HP > \fB\-D\fR, \fB\-\-daemon\fR > .IP > @@ -86,6 +92,22 @@ USB/IP client can connect and use exported devices. > - A usb device 1-2 is now exportable to other hosts! > - Use 'usbip unbind --busid=1-2' when you want to shutdown exporting and use the device locally. > > +The following example shows the use of device mode > + > + server:# modprobe usbip-vudc > + - Use /sys/class/udc/ interface > + - usbip-host is independent of this module. > + > + server:# usbipd -e -D > + - Start usbip daemon in device mode. > + > + server:# modprobe g_mass_storage file=/tmp/tmp.img > + - Bind a gadget to usbip-vudc > + - in this example, a mass storage gadget is bound > + > + server:# usbip list --device > + - Note this is the server side > + > .SH "SEE ALSO" > \fBusbip\fP\fB(8)\fB\fP > > thanks, -- Shuah