setupapi: Use lowercase device paths.
[wine.git] / include / wine / hid.h
blob236888cbdc71a9976c3df171b110ba7c1c2adade
1 /*
2 * Wine internal HID structures
4 * Copyright 2015 Aric Stewart
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_PARSE_H
22 #define __WINE_PARSE_H
24 #include "ntstatus.h"
25 #define WIN32_NO_STATUS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winternl.h"
29 #include "hidusage.h"
30 #include "ddk/hidpi.h"
32 #define HID_MAGIC 0x8491759
34 struct hid_collection_node
36 USAGE usage;
37 USAGE usage_page;
38 USHORT parent;
39 USHORT number_of_children;
40 USHORT next_sibling;
41 USHORT first_child;
42 ULONG collection_type;
45 struct hid_value_caps
47 USHORT usage_page;
48 UCHAR report_id;
49 UCHAR start_bit;
50 USHORT bit_size;
51 USHORT report_count;
52 USHORT start_byte;
53 USHORT total_bits;
54 ULONG bit_field;
55 USHORT end_byte;
56 USHORT link_collection;
57 USAGE link_usage_page;
58 USAGE link_usage;
59 ULONG flags;
60 ULONG padding[8];
61 USAGE usage_min;
62 USAGE usage_max;
63 USHORT string_min;
64 USHORT string_max;
65 USHORT designator_min;
66 USHORT designator_max;
67 USHORT data_index_min;
68 USHORT data_index_max;
69 USHORT null_value;
70 USHORT unknown;
71 LONG logical_min;
72 LONG logical_max;
73 LONG physical_min;
74 LONG physical_max;
75 LONG units;
76 LONG units_exp;
79 /* named array continues on next caps */
80 #define HID_VALUE_CAPS_ARRAY_HAS_MORE 0x01
81 #define HID_VALUE_CAPS_IS_CONSTANT 0x02
82 #define HID_VALUE_CAPS_IS_BUTTON 0x04
83 #define HID_VALUE_CAPS_IS_ABSOLUTE 0x08
84 #define HID_VALUE_CAPS_IS_RANGE 0x10
85 #define HID_VALUE_CAPS_IS_STRING_RANGE 0x40
86 #define HID_VALUE_CAPS_IS_DESIGNATOR_RANGE 0x80
88 #define HID_VALUE_CAPS_HAS_NULL(x) (((x)->bit_field & 0x40) != 0)
89 #define HID_VALUE_CAPS_IS_ARRAY(c) (((c)->bit_field & 2) == 0)
91 struct hid_preparsed_data
93 char magic[8];
94 USAGE usage;
95 USAGE usage_page;
96 USHORT unknown[2];
97 USHORT input_caps_start;
98 USHORT input_caps_count;
99 USHORT input_caps_end;
100 USHORT input_report_byte_length;
101 USHORT output_caps_start;
102 USHORT output_caps_count;
103 USHORT output_caps_end;
104 USHORT output_report_byte_length;
105 USHORT feature_caps_start;
106 USHORT feature_caps_count;
107 USHORT feature_caps_end;
108 USHORT feature_report_byte_length;
109 USHORT caps_size;
110 USHORT number_link_collection_nodes;
111 struct hid_value_caps value_caps[1];
112 /* struct hid_collection_node nodes[1] */
115 #define HID_INPUT_VALUE_CAPS(d) ((d)->value_caps + (d)->input_caps_start)
116 #define HID_OUTPUT_VALUE_CAPS(d) ((d)->value_caps + (d)->output_caps_start)
117 #define HID_FEATURE_VALUE_CAPS(d) ((d)->value_caps + (d)->feature_caps_start)
118 #define HID_COLLECTION_NODES(d) (struct hid_collection_node *)((char *)(d)->value_caps + (d)->caps_size)
120 /* Wine-specific Physical Interface Device usages */
121 /* From USB Device Class Definition for Physical Interface Devices */
122 /* https://www.usb.org/sites/default/files/documents/pid1_01.pdf */
123 #define PID_USAGE_UNDEFINED ((USAGE) 0x00)
124 #define PID_USAGE_PID ((USAGE) 0x01)
125 #define PID_USAGE_NORMAL ((USAGE) 0x20)
126 #define PID_USAGE_SET_EFFECT_REPORT ((USAGE) 0x21)
127 #define PID_USAGE_EFFECT_BLOCK_INDEX ((USAGE) 0x22)
128 #define PID_USAGE_PARAMETER_BLOCK_OFFSET ((USAGE) 0x23)
129 #define PID_USAGE_ROM_FLAG ((USAGE) 0x24)
130 #define PID_USAGE_EFFECT_TYPE ((USAGE) 0x25)
131 #define PID_USAGE_ET_CONSTANT_FORCE ((USAGE) 0x26)
132 #define PID_USAGE_ET_RAMP ((USAGE) 0x27)
133 #define PID_USAGE_ET_CUSTOM_FORCE_DATA ((USAGE) 0x28)
134 #define PID_USAGE_ET_SQUARE ((USAGE) 0x30)
135 #define PID_USAGE_ET_SINE ((USAGE) 0x31)
136 #define PID_USAGE_ET_TRIANGLE ((USAGE) 0x32)
137 #define PID_USAGE_ET_SAWTOOTH_UP ((USAGE) 0x33)
138 #define PID_USAGE_ET_SAWTOOTH_DOWN ((USAGE) 0x34)
139 #define PID_USAGE_ET_SPRING ((USAGE) 0x40)
140 #define PID_USAGE_ET_DAMPER ((USAGE) 0x41)
141 #define PID_USAGE_ET_INERTIA ((USAGE) 0x42)
142 #define PID_USAGE_ET_FRICTION ((USAGE) 0x43)
143 #define PID_USAGE_DURATION ((USAGE) 0x50)
144 #define PID_USAGE_SAMPLE_PERIOD ((USAGE) 0x51)
145 #define PID_USAGE_GAIN ((USAGE) 0x52)
146 #define PID_USAGE_TRIGGER_BUTTON ((USAGE) 0x53)
147 #define PID_USAGE_TRIGGER_REPEAT_INTERVAL ((USAGE) 0x54)
148 #define PID_USAGE_AXES_ENABLE ((USAGE) 0x55)
149 #define PID_USAGE_DIRECTION_ENABLE ((USAGE) 0x56)
150 #define PID_USAGE_DIRECTION ((USAGE) 0x57)
151 #define PID_USAGE_TYPE_SPECIFIC_BLOCK_OFFSET ((USAGE) 0x58)
152 #define PID_USAGE_BLOCK_TYPE ((USAGE) 0x59)
153 #define PID_USAGE_SET_ENVELOPE_REPORT ((USAGE) 0x5a)
154 #define PID_USAGE_ATTACK_LEVEL ((USAGE) 0x5b)
155 #define PID_USAGE_ATTACK_TIME ((USAGE) 0x5c)
156 #define PID_USAGE_FADE_LEVEL ((USAGE) 0x5d)
157 #define PID_USAGE_FADE_TIME ((USAGE) 0x5e)
158 #define PID_USAGE_SET_CONDITION_REPORT ((USAGE) 0x5f)
159 #define PID_USAGE_CP_OFFSET ((USAGE) 0x60)
160 #define PID_USAGE_POSITIVE_COEFFICIENT ((USAGE) 0x61)
161 #define PID_USAGE_NEGATIVE_COEFFICIENT ((USAGE) 0x62)
162 #define PID_USAGE_POSITIVE_SATURATION ((USAGE) 0x63)
163 #define PID_USAGE_NEGATIVE_SATURATION ((USAGE) 0x64)
164 #define PID_USAGE_DEAD_BAND ((USAGE) 0x65)
165 #define PID_USAGE_DOWNLOAD_FORCE_SAMPLE ((USAGE) 0x66)
166 #define PID_USAGE_ISOCH_CUSTOM_FORCE_ENABLE ((USAGE) 0x67)
167 #define PID_USAGE_CUSTOM_FORCE_DATA_REPORT ((USAGE) 0x68)
168 #define PID_USAGE_CUSTOM_FORCE_DATA ((USAGE) 0x69)
169 #define PID_USAGE_CUSTOM_FORCE_VENDOR_DEFINED_DATA ((USAGE) 0x6a)
170 #define PID_USAGE_SET_CUSTOM_FORCE_REPORT ((USAGE) 0x6b)
171 #define PID_USAGE_CUSTOM_FORCE_DATA_OFFSET ((USAGE) 0x6c)
172 #define PID_USAGE_SAMPLE_COUNT ((USAGE) 0x6d)
173 #define PID_USAGE_SET_PERIODIC_REPORT ((USAGE) 0x6e)
174 #define PID_USAGE_OFFSET ((USAGE) 0x6f)
175 #define PID_USAGE_MAGNITUDE ((USAGE) 0x70)
176 #define PID_USAGE_PHASE ((USAGE) 0x71)
177 #define PID_USAGE_PERIOD ((USAGE) 0x72)
178 #define PID_USAGE_SET_CONSTANT_FORCE_REPORT ((USAGE) 0x73)
179 #define PID_USAGE_SET_RAMP_FORCE_REPORT ((USAGE) 0x74)
180 #define PID_USAGE_RAMP_START ((USAGE) 0x75)
181 #define PID_USAGE_RAMP_END ((USAGE) 0x76)
182 #define PID_USAGE_EFFECT_OPERATION_REPORT ((USAGE) 0x77)
183 #define PID_USAGE_EFFECT_OPERATION ((USAGE) 0x78)
184 #define PID_USAGE_OP_EFFECT_START ((USAGE) 0x79)
185 #define PID_USAGE_OP_EFFECT_START_SOLO ((USAGE) 0x7a)
186 #define PID_USAGE_OP_EFFECT_STOP ((USAGE) 0x7b)
187 #define PID_USAGE_LOOP_COUNT ((USAGE) 0x7c)
188 #define PID_USAGE_DEVICE_GAIN_REPORT ((USAGE) 0x7d)
189 #define PID_USAGE_DEVICE_GAIN ((USAGE) 0x7e)
190 #define PID_USAGE_POOL_REPORT ((USAGE) 0x7f)
191 #define PID_USAGE_RAM_POOL_SIZE ((USAGE) 0x80)
192 #define PID_USAGE_ROM_POOL_SIZE ((USAGE) 0x81)
193 #define PID_USAGE_ROM_EFFECT_BLOCK_COUNT ((USAGE) 0x82)
194 #define PID_USAGE_SIMULTANEOUS_EFFECTS_MAX ((USAGE) 0x83)
195 #define PID_USAGE_POOL_ALIGNMENT ((USAGE) 0x84)
196 #define PID_USAGE_POOL_MOVE_REPORT ((USAGE) 0x85)
197 #define PID_USAGE_MOVE_SOURCE ((USAGE) 0x86)
198 #define PID_USAGE_MOVE_DESTINATION ((USAGE) 0x87)
199 #define PID_USAGE_MOVE_LENGTH ((USAGE) 0x88)
200 #define PID_USAGE_BLOCK_LOAD_REPORT ((USAGE) 0x89)
201 #define PID_USAGE_BLOCK_LOAD_STATUS ((USAGE) 0x8b)
202 #define PID_USAGE_BLOCK_LOAD_SUCCESS ((USAGE) 0x8c)
203 #define PID_USAGE_BLOCK_LOAD_FULL ((USAGE) 0x8d)
204 #define PID_USAGE_BLOCK_LOAD_ERROR ((USAGE) 0x8e)
205 #define PID_USAGE_BLOCK_HANDLE ((USAGE) 0x8f)
206 #define PID_USAGE_BLOCK_FREE_REPORT ((USAGE) 0x90)
207 #define PID_USAGE_TYPE_SPECIFIC_BLOCK_HANDLE ((USAGE) 0x91)
208 #define PID_USAGE_STATE_REPORT ((USAGE) 0x92)
209 #define PID_USAGE_EFFECT_PLAYING ((USAGE) 0x94)
210 #define PID_USAGE_DEVICE_CONTROL_REPORT ((USAGE) 0x95)
211 #define PID_USAGE_DEVICE_CONTROL ((USAGE) 0x96)
212 #define PID_USAGE_DC_ENABLE_ACTUATORS ((USAGE) 0x97)
213 #define PID_USAGE_DC_DISABLE_ACTUATORS ((USAGE) 0x98)
214 #define PID_USAGE_DC_STOP_ALL_EFFECTS ((USAGE) 0x99)
215 #define PID_USAGE_DC_DEVICE_RESET ((USAGE) 0x9a)
216 #define PID_USAGE_DC_DEVICE_PAUSE ((USAGE) 0x9b)
217 #define PID_USAGE_DC_DEVICE_CONTINUE ((USAGE) 0x9c)
218 #define PID_USAGE_DEVICE_PAUSED ((USAGE) 0x9f)
219 #define PID_USAGE_ACTUATORS_ENABLED ((USAGE) 0xa0)
220 #define PID_USAGE_SAFETY_SWITCH ((USAGE) 0xa4)
221 #define PID_USAGE_ACTUATOR_OVERRIDE_SWITCH ((USAGE) 0xa5)
222 #define PID_USAGE_ACTUATOR_POWER ((USAGE) 0xa6)
223 #define PID_USAGE_START_DELAY ((USAGE) 0xa7)
224 #define PID_USAGE_PARAMETER_BLOCK_SIZE ((USAGE) 0xa8)
225 #define PID_USAGE_DEVICE_MANAGED_POOL ((USAGE) 0xa9)
226 #define PID_USAGE_SHARED_PARAMETER_BLOCKS ((USAGE) 0xaa)
227 #define PID_USAGE_CREATE_NEW_EFFECT_REPORT ((USAGE) 0xab)
228 #define PID_USAGE_RAM_POOL_AVAILABLE ((USAGE) 0xac)
230 #endif /* __WINE_PARSE_H */