diff options
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r-- | drivers/mtd/ubi/ubi.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index 0359e0cce482..0b0149c41fe3 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h | |||
@@ -85,21 +85,26 @@ | |||
85 | /* | 85 | /* |
86 | * Error codes returned by the I/O sub-system. | 86 | * Error codes returned by the I/O sub-system. |
87 | * | 87 | * |
88 | * UBI_IO_PEB_EMPTY: the physical eraseblock is empty, i.e. it contains only | 88 | * UBI_IO_FF: the read region of flash contains only 0xFFs |
89 | * %0xFF bytes | 89 | * UBI_IO_FF_BITFLIPS: the same as %UBI_IO_FF, but also also there was a data |
90 | * UBI_IO_PEB_FREE: the physical eraseblock is free, i.e. it contains only a | 90 | * integrity error reported by the MTD driver |
91 | * valid erase counter header, and the rest are %0xFF bytes | 91 | * (uncorrectable ECC error in case of NAND) |
92 | * UBI_IO_BAD_HDR: the EC or VID header is corrupted (bad magic or CRC) | 92 | * UBI_IO_BAD_HDR: the EC or VID header is corrupted (bad magic or CRC) |
93 | * UBI_IO_BAD_HDR_READ: the same as %UBI_IO_BAD_HDR, but also there was a read | 93 | * UBI_IO_BAD_HDR_EBADMSG: the same as %UBI_IO_BAD_HDR, but also there was a |
94 | * error reported by the flash driver | 94 | * data integrity error reported by the MTD driver |
95 | * (uncorrectable ECC error in case of NAND) | ||
95 | * UBI_IO_BITFLIPS: bit-flips were detected and corrected | 96 | * UBI_IO_BITFLIPS: bit-flips were detected and corrected |
97 | * | ||
98 | * Note, it is probably better to have bit-flip and ebadmsg as flags which can | ||
99 | * be or'ed with other error code. But this is a big change because there are | ||
100 | * may callers, so it does not worth the risk of introducing a bug | ||
96 | */ | 101 | */ |
97 | enum { | 102 | enum { |
98 | UBI_IO_PEB_EMPTY = 1, | 103 | UBI_IO_FF = 1, |
99 | UBI_IO_PEB_FREE, | 104 | UBI_IO_FF_BITFLIPS, |
100 | UBI_IO_BAD_HDR, | 105 | UBI_IO_BAD_HDR, |
101 | UBI_IO_BAD_HDR_READ, | 106 | UBI_IO_BAD_HDR_EBADMSG, |
102 | UBI_IO_BITFLIPS | 107 | UBI_IO_BITFLIPS, |
103 | }; | 108 | }; |
104 | 109 | ||
105 | /* | 110 | /* |
@@ -356,6 +361,8 @@ struct ubi_wl_entry; | |||
356 | * @peb_size: physical eraseblock size | 361 | * @peb_size: physical eraseblock size |
357 | * @bad_peb_count: count of bad physical eraseblocks | 362 | * @bad_peb_count: count of bad physical eraseblocks |
358 | * @good_peb_count: count of good physical eraseblocks | 363 | * @good_peb_count: count of good physical eraseblocks |
364 | * @corr_peb_count: count of corrupted physical eraseblocks (preserved and not | ||
365 | * used by UBI) | ||
359 | * @erroneous_peb_count: count of erroneous physical eraseblocks in @erroneous | 366 | * @erroneous_peb_count: count of erroneous physical eraseblocks in @erroneous |
360 | * @max_erroneous: maximum allowed amount of erroneous physical eraseblocks | 367 | * @max_erroneous: maximum allowed amount of erroneous physical eraseblocks |
361 | * @min_io_size: minimal input/output unit size of the underlying MTD device | 368 | * @min_io_size: minimal input/output unit size of the underlying MTD device |
@@ -442,6 +449,7 @@ struct ubi_device { | |||
442 | int peb_size; | 449 | int peb_size; |
443 | int bad_peb_count; | 450 | int bad_peb_count; |
444 | int good_peb_count; | 451 | int good_peb_count; |
452 | int corr_peb_count; | ||
445 | int erroneous_peb_count; | 453 | int erroneous_peb_count; |
446 | int max_erroneous; | 454 | int max_erroneous; |
447 | int min_io_size; | 455 | int min_io_size; |
@@ -506,6 +514,7 @@ int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf, | |||
506 | int length); | 514 | int length); |
507 | int ubi_check_volume(struct ubi_device *ubi, int vol_id); | 515 | int ubi_check_volume(struct ubi_device *ubi, int vol_id); |
508 | void ubi_calculate_reserved(struct ubi_device *ubi); | 516 | void ubi_calculate_reserved(struct ubi_device *ubi); |
517 | int ubi_check_pattern(const void *buf, uint8_t patt, int size); | ||
509 | 518 | ||
510 | /* eba.c */ | 519 | /* eba.c */ |
511 | int ubi_eba_unmap_leb(struct ubi_device *ubi, struct ubi_volume *vol, | 520 | int ubi_eba_unmap_leb(struct ubi_device *ubi, struct ubi_volume *vol, |