summaryrefslogtreecommitdiffstats
path: root/include/mtd
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-06-28 13:33:28 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-05 15:07:14 +0200
commite0677920d6e61e246d6906cd931263d35292dc7e (patch)
treea90eb89efef852773cd6ff041d7e48759890147f /include/mtd
parent8dbed40da9c07f106246584e91980dba856dad1e (diff)
downloadbarebox-e0677920d6e61e246d6906cd931263d35292dc7e.tar.gz
barebox-e0677920d6e61e246d6906cd931263d35292dc7e.tar.xz
barebox ubi changes
This adds the layer between barebox and UBI. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/mtd')
-rw-r--r--include/mtd/ubi-user.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index a7421f130c..62d8c936b2 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -265,4 +265,36 @@ struct ubi_leb_change_req {
uint8_t padding[7];
} __attribute__ ((packed));
+/**
+ * ubi_attach_mtd_dev - attach an MTD device.
+ * @mtd_dev: MTD device description object
+ * @ubi_num: number to assign to the new UBI device
+ * @vid_hdr_offset: VID header offset
+ *
+ * This function attaches MTD device @mtd_dev to UBI and assign @ubi_num number
+ * to the newly created UBI device, unless @ubi_num is %UBI_DEV_NUM_AUTO, in
+ * which case this function finds a vacant device nubert and assings it
+ * automatically. Returns the new UBI device number in case of success and a
+ * negative error code in case of failure.
+ *
+ * This of course is originally not exported but is now part of the UBI
+ * interface to barebox.
+ */
+int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset);
+
+/**
+ * ubi_detach_mtd_dev - detach an MTD device.
+ * @ubi_num: UBI device number to detach from
+ * @anyway: detach MTD even if device reference count is not zero
+ *
+ * This function destroys an UBI device number @ubi_num and detaches the
+ * underlying MTD device. Returns zero in case of success and %-EBUSY if the
+ * UBI device is busy and cannot be destroyed, and %-EINVAL if it does not
+ * exist.
+ *
+ * This of course is originally not exported but is now part of the UBI
+ * interface to barebox.
+ */
+int ubi_detach_mtd_dev(struct mtd_info *mtd, int anyway);
+
#endif /* __UBI_USER_H__ */