aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/ubi.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r--drivers/mtd/ubi/ubi.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 940f6b7deec3..1fc32c863b78 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -74,15 +74,15 @@
74#define UBI_IO_RETRIES 3 74#define UBI_IO_RETRIES 3
75 75
76/* 76/*
77 * Error codes returned by the I/O unit. 77 * Error codes returned by the I/O sub-system.
78 * 78 *
79 * UBI_IO_PEB_EMPTY: the physical eraseblock is empty, i.e. it contains only 79 * UBI_IO_PEB_EMPTY: the physical eraseblock is empty, i.e. it contains only
80 * 0xFF bytes 80 * %0xFF bytes
81 * UBI_IO_PEB_FREE: the physical eraseblock is free, i.e. it contains only a 81 * UBI_IO_PEB_FREE: the physical eraseblock is free, i.e. it contains only a
82 * valid erase counter header, and the rest are %0xFF bytes 82 * valid erase counter header, and the rest are %0xFF bytes
83 * UBI_IO_BAD_EC_HDR: the erase counter header is corrupted (bad magic or CRC) 83 * UBI_IO_BAD_EC_HDR: the erase counter header is corrupted (bad magic or CRC)
84 * UBI_IO_BAD_VID_HDR: the volume identifier header is corrupted (bad magic or 84 * UBI_IO_BAD_VID_HDR: the volume identifier header is corrupted (bad magic or
85 * CRC) 85 * CRC)
86 * UBI_IO_BITFLIPS: bit-flips were detected and corrected 86 * UBI_IO_BITFLIPS: bit-flips were detected and corrected
87 */ 87 */
88enum { 88enum {
@@ -99,9 +99,9 @@ enum {
99 * @ec: erase counter 99 * @ec: erase counter
100 * @pnum: physical eraseblock number 100 * @pnum: physical eraseblock number
101 * 101 *
102 * This data structure is used in the WL unit. Each physical eraseblock has a 102 * This data structure is used in the WL sub-system. Each physical eraseblock
103 * corresponding &struct wl_entry object which may be kept in different 103 * has a corresponding &struct wl_entry object which may be kept in different
104 * RB-trees. See WL unit for details. 104 * RB-trees. See WL sub-system for details.
105 */ 105 */
106struct ubi_wl_entry { 106struct ubi_wl_entry {
107 struct rb_node rb; 107 struct rb_node rb;
@@ -118,10 +118,10 @@ struct ubi_wl_entry {
118 * @mutex: read/write mutex to implement read/write access serialization to 118 * @mutex: read/write mutex to implement read/write access serialization to
119 * the (@vol_id, @lnum) logical eraseblock 119 * the (@vol_id, @lnum) logical eraseblock
120 * 120 *
121 * This data structure is used in the EBA unit to implement per-LEB locking. 121 * This data structure is used in the EBA sub-system to implement per-LEB
122 * When a logical eraseblock is being locked - corresponding 122 * locking. When a logical eraseblock is being locked - corresponding
123 * &struct ubi_ltree_entry object is inserted to the lock tree (@ubi->ltree). 123 * &struct ubi_ltree_entry object is inserted to the lock tree (@ubi->ltree).
124 * See EBA unit for details. 124 * See EBA sub-system for details.
125 */ 125 */
126struct ubi_ltree_entry { 126struct ubi_ltree_entry {
127 struct rb_node rb; 127 struct rb_node rb;
@@ -225,7 +225,7 @@ struct ubi_volume {
225#ifdef CONFIG_MTD_UBI_GLUEBI 225#ifdef CONFIG_MTD_UBI_GLUEBI
226 /* 226 /*
227 * Gluebi-related stuff may be compiled out. 227 * Gluebi-related stuff may be compiled out.
228 * TODO: this should not be built into UBI but should be a separate 228 * Note: this should not be built into UBI but should be a separate
229 * ubimtd driver which works on top of UBI and emulates MTD devices. 229 * ubimtd driver which works on top of UBI and emulates MTD devices.
230 */ 230 */
231 struct ubi_volume_desc *gluebi_desc; 231 struct ubi_volume_desc *gluebi_desc;
@@ -235,8 +235,7 @@ struct ubi_volume {
235}; 235};
236 236
237/** 237/**
238 * struct ubi_volume_desc - descriptor of the UBI volume returned when it is 238 * struct ubi_volume_desc - UBI volume descriptor returned when it is opened.
239 * opened.
240 * @vol: reference to the corresponding volume description object 239 * @vol: reference to the corresponding volume description object
241 * @mode: open mode (%UBI_READONLY, %UBI_READWRITE, or %UBI_EXCLUSIVE) 240 * @mode: open mode (%UBI_READONLY, %UBI_READWRITE, or %UBI_EXCLUSIVE)
242 */ 241 */
@@ -316,11 +315,11 @@ struct ubi_wl_entry;
316 * @ro_mode: if the UBI device is in read-only mode 315 * @ro_mode: if the UBI device is in read-only mode
317 * @leb_size: logical eraseblock size 316 * @leb_size: logical eraseblock size
318 * @leb_start: starting offset of logical eraseblocks within physical 317 * @leb_start: starting offset of logical eraseblocks within physical
319 * eraseblocks 318 * eraseblocks
320 * @ec_hdr_alsize: size of the EC header aligned to @hdrs_min_io_size 319 * @ec_hdr_alsize: size of the EC header aligned to @hdrs_min_io_size
321 * @vid_hdr_alsize: size of the VID header aligned to @hdrs_min_io_size 320 * @vid_hdr_alsize: size of the VID header aligned to @hdrs_min_io_size
322 * @vid_hdr_offset: starting offset of the volume identifier header (might be 321 * @vid_hdr_offset: starting offset of the volume identifier header (might be
323 * unaligned) 322 * unaligned)
324 * @vid_hdr_aloffset: starting offset of the VID header aligned to 323 * @vid_hdr_aloffset: starting offset of the VID header aligned to
325 * @hdrs_min_io_size 324 * @hdrs_min_io_size
326 * @vid_hdr_shift: contains @vid_hdr_offset - @vid_hdr_aloffset 325 * @vid_hdr_shift: contains @vid_hdr_offset - @vid_hdr_aloffset
@@ -356,16 +355,16 @@ struct ubi_device {
356 struct mutex volumes_mutex; 355 struct mutex volumes_mutex;
357 356
358 int max_ec; 357 int max_ec;
359 /* TODO: mean_ec is not updated run-time, fix */ 358 /* Note, mean_ec is not updated run-time - should be fixed */
360 int mean_ec; 359 int mean_ec;
361 360
362 /* EBA unit's stuff */ 361 /* EBA sub-system's stuff */
363 unsigned long long global_sqnum; 362 unsigned long long global_sqnum;
364 spinlock_t ltree_lock; 363 spinlock_t ltree_lock;
365 struct rb_root ltree; 364 struct rb_root ltree;
366 struct mutex alc_mutex; 365 struct mutex alc_mutex;
367 366
368 /* Wear-leveling unit's stuff */ 367 /* Wear-leveling sub-system's stuff */
369 struct rb_root used; 368 struct rb_root used;
370 struct rb_root free; 369 struct rb_root free;
371 struct rb_root scrub; 370 struct rb_root scrub;
@@ -388,7 +387,7 @@ struct ubi_device {
388 int thread_enabled; 387 int thread_enabled;
389 char bgt_name[sizeof(UBI_BGT_NAME_PATTERN)+2]; 388 char bgt_name[sizeof(UBI_BGT_NAME_PATTERN)+2];
390 389
391 /* I/O unit's stuff */ 390 /* I/O sub-system's stuff */
392 long long flash_size; 391 long long flash_size;
393 int peb_count; 392 int peb_count;
394 int peb_size; 393 int peb_size;