Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 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 _UAPI_MD_U_H |
| 20 | #define _UAPI_MD_U_H |
| 21 | #define MD_MAJOR_VERSION 0 |
| 22 | #define MD_MINOR_VERSION 90 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define MD_PATCHLEVEL_VERSION 3 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 24 | #define RAID_VERSION _IOR(MD_MAJOR, 0x10, mdu_version_t) |
| 25 | #define GET_ARRAY_INFO _IOR(MD_MAJOR, 0x11, mdu_array_info_t) |
| 26 | #define GET_DISK_INFO _IOR(MD_MAJOR, 0x12, mdu_disk_info_t) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | #define RAID_AUTORUN _IO(MD_MAJOR, 0x14) |
| 28 | #define GET_BITMAP_FILE _IOR(MD_MAJOR, 0x15, mdu_bitmap_file_t) |
| 29 | #define CLEAR_ARRAY _IO(MD_MAJOR, 0x20) |
| 30 | #define ADD_NEW_DISK _IOW(MD_MAJOR, 0x21, mdu_disk_info_t) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 31 | #define HOT_REMOVE_DISK _IO(MD_MAJOR, 0x22) |
| 32 | #define SET_ARRAY_INFO _IOW(MD_MAJOR, 0x23, mdu_array_info_t) |
| 33 | #define SET_DISK_INFO _IO(MD_MAJOR, 0x24) |
| 34 | #define WRITE_RAID_INFO _IO(MD_MAJOR, 0x25) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | #define UNPROTECT_ARRAY _IO(MD_MAJOR, 0x26) |
| 36 | #define PROTECT_ARRAY _IO(MD_MAJOR, 0x27) |
| 37 | #define HOT_ADD_DISK _IO(MD_MAJOR, 0x28) |
| 38 | #define SET_DISK_FAULTY _IO(MD_MAJOR, 0x29) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 | #define HOT_GENERATE_ERROR _IO(MD_MAJOR, 0x2a) |
| 40 | #define SET_BITMAP_FILE _IOW(MD_MAJOR, 0x2b, int) |
| 41 | #define RUN_ARRAY _IOW(MD_MAJOR, 0x30, mdu_param_t) |
| 42 | #define STOP_ARRAY _IO(MD_MAJOR, 0x32) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | #define STOP_ARRAY_RO _IO(MD_MAJOR, 0x33) |
| 44 | #define RESTART_ARRAY_RW _IO(MD_MAJOR, 0x34) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 45 | #define CLUSTERED_DISK_NACK _IO(MD_MAJOR, 0x35) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 46 | #define MdpMinorShift 6 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 47 | typedef struct mdu_version_s { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 48 | int major; |
| 49 | int minor; |
| 50 | int patchlevel; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 51 | } mdu_version_t; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 52 | typedef struct mdu_array_info_s { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 53 | int major_version; |
| 54 | int minor_version; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 55 | int patch_version; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 56 | unsigned int ctime; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 57 | int level; |
| 58 | int size; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 59 | int nr_disks; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 60 | int raid_disks; |
| 61 | int md_minor; |
| 62 | int not_persistent; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 63 | unsigned int utime; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | int state; |
| 65 | int active_disks; |
| 66 | int working_disks; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 67 | int failed_disks; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 68 | int spare_disks; |
| 69 | int layout; |
| 70 | int chunk_size; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 71 | } mdu_array_info_t; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | #define LEVEL_MULTIPATH (- 4) |
| 73 | #define LEVEL_LINEAR (- 1) |
| 74 | #define LEVEL_FAULTY (- 5) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 75 | #define LEVEL_NONE (- 1000000) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 76 | typedef struct mdu_disk_info_s { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 77 | int number; |
| 78 | int major; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 79 | int minor; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 80 | int raid_disk; |
| 81 | int state; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 82 | } mdu_disk_info_t; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 83 | typedef struct mdu_start_info_s { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 84 | int major; |
| 85 | int minor; |
| 86 | int raid_disk; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 87 | int state; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 88 | } mdu_start_info_t; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 89 | typedef struct mdu_bitmap_file_s { |
| 90 | char pathname[4096]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 91 | } mdu_bitmap_file_t; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 92 | typedef struct mdu_param_s { |
| 93 | int personality; |
| 94 | int chunk_size; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 95 | int max_fault; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 96 | } mdu_param_t; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 97 | #endif |