blob: 4790bbf3d65f75665d45c5cedfca5cbf52e6bc1e [file] [log] [blame]
Christopher Ferrisba8d4f42014-09-03 19:56:49 -07001/****************************************************************************
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_HYPERV_H
20#define _UAPI_HYPERV_H
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070021#include <linux/types.h>
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070022#define UTIL_FW_MINOR 0
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070023#define UTIL_WS2K8_FW_MAJOR 1
24#define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR << 16 | UTIL_FW_MINOR)
25#define UTIL_FW_MAJOR 3
26#define UTIL_FW_VERSION (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070027#define VSS_OP_REGISTER 128
Christopher Ferris05d08e92016-02-04 13:16:38 -080028#define VSS_OP_REGISTER1 129
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070029enum hv_vss_op {
Tao Baod7db5942015-01-28 10:07:51 -080030 VSS_OP_CREATE = 0,
Christopher Ferris05d08e92016-02-04 13:16:38 -080031 VSS_OP_DELETE,
Tao Baod7db5942015-01-28 10:07:51 -080032 VSS_OP_HOT_BACKUP,
33 VSS_OP_GET_DM_INFO,
34 VSS_OP_BU_COMPLETE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080035 VSS_OP_FREEZE,
Tao Baod7db5942015-01-28 10:07:51 -080036 VSS_OP_THAW,
37 VSS_OP_AUTO_RECOVER,
38 VSS_OP_COUNT
Christopher Ferris05d08e92016-02-04 13:16:38 -080039};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070040struct hv_vss_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080041 __u8 operation;
42 __u8 reserved[7];
Christopher Ferris05d08e92016-02-04 13:16:38 -080043} __attribute__((packed));
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070044#define VSS_HBU_NO_AUTO_RECOVERY 0x00000005
45struct hv_vss_check_feature {
Tao Baod7db5942015-01-28 10:07:51 -080046 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080047} __attribute__((packed));
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070048struct hv_vss_check_dm_info {
Tao Baod7db5942015-01-28 10:07:51 -080049 __u32 flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070050} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -080051struct hv_vss_msg {
Tao Baod7db5942015-01-28 10:07:51 -080052 union {
53 struct hv_vss_hdr vss_hdr;
54 int error;
Christopher Ferris05d08e92016-02-04 13:16:38 -080055 };
Tao Baod7db5942015-01-28 10:07:51 -080056 union {
57 struct hv_vss_check_feature vss_cf;
58 struct hv_vss_check_dm_info dm_info;
Christopher Ferris05d08e92016-02-04 13:16:38 -080059 };
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070060} __attribute__((packed));
61#define FCOPY_VERSION_0 0
Christopher Ferris05d08e92016-02-04 13:16:38 -080062#define FCOPY_VERSION_1 1
Christopher Ferris05d08e92016-02-04 13:16:38 -080063#define FCOPY_CURRENT_VERSION FCOPY_VERSION_1
64#define W_MAX_PATH 260
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070065enum hv_fcopy_op {
Tao Baod7db5942015-01-28 10:07:51 -080066 START_FILE_COPY = 0,
67 WRITE_TO_FILE,
68 COMPLETE_FCOPY,
Tao Baod7db5942015-01-28 10:07:51 -080069 CANCEL_FCOPY,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070070};
71struct hv_fcopy_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080072 __u32 operation;
Christopher Ferrisaf09c702020-06-01 20:29:29 -070073 __u8 service_id0[16];
74 __u8 service_id1[16];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070075} __attribute__((packed));
76#define OVER_WRITE 0x1
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070077#define CREATE_PATH 0x2
78struct hv_start_fcopy {
Tao Baod7db5942015-01-28 10:07:51 -080079 struct hv_fcopy_hdr hdr;
80 __u16 file_name[W_MAX_PATH];
Tao Baod7db5942015-01-28 10:07:51 -080081 __u16 path_name[W_MAX_PATH];
82 __u32 copy_flags;
83 __u64 file_size;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070084} __attribute__((packed));
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070085#define DATA_FRAGMENT (6 * 1024)
86struct hv_do_fcopy {
Tao Baod7db5942015-01-28 10:07:51 -080087 struct hv_fcopy_hdr hdr;
88 __u32 pad;
Tao Baod7db5942015-01-28 10:07:51 -080089 __u64 offset;
90 __u32 size;
91 __u8 data[DATA_FRAGMENT];
Christopher Ferris82d75042015-01-26 10:57:07 -080092} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -080093#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE (2048)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070094#define HV_KVP_EXCHANGE_MAX_KEY_SIZE (512)
95#define REG_SZ 1
96#define REG_U32 4
Christopher Ferris82d75042015-01-26 10:57:07 -080097#define REG_U64 8
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070098#define KVP_OP_REGISTER 4
99#define KVP_OP_REGISTER1 100
100enum hv_kvp_exchg_op {
Tao Baod7db5942015-01-28 10:07:51 -0800101 KVP_OP_GET = 0,
102 KVP_OP_SET,
103 KVP_OP_DELETE,
104 KVP_OP_ENUMERATE,
Tao Baod7db5942015-01-28 10:07:51 -0800105 KVP_OP_GET_IP_INFO,
106 KVP_OP_SET_IP_INFO,
107 KVP_OP_COUNT
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700108};
Christopher Ferris82d75042015-01-26 10:57:07 -0800109enum hv_kvp_exchg_pool {
Tao Baod7db5942015-01-28 10:07:51 -0800110 KVP_POOL_EXTERNAL = 0,
111 KVP_POOL_GUEST,
112 KVP_POOL_AUTO,
Tao Baod7db5942015-01-28 10:07:51 -0800113 KVP_POOL_AUTO_EXTERNAL,
114 KVP_POOL_AUTO_INTERNAL,
115 KVP_POOL_COUNT
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700116};
Christopher Ferris82d75042015-01-26 10:57:07 -0800117#define HV_S_OK 0x00000000
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700118#define HV_E_FAIL 0x80004005
119#define HV_S_CONT 0x80070103
120#define HV_ERROR_NOT_SUPPORTED 0x80070032
Christopher Ferris82d75042015-01-26 10:57:07 -0800121#define HV_ERROR_MACHINE_LOCKED 0x800704F7
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700122#define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F
123#define HV_INVALIDARG 0x80070057
124#define HV_GUID_NOTFOUND 0x80041002
Christopher Ferris82d75042015-01-26 10:57:07 -0800125#define HV_ERROR_ALREADY_EXISTS 0x80070050
Christopher Ferris106b3a82016-08-24 12:15:38 -0700126#define HV_ERROR_DISK_FULL 0x80070070
Christopher Ferris106b3a82016-08-24 12:15:38 -0700127#define ADDR_FAMILY_NONE 0x00
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700128#define ADDR_FAMILY_IPV4 0x01
129#define ADDR_FAMILY_IPV6 0x02
Christopher Ferris82d75042015-01-26 10:57:07 -0800130#define MAX_ADAPTER_ID_SIZE 128
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131#define MAX_IP_ADDR_SIZE 1024
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700132#define MAX_GATEWAY_SIZE 512
133struct hv_kvp_ipaddr_value {
Tao Baod7db5942015-01-28 10:07:51 -0800134 __u16 adapter_id[MAX_ADAPTER_ID_SIZE];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700135 __u8 addr_family;
Tao Baod7db5942015-01-28 10:07:51 -0800136 __u8 dhcp_enabled;
137 __u16 ip_addr[MAX_IP_ADDR_SIZE];
Tao Baod7db5942015-01-28 10:07:51 -0800138 __u16 sub_net[MAX_IP_ADDR_SIZE];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139 __u16 gate_way[MAX_GATEWAY_SIZE];
Tao Baod7db5942015-01-28 10:07:51 -0800140 __u16 dns_addr[MAX_IP_ADDR_SIZE];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700141} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -0800142struct hv_kvp_hdr {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700143 __u8 operation;
Tao Baod7db5942015-01-28 10:07:51 -0800144 __u8 pool;
145 __u16 pad;
Christopher Ferris82d75042015-01-26 10:57:07 -0800146} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700147struct hv_kvp_exchg_msg_value {
Tao Baod7db5942015-01-28 10:07:51 -0800148 __u32 value_type;
149 __u32 key_size;
Tao Baod7db5942015-01-28 10:07:51 -0800150 __u32 value_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700151 __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
Tao Baod7db5942015-01-28 10:07:51 -0800152 union {
153 __u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
Tao Baod7db5942015-01-28 10:07:51 -0800154 __u32 value_u32;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700155 __u64 value_u64;
Tao Baod7db5942015-01-28 10:07:51 -0800156 };
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700157} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -0800158struct hv_kvp_msg_enumerate {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159 __u32 index;
Tao Baod7db5942015-01-28 10:07:51 -0800160 struct hv_kvp_exchg_msg_value data;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700161} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -0800162struct hv_kvp_msg_get {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700163 struct hv_kvp_exchg_msg_value data;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700164};
165struct hv_kvp_msg_set {
Tao Baod7db5942015-01-28 10:07:51 -0800166 struct hv_kvp_exchg_msg_value data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700167};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700168struct hv_kvp_msg_delete {
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u32 key_size;
Tao Baod7db5942015-01-28 10:07:51 -0800170 __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700171};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700172struct hv_kvp_register {
Tao Baod7db5942015-01-28 10:07:51 -0800173 __u8 version[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
Christopher Ferris82d75042015-01-26 10:57:07 -0800174};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700175struct hv_kvp_msg {
Tao Baod7db5942015-01-28 10:07:51 -0800176 union {
177 struct hv_kvp_hdr kvp_hdr;
Tao Baod7db5942015-01-28 10:07:51 -0800178 int error;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700179 };
Tao Baod7db5942015-01-28 10:07:51 -0800180 union {
181 struct hv_kvp_msg_get kvp_get;
Tao Baod7db5942015-01-28 10:07:51 -0800182 struct hv_kvp_msg_set kvp_set;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700183 struct hv_kvp_msg_delete kvp_delete;
Tao Baod7db5942015-01-28 10:07:51 -0800184 struct hv_kvp_msg_enumerate kvp_enum_data;
185 struct hv_kvp_ipaddr_value kvp_ip_val;
Tao Baod7db5942015-01-28 10:07:51 -0800186 struct hv_kvp_register kvp_register;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700187 } body;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700188} __attribute__((packed));
189struct hv_kvp_ip_msg {
Tao Baod7db5942015-01-28 10:07:51 -0800190 __u8 operation;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700191 __u8 pool;
Tao Baod7db5942015-01-28 10:07:51 -0800192 struct hv_kvp_ipaddr_value kvp_ip_val;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700193} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -0800194#endif