1
2
3
4
5
6
7
8 #ifndef __UAPI_VBOXGUEST_H__
9 #define __UAPI_VBOXGUEST_H__
10
11 #include <asm/bitsperlong.h>
12 #include <linux/ioctl.h>
13 #include <linux/vbox_err.h>
14 #include <linux/vbox_vmmdev_types.h>
15
16
17 #define VBG_IOCTL_HDR_VERSION 0x10001
18
19 #define VBG_IOCTL_HDR_TYPE_DEFAULT 0
20
21
22
23
24
25
26
27 struct vbg_ioctl_hdr {
28
29 __u32 size_in;
30
31 __u32 version;
32
33 __u32 type;
34
35
36
37
38 __s32 rc;
39
40 __u32 size_out;
41
42 __u32 reserved;
43 };
44 VMMDEV_ASSERT_SIZE(vbg_ioctl_hdr, 24);
45
46
47
48
49
50
51
52
53
54
55
56 #define VBG_IOC_VERSION 0x00010000u
57
58
59
60
61
62
63
64 struct vbg_ioctl_driver_version_info {
65
66 struct vbg_ioctl_hdr hdr;
67 union {
68 struct {
69
70 __u32 req_version;
71
72
73
74
75 __u32 min_version;
76
77 __u32 reserved1;
78
79 __u32 reserved2;
80 } in;
81 struct {
82
83 __u32 session_version;
84
85 __u32 driver_version;
86
87 __u32 driver_revision;
88
89 __u32 reserved1;
90
91 __u32 reserved2;
92 } out;
93 } u;
94 };
95 VMMDEV_ASSERT_SIZE(vbg_ioctl_driver_version_info, 24 + 20);
96
97 #define VBG_IOCTL_DRIVER_VERSION_INFO \
98 _IOWR('V', 0, struct vbg_ioctl_driver_version_info)
99
100
101
102 #define VBG_IOCTL_VMMDEV_REQUEST(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 2, s)
103
104
105
106 #define VBG_IOCTL_VMMDEV_REQUEST_BIG _IOC(_IOC_READ | _IOC_WRITE, 'V', 3, 0)
107
108
109
110 struct vbg_ioctl_hgcm_connect {
111 struct vbg_ioctl_hdr hdr;
112 union {
113 struct {
114 struct vmmdev_hgcm_service_location loc;
115 } in;
116 struct {
117 __u32 client_id;
118 } out;
119 } u;
120 };
121 VMMDEV_ASSERT_SIZE(vbg_ioctl_hgcm_connect, 24 + 132);
122
123 #define VBG_IOCTL_HGCM_CONNECT \
124 _IOWR('V', 4, struct vbg_ioctl_hgcm_connect)
125
126
127
128 struct vbg_ioctl_hgcm_disconnect {
129 struct vbg_ioctl_hdr hdr;
130 union {
131 struct {
132 __u32 client_id;
133 } in;
134 } u;
135 };
136 VMMDEV_ASSERT_SIZE(vbg_ioctl_hgcm_disconnect, 24 + 4);
137
138 #define VBG_IOCTL_HGCM_DISCONNECT \
139 _IOWR('V', 5, struct vbg_ioctl_hgcm_disconnect)
140
141
142
143 struct vbg_ioctl_hgcm_call {
144
145 struct vbg_ioctl_hdr hdr;
146
147 __u32 client_id;
148
149 __u32 function;
150
151
152
153
154 __u32 timeout_ms;
155
156 __u8 interruptible;
157
158 __u8 reserved;
159
160
161
162
163
164
165
166
167
168 __u16 parm_count;
169
170
171
172
173 };
174 VMMDEV_ASSERT_SIZE(vbg_ioctl_hgcm_call, 24 + 16);
175
176 #define VBG_IOCTL_HGCM_CALL_32(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 6, s)
177 #define VBG_IOCTL_HGCM_CALL_64(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 7, s)
178 #if __BITS_PER_LONG == 64
179 #define VBG_IOCTL_HGCM_CALL(s) VBG_IOCTL_HGCM_CALL_64(s)
180 #else
181 #define VBG_IOCTL_HGCM_CALL(s) VBG_IOCTL_HGCM_CALL_32(s)
182 #endif
183
184
185
186 struct vbg_ioctl_log {
187
188 struct vbg_ioctl_hdr hdr;
189 union {
190 struct {
191
192
193
194
195
196 char msg[1];
197 } in;
198 } u;
199 };
200
201 #define VBG_IOCTL_LOG(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 9, s)
202
203
204
205 struct vbg_ioctl_wait_for_events {
206
207 struct vbg_ioctl_hdr hdr;
208 union {
209 struct {
210
211 __u32 timeout_ms;
212
213 __u32 events;
214 } in;
215 struct {
216
217 __u32 events;
218 } out;
219 } u;
220 };
221 VMMDEV_ASSERT_SIZE(vbg_ioctl_wait_for_events, 24 + 8);
222
223 #define VBG_IOCTL_WAIT_FOR_EVENTS \
224 _IOWR('V', 10, struct vbg_ioctl_wait_for_events)
225
226
227
228
229
230
231
232
233
234
235
236 #define VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS \
237 _IOWR('V', 11, struct vbg_ioctl_hdr)
238
239
240
241 struct vbg_ioctl_change_filter {
242
243 struct vbg_ioctl_hdr hdr;
244 union {
245 struct {
246
247 __u32 or_mask;
248
249 __u32 not_mask;
250 } in;
251 } u;
252 };
253 VMMDEV_ASSERT_SIZE(vbg_ioctl_change_filter, 24 + 8);
254
255
256 #define VBG_IOCTL_CHANGE_FILTER_MASK \
257 _IOWR('V', 12, struct vbg_ioctl_change_filter)
258
259
260
261 struct vbg_ioctl_set_guest_caps {
262
263 struct vbg_ioctl_hdr hdr;
264 union {
265 struct {
266
267 __u32 or_mask;
268
269 __u32 not_mask;
270 } in;
271 struct {
272
273 __u32 session_caps;
274
275 __u32 global_caps;
276 } out;
277 } u;
278 };
279 VMMDEV_ASSERT_SIZE(vbg_ioctl_set_guest_caps, 24 + 8);
280
281 #define VBG_IOCTL_CHANGE_GUEST_CAPABILITIES \
282 _IOWR('V', 14, struct vbg_ioctl_set_guest_caps)
283
284
285
286 struct vbg_ioctl_check_balloon {
287
288 struct vbg_ioctl_hdr hdr;
289 union {
290 struct {
291
292 __u32 balloon_chunks;
293
294
295
296
297 __u8 handle_in_r3;
298
299 __u8 padding[3];
300 } out;
301 } u;
302 };
303 VMMDEV_ASSERT_SIZE(vbg_ioctl_check_balloon, 24 + 8);
304
305
306
307
308
309
310
311
312 #define VBG_IOCTL_CHECK_BALLOON \
313 _IOWR('V', 17, struct vbg_ioctl_check_balloon)
314
315
316
317 struct vbg_ioctl_write_coredump {
318 struct vbg_ioctl_hdr hdr;
319 union {
320 struct {
321 __u32 flags;
322 } in;
323 } u;
324 };
325 VMMDEV_ASSERT_SIZE(vbg_ioctl_write_coredump, 24 + 4);
326
327 #define VBG_IOCTL_WRITE_CORE_DUMP \
328 _IOWR('V', 19, struct vbg_ioctl_write_coredump)
329
330 #endif