2 * Copyright (c) International Business Machines Corp., 2006
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12 * the GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 * Author: Artem Bityutskiy
20 * UBI (Unsorted Block Images) library.
23 #ifndef __LIBUBI_INT_H__
24 #define __LIBUBI_INT_H__
31 * The below are pre-define UBI file and directory names.
33 * Note, older kernels put 'ubiX_Y' directories straight to '/sys/class/ubi/'.
34 * New kernels puts 'ubiX_Y' directories to '/sys/class/ubi/ubiX/', which is
35 * saner. And for compatibility reasons it also puts symlinks to 'ubiX_Y'
36 * directories to '/sys/class/ubi/'. For now libubi assumes old layout.
39 #define SYSFS_UBI "class/ubi"
40 #define SYSFS_CTRL "class/misc/ubi_ctrl/"
42 #define CTRL_DEV "dev"
44 #define UBI_VER "version"
45 #define UBI_DEV_NAME_PATT "ubi%d"
48 #define DEV_AVAIL_EBS "avail_eraseblocks"
49 #define DEV_TOTAL_EBS "total_eraseblocks"
50 #define DEV_BAD_COUNT "bad_peb_count"
51 #define DEV_EB_SIZE "eraseblock_size"
52 #define DEV_MAX_EC "max_ec"
53 #define DEV_MAX_RSVD "reserved_for_bad"
54 #define DEV_MAX_VOLS "max_vol_count"
55 #define DEV_MIN_IO_SIZE "min_io_size"
56 #define DEV_MTD_NUM "mtd_num"
58 #define UBI_VOL_NAME_PATT "ubi%d_%d"
59 #define VOL_TYPE "type"
61 #define VOL_ALIGNMENT "alignment"
62 #define VOL_DATA_BYTES "data_bytes"
63 #define VOL_RSVD_EBS "reserved_ebs"
64 #define VOL_EB_SIZE "usable_eb_size"
65 #define VOL_CORRUPTED "corrupted"
66 #define VOL_NAME "name"
69 * libubi - UBI library description data structure.
70 * @sysfs: sysfs file system path
71 * @sysfs_ctrl: UBI control device directory in sysfs
72 * @ctrl_dev: UBI control device major/minor numbers sysfs file
73 * @sysfs_ubi: UBI directory in sysfs
74 * @ubi_dev: UBI device sysfs directory pattern
75 * @ubi_version: UBI version file sysfs path
76 * @dev_dev: UBI device major/minor numbers file pattern
77 * @dev_avail_ebs: count of available eraseblocks sysfs path pattern
78 * @dev_total_ebs: total eraseblocks count sysfs path pattern
79 * @dev_bad_count: count of bad eraseblocks sysfs path pattern
80 * @dev_eb_size: size of UBI device's eraseblocks sysfs path pattern
81 * @dev_max_ec: maximum erase counter sysfs path pattern
82 * @dev_bad_rsvd: count of physical eraseblock reserved for bad eraseblocks
84 * @dev_max_vols: maximum volumes number count sysfs path pattern
85 * @dev_min_io_size: minimum I/O unit size sysfs path pattern
86 * @dev_mtd_num: MTD device number
87 * @ubi_vol: UBI volume sysfs directory pattern
88 * @vol_type: volume type sysfs path pattern
89 * @vol_dev: volume major/minor numbers file pattern
90 * @vol_alignment: volume alignment sysfs path pattern
91 * @vol_data_bytes: volume data size sysfs path pattern
92 * @vol_rsvd_ebs: volume reserved size sysfs path pattern
93 * @vol_eb_size: volume eraseblock size sysfs path pattern
94 * @vol_corrupted: volume corruption flag sysfs path pattern
95 * @vol_name: volume name sysfs path pattern
113 char *dev_min_io_size
;
119 char *vol_data_bytes
;
131 #endif /* !__LIBUBI_INT_H__ */