Re: Report ID problem with HID-RAW interface usage

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

 



On Tue, 29 Jun 2010, Alan Ott wrote:

> > i am trying to send a vendor specific HID report from a userspace host
> > program to vendor usb hid device
> > using HIDRAW interface .
> > 
> > 
> > but when i send report in the format<  "Report ID "(0th byte )>
> > <Report ID (1st byte )>  <  "data payload">
> > i am getting perfect report response from usb device .
> >   where we use usb_control_msg as  :
> > 
> > ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
> > 		HID_REQ_SET_REPORT,
> > 		USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
> > 		cpu_to_le16(((HID_OUTPUT_REPORT + 1)<<  8) | *buf),
> > 		interface->desc.bInterfaceNumber, buf + 1, count - 1,
> > 		USB_CTRL_SET_TIMEOUT);
> > 
> >    
> 
> I thought I'd be able to just go check the HID specification and be able to
> say that the report number is not sent as part of the payload for Set_Report
> devices, since it would be redundant because the Report ID is sent over in the
> wValue field.
> 
> Unfortunately, I was not able to see that clearly laid out in the HID
> specification in the section on Set_Report. I did however find language saying
> "if a Report ID tag was used in the Report descriptor, all reports include a
> single byte ID prefix," in section 8.1, Report Types.
> 
> I did some tests with the Windows implementation, and indeed, when numbered
> reports are used in the HID descriptor, the Windows implementation will send
> the report ID as the first byte of the payload.
> 
> Based on the language in the HID spec, and the behavior of Windows, I believe
> the buf+1, count-1 to be a bug.
> 
> Jiri, what do you think? Can you confirm?

Correct, it is a bug indeed.

Does any of you guys already have a patch handy which I could apply? 
Otherwise I'll fix it myself.

Thanks for spotting it,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" 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 Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux