122851890Sopenharmony_ci/****************************************************************************
222851890Sopenharmony_ci ****************************************************************************
322851890Sopenharmony_ci ***
422851890Sopenharmony_ci ***   This header was automatically generated from a Linux kernel header
522851890Sopenharmony_ci ***   of the same name, to make information necessary for userspace to
622851890Sopenharmony_ci ***   call into the kernel available to libc.  It contains only constants,
722851890Sopenharmony_ci ***   structures, and macros generated from the original header, and thus,
822851890Sopenharmony_ci ***   contains no copyrightable information.
922851890Sopenharmony_ci ***
1022851890Sopenharmony_ci ***   To edit the content of this header, modify the corresponding
1122851890Sopenharmony_ci ***   source file (e.g. under external/kernel-headers/original/) then
1222851890Sopenharmony_ci ***   run bionic/libc/kernel/tools/update_all.py
1322851890Sopenharmony_ci ***
1422851890Sopenharmony_ci ***   Any manual change here will be lost the next time this script will
1522851890Sopenharmony_ci ***   be run. You've been warned!
1622851890Sopenharmony_ci ***
1722851890Sopenharmony_ci ****************************************************************************
1822851890Sopenharmony_ci ****************************************************************************/
1922851890Sopenharmony_ci#ifndef __UBI_USER_H__
2022851890Sopenharmony_ci#define __UBI_USER_H__
2122851890Sopenharmony_ci#include <linux/types.h>
2222851890Sopenharmony_ci#define UBI_VOL_NUM_AUTO (- 1)
2322851890Sopenharmony_ci#define UBI_DEV_NUM_AUTO (- 1)
2422851890Sopenharmony_ci#define UBI_MAX_VOLUME_NAME 127
2522851890Sopenharmony_ci#define UBI_IOC_MAGIC 'o'
2622851890Sopenharmony_ci#define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req)
2722851890Sopenharmony_ci#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32)
2822851890Sopenharmony_ci#define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req)
2922851890Sopenharmony_ci#define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req)
3022851890Sopenharmony_ci#define UBI_IOCRPEB _IOW(UBI_IOC_MAGIC, 4, __s32)
3122851890Sopenharmony_ci#define UBI_IOCSPEB _IOW(UBI_IOC_MAGIC, 5, __s32)
3222851890Sopenharmony_ci#define UBI_CTRL_IOC_MAGIC 'o'
3322851890Sopenharmony_ci#define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req)
3422851890Sopenharmony_ci#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32)
3522851890Sopenharmony_ci#define UBI_VOL_IOC_MAGIC 'O'
3622851890Sopenharmony_ci#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64)
3722851890Sopenharmony_ci#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32)
3822851890Sopenharmony_ci#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32)
3922851890Sopenharmony_ci#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
4022851890Sopenharmony_ci#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32)
4122851890Sopenharmony_ci#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
4222851890Sopenharmony_ci#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_vol_prop_req)
4322851890Sopenharmony_ci#define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req)
4422851890Sopenharmony_ci#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
4522851890Sopenharmony_ci#define MAX_UBI_MTD_NAME_LEN 127
4622851890Sopenharmony_ci#define UBI_MAX_RNVOL 32
4722851890Sopenharmony_cienum {
4822851890Sopenharmony_ci  UBI_DYNAMIC_VOLUME = 3,
4922851890Sopenharmony_ci  UBI_STATIC_VOLUME = 4,
5022851890Sopenharmony_ci};
5122851890Sopenharmony_cienum {
5222851890Sopenharmony_ci  UBI_VOL_PROP_DIRECT_WRITE = 1,
5322851890Sopenharmony_ci};
5422851890Sopenharmony_cistruct ubi_attach_req {
5522851890Sopenharmony_ci  __s32 ubi_num;
5622851890Sopenharmony_ci  __s32 mtd_num;
5722851890Sopenharmony_ci  __s32 vid_hdr_offset;
5822851890Sopenharmony_ci  __s16 max_beb_per1024;
5922851890Sopenharmony_ci  __s8 padding[10];
6022851890Sopenharmony_ci};
6122851890Sopenharmony_cienum {
6222851890Sopenharmony_ci  UBI_VOL_SKIP_CRC_CHECK_FLG = 0x1,
6322851890Sopenharmony_ci};
6422851890Sopenharmony_ci#define UBI_VOL_VALID_FLGS (UBI_VOL_SKIP_CRC_CHECK_FLG)
6522851890Sopenharmony_cistruct ubi_mkvol_req {
6622851890Sopenharmony_ci  __s32 vol_id;
6722851890Sopenharmony_ci  __s32 alignment;
6822851890Sopenharmony_ci  __s64 bytes;
6922851890Sopenharmony_ci  __s8 vol_type;
7022851890Sopenharmony_ci  __u8 flags;
7122851890Sopenharmony_ci  __s16 name_len;
7222851890Sopenharmony_ci  __s8 padding2[4];
7322851890Sopenharmony_ci  char name[UBI_MAX_VOLUME_NAME + 1];
7422851890Sopenharmony_ci} __packed;
7522851890Sopenharmony_cistruct ubi_rsvol_req {
7622851890Sopenharmony_ci  __s64 bytes;
7722851890Sopenharmony_ci  __s32 vol_id;
7822851890Sopenharmony_ci} __packed;
7922851890Sopenharmony_cistruct ubi_rnvol_req {
8022851890Sopenharmony_ci  __s32 count;
8122851890Sopenharmony_ci  __s8 padding1[12];
8222851890Sopenharmony_ci  struct {
8322851890Sopenharmony_ci    __s32 vol_id;
8422851890Sopenharmony_ci    __s16 name_len;
8522851890Sopenharmony_ci    __s8 padding2[2];
8622851890Sopenharmony_ci    char name[UBI_MAX_VOLUME_NAME + 1];
8722851890Sopenharmony_ci  } ents[UBI_MAX_RNVOL];
8822851890Sopenharmony_ci} __packed;
8922851890Sopenharmony_cistruct ubi_leb_change_req {
9022851890Sopenharmony_ci  __s32 lnum;
9122851890Sopenharmony_ci  __s32 bytes;
9222851890Sopenharmony_ci  __s8 dtype;
9322851890Sopenharmony_ci  __s8 padding[7];
9422851890Sopenharmony_ci} __packed;
9522851890Sopenharmony_cistruct ubi_map_req {
9622851890Sopenharmony_ci  __s32 lnum;
9722851890Sopenharmony_ci  __s8 dtype;
9822851890Sopenharmony_ci  __s8 padding[3];
9922851890Sopenharmony_ci} __packed;
10022851890Sopenharmony_cistruct ubi_set_vol_prop_req {
10122851890Sopenharmony_ci  __u8 property;
10222851890Sopenharmony_ci  __u8 padding[7];
10322851890Sopenharmony_ci  __u64 value;
10422851890Sopenharmony_ci} __packed;
10522851890Sopenharmony_cistruct ubi_blkcreate_req {
10622851890Sopenharmony_ci  __s8 padding[128];
10722851890Sopenharmony_ci} __packed;
10822851890Sopenharmony_ci#endif
109