diff options
| -rw-r--r-- | include/libirecovery.h | 2 | ||||
| -rw-r--r-- | src/libirecovery.c | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h index f4e62c7..daf1761 100644 --- a/include/libirecovery.h +++ b/include/libirecovery.h | |||
| @@ -100,7 +100,7 @@ irecv_error_t irecv_trigger_limera1n_exploit(irecv_client_t client); | |||
| 100 | 100 | ||
| 101 | /* usb helpers */ | 101 | /* usb helpers */ |
| 102 | irecv_error_t irecv_usb_set_configuration(irecv_client_t client, int configuration); | 102 | irecv_error_t irecv_usb_set_configuration(irecv_client_t client, int configuration); |
| 103 | irecv_error_t irecv_usb_set_interface(irecv_client_t client, int interface, int alt_interface); | 103 | irecv_error_t irecv_usb_set_interface(irecv_client_t client, int usb_interface, int usb_alt_interface); |
| 104 | int irecv_usb_control_transfer(irecv_client_t client, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, unsigned char *data, uint16_t w_length, unsigned int timeout); | 104 | int irecv_usb_control_transfer(irecv_client_t client, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, unsigned char *data, uint16_t w_length, unsigned int timeout); |
| 105 | int irecv_usb_bulk_transfer(irecv_client_t client, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout); | 105 | int irecv_usb_bulk_transfer(irecv_client_t client, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout); |
| 106 | 106 | ||
diff --git a/src/libirecovery.c b/src/libirecovery.c index 8b4864c..f8292d1 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -721,26 +721,26 @@ irecv_error_t irecv_usb_set_configuration(irecv_client_t client, int configurati | |||
| 721 | return IRECV_E_SUCCESS; | 721 | return IRECV_E_SUCCESS; |
| 722 | } | 722 | } |
| 723 | 723 | ||
| 724 | irecv_error_t irecv_usb_set_interface(irecv_client_t client, int interface, int alt_interface) { | 724 | irecv_error_t irecv_usb_set_interface(irecv_client_t client, int usb_interface, int usb_alt_interface) { |
| 725 | if (check_context(client) != IRECV_E_SUCCESS) | 725 | if (check_context(client) != IRECV_E_SUCCESS) |
| 726 | return IRECV_E_NO_DEVICE; | 726 | return IRECV_E_NO_DEVICE; |
| 727 | 727 | ||
| 728 | debug("Setting to interface %d:%d\n", interface, alt_interface); | 728 | debug("Setting to interface %d:%d\n", usb_interface, usb_alt_interface); |
| 729 | #ifndef WIN32 | 729 | #ifndef WIN32 |
| 730 | if (libusb_claim_interface(client->handle, interface) < 0) { | 730 | if (libusb_claim_interface(client->handle, usb_interface) < 0) { |
| 731 | return IRECV_E_USB_INTERFACE; | 731 | return IRECV_E_USB_INTERFACE; |
| 732 | } | 732 | } |
| 733 | 733 | ||
| 734 | if (libusb_set_interface_alt_setting(client->handle, interface, alt_interface) < 0) { | 734 | if (libusb_set_interface_alt_setting(client->handle, usb_interface, usb_alt_interface) < 0) { |
| 735 | return IRECV_E_USB_INTERFACE; | 735 | return IRECV_E_USB_INTERFACE; |
| 736 | } | 736 | } |
| 737 | #else | 737 | #else |
| 738 | if (irecv_usb_control_transfer(client, 0, 0x0B, alt_interface, interface, NULL, 0, USB_TIMEOUT) < 0) { | 738 | if (irecv_usb_control_transfer(client, 0, 0x0B, usb_alt_interface, usb_interface, NULL, 0, USB_TIMEOUT) < 0) { |
| 739 | return IRECV_E_USB_INTERFACE; | 739 | return IRECV_E_USB_INTERFACE; |
| 740 | } | 740 | } |
| 741 | #endif | 741 | #endif |
| 742 | client->interface = interface; | 742 | client->interface = usb_interface; |
| 743 | client->alt_interface = alt_interface; | 743 | client->alt_interface = usb_alt_interface; |
| 744 | 744 | ||
| 745 | return IRECV_E_SUCCESS; | 745 | return IRECV_E_SUCCESS; |
| 746 | } | 746 | } |
