aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/mtd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mtd/mtd.h')
-rw-r--r--include/linux/mtd/mtd.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 94a443d45258..d644e57703ad 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -23,7 +23,7 @@
23 23
24#define MTD_CHAR_MAJOR 90 24#define MTD_CHAR_MAJOR 90
25#define MTD_BLOCK_MAJOR 31 25#define MTD_BLOCK_MAJOR 31
26#define MAX_MTD_DEVICES 16 26#define MAX_MTD_DEVICES 32
27 27
28#define MTD_ERASE_PENDING 0x01 28#define MTD_ERASE_PENDING 0x01
29#define MTD_ERASING 0x02 29#define MTD_ERASING 0x02
@@ -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;
@@ -202,11 +200,20 @@ struct mtd_info {
202 200
203 /* ECC status information */ 201 /* ECC status information */
204 struct mtd_ecc_stats ecc_stats; 202 struct mtd_ecc_stats ecc_stats;
203 /* Subpage shift (NAND) */
204 int subpage_sft;
205 205
206 void *priv; 206 void *priv;
207 207
208 struct module *owner; 208 struct module *owner;
209 int usecount; 209 int usecount;
210
211 /* If the driver is something smart, like UBI, it may need to maintain
212 * its own reference counting. The below functions are only for driver.
213 * The driver may register its callbacks. These callbacks are not
214 * supposed to be called by MTD users */
215 int (*get_device) (struct mtd_info *mtd);
216 void (*put_device) (struct mtd_info *mtd);
210}; 217};
211 218
212 219
@@ -216,6 +223,7 @@ extern int add_mtd_device(struct mtd_info *mtd);
216extern int del_mtd_device (struct mtd_info *mtd); 223extern int del_mtd_device (struct mtd_info *mtd);
217 224
218extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); 225extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
226extern struct mtd_info *get_mtd_device_nm(const char *name);
219 227
220extern void put_mtd_device(struct mtd_info *mtd); 228extern void put_mtd_device(struct mtd_info *mtd);
221 229