ret = mtp_send_event(dev, &event);
goto out;
}
+#ifdef CONFIG_COMPAT
+ case MTP_SEND_EVENT_32:
+ {
+ struct mtp_event_32 event_32;
+ struct mtp_event event;
+ /* return here so we don't change dev->state below,
+ * which would interfere with bulk transfer state.
+ */
+ if (copy_from_user(&event_32, (void __user *)value,
+ sizeof(event_32)))
+ ret = -EFAULT;
+ else {
+ event.length = event_32.length;
+ event.data = (void *)(unsigned long)event_32.data;
+ ret = mtp_send_event(dev, &event);
+ }
+ goto out;
+ }
+#endif
}
fail:
* Copyright (C) 2010 Google, Inc.
* Author: Mike Lockwood <lockwood@android.com>
*
+ * Copyright (C) 2014, NVIDIA CORPORATION. All rights reserved.
+ *
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
void *data;
};
+#ifdef CONFIG_COMPAT
+struct mtp_event_32 {
+ /* size of the event */
+ compat_size_t length;
+ /* event data to send */
+ compat_uptr_t data;
+};
+
+#define MTP_SEND_EVENT_32 _IOW('M', 3, struct mtp_event_32)
+#endif
+
/* Sends the specified file range to the host */
#define MTP_SEND_FILE _IOW('M', 0, struct mtp_file_range)
/* Receives data from the host and writes it to a file.