blob: f291f649aba80538bb1feb3ae6e4c0ad890caa55 [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 _UAPI_MD_U_H
8#define _UAPI_MD_U_H
9#define MD_MAJOR_VERSION 0
10#define MD_MINOR_VERSION 90
Ben Cheng655a7c02013-10-16 16:09:24 -070011#define MD_PATCHLEVEL_VERSION 3
Tao Baod7db5942015-01-28 10:07:51 -080012#define RAID_VERSION _IOR(MD_MAJOR, 0x10, mdu_version_t)
13#define GET_ARRAY_INFO _IOR(MD_MAJOR, 0x11, mdu_array_info_t)
14#define GET_DISK_INFO _IOR(MD_MAJOR, 0x12, mdu_disk_info_t)
Tao Baod7db5942015-01-28 10:07:51 -080015#define RAID_AUTORUN _IO(MD_MAJOR, 0x14)
16#define GET_BITMAP_FILE _IOR(MD_MAJOR, 0x15, mdu_bitmap_file_t)
17#define CLEAR_ARRAY _IO(MD_MAJOR, 0x20)
18#define ADD_NEW_DISK _IOW(MD_MAJOR, 0x21, mdu_disk_info_t)
Tao Baod7db5942015-01-28 10:07:51 -080019#define HOT_REMOVE_DISK _IO(MD_MAJOR, 0x22)
20#define SET_ARRAY_INFO _IOW(MD_MAJOR, 0x23, mdu_array_info_t)
21#define SET_DISK_INFO _IO(MD_MAJOR, 0x24)
22#define WRITE_RAID_INFO _IO(MD_MAJOR, 0x25)
Tao Baod7db5942015-01-28 10:07:51 -080023#define UNPROTECT_ARRAY _IO(MD_MAJOR, 0x26)
24#define PROTECT_ARRAY _IO(MD_MAJOR, 0x27)
25#define HOT_ADD_DISK _IO(MD_MAJOR, 0x28)
26#define SET_DISK_FAULTY _IO(MD_MAJOR, 0x29)
Tao Baod7db5942015-01-28 10:07:51 -080027#define HOT_GENERATE_ERROR _IO(MD_MAJOR, 0x2a)
28#define SET_BITMAP_FILE _IOW(MD_MAJOR, 0x2b, int)
29#define RUN_ARRAY _IOW(MD_MAJOR, 0x30, mdu_param_t)
30#define STOP_ARRAY _IO(MD_MAJOR, 0x32)
Tao Baod7db5942015-01-28 10:07:51 -080031#define STOP_ARRAY_RO _IO(MD_MAJOR, 0x33)
32#define RESTART_ARRAY_RW _IO(MD_MAJOR, 0x34)
Christopher Ferris05d08e92016-02-04 13:16:38 -080033#define CLUSTERED_DISK_NACK _IO(MD_MAJOR, 0x35)
Ben Cheng655a7c02013-10-16 16:09:24 -070034#define MdpMinorShift 6
Christopher Ferris05d08e92016-02-04 13:16:38 -080035typedef struct mdu_version_s {
Tao Baod7db5942015-01-28 10:07:51 -080036 int major;
37 int minor;
38 int patchlevel;
Christopher Ferris05d08e92016-02-04 13:16:38 -080039} mdu_version_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070040typedef struct mdu_array_info_s {
Tao Baod7db5942015-01-28 10:07:51 -080041 int major_version;
42 int minor_version;
Christopher Ferris05d08e92016-02-04 13:16:38 -080043 int patch_version;
Christopher Ferris106b3a82016-08-24 12:15:38 -070044 unsigned int ctime;
Tao Baod7db5942015-01-28 10:07:51 -080045 int level;
46 int size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080047 int nr_disks;
Tao Baod7db5942015-01-28 10:07:51 -080048 int raid_disks;
49 int md_minor;
50 int not_persistent;
Christopher Ferris106b3a82016-08-24 12:15:38 -070051 unsigned int utime;
Tao Baod7db5942015-01-28 10:07:51 -080052 int state;
53 int active_disks;
54 int working_disks;
Christopher Ferris05d08e92016-02-04 13:16:38 -080055 int failed_disks;
Tao Baod7db5942015-01-28 10:07:51 -080056 int spare_disks;
57 int layout;
58 int chunk_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080059} mdu_array_info_t;
Christopher Ferris05d08e92016-02-04 13:16:38 -080060#define LEVEL_NONE (- 1000000)
Ben Cheng655a7c02013-10-16 16:09:24 -070061typedef struct mdu_disk_info_s {
Tao Baod7db5942015-01-28 10:07:51 -080062 int number;
63 int major;
Christopher Ferris05d08e92016-02-04 13:16:38 -080064 int minor;
Tao Baod7db5942015-01-28 10:07:51 -080065 int raid_disk;
66 int state;
Ben Cheng655a7c02013-10-16 16:09:24 -070067} mdu_disk_info_t;
Christopher Ferris05d08e92016-02-04 13:16:38 -080068typedef struct mdu_start_info_s {
Tao Baod7db5942015-01-28 10:07:51 -080069 int major;
70 int minor;
71 int raid_disk;
Christopher Ferris05d08e92016-02-04 13:16:38 -080072 int state;
Ben Cheng655a7c02013-10-16 16:09:24 -070073} mdu_start_info_t;
Tao Baod7db5942015-01-28 10:07:51 -080074typedef struct mdu_bitmap_file_s {
75 char pathname[4096];
Christopher Ferris05d08e92016-02-04 13:16:38 -080076} mdu_bitmap_file_t;
Tao Baod7db5942015-01-28 10:07:51 -080077typedef struct mdu_param_s {
78 int personality;
79 int chunk_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080080 int max_fault;
Ben Cheng655a7c02013-10-16 16:09:24 -070081} mdu_param_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070082#endif