Re: [Libusb-devel] libusb silently ignores permission errors

"Xiaofan Chen" <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On 9/24/07, Alan Stern <[email protected]> wrote:
> On Mon, 24 Sep 2007, Xiaofan Chen wrote:
>
> > By the way, how do you like the idea of getting a console
> > version of usbview to replace lsusb? I think it will address the
> > problem of the original poster of this thread. My problem
> > seems a bit different -- after all is a firmware bug. It
> > seems to me that USBView does not use libusb. Or something
> > uses sysfs.
>
> I don't use USBView, so I can't say for certain.
>
> But I doubt it will replace lsusb, unless it has something like lsusb's
> -v option.  With -v there's no way to avoid unsuspending the device,
> since the necessary information isn't all stored in the kernel.

That is ok (unsuspend the device). The original thread is about
a wrong udev rule will make lsusb (based on libusb) not to list
the device and not showing any error message.

> If all you want is a console display of the existing USB devices, you
> don't need either USBView or lsusb.  All you have to do is "cat
> /proc/bus/usb/devices".
>

Yes I guess this is enough in some cases. But normally "lsusb -v"
is quite useful. The main thing seems to be that no much movement
on the libusb front. Maybe openusb will change that...

It seems to me systool (from sysfsutils) might be extended to replace lsusb.
Just an idea. Not really important to me now.

Eg:
mcuee@mcuee-desktop:~$ systool -b usb -v
...
 Device = "2-4:1.0"
 Device path = "/sys/devices/pci0000:00/0000:00:02.1/usb2/2-4/2-4:1.0"
   bAlternateSetting   = " 0"
   bInterfaceClass     = "00"
   bInterfaceNumber    = "00"
   bInterfaceProtocol  = "00"
   bInterfaceSubClass  = "00"
   bNumEndpoints       = "02"
   modalias            = "usb:v04D8p000Bd0000dc00dsc00dp00ic00isc00ip00"
   uevent              = "DEVTYPE=usb_interface
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/002/002
PRODUCT=4d8/b/0
TYPE=0/0/0
INTERFACE=0/0/0
MODALIAS=usb:v04D8p000Bd0000dc00dsc00dp00ic00isc00ip00"

 Device = "2-4"
 Device path = "/sys/devices/pci0000:00/0000:00:02.1/usb2/2-4"
   bConfigurationValue = "1"
   bDeviceClass        = "00"
   bDeviceProtocol     = "00"
   bDeviceSubClass     = "00"
   bMaxPacketSize0     = "8"
   bMaxPower           = "100mA"
   bNumConfigurations  = "1"
   bNumInterfaces      = " 1"
   bcdDevice           = "0000"
   bmAttributes        = "80"
   busnum              = "2"
   configuration       =
   devnum              = "2"
   dev                 = "189:129"
   idProduct           = "000b"
   idVendor            = "04d8"
   maxchild            = "0"
   quirks              = "0x0"
   speed               = "12"
   uevent              = "MAJOR=189
MINOR=129
DEVTYPE=usb_device
DRIVER=usb
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
DEVICE=/proc/bus/usb/002/002
PRODUCT=4d8/b/0
TYPE=0/0/0
BUSNUM=002
DEVNUM=002"
   version             = " 2.00"

mcuee@mcuee-desktop:~$ lsusb -v
...
Bus 002 Device 002: ID 04d8:000b Microchip Technology, Inc.
Device Descriptor:
 bLength                18
 bDescriptorType         1
 bcdUSB               2.00
 bDeviceClass            0 (Defined at Interface level)
 bDeviceSubClass         0
 bDeviceProtocol         0
 bMaxPacketSize0         8
 idVendor           0x04d8 Microchip Technology, Inc.
 idProduct          0x000b
 bcdDevice            0.00
 iManufacturer           0
 iProduct                0
 iSerial                 0
 bNumConfigurations      1
 Configuration Descriptor:
   bLength                 9
   bDescriptorType         2
   wTotalLength           32
   bNumInterfaces          1
   bConfigurationValue     1
   iConfiguration          0
   bmAttributes         0x80
     (Bus Powered)
   MaxPower              100mA
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        0
     bAlternateSetting       0
     bNumEndpoints           2
     bInterfaceClass         0 (Defined at Interface level)
     bInterfaceSubClass      0
     bInterfaceProtocol      0
     iInterface              0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0040  1x 64 bytes
       bInterval               0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x81  EP 1 IN
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0040  1x 64 bytes
       bInterval               0
cannot read device status, Broken pipe (32)
...

Xiaofan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.