Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _LINUX_DM_IOCTL_V4_H |
| 8 | #define _LINUX_DM_IOCTL_V4_H |
| 9 | #include <linux/types.h> |
| 10 | #define DM_DIR "mapper" |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | #define DM_CONTROL_NODE "control" |
| 12 | #define DM_MAX_TYPE_NAME 16 |
| 13 | #define DM_NAME_LEN 128 |
| 14 | #define DM_UUID_LEN 129 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 15 | struct dm_ioctl { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 16 | __u32 version[3]; |
| 17 | __u32 data_size; |
| 18 | __u32 data_start; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 19 | __u32 target_count; |
| 20 | __s32 open_count; |
| 21 | __u32 flags; |
| 22 | __u32 event_nr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 23 | __u32 padding; |
| 24 | __u64 dev; |
| 25 | char name[DM_NAME_LEN]; |
| 26 | char uuid[DM_UUID_LEN]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | char data[7]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 28 | }; |
| 29 | struct dm_target_spec { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 30 | __u64 sector_start; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 31 | __u64 length; |
| 32 | __s32 status; |
| 33 | __u32 next; |
| 34 | char target_type[DM_MAX_TYPE_NAME]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | }; |
| 36 | struct dm_target_deps { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 37 | __u32 count; |
| 38 | __u32 padding; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 39 | __u64 dev[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | }; |
| 41 | struct dm_name_list { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 42 | __u64 dev; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | __u32 next; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 44 | char name[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | }; |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 46 | #define DM_NAME_LIST_FLAG_HAS_UUID 1 |
| 47 | #define DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | struct dm_target_versions { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 49 | __u32 next; |
| 50 | __u32 version[3]; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 51 | char name[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 52 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 53 | struct dm_target_msg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 54 | __u64 sector; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 55 | char message[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 57 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 58 | DM_VERSION_CMD = 0, |
| 59 | DM_REMOVE_ALL_CMD, |
| 60 | DM_LIST_DEVICES_CMD, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 61 | DM_DEV_CREATE_CMD, |
| 62 | DM_DEV_REMOVE_CMD, |
| 63 | DM_DEV_RENAME_CMD, |
| 64 | DM_DEV_SUSPEND_CMD, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 65 | DM_DEV_STATUS_CMD, |
| 66 | DM_DEV_WAIT_CMD, |
| 67 | DM_TABLE_LOAD_CMD, |
| 68 | DM_TABLE_CLEAR_CMD, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 69 | DM_TABLE_DEPS_CMD, |
| 70 | DM_TABLE_STATUS_CMD, |
| 71 | DM_LIST_VERSIONS_CMD, |
| 72 | DM_TARGET_MSG_CMD, |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 73 | DM_DEV_SET_GEOMETRY_CMD, |
| 74 | DM_DEV_ARM_POLL_CMD, |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 75 | DM_GET_TARGET_VERSION_CMD, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 76 | }; |
| 77 | #define DM_IOCTL 0xfd |
| 78 | #define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 79 | #define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl) |
| 80 | #define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl) |
| 81 | #define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl) |
| 82 | #define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 83 | #define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl) |
| 84 | #define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl) |
| 85 | #define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl) |
| 86 | #define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 87 | #define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, DM_DEV_ARM_POLL_CMD, struct dm_ioctl) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 88 | #define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl) |
| 89 | #define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl) |
| 90 | #define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl) |
| 91 | #define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 92 | #define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl) |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 93 | #define DM_GET_TARGET_VERSION _IOWR(DM_IOCTL, DM_GET_TARGET_VERSION_CMD, struct dm_ioctl) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 94 | #define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl) |
| 95 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
| 96 | #define DM_VERSION_MAJOR 4 |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 97 | #define DM_VERSION_MINOR 48 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 98 | #define DM_VERSION_PATCHLEVEL 0 |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 99 | #define DM_VERSION_EXTRA "-ioctl(2023-03-01)" |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 100 | #define DM_READONLY_FLAG (1 << 0) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 101 | #define DM_SUSPEND_FLAG (1 << 1) |
| 102 | #define DM_PERSISTENT_DEV_FLAG (1 << 3) |
| 103 | #define DM_STATUS_TABLE_FLAG (1 << 4) |
| 104 | #define DM_ACTIVE_PRESENT_FLAG (1 << 5) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 105 | #define DM_INACTIVE_PRESENT_FLAG (1 << 6) |
| 106 | #define DM_BUFFER_FULL_FLAG (1 << 8) |
| 107 | #define DM_SKIP_BDGET_FLAG (1 << 9) |
| 108 | #define DM_SKIP_LOCKFS_FLAG (1 << 10) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 109 | #define DM_NOFLUSH_FLAG (1 << 11) |
| 110 | #define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) |
| 111 | #define DM_UEVENT_GENERATED_FLAG (1 << 13) |
| 112 | #define DM_UUID_FLAG (1 << 14) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 113 | #define DM_SECURE_DATA_FLAG (1 << 15) |
| 114 | #define DM_DATA_OUT_FLAG (1 << 16) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 115 | #define DM_DEFERRED_REMOVE (1 << 17) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 116 | #define DM_INTERNAL_SUSPEND_FLAG (1 << 18) |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 117 | #define DM_IMA_MEASUREMENT_FLAG (1 << 19) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 118 | #endif |