diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 1 | ||||
-rw-r--r-- | include/libmtd.h | 13 | ||||
-rw-r--r-- | include/libubi.h | 5 | ||||
-rw-r--r-- | include/mtd/ubi-user.h | 10 |
4 files changed, 27 insertions, 2 deletions
diff --git a/include/common.h b/include/common.h index 31b6cd1..303d30d 100644 --- a/include/common.h +++ b/include/common.h @@ -236,6 +236,7 @@ do { \ long long util_get_bytes(const char *str); void util_print_bytes(long long bytes, int bracket); int util_srand(void); +char *mtd_find_dev_node(const char *id); /* * The following helpers are here to avoid compiler complaints about unchecked diff --git a/include/libmtd.h b/include/libmtd.h index 6ab0de5..f909a16 100644 --- a/include/libmtd.h +++ b/include/libmtd.h @@ -130,7 +130,7 @@ int mtd_get_info(libmtd_t desc, struct mtd_info *info); /** * mtd_get_dev_info - get information about an MTD device. * @desc: MTD library descriptor - * @node: name of the MTD device node + * @node: path of the MTD device node * @mtd: the MTD device information is returned here * * This function gets information about MTD device defined by the @node device @@ -152,6 +152,17 @@ int mtd_get_dev_info(libmtd_t desc, const char *node, struct mtd_dev_info *mtd); int mtd_get_dev_info1(libmtd_t desc, int mtd_num, struct mtd_dev_info *mtd); /** + * mtd_get_dev_info2 - get information about an MTD device. + * @desc: MTD library descriptor + * @name: name of the MTD device + * @mtd: the MTD device information is returned here + * + * This function is identical to 'mtd_get_dev_info()' except that it accepts + * MTD device's name, not MTD character device. + */ +int mtd_get_dev_info2(libmtd_t desc, const char *name, struct mtd_dev_info *mtd); + +/** * mtd_lock - lock eraseblocks. * @desc: MTD library descriptor * @mtd: MTD device description object diff --git a/include/libubi.h b/include/libubi.h index 46c732a..e1e234e 100644 --- a/include/libubi.h +++ b/include/libubi.h @@ -25,6 +25,7 @@ #include <ctype.h> #include <stdint.h> +#include <stdbool.h> #include <mtd/ubi-user.h> #ifdef __cplusplus @@ -53,6 +54,8 @@ typedef void * libubi_t; * @vid_hdr_offset: VID header offset (%0 means default offset and this is what * most of the users want) * @max_beb_per1024: Maximum expected bad eraseblocks per 1024 eraseblocks + * @disable_fm: whether disable fastmap + * @need_resv_pool: whether reserve free pebs for filling pool/wl_pool */ struct ubi_attach_request { @@ -61,6 +64,8 @@ struct ubi_attach_request const char *mtd_dev_node; int vid_hdr_offset; int max_beb_per1024; + bool disable_fm; + bool need_resv_pool; }; /** diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h index 707c4f2..bb5c0f9 100644 --- a/include/mtd/ubi-user.h +++ b/include/mtd/ubi-user.h @@ -235,6 +235,8 @@ enum { * @mtd_num: MTD device number to attach * @vid_hdr_offset: VID header offset (use defaults if %0) * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs + * @disable_fm: whether disable fastmap + * @need_resv_pool: whether reserve free pebs for filling pool/wl_pool * @padding: reserved for future, not used, has to be zeroed * * This data structure is used to specify MTD device UBI has to attach and the @@ -270,13 +272,19 @@ enum { * eraseblocks for new bad eraseblocks, but attempts to use available * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used. + * + * If @disable_fm is not zero, ubi doesn't create new fastmap even the module + * param 'fm_autoconvert' is set, and existed old fastmap will be destroyed + * after doing full scanning. */ struct ubi_attach_req { int32_t ubi_num; int32_t mtd_num; int32_t vid_hdr_offset; int16_t max_beb_per1024; - int8_t padding[10]; + int8_t disable_fm; + int8_t need_resv_pool; + int8_t padding[8]; }; /* |