From fb8d593cfea094dd50d74873c8c00445eb0a040f Mon Sep 17 00:00:00 2001 From: Marc Schink Date: Tue, 2 Jul 2013 21:52:23 +0200 Subject: [PATCH] Use GET_REPORT request for device to host transfer. --- hardware/ikalogic-scanalogic2/api.c | 2 +- hardware/ikalogic-scanalogic2/protocol.c | 2 +- hardware/ikalogic-scanalogic2/protocol.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hardware/ikalogic-scanalogic2/api.c b/hardware/ikalogic-scanalogic2/api.c index 91512082..4f1d09fb 100644 --- a/hardware/ikalogic-scanalogic2/api.c +++ b/hardware/ikalogic-scanalogic2/api.c @@ -161,7 +161,7 @@ static GSList *scan(GSList *options) PACKET_LENGTH); libusb_fill_control_setup(devc->xfer_buf_in, - USB_REQUEST_TYPE_IN, USB_HID_SET_REPORT, + USB_REQUEST_TYPE_IN, USB_HID_GET_REPORT, USB_HID_REPORT_TYPE_FEATURE, USB_INTERFACE, PACKET_LENGTH); libusb_fill_control_setup(devc->xfer_buf_out, diff --git a/hardware/ikalogic-scanalogic2/protocol.c b/hardware/ikalogic-scanalogic2/protocol.c index 4ed690b6..29e374bc 100644 --- a/hardware/ikalogic-scanalogic2/protocol.c +++ b/hardware/ikalogic-scanalogic2/protocol.c @@ -752,7 +752,7 @@ SR_PRIV int sl2_get_device_info(struct sr_usb_dev_inst usb, SR_PRIV int sl2_transfer_in(libusb_device_handle *dev_handle, uint8_t *data) { return libusb_control_transfer(dev_handle, USB_REQUEST_TYPE_IN, - USB_HID_SET_REPORT, USB_HID_REPORT_TYPE_FEATURE, USB_INTERFACE, + USB_HID_GET_REPORT, USB_HID_REPORT_TYPE_FEATURE, USB_INTERFACE, (unsigned char *)data, PACKET_LENGTH, USB_TIMEOUT); } diff --git a/hardware/ikalogic-scanalogic2/protocol.h b/hardware/ikalogic-scanalogic2/protocol.h index 1756ed96..adc38592 100644 --- a/hardware/ikalogic-scanalogic2/protocol.h +++ b/hardware/ikalogic-scanalogic2/protocol.h @@ -49,6 +49,7 @@ #define USB_REQUEST_TYPE_OUT (LIBUSB_REQUEST_TYPE_CLASS | \ LIBUSB_RECIPIENT_INTERFACE | LIBUSB_ENDPOINT_OUT) +#define USB_HID_GET_REPORT 0x01 #define USB_HID_SET_REPORT 0x09 #define USB_HID_REPORT_TYPE_FEATURE 0x300