2 * Gadget Function Driver for MTP
4 * Copyright (C) 2010 Google, Inc.
5 * Author: Mike Lockwood <lockwood@android.com>
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 #ifndef _UAPI_LINUX_USB_F_MTP_H
19 #define _UAPI_LINUX_USB_F_MTP_H
21 #include <linux/ioctl.h>
22 #include <linux/types.h>
24 struct mtp_file_range {
25 /* file descriptor for file to transfer */
27 /* offset in file for start of transfer */
29 /* number of bytes to transfer */
31 /* MTP command ID for data header,
32 * used only for MTP_SEND_FILE_WITH_HEADER
35 /* MTP transaction ID for data header,
36 * used only for MTP_SEND_FILE_WITH_HEADER
38 uint32_t transaction_id;
42 /* size of the event */
44 /* event data to send */
48 /* Sends the specified file range to the host */
49 #define MTP_SEND_FILE _IOW('M', 0, struct mtp_file_range)
50 /* Receives data from the host and writes it to a file.
51 * The file is created if it does not exist.
53 #define MTP_RECEIVE_FILE _IOW('M', 1, struct mtp_file_range)
54 /* Sends an event to the host via the interrupt endpoint */
55 #define MTP_SEND_EVENT _IOW('M', 3, struct mtp_event)
56 /* Sends the specified file range to the host,
57 * with a 12 byte MTP data packet header at the beginning.
59 #define MTP_SEND_FILE_WITH_HEADER _IOW('M', 4, struct mtp_file_range)
61 #endif /* _UAPI_LINUX_USB_F_MTP_H */