Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354726
b: refs/heads/master
c: 9742aec
h: refs/heads/master
v: v3
  • Loading branch information
Sergei Shtylyov authored and Greg Kroah-Hartman committed Feb 8, 2013
1 parent 8ab1e6f commit d50193b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 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: ceb675a9e25c0c11f76f8e72a862caf08d3934d3
refs/heads/master: 9742aecda4d02976535051db4af4830bd98373a1
27 changes: 13 additions & 14 deletions trunk/tools/usb/testusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ static int find_testdev(const char *name, const struct stat *sb, int flag)

entry->ifnum = ifnum;

/* FIXME ask usbfs what speed; update USBDEVFS_CONNECTINFO so
* it tells about high speed etc */
/* FIXME update USBDEVFS_CONNECTINFO so it tells about high speed etc */

fprintf(stderr, "%s speed\t%s\t%u\n",
speed(entry->speed), entry->name, entry->ifnum);
Expand Down Expand Up @@ -351,7 +350,7 @@ static void *handle_testdev (void *arg)
return arg;
}

static const char *usbfs_dir_find(void)
static const char *usb_dir_find(void)
{
static char udev_usb_path[] = "/dev/bus/usb";

Expand Down Expand Up @@ -380,7 +379,7 @@ int main (int argc, char **argv)
int c;
struct testdev *entry;
char *device;
const char *usbfs_dir = NULL;
const char *usb_dir = NULL;
int all = 0, forever = 0, not = 0;
int test = -1 /* all */;
struct usbtest_param param;
Expand All @@ -407,8 +406,8 @@ int main (int argc, char **argv)
case 'D': /* device, if only one */
device = optarg;
continue;
case 'A': /* use all devices with specified usbfs dir */
usbfs_dir = optarg;
case 'A': /* use all devices with specified USB dir */
usb_dir = optarg;
/* FALL THROUGH */
case 'a': /* use all devices */
device = NULL;
Expand Down Expand Up @@ -449,7 +448,7 @@ int main (int argc, char **argv)
"usage: %s [options]\n"
"Options:\n"
"\t-D dev only test specific device\n"
"\t-A usbfs-dir\n"
"\t-A usb-dir\n"
"\t-a test all recognized devices\n"
"\t-l loop forever(for stress test)\n"
"\t-t testnum only run specified case\n"
Expand All @@ -470,18 +469,18 @@ int main (int argc, char **argv)
goto usage;
}

/* Find usbfs mount point */
if (!usbfs_dir) {
usbfs_dir = usbfs_dir_find();
if (!usbfs_dir) {
fputs ("usbfs files are missing\n", stderr);
/* Find usb device subdirectory */
if (!usb_dir) {
usb_dir = usb_dir_find();
if (!usb_dir) {
fputs ("USB device files are missing\n", stderr);
return -1;
}
}

/* collect and list the test devices */
if (ftw (usbfs_dir, find_testdev, 3) != 0) {
fputs ("ftw failed; is usbfs missing?\n", stderr);
if (ftw (usb_dir, find_testdev, 3) != 0) {
fputs ("ftw failed; are USB device files missing?\n", stderr);
return -1;
}

Expand Down

0 comments on commit d50193b

Please sign in to comment.