aboutsummaryrefslogtreecommitdiff
path: root/src/ptp.h
diff options
context:
space:
mode:
authorRichard Low <richard@wentnet.com>2007-02-17 09:47:26 +0000
committerRichard Low <richard@wentnet.com>2007-02-17 09:47:26 +0000
commit02724f68a036acb6688b400b6c8546b836f5f04e (patch)
tree0eb375b3e77184cb912b69adf52bef1c524840c1 /src/ptp.h
parent507e7fe72b0424cb0732819cb2f62c1f7b791ce8 (diff)
downloadlibmtp-02724f68a036acb6688b400b6c8546b836f5f04e.tar.gz
read/write sizes changed
Diffstat (limited to 'src/ptp.h')
-rw-r--r--src/ptp.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ptp.h b/src/ptp.h
index dc1a63c..a3d9563 100644
--- a/src/ptp.h
+++ b/src/ptp.h
@@ -61,9 +61,11 @@ typedef struct _PTPContainer PTPContainer;
* Previously we had this as 4096 for MTP devices. We have found
* and fixed the bugs that made this necessary and it can be 512 again.
*/
-#define PTP_USB_BULK_HS_MAX_PACKET_LEN 512
+#define PTP_USB_BULK_HS_MAX_PACKET_LEN_WRITE 512
+#define PTP_USB_BULK_HS_MAX_PACKET_LEN_READ 4096
#define PTP_USB_BULK_HDR_LEN (2*sizeof(uint32_t)+2*sizeof(uint16_t))
-#define PTP_USB_BULK_PAYLOAD_LEN (PTP_USB_BULK_HS_MAX_PACKET_LEN-PTP_USB_BULK_HDR_LEN)
+#define PTP_USB_BULK_PAYLOAD_LEN_WRITE (PTP_USB_BULK_HS_MAX_PACKET_LEN_WRITE-PTP_USB_BULK_HDR_LEN)
+#define PTP_USB_BULK_PAYLOAD_LEN_READ (PTP_USB_BULK_HS_MAX_PACKET_LEN_READ-PTP_USB_BULK_HDR_LEN)
#define PTP_USB_BULK_REQ_LEN (PTP_USB_BULK_HDR_LEN+5*sizeof(uint32_t))
struct _PTPUSBBulkContainer {
@@ -79,7 +81,9 @@ struct _PTPUSBBulkContainer {
uint32_t param4;
uint32_t param5;
} params;
- unsigned char data[PTP_USB_BULK_PAYLOAD_LEN];
+ // this must be set to the maximum of PTP_USB_BULK_PAYLOAD_LEN_WRITE
+ // and PTP_USB_BULK_PAYLOAD_LEN_READ
+ unsigned char data[PTP_USB_BULK_PAYLOAD_LEN_READ];
} payload;
};
typedef struct _PTPUSBBulkContainer PTPUSBBulkContainer;