#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sched.h>
+#include "hid-ids.h"
#include "hid-logitech-hidpp.h"
MODULE_LICENSE("GPL");
sizeof(struct hidpp_report),
HID_OUTPUT_REPORT);
- return (sent_bytes < 0) ? sent_bytes : 0;
+ /* It seems that sending via bluetooth can return -EIO even
+ * when the message is delivered, so we have this hack: */
+ return (sent_bytes < 0 && sent_bytes != -EIO) ? sent_bytes : 0;
}
static int hidpp_send_message_sync(struct hidpp_device *hidpp_dev,
memset(&message, 0, sizeof(message));
message.report_id = report_id;
+ /* If sending to a non-DJ device, device expects 0xff. If sending to
+ * a DJ device, this device_index will be overwritten by the DJ code: */
+ message.device_index = 0xff;
message.rap.sub_id = sub_id;
message.rap.reg_address = reg_address;
memcpy(&message.rap.params, params, param_count);
params[0] = feature_id >> 8;
params[1] = feature_id & 0xff;
ret = hidpp_send_hidpp2_sync(hidpp_dev,
- REPORT_ID_HIDPP_SHORT,
+ REPORT_ID_HIDPP_LONG,
0,
0,
software_id,
hidpp_print_raw_event("hidpp_raw_event", data, size);
- if ((report->report_id != REPORT_ID_HIDPP_LONG) &&
- (report->report_id != REPORT_ID_HIDPP_SHORT)) {
+ if (!(report->report_id == REPORT_ID_HIDPP_LONG ||
+ report->report_id == REPORT_ID_HIDPP_SHORT ||
+ (report->report_id == T651_REPORT_TYPE_MOUSE &&
+ hdev->product == USB_DEVICE_ID_WIRELESS_TOUCHPAD_T651))) {
dbg_hid("hid-logitech-hidpp.c:%s: ignore report_id:%d\n",
__func__, report->report_id);
return 0;