Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153776
b: refs/heads/master
c: aea7cea
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Cernekee authored and David Woodhouse committed May 29, 2009
1 parent 4cfc48d commit 9400bcd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 977185404046afb31d2e18fac0a076de1a20bf0e
refs/heads/master: aea7cea9fa9e39e71f95ad70b3daf98ba9972587
28 changes: 28 additions & 0 deletions trunk/drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,34 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
break;
}

case MEMWRITEOOB64:
{
struct mtd_oob_buf64 buf;
struct mtd_oob_buf64 __user *buf_user = argp;

if (copy_from_user(&buf, argp, sizeof(buf)))
ret = -EFAULT;
else
ret = mtd_do_writeoob(file, mtd, buf.start, buf.length,
(void __user *)(uintptr_t)buf.usr_ptr,
&buf_user->length);
break;
}

case MEMREADOOB64:
{
struct mtd_oob_buf64 buf;
struct mtd_oob_buf64 __user *buf_user = argp;

if (copy_from_user(&buf, argp, sizeof(buf)))
ret = -EFAULT;
else
ret = mtd_do_readoob(mtd, buf.start, buf.length,
(void __user *)(uintptr_t)buf.usr_ptr,
&buf_user->length);
break;
}

case MEMLOCK:
{
struct erase_info_user einfo;
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2411,6 +2411,8 @@ COMPATIBLE_IOCTL(ECCGETLAYOUT)
COMPATIBLE_IOCTL(ECCGETSTATS)
COMPATIBLE_IOCTL(MTDFILEMODE)
COMPATIBLE_IOCTL(MEMERASE64)
COMPATIBLE_IOCTL(MEMREADOOB64)
COMPATIBLE_IOCTL(MEMWRITEOOB64)
/* NBD */
ULONG_IOCTL(NBD_SET_SOCK)
ULONG_IOCTL(NBD_SET_BLKSIZE)
Expand Down
9 changes: 9 additions & 0 deletions trunk/include/mtd/mtd-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ struct mtd_oob_buf {
unsigned char __user *ptr;
};

struct mtd_oob_buf64 {
__u64 start;
__u32 pad;
__u32 length;
__u64 usr_ptr;
};

#define MTD_ABSENT 0
#define MTD_RAM 1
#define MTD_ROM 2
Expand Down Expand Up @@ -101,6 +108,8 @@ struct otp_info {
#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
#define MTDFILEMODE _IO('M', 19)
#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)

/*
* Obsolete legacy interface. Keep it in order not to break userspace
Expand Down

0 comments on commit 9400bcd

Please sign in to comment.