diff options
author | Vitaly Wool <vwool@ru.mvista.com> | 2006-11-03 10:20:38 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-11-28 17:39:03 -0500 |
commit | 7014568bad55c20b7ee4f439d78c9e875912d51f (patch) | |
tree | 1b558ef8d77d31925cc396ed69d8f785615cf09f /include/linux/mtd | |
parent | 191876729901d0c8dab8a331f9a1e4b73a56457b (diff) |
[MTD] [NAND] remove len/ooblen confusion.
As was discussed between Ricard Wanderlöf, David Woodhouse, Artem
Bityutskiy and me, the current API for reading/writing OOB is confusing.
The thing that introduces confusion is the need to specify ops.len
together with ops.ooblen for reads/writes that concern only OOB not data
area. So, ops.len is overloaded: when ops.datbuf != NULL it serves to
specify the length of the data read, and when ops.datbuf == NULL, it
serves to specify the full OOB read length.
The patch inlined below is the slightly updated version of the previous
patch serving the same purpose, but with the new Artem's comments taken
into account.
Artem, BTW, thanks a lot for your valuable input!
Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/mtd.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 94a443d45258..4fc391ec9d01 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -75,15 +75,12 @@ typedef enum { | |||
75 | * struct mtd_oob_ops - oob operation operands | 75 | * struct mtd_oob_ops - oob operation operands |
76 | * @mode: operation mode | 76 | * @mode: operation mode |
77 | * | 77 | * |
78 | * @len: number of bytes to write/read. When a data buffer is given | 78 | * @len: number of data bytes to write/read |
79 | * (datbuf != NULL) this is the number of data bytes. When | ||
80 | * no data buffer is available this is the number of oob bytes. | ||
81 | * | 79 | * |
82 | * @retlen: number of bytes written/read. When a data buffer is given | 80 | * @retlen: number of data bytes written/read |
83 | * (datbuf != NULL) this is the number of data bytes. When | ||
84 | * no data buffer is available this is the number of oob bytes. | ||
85 | * | 81 | * |
86 | * @ooblen: number of oob bytes per page | 82 | * @ooblen: number of oob bytes to write/read |
83 | * @oobretlen: number of oob bytes written/read | ||
87 | * @ooboffs: offset of oob data in the oob area (only relevant when | 84 | * @ooboffs: offset of oob data in the oob area (only relevant when |
88 | * mode = MTD_OOB_PLACE) | 85 | * mode = MTD_OOB_PLACE) |
89 | * @datbuf: data buffer - if NULL only oob data are read/written | 86 | * @datbuf: data buffer - if NULL only oob data are read/written |
@@ -94,6 +91,7 @@ struct mtd_oob_ops { | |||
94 | size_t len; | 91 | size_t len; |
95 | size_t retlen; | 92 | size_t retlen; |
96 | size_t ooblen; | 93 | size_t ooblen; |
94 | size_t oobretlen; | ||
97 | uint32_t ooboffs; | 95 | uint32_t ooboffs; |
98 | uint8_t *datbuf; | 96 | uint8_t *datbuf; |
99 | uint8_t *oobbuf; | 97 | uint8_t *oobbuf; |