drm/rockchip: Don't change hdmi reference clock rate
[drm/drm-misc.git] / include / uapi / linux / raid / md_u.h
blob7be89a4906e73e9fba2e9bedb4ec3666dd75e57b
1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2 /*
3 md_u.h : user <=> kernel API between Linux raidtools and RAID drivers
4 Copyright (C) 1998 Ingo Molnar
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
12 #ifndef _UAPI_MD_U_H
13 #define _UAPI_MD_U_H
16 * Different major versions are not compatible.
17 * Different minor versions are only downward compatible.
18 * Different patchlevel versions are downward and upward compatible.
20 #define MD_MAJOR_VERSION 0
21 #define MD_MINOR_VERSION 90
23 * MD_PATCHLEVEL_VERSION indicates kernel functionality.
24 * >=1 means different superblock formats are selectable using SET_ARRAY_INFO
25 * and major_version/minor_version accordingly
26 * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT
27 * in the super status byte
28 * >=3 means that bitmap superblock version 4 is supported, which uses
29 * little-ending representation rather than host-endian
31 #define MD_PATCHLEVEL_VERSION 3
33 /* ioctls */
35 /* status */
36 #define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)
37 #define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)
38 #define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)
39 #define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
40 #define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
42 /* configuration */
43 #define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
44 #define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
45 #define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
46 #define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
47 #define SET_DISK_INFO _IO (MD_MAJOR, 0x24)
48 #define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)
49 #define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)
50 #define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
51 #define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
52 #define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
53 #define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
54 #define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
56 /* usage */
57 #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
58 /* 0x31 was START_ARRAY */
59 #define STOP_ARRAY _IO (MD_MAJOR, 0x32)
60 #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
61 #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
62 #define CLUSTERED_DISK_NACK _IO (MD_MAJOR, 0x35)
64 /* 63 partitions with the alternate major number (mdp) */
65 #define MdpMinorShift 6
67 typedef struct mdu_version_s {
68 int major;
69 int minor;
70 int patchlevel;
71 } mdu_version_t;
73 typedef struct mdu_array_info_s {
75 * Generic constant information
77 int major_version;
78 int minor_version;
79 int patch_version;
80 unsigned int ctime;
81 int level;
82 int size;
83 int nr_disks;
84 int raid_disks;
85 int md_minor;
86 int not_persistent;
89 * Generic state information
91 unsigned int utime; /* 0 Superblock update time */
92 int state; /* 1 State bits (clean, ...) */
93 int active_disks; /* 2 Number of currently active disks */
94 int working_disks; /* 3 Number of working disks */
95 int failed_disks; /* 4 Number of failed disks */
96 int spare_disks; /* 5 Number of spare disks */
99 * Personality information
101 int layout; /* 0 the array's physical layout */
102 int chunk_size; /* 1 chunk size in bytes */
104 } mdu_array_info_t;
106 /* we need a value for 'no level specified' and 0
107 * means 'raid0', so we need something else. This is
108 * for internal use only
110 #define LEVEL_NONE (-1000000)
112 typedef struct mdu_disk_info_s {
114 * configuration/status of one particular disk
116 int number;
117 int major;
118 int minor;
119 int raid_disk;
120 int state;
122 } mdu_disk_info_t;
124 typedef struct mdu_start_info_s {
126 * configuration/status of one particular disk
128 int major;
129 int minor;
130 int raid_disk;
131 int state;
133 } mdu_start_info_t;
135 typedef struct mdu_bitmap_file_s
137 char pathname[4096];
138 } mdu_bitmap_file_t;
140 typedef struct mdu_param_s
142 int personality; /* 1,2,3,4 */
143 int chunk_size; /* in bytes */
144 int max_fault; /* unused for now */
145 } mdu_param_t;
147 #endif /* _UAPI_MD_U_H */