Home | History | Annotate | Download | only in oslib

Lines Matching refs:mtd

20  * MTD library.
23 /* Imported from mtd-utils by dehrenberg */
35 /* Maximum MTD device name length */
37 /* Maximum MTD device type string length */
40 /* MTD library descriptor */
47 * @mtd_dev_cnt: count of MTD devices in system
48 * @lowest_mtd_num: lowest MTD device number in system
49 * @highest_mtd_num: highest MTD device number in system
50 * @sysfs_supported: non-zero if sysfs is supported by MTD
61 * struct mtd_dev_info - information about an MTD device.
62 * @mtd_num: MTD device number
65 * @type: flash type (constants like %MTD_NANDFLASH defined in mtd-abi.h)
76 * @bb_allowed: non-zero if the MTD device may have bad eraseblocks
98 * libmtd_open - open MTD library.
100 * This function initializes and opens the MTD library and returns MTD library
102 * failure, errno contains zero if MTD is not present in the system, or
108 * libmtd_close - close MTD library.
109 * @desc: MTD library descriptor
114 * mtd_dev_present - check whether a MTD device is present.
115 * @desc: MTD library descriptor
116 * @mtd_num: MTD device number to check
118 * This function returns %1 if MTD device is present and %0 if not.
123 * mtd_get_info - get general MTD information.
124 * @desc: MTD library descriptor
125 * @info: the MTD device information is returned here
127 * This function fills the passed @info object with general MTD information and
128 * returns %0 in case of success and %-1 in case of failure. If MTD subsystem is
134 * mtd_get_dev_info - get information about an MTD device.
135 * @desc: MTD library descriptor
136 * @node: name of the MTD device node
137 * @mtd: the MTD device information is returned here
139 * This function gets information about MTD device defined by the @node device
140 * node file and saves this information in the @mtd object. Returns %0 in case
141 * of success and %-1 in case of failure. If MTD subsystem is not present in the
142 * system, or the MTD device does not exist, errno is set to @ENODEV.
144 int mtd_get_dev_info(libmtd_t desc, const char *node, struct mtd_dev_info *mtd);
147 * mtd_get_dev_info1 - get information about an MTD device.
148 * @desc: MTD library descriptor
149 * @mtd_num: MTD device number to fetch information about
150 * @mtd: the MTD device information is returned here
153 * MTD device number, not MTD character device.
155 int mtd_get_dev_info1(libmtd_t desc, int mtd_num, struct mtd_dev_info *mtd);
159 * @desc: MTD library descriptor
160 * @mtd: MTD device description object
161 * @fd: MTD device node file descriptor
167 int mtd_lock(const struct mtd_dev_info *mtd, int fd, int eb);
171 * @desc: MTD library descriptor
172 * @mtd: MTD device description object
173 * @fd: MTD device node file descriptor
179 int mtd_unlock(const struct mtd_dev_info *mtd, int fd, int eb);
183 * @desc: MTD library descriptor
184 * @mtd: MTD device description object
185 * @fd: MTD device node file descriptor
188 * This function erases eraseblock @eb of MTD device described by @fd. Returns
191 int mtd_erase(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb);
195 * @fd: MTD device node file descriptor
208 * @mtd: MTD device description object
209 * @fd: MTD device node file descriptor
212 * This function checks to see if eraseblock @eb of MTD device described
218 int mtd_is_locked(const struct mtd_dev_info *mtd, int fd, int eb);
222 * @desc: MTD library descriptor
223 * @mtd: MTD device description object
224 * @fd: MTD device node file descriptor
230 int mtd_torture(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb);
234 * @mtd: MTD device description object
235 * @fd: MTD device node file descriptor
241 int mtd_is_bad(const struct mtd_dev_info *mtd, int fd, int eb);
245 * @mtd: MTD device description object
246 * @fd: MTD device node file descriptor
252 int mtd_mark_bad(const struct mtd_dev_info *mtd, int fd, int eb);
255 * mtd_read - read data from an MTD device.
256 * @mtd: MTD device description object
257 * @fd: MTD device node file descriptor
264 * of the MTD device defined by @mtd and stores the read data at buffer @buf.
267 int mtd_read(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
271 * mtd_write - write data to an MTD device.
272 * @desc: MTD library descriptor
273 * @mtd: MTD device description object
274 * @fd: MTD device node file descriptor
284 * of the MTD device defined by @mtd. Returns %0 in case of success and %-1 in
289 int mtd_write(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb,
295 * @desc: MTD library descriptor
296 * @mtd: MTD device description object
297 * @fd: MTD device node file descriptor
303 * MTD device described by @fd. The address is specified as page byte offset
304 * from the beginning of the MTD device. This function returns %0 in case of
307 int mtd_read_oob(libmtd_t desc, const struct mtd_dev_info *mtd, int fd,
312 * @desc: MTD library descriptor
313 * @mtd: MTD device description object
314 * @fd: MTD device node file descriptor
320 * MTD device described by @fd. The address is specified as page byte offset
321 * from the beginning of the MTD device. Returns %0 in case of success and %-1
324 int mtd_write_oob(libmtd_t desc, const struct mtd_dev_info *mtd, int fd,
328 * mtd_write_img - write a file to MTD device.
329 * @mtd: MTD device description object
330 * @fd: MTD device node file descriptor
335 * This function writes an image @img_name the MTD device defined by @mtd. @eb
336 * and @offs are the starting eraseblock and offset on the MTD device. Returns
339 int mtd_write_img(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
343 * mtd_probe_node - test MTD node.
344 * @desc: MTD library descriptor
347 * This function tests whether @node is an MTD device node and returns %1 if it