blob: fdf828c4925046815b2695427d539750961044a5 [file] [log] [blame]
Mike Lockwoodba83b012010-04-16 10:39:22 -04001/*
2 * Gadget Function Driver for MTP
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Author: Mike Lockwood <lockwood@android.com>
6 *
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.
10 *
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.
15 *
16 */
17
18#ifndef __LINUX_USB_F_MTP_H
19#define __LINUX_USB_F_MTP_H
20
Mike Lockwoodba83b012010-04-16 10:39:22 -040021
22struct mtp_file_range {
23 /* file descriptor for file to transfer */
24 int fd;
25 /* offset in file for start of transfer */
26 loff_t offset;
27 /* number of bytes to transfer */
Mike Lockwood3e800b62010-11-16 17:14:32 -050028 int64_t length;
Mike Lockwoodba83b012010-04-16 10:39:22 -040029};
30
Mike Lockwood1de4d4d2010-07-06 19:27:52 -040031struct mtp_event {
32 /* size of the event */
33 size_t length;
34 /* event data to send */
35 void *data;
36};
37
Mike Lockwoodba83b012010-04-16 10:39:22 -040038/* Sends the specified file range to the host */
39#define MTP_SEND_FILE _IOW('M', 0, struct mtp_file_range)
40/* Receives data from the host and writes it to a file.
41 * The file is created if it does not exist.
42 */
43#define MTP_RECEIVE_FILE _IOW('M', 1, struct mtp_file_range)
Mike Lockwood1de4d4d2010-07-06 19:27:52 -040044/* Sends an event to the host via the interrupt endpoint */
45#define MTP_SEND_EVENT _IOW('M', 3, struct mtp_event)
Mike Lockwoodba83b012010-04-16 10:39:22 -040046
47#endif /* __LINUX_USB_F_MTP_H */