blob: 866fbd2c9aecf914ba944c672baf02a256551740 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __UBI_USER_H__
20#define __UBI_USER_H__
21#include <linux/types.h>
Tao Baod7db5942015-01-28 10:07:51 -080022#define UBI_VOL_NUM_AUTO (- 1)
Tao Baod7db5942015-01-28 10:07:51 -080023#define UBI_DEV_NUM_AUTO (- 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define UBI_MAX_VOLUME_NAME 127
25#define UBI_IOC_MAGIC 'o'
26#define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req)
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32)
28#define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req)
29#define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req)
Christopher Ferris24f97eb2019-05-20 12:58:13 -070030#define UBI_IOCRPEB _IOW(UBI_IOC_MAGIC, 4, __s32)
31#define UBI_IOCSPEB _IOW(UBI_IOC_MAGIC, 5, __s32)
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define UBI_CTRL_IOC_MAGIC 'o'
Ben Cheng655a7c02013-10-16 16:09:24 -070033#define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req)
34#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32)
35#define UBI_VOL_IOC_MAGIC 'O'
36#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64)
Ben Cheng655a7c02013-10-16 16:09:24 -070037#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32)
38#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32)
39#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
40#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32)
Ben Cheng655a7c02013-10-16 16:09:24 -070041#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
Tao Baod7db5942015-01-28 10:07:51 -080042#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_vol_prop_req)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070043#define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req)
44#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070045#define MAX_UBI_MTD_NAME_LEN 127
46#define UBI_MAX_RNVOL 32
Ben Cheng655a7c02013-10-16 16:09:24 -070047enum {
Tao Baod7db5942015-01-28 10:07:51 -080048 UBI_DYNAMIC_VOLUME = 3,
Tao Baod7db5942015-01-28 10:07:51 -080049 UBI_STATIC_VOLUME = 4,
Ben Cheng655a7c02013-10-16 16:09:24 -070050};
Ben Cheng655a7c02013-10-16 16:09:24 -070051enum {
Tao Baod7db5942015-01-28 10:07:51 -080052 UBI_VOL_PROP_DIRECT_WRITE = 1,
Ben Cheng655a7c02013-10-16 16:09:24 -070053};
54struct ubi_attach_req {
Tao Baod7db5942015-01-28 10:07:51 -080055 __s32 ubi_num;
56 __s32 mtd_num;
Tao Baod7db5942015-01-28 10:07:51 -080057 __s32 vid_hdr_offset;
58 __s16 max_beb_per1024;
59 __s8 padding[10];
Ben Cheng655a7c02013-10-16 16:09:24 -070060};
Christopher Ferris9ce28842018-10-25 12:11:39 -070061enum {
62 UBI_VOL_SKIP_CRC_CHECK_FLG = 0x1,
63};
64#define UBI_VOL_VALID_FLGS (UBI_VOL_SKIP_CRC_CHECK_FLG)
Ben Cheng655a7c02013-10-16 16:09:24 -070065struct ubi_mkvol_req {
Tao Baod7db5942015-01-28 10:07:51 -080066 __s32 vol_id;
67 __s32 alignment;
68 __s64 bytes;
Tao Baod7db5942015-01-28 10:07:51 -080069 __s8 vol_type;
Christopher Ferris9ce28842018-10-25 12:11:39 -070070 __u8 flags;
Tao Baod7db5942015-01-28 10:07:51 -080071 __s16 name_len;
72 __s8 padding2[4];
Tao Baod7db5942015-01-28 10:07:51 -080073 char name[UBI_MAX_VOLUME_NAME + 1];
Ben Cheng655a7c02013-10-16 16:09:24 -070074} __packed;
Ben Cheng655a7c02013-10-16 16:09:24 -070075struct ubi_rsvol_req {
Tao Baod7db5942015-01-28 10:07:51 -080076 __s64 bytes;
Tao Baod7db5942015-01-28 10:07:51 -080077 __s32 vol_id;
Ben Cheng655a7c02013-10-16 16:09:24 -070078} __packed;
Ben Cheng655a7c02013-10-16 16:09:24 -070079struct ubi_rnvol_req {
Tao Baod7db5942015-01-28 10:07:51 -080080 __s32 count;
Tao Baod7db5942015-01-28 10:07:51 -080081 __s8 padding1[12];
82 struct {
83 __s32 vol_id;
84 __s16 name_len;
Tao Baod7db5942015-01-28 10:07:51 -080085 __s8 padding2[2];
86 char name[UBI_MAX_VOLUME_NAME + 1];
87 } ents[UBI_MAX_RNVOL];
Ben Cheng655a7c02013-10-16 16:09:24 -070088} __packed;
89struct ubi_leb_change_req {
Tao Baod7db5942015-01-28 10:07:51 -080090 __s32 lnum;
91 __s32 bytes;
92 __s8 dtype;
Tao Baod7db5942015-01-28 10:07:51 -080093 __s8 padding[7];
Ben Cheng655a7c02013-10-16 16:09:24 -070094} __packed;
Ben Cheng655a7c02013-10-16 16:09:24 -070095struct ubi_map_req {
Tao Baod7db5942015-01-28 10:07:51 -080096 __s32 lnum;
Tao Baod7db5942015-01-28 10:07:51 -080097 __s8 dtype;
98 __s8 padding[3];
Ben Cheng655a7c02013-10-16 16:09:24 -070099} __packed;
100struct ubi_set_vol_prop_req {
Tao Baod7db5942015-01-28 10:07:51 -0800101 __u8 property;
102 __u8 padding[7];
103 __u64 value;
Ben Cheng655a7c02013-10-16 16:09:24 -0700104} __packed;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700105struct ubi_blkcreate_req {
Tao Baod7db5942015-01-28 10:07:51 -0800106 __s8 padding[128];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700107} __packed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700108#endif