diff options
author | Linus Walleij <triad@df.lth.se> | 2013-11-06 04:07:14 +0100 |
---|---|---|
committer | Linus Walleij <triad@df.lth.se> | 2013-11-06 04:07:14 +0100 |
commit | c27ba017bbc18fcc5d436be1b4b5eb60a25de414 (patch) | |
tree | a8091701482af789469e65e3e053ad8fb0c5dfa1 /src/libusb1-glue.c | |
parent | 760e264b0ad584f06ca7526e59a1415c9edbed9a (diff) | |
download | libmtp-c27ba017bbc18fcc5d436be1b4b5eb60a25de414.tar.gz |
Revert "USB 3.0 support."
This reverts commit 77ad0b15fecacb415dc508168919cc3c4583dd36.
Diffstat (limited to 'src/libusb1-glue.c')
-rw-r--r-- | src/libusb1-glue.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/src/libusb1-glue.c b/src/libusb1-glue.c index e1cc6d7..7dee45f 100644 --- a/src/libusb1-glue.c +++ b/src/libusb1-glue.c @@ -837,19 +837,6 @@ ptp_read_func ( unsigned long written; unsigned char *bytes; int expect_terminator_byte = 0; - unsigned long usb_inep_maxpacket_size; - unsigned long context_block_size_1; - unsigned long context_block_size_2; - - usb_inep_maxpacket_size = ptp_usb->inep_maxpacket; - if (usb_inep_maxpacket_size == 0x400) { - context_block_size_1 = CONTEXT_BLOCK_SIZE_1 - 0x200; - context_block_size_2 = CONTEXT_BLOCK_SIZE_2 + 0x200; - } - else { - context_block_size_1 = CONTEXT_BLOCK_SIZE_1; - context_block_size_2 = CONTEXT_BLOCK_SIZE_2; - } // This is the largest block we'll need to read in. bytes = malloc(CONTEXT_BLOCK_SIZE); @@ -870,11 +857,11 @@ ptp_read_func ( } else if (curread == 0) // we are first packet, but not last packet - toread = context_block_size_1; - else if (toread == context_block_size_1) - toread = context_block_size_2; - else if (toread == context_block_size_2) - toread = context_block_size_1; + toread = CONTEXT_BLOCK_SIZE_1; + else if (toread == CONTEXT_BLOCK_SIZE_1) + toread = CONTEXT_BLOCK_SIZE_2; + else if (toread == CONTEXT_BLOCK_SIZE_2) + toread = CONTEXT_BLOCK_SIZE_1; else LIBMTP_INFO("unexpected toread size 0x%04x, 0x%04x remaining bytes\n", (unsigned int) toread, (unsigned int) (size-curread)); @@ -1280,10 +1267,6 @@ static uint16_t ptp_usb_getpacket(PTPParams *params, PTPDataHandler memhandler; uint16_t ret; unsigned char *x = NULL; - unsigned long packet_size; - PTP_USB *ptp_usb = (PTP_USB *) params->data; - - packet_size = ptp_usb->inep_maxpacket; /* read the header and potentially the first data */ if (params->response_packet_size > 0) { @@ -1297,7 +1280,7 @@ static uint16_t ptp_usb_getpacket(PTPParams *params, return PTP_RC_OK; } ptp_init_recv_memory_handler (&memhandler); - ret = ptp_read_func(packet_size, &memhandler, params->data, rlen, 0); + ret = ptp_read_func(PTP_USB_BULK_HS_MAX_PACKET_LEN_READ, &memhandler, params->data, rlen, 0); ptp_exit_recv_memory_handler (&memhandler, &x, rlen); if (x) { memcpy (packet, x, *rlen); |