blob: 93831de10a78b3f7c340aa25b297d09da77ee3dd [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef __UBI_USER_H__
8#define __UBI_USER_H__
9#include <linux/types.h>
Tao Baod7db5942015-01-28 10:07:51 -080010#define UBI_VOL_NUM_AUTO (- 1)
Tao Baod7db5942015-01-28 10:07:51 -080011#define UBI_DEV_NUM_AUTO (- 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070012#define UBI_MAX_VOLUME_NAME 127
13#define UBI_IOC_MAGIC 'o'
14#define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req)
Ben Cheng655a7c02013-10-16 16:09:24 -070015#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32)
16#define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req)
17#define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req)
Christopher Ferris24f97eb2019-05-20 12:58:13 -070018#define UBI_IOCRPEB _IOW(UBI_IOC_MAGIC, 4, __s32)
19#define UBI_IOCSPEB _IOW(UBI_IOC_MAGIC, 5, __s32)
Ben Cheng655a7c02013-10-16 16:09:24 -070020#define UBI_CTRL_IOC_MAGIC 'o'
Ben Cheng655a7c02013-10-16 16:09:24 -070021#define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req)
22#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32)
23#define UBI_VOL_IOC_MAGIC 'O'
24#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64)
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32)
26#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32)
27#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
28#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32)
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
Tao Baod7db5942015-01-28 10:07:51 -080030#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_vol_prop_req)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070031#define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req)
32#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070033#define MAX_UBI_MTD_NAME_LEN 127
34#define UBI_MAX_RNVOL 32
Ben Cheng655a7c02013-10-16 16:09:24 -070035enum {
Tao Baod7db5942015-01-28 10:07:51 -080036 UBI_DYNAMIC_VOLUME = 3,
Tao Baod7db5942015-01-28 10:07:51 -080037 UBI_STATIC_VOLUME = 4,
Ben Cheng655a7c02013-10-16 16:09:24 -070038};
Ben Cheng655a7c02013-10-16 16:09:24 -070039enum {
Tao Baod7db5942015-01-28 10:07:51 -080040 UBI_VOL_PROP_DIRECT_WRITE = 1,
Ben Cheng655a7c02013-10-16 16:09:24 -070041};
42struct ubi_attach_req {
Tao Baod7db5942015-01-28 10:07:51 -080043 __s32 ubi_num;
44 __s32 mtd_num;
Tao Baod7db5942015-01-28 10:07:51 -080045 __s32 vid_hdr_offset;
46 __s16 max_beb_per1024;
Christopher Ferris6cd53a52022-12-12 23:39:16 +000047 __s8 disable_fm;
48 __s8 padding[9];
Ben Cheng655a7c02013-10-16 16:09:24 -070049};
Christopher Ferris9ce28842018-10-25 12:11:39 -070050enum {
51 UBI_VOL_SKIP_CRC_CHECK_FLG = 0x1,
52};
53#define UBI_VOL_VALID_FLGS (UBI_VOL_SKIP_CRC_CHECK_FLG)
Ben Cheng655a7c02013-10-16 16:09:24 -070054struct ubi_mkvol_req {
Tao Baod7db5942015-01-28 10:07:51 -080055 __s32 vol_id;
56 __s32 alignment;
57 __s64 bytes;
Tao Baod7db5942015-01-28 10:07:51 -080058 __s8 vol_type;
Christopher Ferris9ce28842018-10-25 12:11:39 -070059 __u8 flags;
Tao Baod7db5942015-01-28 10:07:51 -080060 __s16 name_len;
61 __s8 padding2[4];
Tao Baod7db5942015-01-28 10:07:51 -080062 char name[UBI_MAX_VOLUME_NAME + 1];
Colin Cross4ac33222022-12-15 15:45:35 -080063} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070064struct ubi_rsvol_req {
Tao Baod7db5942015-01-28 10:07:51 -080065 __s64 bytes;
Tao Baod7db5942015-01-28 10:07:51 -080066 __s32 vol_id;
Colin Cross4ac33222022-12-15 15:45:35 -080067} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070068struct ubi_rnvol_req {
Tao Baod7db5942015-01-28 10:07:51 -080069 __s32 count;
Tao Baod7db5942015-01-28 10:07:51 -080070 __s8 padding1[12];
71 struct {
72 __s32 vol_id;
73 __s16 name_len;
Tao Baod7db5942015-01-28 10:07:51 -080074 __s8 padding2[2];
75 char name[UBI_MAX_VOLUME_NAME + 1];
76 } ents[UBI_MAX_RNVOL];
Colin Cross4ac33222022-12-15 15:45:35 -080077} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070078struct ubi_leb_change_req {
Tao Baod7db5942015-01-28 10:07:51 -080079 __s32 lnum;
80 __s32 bytes;
81 __s8 dtype;
Tao Baod7db5942015-01-28 10:07:51 -080082 __s8 padding[7];
Colin Cross4ac33222022-12-15 15:45:35 -080083} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070084struct ubi_map_req {
Tao Baod7db5942015-01-28 10:07:51 -080085 __s32 lnum;
Tao Baod7db5942015-01-28 10:07:51 -080086 __s8 dtype;
87 __s8 padding[3];
Colin Cross4ac33222022-12-15 15:45:35 -080088} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070089struct ubi_set_vol_prop_req {
Tao Baod7db5942015-01-28 10:07:51 -080090 __u8 property;
91 __u8 padding[7];
92 __u64 value;
Colin Cross4ac33222022-12-15 15:45:35 -080093} __attribute__((__packed__));
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070094struct ubi_blkcreate_req {
Tao Baod7db5942015-01-28 10:07:51 -080095 __s8 padding[128];
Colin Cross4ac33222022-12-15 15:45:35 -080096} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070097#endif