diff options
Diffstat (limited to 'src/libirecovery.c')
| -rw-r--r-- | src/libirecovery.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index 8b90ac5..38e7915 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -214,7 +214,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec | |||
| 214 | irecv_client_t _client = (irecv_client_t) malloc(sizeof(struct irecv_client_private)); | 214 | irecv_client_t _client = (irecv_client_t) malloc(sizeof(struct irecv_client_private)); |
| 215 | memset(_client, 0, sizeof(struct irecv_client_private)); | 215 | memset(_client, 0, sizeof(struct irecv_client_private)); |
| 216 | 216 | ||
| 217 | // Get DFU paths | 217 | /* get DFU paths */ |
| 218 | usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); | 218 | usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); |
| 219 | memset(¤tInterface, '\0', sizeof(SP_DEVICE_INTERFACE_DATA)); | 219 | memset(¤tInterface, '\0', sizeof(SP_DEVICE_INTERFACE_DATA)); |
| 220 | currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); | 220 | currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); |
| @@ -245,7 +245,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec | |||
| 245 | 245 | ||
| 246 | if (ecid == IRECV_K_WTF_MODE) { | 246 | if (ecid == IRECV_K_WTF_MODE) { |
| 247 | if (_client->mode != IRECV_K_WTF_MODE) { | 247 | if (_client->mode != IRECV_K_WTF_MODE) { |
| 248 | // special ecid case, ignore !IRECV_K_WTF_MODE | 248 | /* special ecid case, ignore !IRECV_K_WTF_MODE */ |
| 249 | continue; | 249 | continue; |
| 250 | } else { | 250 | } else { |
| 251 | ecid = 0; | 251 | ecid = 0; |
| @@ -253,7 +253,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec | |||
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | if ((ecid != 0) && (_client->mode == IRECV_K_WTF_MODE)) { | 255 | if ((ecid != 0) && (_client->mode == IRECV_K_WTF_MODE)) { |
| 256 | // we can't get ecid in WTF mode | 256 | /* we can't get ecid in WTF mode */ |
| 257 | mobiledevice_closepipes(_client); | 257 | mobiledevice_closepipes(_client); |
| 258 | continue; | 258 | continue; |
| 259 | } | 259 | } |
| @@ -305,7 +305,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec | |||
| 305 | return IRECV_E_SUCCESS; | 305 | return IRECV_E_SUCCESS; |
| 306 | } | 306 | } |
| 307 | 307 | ||
| 308 | // Get iBoot path | 308 | /* get iBoot path */ |
| 309 | usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_IBOOT, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); | 309 | usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_IBOOT, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); |
| 310 | memset(¤tInterface, '\0', sizeof(SP_DEVICE_INTERFACE_DATA)); | 310 | memset(¤tInterface, '\0', sizeof(SP_DEVICE_INTERFACE_DATA)); |
| 311 | currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); | 311 | currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); |
| @@ -335,7 +335,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec | |||
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | if ((ecid != 0) && (_client->mode == IRECV_K_WTF_MODE)) { | 337 | if ((ecid != 0) && (_client->mode == IRECV_K_WTF_MODE)) { |
| 338 | // we can't get ecid in WTF mode | 338 | /* we can't get ecid in WTF mode */ |
| 339 | mobiledevice_closepipes(_client); | 339 | mobiledevice_closepipes(_client); |
| 340 | continue; | 340 | continue; |
| 341 | } | 341 | } |
| @@ -602,7 +602,7 @@ irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned long long e | |||
| 602 | 602 | ||
| 603 | if (ecid == IRECV_K_WTF_MODE) { | 603 | if (ecid == IRECV_K_WTF_MODE) { |
| 604 | if (usb_descriptor.idProduct != IRECV_K_WTF_MODE) { | 604 | if (usb_descriptor.idProduct != IRECV_K_WTF_MODE) { |
| 605 | // special ecid case, ignore !IRECV_K_WTF_MODE | 605 | /* special ecid case, ignore !IRECV_K_WTF_MODE */ |
| 606 | continue; | 606 | continue; |
| 607 | } else { | 607 | } else { |
| 608 | ecid = 0; | 608 | ecid = 0; |
| @@ -610,7 +610,7 @@ irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned long long e | |||
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | if ((ecid != 0) && (usb_descriptor.idProduct == IRECV_K_WTF_MODE)) { | 612 | if ((ecid != 0) && (usb_descriptor.idProduct == IRECV_K_WTF_MODE)) { |
| 613 | // we can't get ecid in WTF mode | 613 | /* we can't get ecid in WTF mode */ |
| 614 | continue; | 614 | continue; |
| 615 | } | 615 | } |
| 616 | 616 | ||
| @@ -734,9 +734,6 @@ irecv_error_t irecv_usb_set_interface(irecv_client_t client, int interface, int | |||
| 734 | 734 | ||
| 735 | debug("Setting to interface %d:%d\n", interface, alt_interface); | 735 | debug("Setting to interface %d:%d\n", interface, alt_interface); |
| 736 | #ifndef WIN32 | 736 | #ifndef WIN32 |
| 737 | // pod2g 2011-01-07: we may want to claim multiple interfaces | ||
| 738 | //libusb_release_interface(client->handle, client->interface); | ||
| 739 | |||
| 740 | if (libusb_claim_interface(client->handle, interface) < 0) { | 737 | if (libusb_claim_interface(client->handle, interface) < 0) { |
| 741 | return IRECV_E_USB_INTERFACE; | 738 | return IRECV_E_USB_INTERFACE; |
| 742 | } | 739 | } |
| @@ -1125,7 +1122,7 @@ irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, un | |||
| 1125 | } | 1122 | } |
| 1126 | 1123 | ||
| 1127 | if (dfuNotifyFinished == 2) { | 1124 | if (dfuNotifyFinished == 2) { |
| 1128 | // we send a pseudo ZLP here just in case | 1125 | /* we send a pseudo ZLP here just in case */ |
| 1129 | irecv_usb_control_transfer(client, 0x21, 1, 0, 0, 0, 0, USB_TIMEOUT); | 1126 | irecv_usb_control_transfer(client, 0x21, 1, 0, 0, 0, 0, USB_TIMEOUT); |
| 1130 | } | 1127 | } |
| 1131 | 1128 | ||
