Re: current version of http://www.linux-usb.org/usbtest/ testusb.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello greg,

> It should be changed to point to where the usbfs files are now located
> (i.e. /dev/bus/usb/ instead of the old usbfs mount point.)

Thanks, your suggestion helped.

I changed /proc/bus/usb/BBB/DDD  to /dev/bus/usb/BBB/DDD, and,
/proc/bus/usb/devices to /sys/kernel/debug/usb/devices in testusb.c. I
still have the below isuse when I run testusb.

smart_sudo ./testusb -D 006
./testusb: 006 may see only control tests
can't open dev file r/w: No such file or directory
- (0:i:/dev/bus/usb)  -  -  -  -  -  -  -  -  -  -  -
ls -altr 006
total 0
drwxr-xr-x 2 root root       60 Sep  8 13:09 .
drwxr-xr-x 9 root root      180 Sep  8 13:09 ..
crw-rw-r-- 1 root usb  189, 640 Sep  8 13:09 001
- (0:i:/dev/bus/usb)  -  -  -  -  -  -  -  -  -  -  -
ls -altr
total 0
drwxr-xr-x 3 root root  60 Sep  8 13:08 ..
drwxr-xr-x 2 root root  60 Sep  8 13:08 003
drwxr-xr-x 2 root root  60 Sep  8 13:08 004
drwxr-xr-x 2 root root  60 Sep  8 13:08 005
drwxr-xr-x 2 root root 100 Sep  8 13:08 002
drwxr-xr-x 2 root root 160 Sep  8 13:08 001
drwxr-xr-x 2 root root  60 Sep  8 13:09 006
drwxr-xr-x 2 root root  60 Sep  8 13:09 007
drwxr-xr-x 9 root root 180 Sep  8 13:09 .
- (0:i:/dev/bus/usb)  -  -  -  -  -  -  -  -  -  -  -

Just wanted to check if you have any thoughts, please?

Thanks
Joe


Changes made to testusb.c:

@@ -1,8 +1,9 @@
 /* $(CROSS_COMPILE)cc -Wall -g -lpthread -o testusb testusb.c */
+/* got this script from  http://www.linux-usb.org/usbtest/ */

 /*
  * Copyright (c) 2002 by David Brownell
- *
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  * Free Software Foundation; either version 2 of the License, or (at your
@@ -172,9 +173,11 @@ static int find_testdev (const char *name, const
struct stat *sb, int flag)
        int                             fd;
        struct usb_device_descriptor    dev;

+/*     fprintf (stdout, "name: %s\n", name); */
        if (flag != FTW_F)
                return 0;
-       /* ignore /proc/bus/usb/{devices,drivers} */
+
+       /* ignore /dev/bus/usb/{devices,drivers} */
        if (strrchr (name, '/')[1] == 'd')
                return 0;

@@ -234,6 +237,8 @@ static void *handle_testdev (void *arg)
        int                     fd, i;
        int                     status;

+/*     printf ("dev->name: %s\n", dev->name); */
+/*     fflush (stdout); */
        if ((fd = open (dev->name, O_RDWR)) < 0) {
                perror ("can't open dev file r/w");
                return 0;
@@ -357,17 +362,17 @@ usage:
                goto usage;
        if (!all && !device) {
                fprintf (stderr, "must specify '-a' or '-D dev', "
-                       "or DEVICE=/proc/bus/usb/BBB/DDD in env\n");
+                       "or DEVICE=/dev/bus/usb/BBB/DDD in env\n");
                goto usage;
        }

-       if ((c = open ("/proc/bus/usb/devices", O_RDONLY)) < 0) {
+       if ((c = open ("/sys/kernel/debug/usb/devices", O_RDONLY)) < 0) {
                fputs ("usbfs files are missing\n", stderr);
                return -1;
        }

        /* collect and list the test devices */
-       if (ftw ("/proc/bus/usb", find_testdev, 3) != 0) {
+       if (ftw ("/dev/bus/usb", find_testdev, 3) != 0) {
                fputs ("ftw failed; is usbfs missing?\n", stderr);
                return -1;
        }
(END)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux