aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/mtdchar.c28
-rw-r--r--fs/compat_ioctl.c2
-rw-r--r--include/mtd/mtd-abi.h9
3 files changed, 39 insertions, 0 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 51bb0b092003..99d1fbc95011 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -607,6 +607,34 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
607 break; 607 break;
608 } 608 }
609 609
610 case MEMWRITEOOB64:
611 {
612 struct mtd_oob_buf64 buf;
613 struct mtd_oob_buf64 __user *buf_user = argp;
614
615 if (copy_from_user(&buf, argp, sizeof(buf)))
616 ret = -EFAULT;
617 else
618 ret = mtd_do_writeoob(file, mtd, buf.start, buf.length,
619 (void __user *)(uintptr_t)buf.usr_ptr,
620 &buf_user->length);
621 break;
622 }
623
624 case MEMREADOOB64:
625 {
626 struct mtd_oob_buf64 buf;
627 struct mtd_oob_buf64 __user *buf_user = argp;
628
629 if (copy_from_user(&buf, argp, sizeof(buf)))
630 ret = -EFAULT;
631 else
632 ret = mtd_do_readoob(mtd, buf.start, buf.length,
633 (void __user *)(uintptr_t)buf.usr_ptr,
634 &buf_user->length);
635 break;
636 }
637
610 case MEMLOCK: 638 case MEMLOCK:
611 { 639 {
612 struct erase_info_user einfo; 640 struct erase_info_user einfo;
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 196397bff086..8da222eacbaf 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -2411,6 +2411,8 @@ COMPATIBLE_IOCTL(ECCGETLAYOUT)
2411COMPATIBLE_IOCTL(ECCGETSTATS) 2411COMPATIBLE_IOCTL(ECCGETSTATS)
2412COMPATIBLE_IOCTL(MTDFILEMODE) 2412COMPATIBLE_IOCTL(MTDFILEMODE)
2413COMPATIBLE_IOCTL(MEMERASE64) 2413COMPATIBLE_IOCTL(MEMERASE64)
2414COMPATIBLE_IOCTL(MEMREADOOB64)
2415COMPATIBLE_IOCTL(MEMWRITEOOB64)
2414/* NBD */ 2416/* NBD */
2415ULONG_IOCTL(NBD_SET_SOCK) 2417ULONG_IOCTL(NBD_SET_SOCK)
2416ULONG_IOCTL(NBD_SET_BLKSIZE) 2418ULONG_IOCTL(NBD_SET_BLKSIZE)
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index 2e32be1e3a1e..be51ae2bd0ff 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -23,6 +23,13 @@ struct mtd_oob_buf {
23 unsigned char __user *ptr; 23 unsigned char __user *ptr;
24}; 24};
25 25
26struct mtd_oob_buf64 {
27 __u64 start;
28 __u32 pad;
29 __u32 length;
30 __u64 usr_ptr;
31};
32
26#define MTD_ABSENT 0 33#define MTD_ABSENT 0
27#define MTD_RAM 1 34#define MTD_RAM 1
28#define MTD_ROM 2 35#define MTD_ROM 2
@@ -101,6 +108,8 @@ struct otp_info {
101#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) 108#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
102#define MTDFILEMODE _IO('M', 19) 109#define MTDFILEMODE _IO('M', 19)
103#define MEMERASE64 _IOW('M', 20, struct erase_info_user64) 110#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
111#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
112#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)
104 113
105/* 114/*
106 * Obsolete legacy interface. Keep it in order not to break userspace 115 * Obsolete legacy interface. Keep it in order not to break userspace