f_mtp.h: Update for MTP_SEND_FILE_WITH_HEADER ioctl
Change-Id: I0d1ea12e5ae3f83d550edb1f2b7374da850086c2
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/original/linux/usb/f_mtp.h b/original/linux/usb/f_mtp.h
index e4fd880..c19cf02 100644
--- a/original/linux/usb/f_mtp.h
+++ b/original/linux/usb/f_mtp.h
@@ -18,10 +18,20 @@
#ifndef __LINUX_USB_F_MTP_H
#define __LINUX_USB_F_MTP_H
-/* Constants for MTP_SET_INTERFACE_MODE */
-#define MTP_INTERFACE_MODE_MTP 0
-#define MTP_INTERFACE_MODE_PTP 1
+#ifdef __KERNEL__
+struct mtp_data_header {
+ /* length of packet, including this header */
+ uint32_t length;
+ /* container type (2 for data packet) */
+ uint16_t type;
+ /* MTP command code */
+ uint16_t command;
+ /* MTP transaction ID */
+ uint32_t transaction_id;
+};
+
+#endif /* __KERNEL__ */
struct mtp_file_range {
/* file descriptor for file to transfer */
@@ -30,6 +40,14 @@
loff_t offset;
/* number of bytes to transfer */
int64_t length;
+ /* MTP command ID for data header,
+ * used only for MTP_SEND_FILE_WITH_HEADER
+ */
+ uint16_t command;
+ /* MTP transaction ID for data header,
+ * used only for MTP_SEND_FILE_WITH_HEADER
+ */
+ uint32_t transaction_id;
};
struct mtp_event {
@@ -45,9 +63,11 @@
* The file is created if it does not exist.
*/
#define MTP_RECEIVE_FILE _IOW('M', 1, struct mtp_file_range)
-/* Sets the driver mode to either MTP or PTP */
-#define MTP_SET_INTERFACE_MODE _IOW('M', 2, int)
/* Sends an event to the host via the interrupt endpoint */
#define MTP_SEND_EVENT _IOW('M', 3, struct mtp_event)
+/* Sends the specified file range to the host,
+ * with a 12 byte MTP data packet header at the beginning.
+ */
+#define MTP_SEND_FILE_WITH_HEADER _IOW('M', 4, struct mtp_file_range)
#endif /* __LINUX_USB_F_MTP_H */