aboutsummaryrefslogtreecommitdiffstats
path: root/include/mtd/ubi-user.h
diff options
context:
space:
mode:
authorSidney Amani <seed@uffs.org>2009-01-27 04:11:46 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-01-27 09:54:41 -0500
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 @@
124 * To check if a logical eraseblock is mapped to a physical eraseblock, the 124 * To check if a logical eraseblock is mapped to a physical eraseblock, the
125 * %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is 125 * %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is
126 * not mapped, and %1 if it is mapped. 126 * not mapped, and %1 if it is mapped.
127 *
128 * Set an UBI volume property
129 * ~~~~~~~~~~~~~~~~~~~~~~~~~
130 *
131 * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
132 * used. A pointer to a &struct ubi_set_prop_req object is expected to be
133 * passed. The object describes which property should be set, and to which value
134 * it should be set.
127 */ 135 */
128 136
129/* 137/*
@@ -175,6 +183,8 @@
175#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, int32_t) 183#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, int32_t)
176/* Check if LEB is mapped command */ 184/* Check if LEB is mapped command */
177#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, int32_t) 185#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, int32_t)
186/* Set an UBI volume property */
187#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
178 188
179/* Maximum MTD device name length supported by UBI */ 189/* Maximum MTD device name length supported by UBI */
180#define MAX_UBI_MTD_NAME_LEN 127 190#define MAX_UBI_MTD_NAME_LEN 127
@@ -210,6 +220,16 @@ enum {
210 UBI_STATIC_VOLUME = 4, 220 UBI_STATIC_VOLUME = 4,
211}; 221};
212 222
223/*
224 * UBI set property ioctl constants
225 *
226 * @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and
227 * erase individual eraseblocks on dynamic volumes
228 */
229enum {
230 UBI_PROP_DIRECT_WRITE = 1,
231};
232
213/** 233/**
214 * struct ubi_attach_req - attach MTD device request. 234 * struct ubi_attach_req - attach MTD device request.
215 * @ubi_num: UBI device number to create 235 * @ubi_num: UBI device number to create
@@ -373,4 +393,18 @@ struct ubi_map_req {
373 int8_t padding[3]; 393 int8_t padding[3];
374} __attribute__ ((packed)); 394} __attribute__ ((packed));
375 395
396
397/**
398 * struct ubi_set_prop_req - a data structure used to set an ubi volume
399 * property.
400 * @property: property to set (%UBI_PROP_DIRECT_WRITE)
401 * @padding: reserved for future, not used, has to be zeroed
402 * @value: value to set
403 */
404struct ubi_set_prop_req {
405 uint8_t property;
406 uint8_t padding[7];
407 uint64_t value;
408} __attribute__ ((packed));
409
376#endif /* __UBI_USER_H__ */ 410#endif /* __UBI_USER_H__ */