summaryrefslogtreecommitdiff
path: root/include/mtd/ubi-user.h
diff options
context:
space:
mode:
authorSidney Amani <seed@uffs.org>2009-01-27 10:11:46 +0100
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-01-27 16:54:41 +0200
commit766fb95ba06e1bbf531d30dc05e21b2d4a0e8dd2 (patch)
treea7041e919ca5f6d5460b7d7ecfb27e08b9119236 /include/mtd/ubi-user.h
parent36b477d005fbda29e7581c3cef7ee31a59d8970b (diff)
UBI: allow direct user-space I/O
Introduce a new ioctl UBI_IOCSETPROP to set properties on a volume. Also add the first property: UBI_PROP_DIRECT_WRITE, this property is used to set the ability to use direct writes in userspace Signed-off-by: Sidney Amani <seed@uffs.org> Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'include/mtd/ubi-user.h')
-rw-r--r--include/mtd/ubi-user.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index 82113e160a2c..296efae3525e 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -124,6 +124,14 @@
* To check if a logical eraseblock is mapped to a physical eraseblock, the
* %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is
* not mapped, and %1 if it is mapped.
+ *
+ * Set an UBI volume property
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
+ * used. A pointer to a &struct ubi_set_prop_req object is expected to be
+ * passed. The object describes which property should be set, and to which value
+ * it should be set.
*/
/*
@@ -175,6 +183,8 @@
#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, int32_t)
/* Check if LEB is mapped command */
#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, int32_t)
+/* Set an UBI volume property */
+#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
/* Maximum MTD device name length supported by UBI */
#define MAX_UBI_MTD_NAME_LEN 127
@@ -210,6 +220,16 @@ enum {
UBI_STATIC_VOLUME = 4,
};
+/*
+ * UBI set property ioctl constants
+ *
+ * @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and
+ * erase individual eraseblocks on dynamic volumes
+ */
+enum {
+ UBI_PROP_DIRECT_WRITE = 1,
+};
+
/**
* struct ubi_attach_req - attach MTD device request.
* @ubi_num: UBI device number to create
@@ -373,4 +393,18 @@ struct ubi_map_req {
int8_t padding[3];
} __attribute__ ((packed));
+
+/**
+ * struct ubi_set_prop_req - a data structure used to set an ubi volume
+ * property.
+ * @property: property to set (%UBI_PROP_DIRECT_WRITE)
+ * @padding: reserved for future, not used, has to be zeroed
+ * @value: value to set
+ */
+struct ubi_set_prop_req {
+ uint8_t property;
+ uint8_t padding[7];
+ uint64_t value;
+} __attribute__ ((packed));
+
#endif /* __UBI_USER_H__ */