summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2014-03-14 11:25:24 -0300
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-03-25 09:54:48 +0200
commit6a9db93c239ff61412ba6629919b4411d836ae23 (patch)
tree5aa80cf857d2429f1687b6f275fee626005958b7 /include
parentdcea43eba91642939c82739387147da26d572758 (diff)
ubi-utils: Add ubiblock tool
With the addition of block device access to UBI volumes, we now add a simple userspace tool to access the new ioctls. Usage of this tool is as simple as it gets: $ ubiblock --create /dev/ubi0_0 will create a new block device /dev/ubiblock0_0, and $ ubiblock --remove /dev/ubi0_0 will remove the device. Artem: slightly changed the header comment. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/mtd/ubi-user.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index 1c06d88..2b50dad 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -132,6 +132,16 @@
* used. A pointer to a &struct ubi_set_vol_prop_req object is expected to be
* passed. The object describes which property should be set, and to which value
* it should be set.
+ *
+ * Block devices on UBI volumes
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * To create a R/O block device on top of an UBI volume the %UBI_IOCVOLCRBLK
+ * should be used. A pointer to a &struct ubi_blkcreate_req object is expected
+ * to be passed, which is not used and reserved for future usage.
+ *
+ * Conversely, to remove a block device the %UBI_IOCVOLRMBLK should be used,
+ * which takes no arguments.
*/
/*
@@ -186,6 +196,10 @@
/* Set an UBI volume property */
#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \
struct ubi_set_vol_prop_req)
+/* Create a R/O block device on top of an UBI volume */
+#define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req)
+/* Remove the R/O block device */
+#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
/* Maximum MTD device name length supported by UBI */
#define MAX_UBI_MTD_NAME_LEN 127
@@ -415,4 +429,12 @@ struct ubi_set_vol_prop_req {
uint64_t value;
} __attribute__((packed));
+/**
+ * struct ubi_blkcreate_req - a data structure used in block creation requests.
+ * @padding: reserved for future, not used, has to be zeroed
+ */
+struct ubi_blkcreate_req {
+ int8_t padding[128];
+} __attribute__((packed));
+
#endif /* __UBI_USER_H__ */