diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2016-02-05 22:24:26 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2016-02-05 22:24:26 +0100 |
commit | aac75024bc25550ffdb4df95299e453842a0abab (patch) | |
tree | d0f046dcf32043c33311d16a791e35b47cec5e98 /src/libopenusb1-glue.c | |
parent | 1d419426e2af226b87fc5340d602857706002817 (diff) | |
download | libmtp-aac75024bc25550ffdb4df95299e453842a0abab.tar.gz |
in read, use the maxpacket from the device, not _HS_ packetsize
Diffstat (limited to 'src/libopenusb1-glue.c')
-rw-r--r-- | src/libopenusb1-glue.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libopenusb1-glue.c b/src/libopenusb1-glue.c index 934987b..1e04f04 100644 --- a/src/libopenusb1-glue.c +++ b/src/libopenusb1-glue.c @@ -1351,7 +1351,7 @@ ptp_usb_getdata(PTPParams* params, PTPContainer* ptp, PTPDataHandler *handler) { break; } } - if (rlen == PTP_USB_BULK_HS_MAX_PACKET_LEN_READ) { + if (rlen == ptp_usb->inep_maxpacket) { /* Copy first part of data to 'data' */ putfunc_ret = handler->putfunc( @@ -1433,7 +1433,7 @@ ptp_usb_getdata(PTPParams* params, PTPContainer* ptp, PTPDataHandler *handler) { return putfunc_ret; if (FLAG_NO_ZERO_READS(ptp_usb) && - len + PTP_USB_BULK_HDR_LEN == PTP_USB_BULK_HS_MAX_PACKET_LEN_READ) { + len + PTP_USB_BULK_HDR_LEN == ptp_usb->inep_maxpacket) { LIBMTP_USB_DEBUG("Reading in extra terminating byte\n"); @@ -1459,8 +1459,8 @@ ptp_usb_getdata(PTPParams* params, PTPContainer* ptp, PTPDataHandler *handler) { xread = bulk.result.transferred_bytes; if (result != 1) - LIBMTP_INFO("Could not read in extra byte for PTP_USB_BULK_HS_MAX_PACKET_LEN_READ long file, return value 0x%04x\n", result); - } else if (len + PTP_USB_BULK_HDR_LEN == PTP_USB_BULK_HS_MAX_PACKET_LEN_READ && params->split_header_data == 0) { + LIBMTP_INFO("Could not read in extra byte for %d bytes long file, return value 0x%04x\n", ptp_usb->inep_maxpacket, result); + } else if (len + PTP_USB_BULK_HDR_LEN == ptp_usb->inep_maxpacket && params->split_header_data == 0) { int zeroresult = 0, xread; unsigned char zerobyte = 0; |