1655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/**************************************************************************** 2655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 3655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 4655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** This header was automatically generated from a Linux kernel header 5655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** of the same name, to make information necessary for userspace to 6655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** call into the kernel available to libc. It contains only constants, 7655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** structures, and macros generated from the original header, and thus, 8655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** contains no copyrightable information. 9655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 10655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** To edit the content of this header, modify the corresponding 11655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** source file (e.g. under external/kernel-headers/original/) then 12655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** run bionic/libc/kernel/tools/update_all.py 13655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 14655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** Any manual change here will be lost the next time this script will 15655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** be run. You've been warned! 16655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 17655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 18655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ****************************************************************************/ 19655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#ifndef _LINUX_DM_IOCTL_V4_H 20655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define _LINUX_DM_IOCTL_V4_H 21655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/types.h> 22655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_DIR "mapper" 23655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_CONTROL_NODE "control" 24655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_MAX_TYPE_NAME 16 25655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_NAME_LEN 128 26655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_UUID_LEN 129 27655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct dm_ioctl { 28d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 version[3]; 29d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 data_size; 30d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 data_start; 31d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 target_count; 32d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 open_count; 33d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 flags; 34d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 event_nr; 35d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 padding; 36d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u64 dev; 37d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char name[DM_NAME_LEN]; 38d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char uuid[DM_UUID_LEN]; 39d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char data[7]; 40655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 41655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct dm_target_spec { 42d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u64 sector_start; 43d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u64 length; 44d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 status; 45d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 next; 46d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char target_type[DM_MAX_TYPE_NAME]; 47655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 48655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct dm_target_deps { 49d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 count; 50d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 padding; 51d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u64 dev[0]; 52655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 53655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct dm_name_list { 54d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u64 dev; 55d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 next; 56d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char name[0]; 57655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 58655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct dm_target_versions { 59d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 next; 60d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 version[3]; 61d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char name[0]; 62655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 63655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct dm_target_msg { 64d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u64 sector; 65d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char message[0]; 66655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 67655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengenum { 68d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_VERSION_CMD = 0, 69d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_REMOVE_ALL_CMD, 70d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_LIST_DEVICES_CMD, 71d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_DEV_CREATE_CMD, 72d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_DEV_REMOVE_CMD, 73d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_DEV_RENAME_CMD, 74d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_DEV_SUSPEND_CMD, 75d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_DEV_STATUS_CMD, 76d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_DEV_WAIT_CMD, 77d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_TABLE_LOAD_CMD, 78d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_TABLE_CLEAR_CMD, 79d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_TABLE_DEPS_CMD, 80d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_TABLE_STATUS_CMD, 81d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_LIST_VERSIONS_CMD, 82d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_TARGET_MSG_CMD, 83d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao DM_DEV_SET_GEOMETRY_CMD 84655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 85655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_IOCTL 0xfd 86655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl) 87655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl) 88655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl) 89655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl) 90655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl) 91655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl) 92655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl) 93655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl) 94655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl) 95655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl) 96655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl) 97655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl) 98655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl) 99655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl) 100655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl) 101655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 102655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_VERSION_MAJOR 4 10349f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define DM_VERSION_MINOR 35 104655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_VERSION_PATCHLEVEL 0 10549f525c47bd383cd6a87db8f067cddb3ab620d17Christopher Ferris#define DM_VERSION_EXTRA "-ioctl(2016-06-23)" 106655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_READONLY_FLAG (1 << 0) 107655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_SUSPEND_FLAG (1 << 1) 108655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_PERSISTENT_DEV_FLAG (1 << 3) 109655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_STATUS_TABLE_FLAG (1 << 4) 110655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_ACTIVE_PRESENT_FLAG (1 << 5) 111655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_INACTIVE_PRESENT_FLAG (1 << 6) 112655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_BUFFER_FULL_FLAG (1 << 8) 113655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_SKIP_BDGET_FLAG (1 << 9) 114655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_SKIP_LOCKFS_FLAG (1 << 10) 115655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_NOFLUSH_FLAG (1 << 11) 116655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) 117655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_UEVENT_GENERATED_FLAG (1 << 13) 118655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_UUID_FLAG (1 << 14) 119655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_SECURE_DATA_FLAG (1 << 15) 120655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define DM_DATA_OUT_FLAG (1 << 16) 12138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define DM_DEFERRED_REMOVE (1 << 17) 12205d08e9716b5974d6ed08973f44930804890b902Christopher Ferris#define DM_INTERNAL_SUSPEND_FLAG (1 << 18) 12305d08e9716b5974d6ed08973f44930804890b902Christopher Ferris#endif 124