Re: USB-HID

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

 



On Fri, 30 Aug 2013, Kasi Viswanathan wrote:

> Hi,
> 
> > I have a custom device, which is usb-hid. But, when i plug it in the
> system,
> > it is not recognized as a usb-hid device. I have put prints on the
> > usbhid_probe() function, to confirm that, but there is no prints in the
> > dmesg, which confirms that this is not recognized as a usb-hid device.
> 
> This means that the device's descriptors are bad.  What does "lsusb -v"
> show?
> 
> Kasi : lsusb -v shows the following info.
> /dev/bus/usb/001/008:
>   Device Descriptor
>     bcdUSB: 0110
>     bDeviceClass: ff

0xff means the device class is vendor-specific.  Hence there is no way 
for the system to tell whether it is or isn't HID.

If this value were set to 0 instead, then the system would look at the 
interface descriptor's bInterfaceClass value, which does indicate that 
the interface is HID.

>     bDeviceSubClass: 00
>     bDeviceProtocol: 00
>     bMaxPacketSize0: 08
>     idVendor: 0451
>     idProduct: 2f90
>     bcdDevice: 1111
>     iManufacturer: 00
>     iProduct: 00
>     iSerialNumber: 00
>     bNumConfiguration: 01
> 
>   Config Descriptor
>     wTotalLength: 0029
>     bNumInterfaces: 01
>     bConfigurationValue: 01
>     iConfiguration: 00
>     bmAttributes: 80
>     bMaxPower: 100 mA
> 
>   Interface Descriptor
>     bInterfaceNumber: 00
>     bAlternateSetting: 00
>     bNumEndpoints: 02
>     bInterfaceClass: 03

0x03 is USB_CLASS_HID.

> > Is there any simple code, which can list all the usb-hid devices that are
> > connected to the pc?
> 
> How will that help?
> 
> Kasi : If i have a simple code, then i can once for all determine, if the
> HID descriptor provided by the device is valid or not.
> 
> Kindly let me know your view on the same.

Listing all the USB HID devices on a PC will not tell you whether the 
descriptor is valid.  The only way to do that is to validate the 
descriptor.

Alan Stern

--
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