1/*
2 * Copyright 2009, Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Michael Lotz <mmlr@mlotz.ch>
7 */
8#ifndef VMWARE_TYPES_H
9#define VMWARE_TYPES_H
10
11#define VMWARE_PORT_MAGIC					0x564d5868
12#define VMWARE_PORT_NUMBER					0x5658
13
14#define VMWARE_VERSION_ID					0x3442554a
15#define VMWARE_ERROR						0xffff
16
17#define VMWARE_VALUE_DISABLE				0x000000f5
18#define VMWARE_VALUE_READ_ID				0x45414552
19#define VMWARE_VALUE_REQUEST_ABSOLUTE		0x53424152
20
21#define VMWARE_COMMAND_POINTER_DATA		39
22#define VMWARE_COMMAND_POINTER_STATUS		40
23#define VMWARE_COMMAND_POINTER_COMMAND		41
24
25
26struct command_s {
27	uint32	magic;
28	uint32	value;
29	uint32	command;
30	uint32	port;
31} _PACKED;
32
33
34struct data_s {
35	uint16	buttons;
36	uint16	flags;
37	int32	x; // signed when relative
38	int32	y; // signed when relative
39	int32	z; // always signed
40} _PACKED;
41
42
43struct status_s {
44	uint16	num_words;
45	uint16	status;
46	uint32	unused[2];
47} _PACKED;
48
49
50struct version_s {
51	uint32	version;
52	uint32	unused[3];
53} _PACKED;
54
55
56union packet_u {
57	struct command_s	command;
58	struct data_s		data;
59	struct status_s		status;
60	struct version_s	version;
61};
62
63#endif // VMWARE_TYPES_H
64