From: Vitaly Wool <vwool@ru.mvista.com>
To: linux-mtd@lists.infradead.org
Subject: [PATCH] [update] MTD ioctl interface rework to get rid of MEMGETOOBSEL/MEMSETOOBSEL
Date: Fri, 02 Dec 2005 10:02:22 +0300 [thread overview]
Message-ID: <438FF17E.9080601@ru.mvista.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 453 bytes --]
Hi,
this patch gets rid of MEMGETOOBSEL/MEMSETOOBSEL ioctls and introduces a new one (MEMGETOOBAVAIL).
As page layout is moving towards being an internal NAND layer knowledge, there's no need to let the user lavel apps change or read it. On the other hand, user level apps will need to know how many bytes long a free OOB area is for this particular flash type.
The main difference with the previous patch
- no more reuse of old ioctl values
Vitaly
[-- Attachment #2: mtd-nand-generic.patch --]
[-- Type: text/plain, Size: 1589 bytes --]
diff -uNr linux-2.6.10.orig/drivers/mtd/mtdchar.c linux-2.6.10.nand/drivers/mtd/mtdchar.c
--- linux-2.6.10.orig/drivers/mtd/mtdchar.c 2005-11-24 15:58:37.000000000 +0300
+++ linux-2.6.10.nand/drivers/mtd/mtdchar.c 2005-11-28 16:40:40.000000000 +0300
@@ -520,16 +520,9 @@
break;
}
- case MEMSETOOBSEL:
+ case MEMGETOOBAVAIL:
{
- if (copy_from_user(&mtd->oobinfo, argp, sizeof(struct nand_oobinfo)))
- return -EFAULT;
- break;
- }
-
- case MEMGETOOBSEL:
- {
- if (copy_to_user(argp, &(mtd->oobinfo), sizeof(struct nand_oobinfo)))
+ if (copy_to_user(argp, &(mtd->oobavail), sizeof(mtd->oobavail)))
return -EFAULT;
break;
}
diff -uNr linux-2.6.10.orig/include/mtd/mtd-abi.h linux-2.6.10.nand/include/mtd/mtd-abi.h
--- linux-2.6.10.orig/include/mtd/mtd-abi.h 2005-11-24 15:58:49.000000000 +0300
+++ linux-2.6.10.nand/include/mtd/mtd-abi.h 2005-11-30 16:35:24.972168568 +0300
@@ -102,14 +102,13 @@
#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
#define MEMGETREGIONCOUNT _IOR('M', 7, int)
#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
-#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
-#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
#define MEMGETBADBLOCK _IOW('M', 11, loff_t)
#define MEMSETBADBLOCK _IOW('M', 12, loff_t)
#define OTPSELECT _IOR('M', 13, int)
#define OTPGETREGIONCOUNT _IOW('M', 14, int)
#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
#define OTPLOCK _IOR('M', 16, struct otp_info)
+#define MEMGETOOBAVAIL _IOR('M', 16, uint32_t)
struct nand_oobinfo {
uint32_t useecc;
reply other threads:[~2005-12-02 7:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=438FF17E.9080601@ru.mvista.com \
--to=vwool@ru.mvista.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox