Subversion Repositories freemyipod

Rev

Rev 770 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 770 Rev 785
Line 56... Line 56...
56
#endif
56
#endif
57
 
57
 
58
    return LIBUSB_SUCCESS;
58
    return LIBUSB_SUCCESS;
59
}
59
}
60
 
60
 
61
int usb_find(const uint16_t vendor_id, const uint16_t product_id, uint8_t* reattach)
61
int usb_find(uint16_t vendor_id, uint16_t product_id, uint8_t* reattach)
62
{
62
{
63
    libusb_device **devs, *dev;
63
    libusb_device **devs, *dev;
64
    ssize_t devs_cnt;
64
    ssize_t devs_cnt;
65
    int res, i;
65
    int res, i;
66
    struct libusb_device_descriptor dev_desc;
66
    struct libusb_device_descriptor dev_desc;
Line 287... Line 287...
287
#endif
287
#endif
288
 
288
 
289
    return LIBUSB_SUCCESS;
289
    return LIBUSB_SUCCESS;
290
}
290
}
291
 
291
 
292
int usb_bulk_transfer(const unsigned char endpoint, void* data, const int length)
292
int usb_bulk_transfer(unsigned char endpoint, void* data, int length)
293
{
293
{
294
    int transferred;
294
    int transferred;
295
    int res;
295
    int res;
296
 
296
 
297
    res = libusb_bulk_transfer(usb_handle, endpoint, (unsigned char*)data, length, &transferred, 30000);
297
    res = libusb_bulk_transfer(usb_handle, endpoint, (unsigned char*)data, length, &transferred, 30000);
Line 307... Line 307...
307
    }
307
    }
308
 
308
 
309
    return LIBUSB_SUCCESS;
309
    return LIBUSB_SUCCESS;
310
}
310
}
311
 
311
 
312
int usb_close(const uint8_t reattach) {
312
int usb_close(uint8_t reattach) {
313
    int res;
313
    int res;
314
 
314
 
315
#ifdef DEBUG
315
#ifdef DEBUG
316
    fprintf(stderr, "Releasing USB interface...\n");
316
    fprintf(stderr, "Releasing USB interface...\n");
317
#endif
317
#endif
Line 362... Line 362...
362
#endif
362
#endif
363
 
363
 
364
    libusb_exit(usb_ctx);
364
    libusb_exit(usb_ctx);
365
}
365
}
366
 
366
 
367
int usb_destroy(const uint8_t reattach)
367
int usb_destroy(uint8_t reattach)
368
{
368
{
369
    int res = LIBUSB_SUCCESS;
369
    int res = LIBUSB_SUCCESS;
370
 
370
 
371
    if (usb_handle)
371
    if (usb_handle)
372
    {
372
    {