Staging: hv: hv_mouse: fix up copyright and license header
[deliverable/linux.git] / drivers / staging / hv / vmbus_hid_protocol.h
1 /*
2 * Copyright (c) 2009, Microsoft Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Authors:
18 * Hank Janssen <hjanssen@microsoft.com>
19 */
20 #ifndef _VMBUS_HID_PROTOCOL_
21 #define _VMBUS_HID_PROTOCOL_
22
23 /* The maximum size of a synthetic input message. */
24 #define SYNTHHID_MAX_INPUT_REPORT_SIZE 16
25
26 /*
27 * Current version
28 *
29 * History:
30 * Beta, RC < 2008/1/22 1,0
31 * RC > 2008/1/22 2,0
32 */
33 #define SYNTHHID_INPUT_VERSION_MAJOR 2
34 #define SYNTHHID_INPUT_VERSION_MINOR 0
35 #define SYNTHHID_INPUT_VERSION_DWORD (SYNTHHID_INPUT_VERSION_MINOR | \
36 (SYNTHHID_INPUT_VERSION_MAJOR << 16))
37
38
39 #pragma pack(push,1)
40
41 /*
42 * Message types in the synthetic input protocol
43 */
44 enum synthhid_msg_type
45 {
46 SynthHidProtocolRequest,
47 SynthHidProtocolResponse,
48 SynthHidInitialDeviceInfo,
49 SynthHidInitialDeviceInfoAck,
50 SynthHidInputReport,
51 SynthHidMax
52 };
53
54
55 /*
56 * Basic message structures.
57 */
58 typedef struct
59 {
60 enum synthhid_msg_type Type; /* Type of the enclosed message */
61 u32 Size; /* Size of the enclosed message
62 * (size of the data payload)
63 */
64 } SYNTHHID_MESSAGE_HEADER, *PSYNTHHID_MESSAGE_HEADER;
65
66 typedef struct
67 {
68 SYNTHHID_MESSAGE_HEADER Header;
69 char Data[1]; /* Enclosed message */
70 } SYNTHHID_MESSAGE, *PSYNTHHID_MESSAGE;
71
72 typedef union
73 {
74 struct {
75 u16 Minor;
76 u16 Major;
77 };
78
79 u32 AsDWord;
80 } SYNTHHID_VERSION, *PSYNTHHID_VERSION;
81
82 /*
83 * Protocol messages
84 */
85 typedef struct
86 {
87 SYNTHHID_MESSAGE_HEADER Header;
88 SYNTHHID_VERSION VersionRequested;
89 } SYNTHHID_PROTOCOL_REQUEST, *PSYNTHHID_PROTOCOL_REQUEST;
90
91 typedef struct
92 {
93 SYNTHHID_MESSAGE_HEADER Header;
94 SYNTHHID_VERSION VersionRequested;
95 unsigned char Approved;
96 } SYNTHHID_PROTOCOL_RESPONSE, *PSYNTHHID_PROTOCOL_RESPONSE;
97
98 typedef struct
99 {
100 SYNTHHID_MESSAGE_HEADER Header;
101 struct input_dev_info HidDeviceAttributes;
102 unsigned char HidDescriptorInformation[1];
103 } SYNTHHID_DEVICE_INFO, *PSYNTHHID_DEVICE_INFO;
104
105 typedef struct
106 {
107 SYNTHHID_MESSAGE_HEADER Header;
108 unsigned char Reserved;
109 } SYNTHHID_DEVICE_INFO_ACK, *PSYNTHHID_DEVICE_INFO_ACK;
110
111 typedef struct
112 {
113 SYNTHHID_MESSAGE_HEADER Header;
114 char ReportBuffer[1];
115 } SYNTHHID_INPUT_REPORT, *PSYNTHHID_INPUT_REPORT;
116
117 #pragma pack(pop)
118
119 #endif /* _VMBUS_HID_PROTOCOL_ */
120
This page took 0.09761 seconds and 5 git commands to generate.