Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259981
b: refs/heads/master
c: b9d65b1
h: refs/heads/master
i:
  259979: 809da01
v: v3
  • Loading branch information
matt mooney authored and Greg Kroah-Hartman committed Jul 6, 2011
1 parent a037421 commit 63577d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 622dde8105488e4dfee94cc352c3b7d78f7cc495
refs/heads/master: b9d65b1dd30abdb585e6750e4edfc8ce3b3ab28a
17 changes: 11 additions & 6 deletions trunk/drivers/staging/usbip/userspace/src/usbip_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void usbip_list_usage(void)
printf("usage: %s", usbip_list_usage_string);
}

static int get_exported_devices(int sockfd)
static int get_exported_devices(char *host, int sockfd)
{
char product_name[100];
char class_name[100];
Expand Down Expand Up @@ -77,6 +77,15 @@ static int get_exported_devices(int sockfd)
PACK_OP_DEVLIST_REPLY(0, &reply);
dbg("exportable devices: %d\n", reply.ndev);

if (reply.ndev == 0) {
info("no exportable devices found on %s", host);
return 0;
}

printf("Exportable USB devices\n");
printf("======================\n");
printf(" - %s\n", host);

for (i = 0; i < reply.ndev; i++) {
memset(&udev, 0, sizeof(udev));
rc = usbip_recv(sockfd, &udev, sizeof(udev));
Expand Down Expand Up @@ -128,11 +137,7 @@ static int list_exported_devices(char *host)
}
dbg("connected to %s:%s", host, USBIP_PORT_STRING);

printf("Exportable USB devices\n");
printf("======================\n");
printf(" - %s\n", host);

rc = get_exported_devices(sockfd);
rc = get_exported_devices(host, sockfd);
if (rc < 0) {
err("failed to get device list from %s", host);
return -1;
Expand Down

0 comments on commit 63577d2

Please sign in to comment.