mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <shuah.kh@samsung.com>
To: Valentina Manea <valentina.manea.m@gmail.com>,
	gregkh@linuxfoundation.org
Cc: tobias.polzer@fau.de, dominik.paulus@fau.de,
	ly80toro@cip.cs.fau.de, ihadzic@research.bell-labs.com,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	devel@driverdev.osuosl.org, firefly@lists.rosedu.org,
	Shuah Khan <shuah.kh@samsung.com>
Subject: Re: [PATCH 05/12] staging: usbip: userspace: re-add interface information listing
Date: Thu, 06 Mar 2014 14:11:52 -0700	[thread overview]
Message-ID: <5318E498.2090800@samsung.com> (raw)
In-Reply-To: <1393960252-21247-6-git-send-email-valentina.manea.m@gmail.com>

On 03/04/2014 12:10 PM, Valentina Manea wrote:
> This was deleted in the driver conversion patch. It didn't need
> to be deleted; showing more information is ok.
>
> Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
> ---
>   drivers/staging/usbip/userspace/src/usbip_list.c | 20 +++++++++++++++++++-
>   drivers/staging/usbip/userspace/src/usbipd.c     | 16 +++++++++++++++-
>   2 files changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/usbip/userspace/src/usbip_list.c b/drivers/staging/usbip/userspace/src/usbip_list.c
> index 2255107..7e1820a 100644
> --- a/drivers/staging/usbip/userspace/src/usbip_list.c
> +++ b/drivers/staging/usbip/userspace/src/usbip_list.c
> @@ -52,8 +52,9 @@ static int get_exported_devices(char *host, int sockfd)
>   	struct op_devlist_reply reply;
>   	uint16_t code = OP_REP_DEVLIST;
>   	struct usbip_usb_device udev;
> +	struct usbip_usb_interface uintf;
>   	unsigned int i;
> -	int rc;
> +	int rc, j;
>
>   	rc = usbip_net_send_op_common(sockfd, OP_REQ_DEVLIST, 0);
>   	if (rc < 0) {
> @@ -103,6 +104,23 @@ static int get_exported_devices(char *host, int sockfd)
>   		printf("%11s: %s\n", "", udev.path);
>   		printf("%11s: %s\n", "", class_name);
>
> +		for (j = 0; j < udev.bNumInterfaces; j++) {
> +			rc = usbip_net_recv(sockfd, &uintf, sizeof(uintf));
> +			if (rc < 0) {
> +				dbg("usbip_net_recv failed: usbip_usb_intf[%d]",
> +						j);

Please use err() instead of dbg() so this error is reported when it 
happens, not just when usbip_use_debug is enabled.

> +
> +				return -1;
> +			}
> +			usbip_net_pack_usb_interface(0, &uintf);
> +
> +			usbip_names_get_class(class_name, sizeof(class_name),
> +					uintf.bInterfaceClass,
> +					uintf.bInterfaceSubClass,
> +					uintf.bInterfaceProtocol);
> +			printf("%11s: %2d - %s\n", "", j, class_name);
> +		}
> +
>   		printf("\n");
>   	}
>
> diff --git a/drivers/staging/usbip/userspace/src/usbipd.c b/drivers/staging/usbip/userspace/src/usbipd.c
> index c2b3ced..b2230f7 100644
> --- a/drivers/staging/usbip/userspace/src/usbipd.c
> +++ b/drivers/staging/usbip/userspace/src/usbipd.c
> @@ -159,8 +159,9 @@ static int send_reply_devlist(int connfd)
>   {
>   	struct usbip_exported_device *edev;
>   	struct usbip_usb_device pdu_udev;
> +	struct usbip_usb_interface pdu_uinf;
>   	struct op_devlist_reply reply;
> -	int rc;
> +	int rc, i;
>
>   	reply.ndev = 0;
>   	/* number of exported devices */
> @@ -194,6 +195,19 @@ static int send_reply_devlist(int connfd)
>   			dbg("usbip_net_send failed: pdu_udev");

Same comment as above.

>   			return -1;
>   		}
> +
> +		for (i = 0; i < edev->udev.bNumInterfaces; i++) {
> +			dump_usb_interface(&edev->uinf[i]);
> +			memcpy(&pdu_uinf, &edev->uinf[i], sizeof(pdu_uinf));
> +			usbip_net_pack_usb_interface(1, &pdu_uinf);
> +
> +			rc = usbip_net_send(connfd, &pdu_uinf,
> +					sizeof(pdu_uinf));
> +			if (rc < 0) {
> +				dbg("usbip_net_send failed: pdu_uinf");

Same comment as above.

> +				return -1;
> +			}
> +		}
>   	}
>
>   	return 0;
>

You have my Reviewed-by after making the recommended changes.

Reviewed-by: Shuah Khan <shuah.kh@samsung.com>

-- Shuah

-- 
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658

  reply	other threads:[~2014-03-06 21:11 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 19:10 [PATCH 00/12] Migrate usbip-utils to libudev Valentina Manea
2014-03-04 19:10 ` [PATCH 01/12] staging: usbip: userspace: migrate usbip_bind " Valentina Manea
2014-03-05  9:42   ` Dan Carpenter
2014-03-05 10:15     ` Dan Carpenter
2014-03-06  6:17       ` Valentina Manea
2014-03-05  9:56   ` Dan Carpenter
2014-03-06 16:15   ` Shuah Khan
2014-03-06 18:19     ` Dan Carpenter
2014-03-04 19:10 ` [PATCH 02/12] staging: usbip: userspace: remove useless libsysfs includes Valentina Manea
2014-03-04 19:10 ` [PATCH 03/12] staging: usbip: userspace: migrate usbip_unbind to libudev Valentina Manea
2014-03-06 16:31   ` Shuah Khan
2014-03-04 19:10 ` [PATCH 04/12] staging: usbip: userspace: migrate usbip_list " Valentina Manea
2014-03-06 20:57   ` Shuah Khan
2014-03-04 19:10 ` [PATCH 05/12] staging: usbip: userspace: re-add interface information listing Valentina Manea
2014-03-06 21:11   ` Shuah Khan [this message]
2014-03-04 19:10 ` [PATCH 06/12] staging: usbip: userspace: add new list API Valentina Manea
2014-03-05  6:35   ` Greg KH
2014-03-05 10:16     ` Dan Carpenter
     [not found]       ` <CAByK=5bzS4R0sGj5w5x8gc8DcKXvnr58WskoShuq6G30YTsOgQ@mail.gmail.com>
2014-03-06 19:55         ` [firefly] " Greg KH
2014-03-04 19:10 ` [PATCH 07/12] staging: usbip: userspace: move sysfs_utils to libsrc Valentina Manea
2014-03-04 19:10 ` [PATCH 08/12] staging: usbip: userspace: migrate usbip_host_driver to libudev Valentina Manea
2014-03-06 21:43   ` Shuah Khan
2014-03-04 19:10 ` [PATCH 09/12] staging: usbip: userspace: remove class device infrastructure in vhci_driver Valentina Manea
2014-03-06 21:59   ` Shuah Khan
2014-03-04 19:10 ` [PATCH 10/12] staging: usbip: userspace: migrate vhci_driver to libudev Valentina Manea
2014-03-06 22:07   ` Shuah Khan
2014-03-04 19:10 ` [PATCH 11/12] staging: usbip: userspace: remove libsysfs flag and autoconf check Valentina Manea
2014-03-04 19:10 ` [PATCH 12/12] staging: usbip: userspace: update dependencies in README Valentina Manea
2014-03-05  6:37 ` [PATCH 00/12] Migrate usbip-utils to libudev Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5318E498.2090800@samsung.com \
    --to=shuah.kh@samsung.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dominik.paulus@fau.de \
    --cc=firefly@lists.rosedu.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ihadzic@research.bell-labs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ly80toro@cip.cs.fau.de \
    --cc=tobias.polzer@fau.de \
    --cc=valentina.manea.m@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome