Commit 7f02bb62 authored by Mazin Rezk's avatar Mazin Rezk Committed by Jiri Kosina

HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff

Some parts of hid-logitech-dj explicitly referred to 0xff for the
receiver index. This patch changes those references to the
HIDPP_RECEIVER_INDEX definition.
Signed-off-by: default avatarMazin Rezk <mnrzk@protonmail.com>
Reviewed-by: default avatarFilipe Laíns <lains@archlinux.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 1ee1369b
...@@ -1153,7 +1153,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) ...@@ -1153,7 +1153,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
if (!dj_report) if (!dj_report)
return -ENOMEM; return -ENOMEM;
dj_report->report_id = REPORT_ID_DJ_SHORT; dj_report->report_id = REPORT_ID_DJ_SHORT;
dj_report->device_index = 0xFF; dj_report->device_index = HIDPP_RECEIVER_INDEX;
dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES; dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES;
retval = logi_dj_recv_send_report(djrcv_dev, dj_report); retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
kfree(dj_report); kfree(dj_report);
...@@ -1175,7 +1175,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, ...@@ -1175,7 +1175,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
if (djrcv_dev->type == recvr_type_dj) { if (djrcv_dev->type == recvr_type_dj) {
dj_report->report_id = REPORT_ID_DJ_SHORT; dj_report->report_id = REPORT_ID_DJ_SHORT;
dj_report->device_index = 0xFF; dj_report->device_index = HIDPP_RECEIVER_INDEX;
dj_report->report_type = REPORT_TYPE_CMD_SWITCH; dj_report->report_type = REPORT_TYPE_CMD_SWITCH;
dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F; dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F;
dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] = dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] =
...@@ -1204,7 +1204,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, ...@@ -1204,7 +1204,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
memset(buf, 0, HIDPP_REPORT_SHORT_LENGTH); memset(buf, 0, HIDPP_REPORT_SHORT_LENGTH);
buf[0] = REPORT_ID_HIDPP_SHORT; buf[0] = REPORT_ID_HIDPP_SHORT;
buf[1] = 0xFF; buf[1] = HIDPP_RECEIVER_INDEX;
buf[2] = 0x80; buf[2] = 0x80;
buf[3] = 0x00; buf[3] = 0x00;
buf[4] = 0x00; buf[4] = 0x00;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment