summaryrefslogtreecommitdiff
path: root/ubi-utils/include/libmtd.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-06-14 13:25:07 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-06-14 13:54:31 +0300
commit5e77e9d5a72d4f7bafc74373d5e44a106a369ceb (patch)
tree3e5e47d7ba2487a409f53a3f27456723ca86dfda /ubi-utils/include/libmtd.h
parent8b1c9cad58f5e2055646b57245fc72cca398c264 (diff)
libmtd: add mtd_write_img
Add another helper interface which can be used to write an image to an mtd device. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/include/libmtd.h')
-rw-r--r--ubi-utils/include/libmtd.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ubi-utils/include/libmtd.h b/ubi-utils/include/libmtd.h
index c8b44e8..dd82b72 100644
--- a/ubi-utils/include/libmtd.h
+++ b/ubi-utils/include/libmtd.h
@@ -214,6 +214,21 @@ int mtd_write(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
void *buf, int len);
/**
+ * mtd_write_img - write a file to MTD device.
+ * @mtd: MTD device description object
+ * @fd: MTD device node file descriptor
+ * @eb: eraseblock to write to
+ * @offs: offset withing the eraseblock to write to
+ * @img_name: the file to write
+ *
+ * This function writes an image @img_name the MTD device defined by @mtd. @eb
+ * and @offs are the starting eraseblock and offset on the MTD device. Returns
+ * %0 in case of success and %-1 in case of failure.
+ */
+int mtd_write_img(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
+ const char *img_name);
+
+/**
* mtd_probe_node - test MTD node.
* @desc: MTD library descriptor
* @node: the node to test