xref: /freebsd/sys/dev/hid/hidrdesc.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2000 Nick Hibma <n_hibma@FreeBSD.org>
5  * All rights reserved.
6  *
7  * Copyright (c) 2005 Ed Schouten <ed@FreeBSD.org>
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29  * SUCH DAMAGE.
30  *
31  * This file contains replacements for broken HID report descriptors.
32  */
33 
34 #define	HID_GRAPHIRE_REPORT_DESCR(...) \
35     0x05, 0x0d,                    /*  USAGE_PAGE (Digitizers)		*/\
36     0x09, 0x01,                    /*  USAGE (Digitizer)		*/\
37     0xa1, 0x01,                    /*  COLLECTION (Application)		*/\
38     0x85, 0x02,                    /*    REPORT_ID (2)			*/\
39     0x05, 0x0d,                    /*    USAGE_PAGE (Digitizers)	*/\
40     0x09, 0x01,                    /*    USAGE (Digitizer)		*/\
41     0xa1, 0x00,                    /*    COLLECTION (Physical)		*/\
42     0x15, 0x00,                    /*      LOGICAL_MINIMUM (0)		*/\
43     0x25, 0x01,                    /*      LOGICAL_MAXIMUM (1)		*/\
44     0x09, 0x33,                    /*      USAGE (Touch)		*/\
45     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
46     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
47     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
48     0x09, 0x44,                    /*      USAGE (Barrel Switch)	*/\
49     0x95, 0x02,                    /*      REPORT_COUNT (2)		*/\
50     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
51     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
52     0x09, 0x00,                    /*      USAGE (Undefined)		*/\
53     0x95, 0x02,                    /*      REPORT_COUNT (2)		*/\
54     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
55     0x81, 0x03,                    /*      INPUT (Cnst,Var,Abs)		*/\
56     0x09, 0x3c,                    /*      USAGE (Invert)		*/\
57     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
58     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
59     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
60     0x09, 0x38,                    /*      USAGE (Transducer Index)	*/\
61     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
62     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
63     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
64     0x09, 0x32,                    /*      USAGE (In Range)		*/\
65     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
66     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
67     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
68     0x05, 0x01,                    /*      USAGE_PAGE (Generic Desktop)	*/\
69     0x09, 0x30,                    /*      USAGE (X)			*/\
70     0x15, 0x00,                    /*      LOGICAL_MINIMUM (0)		*/\
71     0x26, 0xde, 0x27,              /*      LOGICAL_MAXIMUM (10206)	*/\
72     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
73     0x75, 0x10,                    /*      REPORT_SIZE (16)		*/\
74     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
75     0x09, 0x31,                    /*      USAGE (Y)			*/\
76     0x26, 0xfe, 0x1c,              /*      LOGICAL_MAXIMUM (7422)	*/\
77     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
78     0x75, 0x10,                    /*      REPORT_SIZE (16)		*/\
79     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
80     0x05, 0x0d,                    /*      USAGE_PAGE (Digitizers)	*/\
81     0x09, 0x30,                    /*      USAGE (Tip Pressure)		*/\
82     0x26, 0xff, 0x01,              /*      LOGICAL_MAXIMUM (511)	*/\
83     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
84     0x75, 0x10,                    /*      REPORT_SIZE (16)		*/\
85     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
86     0xc0,                          /*    END_COLLECTION			*/\
87     0x05, 0x0d,                    /*    USAGE_PAGE (Digitizers)	*/\
88     0x09, 0x00,                    /*    USAGE (Undefined)		*/\
89     0x85, 0x02,                    /*    REPORT_ID (2)			*/\
90     0x95, 0x01,                    /*    REPORT_COUNT (1)		*/\
91     0xb1, 0x02,                    /*    FEATURE (Data,Var,Abs)		*/\
92     0x09, 0x00,                    /*    USAGE (Undefined)		*/\
93     0x85, 0x03,                    /*    REPORT_ID (3)			*/\
94     0x95, 0x01,                    /*    REPORT_COUNT (1)		*/\
95     0xb1, 0x02,                    /*    FEATURE (Data,Var,Abs)		*/\
96     0xc0,                          /*  END_COLLECTION			*/\
97 
98 #define	HID_GRAPHIRE3_4X5_REPORT_DESCR(...) \
99     0x05, 0x01,                    /* USAGE_PAGE (Generic Desktop)	*/\
100     0x09, 0x02,                    /* USAGE (Mouse)			*/\
101     0xa1, 0x01,                    /* COLLECTION (Application)		*/\
102     0x85, 0x01,                    /*   REPORT_ID (1)			*/\
103     0x09, 0x01,                    /*   USAGE (Pointer)			*/\
104     0xa1, 0x00,                    /*   COLLECTION (Physical)		*/\
105     0x05, 0x09,                    /*     USAGE_PAGE (Button)		*/\
106     0x19, 0x01,                    /*     USAGE_MINIMUM (Button 1)	*/\
107     0x29, 0x03,                    /*     USAGE_MAXIMUM (Button 3)	*/\
108     0x15, 0x00,                    /*     LOGICAL_MINIMUM (0)		*/\
109     0x25, 0x01,                    /*     LOGICAL_MAXIMUM (1)		*/\
110     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
111     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
112     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
113     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
114     0x75, 0x05,                    /*     REPORT_SIZE (5)		*/\
115     0x81, 0x01,                    /*     INPUT (Cnst,Ary,Abs)		*/\
116     0x05, 0x01,                    /*     USAGE_PAGE (Generic Desktop)	*/\
117     0x09, 0x30,                    /*     USAGE (X)			*/\
118     0x09, 0x31,                    /*     USAGE (Y)			*/\
119     0x09, 0x38,                    /*     USAGE (Wheel)			*/\
120     0x15, 0x81,                    /*     LOGICAL_MINIMUM (-127)	*/\
121     0x25, 0x7f,                    /*     LOGICAL_MAXIMUM (127)		*/\
122     0x75, 0x08,                    /*     REPORT_SIZE (8)		*/\
123     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
124     0x81, 0x06,                    /*     INPUT (Data,Var,Rel)		*/\
125     0xc0,                          /*   END_COLLECTION			*/\
126     0xc0,                          /* END_COLLECTION			*/\
127     0x05, 0x0d,                    /* USAGE_PAGE (Digitizers)		*/\
128     0x09, 0x01,                    /* USAGE (Pointer)			*/\
129     0xa1, 0x01,                    /* COLLECTION (Applicaption)		*/\
130     0x85, 0x02,                    /*   REPORT_ID (2)			*/\
131     0x05, 0x0d,                    /*   USAGE_PAGE (Digitizers)		*/\
132     0x09, 0x01,                    /*   USAGE (Digitizer)		*/\
133     0xa1, 0x00,                    /*   COLLECTION (Physical)		*/\
134     0x09, 0x33,                    /*     USAGE (Touch)			*/\
135     0x09, 0x44,                    /*     USAGE (Barrel Switch)		*/\
136     0x09, 0x44,                    /*     USAGE (Barrel Switch)		*/\
137     0x15, 0x00,                    /*     LOGICAL_MINIMUM (0)		*/\
138     0x25, 0x01,                    /*     LOGICAL_MAXIMUM (1)		*/\
139     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
140     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
141     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
142     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
143     0x95, 0x02,                    /*     REPORT_COUNT (2)		*/\
144     0x81, 0x01,                    /*     INPUT (Cnst,Ary,Abs)		*/\
145     0x09, 0x3c,                    /*     USAGE (Invert)		*/\
146     0x09, 0x38,                    /*     USAGE (Transducer Index)	*/\
147     0x09, 0x32,                    /*     USAGE (In Range)		*/\
148     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
149     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
150     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
151     0x05, 0x01,                    /*     USAGE_PAGE (Generic Desktop)	*/\
152     0x09, 0x30,                    /*     USAGE (X)			*/\
153     0x15, 0x00,                    /*     LOGICAL_MINIMUM (0)		*/\
154     0x26, 0xde, 0x27,              /*     LOGICAL_MAXIMUM (10206)	*/\
155     0x75, 0x10,                    /*     REPORT_SIZE (16)		*/\
156     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
157     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
158     0x09, 0x31,                    /*     USAGE (Y)			*/\
159     0x26, 0xfe, 0x1c,              /*     LOGICAL_MAXIMUM (7422)	*/\
160     0x75, 0x10,                    /*     REPORT_SIZE (16)		*/\
161     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
162     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
163     0x05, 0x0d,                    /*     USAGE_PAGE (Digitizers)	*/\
164     0x09, 0x30,                    /*     USAGE (Tip Pressure)		*/\
165     0x26, 0xff, 0x01,              /*     LOGICAL_MAXIMUM (511)		*/\
166     0x75, 0x10,                    /*     REPORT_SIZE (16)		*/\
167     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
168     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
169     0xc0,                          /*   END_COLLECTION			*/\
170     0x05, 0x0d,                    /*   USAGE_PAGE (Digitizers)		*/\
171     0x09, 0x00,                    /*   USAGE (Undefined)		*/\
172     0x85, 0x02,                    /*   REPORT_ID (2)			*/\
173     0x95, 0x01,                    /*   REPORT_COUNT (1)		*/\
174     0xb1, 0x02,                    /*   FEATURE (Data,Var,Abs)		*/\
175     0x09, 0x00,                    /*   USAGE (Undefined)		*/\
176     0x85, 0x03,                    /*   REPORT_ID (3)			*/\
177     0x95, 0x01,                    /*   REPORT_COUNT (1)		*/\
178     0xb1, 0x02,                    /*   FEATURE (Data,Var,Abs)		*/\
179     0xc0                           /* END_COLLECTION			*/\
180 
181 /*
182  * The descriptor has no output report format, thus preventing you from
183  * controlling the LEDs and the built-in rumblers.
184  */
185 #define	HID_XB360GP_REPORT_DESCR(...) \
186     0x05, 0x01,		/* USAGE PAGE (Generic Desktop)		*/\
187     0x09, 0x05,		/* USAGE (Gamepad)			*/\
188     0xa1, 0x01,		/* COLLECTION (Application)		*/\
189     /* Unused */\
190     0x75, 0x08,		/*  REPORT SIZE (8)			*/\
191     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
192     0x81, 0x01,		/*  INPUT (Constant)			*/\
193     /* Byte count */\
194     0x75, 0x08,		/*  REPORT SIZE (8)			*/\
195     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
196     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
197     0x09, 0x3b,		/*  USAGE (Byte Count)			*/\
198     0x81, 0x01,		/*  INPUT (Constant)			*/\
199     /* D-Pad */\
200     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
201     0x09, 0x01,		/*  USAGE (Pointer)			*/\
202     0xa1, 0x00,		/*  COLLECTION (Physical)		*/\
203     0x75, 0x01,		/*   REPORT SIZE (1)			*/\
204     0x15, 0x00,		/*   LOGICAL MINIMUM (0)		*/\
205     0x25, 0x01,		/*   LOGICAL MAXIMUM (1)		*/\
206     0x35, 0x00,		/*   PHYSICAL MINIMUM (0)		*/\
207     0x45, 0x01,		/*   PHYSICAL MAXIMUM (1)		*/\
208     0x95, 0x04,		/*   REPORT COUNT (4)			*/\
209     0x05, 0x01,		/*   USAGE PAGE (Generic Desktop)	*/\
210     0x09, 0x90,		/*   USAGE (D-Pad Up)			*/\
211     0x09, 0x91,		/*   USAGE (D-Pad Down)			*/\
212     0x09, 0x93,		/*   USAGE (D-Pad Left)			*/\
213     0x09, 0x92,		/*   USAGE (D-Pad Right)		*/\
214     0x81, 0x02,		/*   INPUT (Data, Variable, Absolute)	*/\
215     0xc0,		/*  END COLLECTION			*/\
216     /* Buttons 5-11 */\
217     0x75, 0x01,		/*  REPORT SIZE (1)			*/\
218     0x15, 0x00,		/*  LOGICAL MINIMUM (0)			*/\
219     0x25, 0x01,		/*  LOGICAL MAXIMUM (1)			*/\
220     0x35, 0x00,		/*  PHYSICAL MINIMUM (0)		*/\
221     0x45, 0x01,		/*  PHYSICAL MAXIMUM (1)		*/\
222     0x95, 0x07,		/*  REPORT COUNT (7)			*/\
223     0x05, 0x09,		/*  USAGE PAGE (Button)			*/\
224     0x09, 0x08,		/*  USAGE (Button 8)			*/\
225     0x09, 0x07,		/*  USAGE (Button 7)			*/\
226     0x09, 0x09,		/*  USAGE (Button 9)			*/\
227     0x09, 0x0a,		/*  USAGE (Button 10)			*/\
228     0x09, 0x05,		/*  USAGE (Button 5)			*/\
229     0x09, 0x06,		/*  USAGE (Button 6)			*/\
230     0x09, 0x0b,		/*  USAGE (Button 11)			*/\
231     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
232     /* Unused */\
233     0x75, 0x01,		/*  REPORT SIZE (1)			*/\
234     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
235     0x81, 0x01,		/*  INPUT (Constant)			*/\
236     /* Buttons 1-4 */\
237     0x75, 0x01,		/*  REPORT SIZE (1)			*/\
238     0x15, 0x00,		/*  LOGICAL MINIMUM (0)			*/\
239     0x25, 0x01,		/*  LOGICAL MAXIMUM (1)			*/\
240     0x35, 0x00,		/*  PHYSICAL MINIMUM (0)		*/\
241     0x45, 0x01,		/*  PHYSICAL MAXIMUM (1)		*/\
242     0x95, 0x04,		/*  REPORT COUNT (4)			*/\
243     0x05, 0x09,		/*  USAGE PAGE (Button)			*/\
244     0x19, 0x01,		/*  USAGE MINIMUM (Button 1)		*/\
245     0x29, 0x04,		/*  USAGE MAXIMUM (Button 4)		*/\
246     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
247     /* Triggers */\
248     0x75, 0x08,		/*  REPORT SIZE (8)			*/\
249     0x15, 0x00,		/*  LOGICAL MINIMUM (0)			*/\
250     0x26, 0xff, 0x00,	/*  LOGICAL MAXIMUM (255)		*/\
251     0x35, 0x00,		/*  PHYSICAL MINIMUM (0)		*/\
252     0x46, 0xff, 0x00,	/*  PHYSICAL MAXIMUM (255)		*/\
253     0x95, 0x02,		/*  REPORT SIZE (2)			*/\
254     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
255     0x09, 0x32,		/*  USAGE (Z)				*/\
256     0x09, 0x35,		/*  USAGE (Rz)				*/\
257     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
258     /* Sticks */\
259     0x75, 0x10,		/*  REPORT SIZE (16)			*/\
260     0x16, 0x00, 0x80,	/*  LOGICAL MINIMUM (-32768)		*/\
261     0x26, 0xff, 0x7f,	/*  LOGICAL MAXIMUM (32767)		*/\
262     0x36, 0x00, 0x80,	/*  PHYSICAL MINIMUM (-32768)		*/\
263     0x46, 0xff, 0x7f,	/*  PHYSICAL MAXIMUM (32767)		*/\
264     0x95, 0x04,		/*  REPORT COUNT (4)			*/\
265     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
266     0x09, 0x30,		/*  USAGE (X)				*/\
267     0x09, 0x31,		/*  USAGE (Y)				*/\
268     0x09, 0x33,		/*  USAGE (Rx)				*/\
269     0x09, 0x34,		/*  USAGE (Ry)				*/\
270     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
271     /* Unused */\
272     0x75, 0x30,		/*  REPORT SIZE (48)			*/\
273     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
274     0x81, 0x01,		/*  INPUT (Constant)			*/\
275     0xc0		/* END COLLECTION			*/\
276 
277 /* Fixed report descriptor for Super Nintendo gamepads */
278 #define	HID_SNES_REPORT_DESCR(...) \
279     0x05, 0x01,         /*  Usage Page (Desktop),           */\
280     0x09, 0x04,         /*  Usage (Joystik),                */\
281     0xA1, 0x01,         /*  Collection (Application),       */\
282     0xA1, 0x02,         /*      Collection (Logical),       */\
283     0x14,               /*          Logical Minimum (0),    */\
284     0x75, 0x08,         /*          Report Size (8),        */\
285     0x95, 0x03,         /*          Report Count (3),       */\
286     0x81, 0x01,         /*          Input (Constant),       */\
287     0x26, 0xFF, 0x00,   /*          Logical Maximum (255),  */\
288     0x95, 0x02,         /*          Report Count (2),       */\
289     0x09, 0x30,         /*          Usage (X),              */\
290     0x09, 0x31,         /*          Usage (Y),              */\
291     0x81, 0x02,         /*          Input (Variable),       */\
292     0x75, 0x01,         /*          Report Size (1),        */\
293     0x95, 0x04,         /*          Report Count (4),       */\
294     0x81, 0x01,         /*          Input (Constant),       */\
295     0x25, 0x01,         /*          Logical Maximum (1),    */\
296     0x95, 0x0A,         /*          Report Count (10),      */\
297     0x05, 0x09,         /*          Usage Page (Button),    */\
298     0x19, 0x01,         /*          Usage Minimum (01h),    */\
299     0x29, 0x0A,         /*          Usage Maximum (0Ah),    */\
300     0x81, 0x02,         /*          Input (Variable),       */\
301     0x95, 0x0A,         /*          Report Count (10),      */\
302     0x81, 0x01,         /*          Input (Constant),       */\
303     0xC0,               /*      End Collection,             */\
304     0xC0                /*  End Collection                  */
305 
306 /* HID mouse boot protocol descriptor */
307 #define	HID_MOUSE_BOOTPROTO_DESCR(...) \
308     0x05, 0x01,		/* Usage Page (Generic Desktop Ctrls)	*/\
309     0x09, 0x02,		/* Usage (Mouse)			*/\
310     0xA1, 0x01,		/* Collection (Application)		*/\
311     0x09, 0x01,		/*   Usage (Pointer)			*/\
312     0xA1, 0x00,		/*   Collection (Physical)		*/\
313     0x95, 0x03,		/*     Report Count (3)			*/\
314     0x75, 0x01,		/*     Report Size (1)			*/\
315     0x05, 0x09,		/*     Usage Page (Button)		*/\
316     0x19, 0x01,		/*     Usage Minimum (0x01)		*/\
317     0x29, 0x03,		/*     Usage Maximum (0x03)		*/\
318     0x15, 0x00,		/*     Logical Minimum (0)		*/\
319     0x25, 0x01,		/*     Logical Maximum (1)		*/\
320     0x81, 0x02,		/*     Input (Data,Var,Abs)		*/\
321     0x95, 0x01,		/*     Report Count (1)			*/\
322     0x75, 0x05,		/*     Report Size (5)			*/\
323     0x81, 0x03,		/*     Input (Const)			*/\
324     0x75, 0x08,		/*     Report Size (8)			*/\
325     0x95, 0x02,		/*     Report Count (2)			*/\
326     0x05, 0x01,		/*     Usage Page (Generic Desktop Ctrls) */\
327     0x09, 0x30,		/*     Usage (X)			*/\
328     0x09, 0x31,		/*     Usage (Y)			*/\
329     0x15, 0x81,		/*     Logical Minimum (-127)		*/\
330     0x25, 0x7F,		/*     Logical Maximum (127)		*/\
331     0x81, 0x06,		/*     Input (Data,Var,Rel)		*/\
332     0xC0,      		/*   End Collection			*/\
333     0xC0,      		/* End Collection			*/
334 
335 /* HID keyboard boot protocol descriptor */
336 #define	HID_KBD_BOOTPROTO_DESCR(...) \
337     0x05, 0x01,		/* Usage Page (Generic Desktop Ctrls)	*/\
338     0x09, 0x06,		/* Usage (Keyboard)			*/\
339     0xA1, 0x01,		/* Collection (Application)		*/\
340     0x05, 0x07,		/*   Usage Page (Kbrd/Keypad)		*/\
341     0x19, 0xE0,		/*   Usage Minimum (0xE0)		*/\
342     0x29, 0xE7,		/*   Usage Maximum (0xE7)		*/\
343     0x15, 0x00,		/*   Logical Minimum (0)		*/\
344     0x25, 0x01,		/*   Logical Maximum (1)		*/\
345     0x75, 0x01,		/*   Report Size (1)			*/\
346     0x95, 0x08,		/*   Report Count (8)			*/\
347     0x81, 0x02,		/*   Input (Data,Var,Abs)		*/\
348     0x95, 0x01,		/*   Report Count (1)			*/\
349     0x75, 0x08,		/*   Report Size (8)			*/\
350     0x81, 0x01,		/*   Input (Const,Array,Abs)		*/\
351     0x95, 0x03,		/*   Report Count (3)			*/\
352     0x75, 0x01,		/*   Report Size (1)			*/\
353     0x05, 0x08,		/*   Usage Page (LEDs)			*/\
354     0x19, 0x01,		/*   Usage Minimum (Num Lock)		*/\
355     0x29, 0x03,		/*   Usage Maximum (Scroll Lock)	*/\
356     0x91, 0x02,		/*   Output (Data,Var,Abs)		*/\
357     0x95, 0x05,		/*   Report Count (5)			*/\
358     0x75, 0x01,		/*   Report Size (1)			*/\
359     0x91, 0x01,		/*   Output (Const,Array,Abs)		*/\
360     0x95, 0x06,		/*   Report Count (6)			*/\
361     0x75, 0x08,		/*   Report Size (8)			*/\
362     0x15, 0x00,		/*   Logical Minimum (0)		*/\
363     0x26, 0xFF, 0x00,	/*   Logical Maximum (255)		*/\
364     0x05, 0x07,		/*   Usage Page (Kbrd/Keypad)		*/\
365     0x19, 0x00,		/*   Usage Minimum (0x00)		*/\
366     0x2A, 0xFF, 0x00,	/*   Usage Maximum (0xFF)		*/\
367     0x81, 0x00,		/*   Input (Data,Array,Abs)		*/\
368     0xC0,		/* End Collection			*/
369