blob: 50ab068bc86dd552b051f84db63768f4a325376a [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 */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -07007#ifndef _UAPI_HYPERV_H
8#define _UAPI_HYPERV_H
Christopher Ferris2abfa9e2021-11-01 16:26:06 -07009#include <linux/types.h>
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070010#define UTIL_FW_MINOR 0
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070011#define UTIL_WS2K8_FW_MAJOR 1
12#define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR << 16 | UTIL_FW_MINOR)
13#define UTIL_FW_MAJOR 3
14#define UTIL_FW_VERSION (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070015#define VSS_OP_REGISTER 128
Christopher Ferris05d08e92016-02-04 13:16:38 -080016#define VSS_OP_REGISTER1 129
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070017enum hv_vss_op {
Tao Baod7db5942015-01-28 10:07:51 -080018 VSS_OP_CREATE = 0,
Christopher Ferris05d08e92016-02-04 13:16:38 -080019 VSS_OP_DELETE,
Tao Baod7db5942015-01-28 10:07:51 -080020 VSS_OP_HOT_BACKUP,
21 VSS_OP_GET_DM_INFO,
22 VSS_OP_BU_COMPLETE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080023 VSS_OP_FREEZE,
Tao Baod7db5942015-01-28 10:07:51 -080024 VSS_OP_THAW,
25 VSS_OP_AUTO_RECOVER,
26 VSS_OP_COUNT
Christopher Ferris05d08e92016-02-04 13:16:38 -080027};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070028struct hv_vss_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080029 __u8 operation;
30 __u8 reserved[7];
Christopher Ferris05d08e92016-02-04 13:16:38 -080031} __attribute__((packed));
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070032#define VSS_HBU_NO_AUTO_RECOVERY 0x00000005
33struct hv_vss_check_feature {
Tao Baod7db5942015-01-28 10:07:51 -080034 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080035} __attribute__((packed));
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070036struct hv_vss_check_dm_info {
Tao Baod7db5942015-01-28 10:07:51 -080037 __u32 flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070038} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -080039struct hv_vss_msg {
Tao Baod7db5942015-01-28 10:07:51 -080040 union {
41 struct hv_vss_hdr vss_hdr;
42 int error;
Christopher Ferris05d08e92016-02-04 13:16:38 -080043 };
Tao Baod7db5942015-01-28 10:07:51 -080044 union {
45 struct hv_vss_check_feature vss_cf;
46 struct hv_vss_check_dm_info dm_info;
Christopher Ferris05d08e92016-02-04 13:16:38 -080047 };
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070048} __attribute__((packed));
49#define FCOPY_VERSION_0 0
Christopher Ferris05d08e92016-02-04 13:16:38 -080050#define FCOPY_VERSION_1 1
Christopher Ferris05d08e92016-02-04 13:16:38 -080051#define FCOPY_CURRENT_VERSION FCOPY_VERSION_1
52#define W_MAX_PATH 260
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070053enum hv_fcopy_op {
Tao Baod7db5942015-01-28 10:07:51 -080054 START_FILE_COPY = 0,
55 WRITE_TO_FILE,
56 COMPLETE_FCOPY,
Tao Baod7db5942015-01-28 10:07:51 -080057 CANCEL_FCOPY,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070058};
59struct hv_fcopy_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080060 __u32 operation;
Christopher Ferrisaf09c702020-06-01 20:29:29 -070061 __u8 service_id0[16];
62 __u8 service_id1[16];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070063} __attribute__((packed));
64#define OVER_WRITE 0x1
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070065#define CREATE_PATH 0x2
66struct hv_start_fcopy {
Tao Baod7db5942015-01-28 10:07:51 -080067 struct hv_fcopy_hdr hdr;
68 __u16 file_name[W_MAX_PATH];
Tao Baod7db5942015-01-28 10:07:51 -080069 __u16 path_name[W_MAX_PATH];
70 __u32 copy_flags;
71 __u64 file_size;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070072} __attribute__((packed));
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070073#define DATA_FRAGMENT (6 * 1024)
74struct hv_do_fcopy {
Tao Baod7db5942015-01-28 10:07:51 -080075 struct hv_fcopy_hdr hdr;
76 __u32 pad;
Tao Baod7db5942015-01-28 10:07:51 -080077 __u64 offset;
78 __u32 size;
79 __u8 data[DATA_FRAGMENT];
Christopher Ferris82d75042015-01-26 10:57:07 -080080} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -080081#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE (2048)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070082#define HV_KVP_EXCHANGE_MAX_KEY_SIZE (512)
83#define REG_SZ 1
84#define REG_U32 4
Christopher Ferris82d75042015-01-26 10:57:07 -080085#define REG_U64 8
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070086#define KVP_OP_REGISTER 4
87#define KVP_OP_REGISTER1 100
88enum hv_kvp_exchg_op {
Tao Baod7db5942015-01-28 10:07:51 -080089 KVP_OP_GET = 0,
90 KVP_OP_SET,
91 KVP_OP_DELETE,
92 KVP_OP_ENUMERATE,
Tao Baod7db5942015-01-28 10:07:51 -080093 KVP_OP_GET_IP_INFO,
94 KVP_OP_SET_IP_INFO,
95 KVP_OP_COUNT
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070096};
Christopher Ferris82d75042015-01-26 10:57:07 -080097enum hv_kvp_exchg_pool {
Tao Baod7db5942015-01-28 10:07:51 -080098 KVP_POOL_EXTERNAL = 0,
99 KVP_POOL_GUEST,
100 KVP_POOL_AUTO,
Tao Baod7db5942015-01-28 10:07:51 -0800101 KVP_POOL_AUTO_EXTERNAL,
102 KVP_POOL_AUTO_INTERNAL,
103 KVP_POOL_COUNT
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700104};
Christopher Ferris82d75042015-01-26 10:57:07 -0800105#define HV_S_OK 0x00000000
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700106#define HV_E_FAIL 0x80004005
107#define HV_S_CONT 0x80070103
108#define HV_ERROR_NOT_SUPPORTED 0x80070032
Christopher Ferris82d75042015-01-26 10:57:07 -0800109#define HV_ERROR_MACHINE_LOCKED 0x800704F7
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700110#define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F
111#define HV_INVALIDARG 0x80070057
112#define HV_GUID_NOTFOUND 0x80041002
Christopher Ferris82d75042015-01-26 10:57:07 -0800113#define HV_ERROR_ALREADY_EXISTS 0x80070050
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114#define HV_ERROR_DISK_FULL 0x80070070
Christopher Ferris106b3a82016-08-24 12:15:38 -0700115#define ADDR_FAMILY_NONE 0x00
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700116#define ADDR_FAMILY_IPV4 0x01
117#define ADDR_FAMILY_IPV6 0x02
Christopher Ferris82d75042015-01-26 10:57:07 -0800118#define MAX_ADAPTER_ID_SIZE 128
Christopher Ferris106b3a82016-08-24 12:15:38 -0700119#define MAX_IP_ADDR_SIZE 1024
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700120#define MAX_GATEWAY_SIZE 512
121struct hv_kvp_ipaddr_value {
Tao Baod7db5942015-01-28 10:07:51 -0800122 __u16 adapter_id[MAX_ADAPTER_ID_SIZE];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700123 __u8 addr_family;
Tao Baod7db5942015-01-28 10:07:51 -0800124 __u8 dhcp_enabled;
125 __u16 ip_addr[MAX_IP_ADDR_SIZE];
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u16 sub_net[MAX_IP_ADDR_SIZE];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700127 __u16 gate_way[MAX_GATEWAY_SIZE];
Tao Baod7db5942015-01-28 10:07:51 -0800128 __u16 dns_addr[MAX_IP_ADDR_SIZE];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700129} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -0800130struct hv_kvp_hdr {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131 __u8 operation;
Tao Baod7db5942015-01-28 10:07:51 -0800132 __u8 pool;
133 __u16 pad;
Christopher Ferris82d75042015-01-26 10:57:07 -0800134} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700135struct hv_kvp_exchg_msg_value {
Tao Baod7db5942015-01-28 10:07:51 -0800136 __u32 value_type;
137 __u32 key_size;
Tao Baod7db5942015-01-28 10:07:51 -0800138 __u32 value_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139 __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
Tao Baod7db5942015-01-28 10:07:51 -0800140 union {
141 __u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
Tao Baod7db5942015-01-28 10:07:51 -0800142 __u32 value_u32;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700143 __u64 value_u64;
Tao Baod7db5942015-01-28 10:07:51 -0800144 };
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700145} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -0800146struct hv_kvp_msg_enumerate {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700147 __u32 index;
Tao Baod7db5942015-01-28 10:07:51 -0800148 struct hv_kvp_exchg_msg_value data;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700149} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -0800150struct hv_kvp_msg_get {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700151 struct hv_kvp_exchg_msg_value data;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700152};
153struct hv_kvp_msg_set {
Tao Baod7db5942015-01-28 10:07:51 -0800154 struct hv_kvp_exchg_msg_value data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700155};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700156struct hv_kvp_msg_delete {
Tao Baod7db5942015-01-28 10:07:51 -0800157 __u32 key_size;
Tao Baod7db5942015-01-28 10:07:51 -0800158 __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700160struct hv_kvp_register {
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u8 version[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
Christopher Ferris82d75042015-01-26 10:57:07 -0800162};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700163struct hv_kvp_msg {
Tao Baod7db5942015-01-28 10:07:51 -0800164 union {
165 struct hv_kvp_hdr kvp_hdr;
Tao Baod7db5942015-01-28 10:07:51 -0800166 int error;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700167 };
Tao Baod7db5942015-01-28 10:07:51 -0800168 union {
169 struct hv_kvp_msg_get kvp_get;
Tao Baod7db5942015-01-28 10:07:51 -0800170 struct hv_kvp_msg_set kvp_set;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700171 struct hv_kvp_msg_delete kvp_delete;
Tao Baod7db5942015-01-28 10:07:51 -0800172 struct hv_kvp_msg_enumerate kvp_enum_data;
173 struct hv_kvp_ipaddr_value kvp_ip_val;
Tao Baod7db5942015-01-28 10:07:51 -0800174 struct hv_kvp_register kvp_register;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700175 } body;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700176} __attribute__((packed));
177struct hv_kvp_ip_msg {
Tao Baod7db5942015-01-28 10:07:51 -0800178 __u8 operation;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700179 __u8 pool;
Tao Baod7db5942015-01-28 10:07:51 -0800180 struct hv_kvp_ipaddr_value kvp_ip_val;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700181} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -0800182#endif