Re: hidraw, sixaxis and output reports.

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

 



On 10/02/2010 11:59 AM, Antonio Ospite wrote:
Hi,

I am trying to set leds on sixaxis now, and the code I have works OK
with libusb, but the equivalent for hidraw does not.

The procedure to set leds is to send an output report 0x01 with the
correct data. After looking at drivers/usbhid/hid-core.c in
usbhid_output_raw_report() I see that output reports are sent over the
interrupt endpoint when hid->urbout is defined (that is when the device
has an interrupt out ep, right?), but it looks like this particular
device is accepting output reports only on the _control_ endpoint; this
is exactly what the working libusb version does btw.

Just for the record, this dumb hack makes setting leds work on sixaxis
with hidraw:

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index df80532..731c08c 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -841,7 +841,7 @@ static int usbhid_output_raw_report(struct hid_device *hid, __u8 *buf, size_t co
         struct usb_host_interface *interface = intf->cur_altsetting;
         int ret;

-       if (usbhid->urbout&&  report_type != HID_FEATURE_REPORT) {
+       if (0&&  usbhid->urbout&&  report_type != HID_FEATURE_REPORT) {
                 int actual_length;
                 int skipped_report_id = 0;
                 if (buf[0] == 0x0) {

If you are interested in the userspace programs, just ping me.

What can I do to handle this properly? Add another quirk? Something
like HID_QUIRK_NO_INTERRUPT_OUT_EP or HID_QUIRK_FORCE_CONTROL_OUT_EP?

Sounds right to me. If there's an OUT endpoint, the device SHOULD handle output reports on it. Anything else is non-compliant, and I think a quirk makes sense.

That SixAxis is quite a pain....

Alan.



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