xref: /freebsd/sys/dev/hid/hidrdesc.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
11ffa5c63SVladimir Kondratyev /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
31ffa5c63SVladimir Kondratyev  *
41ffa5c63SVladimir Kondratyev  * Copyright (c) 2000 Nick Hibma <n_hibma@FreeBSD.org>
51ffa5c63SVladimir Kondratyev  * All rights reserved.
61ffa5c63SVladimir Kondratyev  *
71ffa5c63SVladimir Kondratyev  * Copyright (c) 2005 Ed Schouten <ed@FreeBSD.org>
81ffa5c63SVladimir Kondratyev  * All rights reserved.
91ffa5c63SVladimir Kondratyev  *
101ffa5c63SVladimir Kondratyev  * Redistribution and use in source and binary forms, with or without
111ffa5c63SVladimir Kondratyev  * modification, are permitted provided that the following conditions
121ffa5c63SVladimir Kondratyev  * are met:
131ffa5c63SVladimir Kondratyev  * 1. Redistributions of source code must retain the above copyright
141ffa5c63SVladimir Kondratyev  *    notice, this list of conditions and the following disclaimer.
151ffa5c63SVladimir Kondratyev  * 2. Redistributions in binary form must reproduce the above copyright
161ffa5c63SVladimir Kondratyev  *    notice, this list of conditions and the following disclaimer in the
171ffa5c63SVladimir Kondratyev  *    documentation and/or other materials provided with the distribution.
181ffa5c63SVladimir Kondratyev  *
191ffa5c63SVladimir Kondratyev  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
201ffa5c63SVladimir Kondratyev  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
211ffa5c63SVladimir Kondratyev  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
221ffa5c63SVladimir Kondratyev  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
231ffa5c63SVladimir Kondratyev  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
241ffa5c63SVladimir Kondratyev  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
251ffa5c63SVladimir Kondratyev  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
261ffa5c63SVladimir Kondratyev  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
271ffa5c63SVladimir Kondratyev  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
281ffa5c63SVladimir Kondratyev  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
291ffa5c63SVladimir Kondratyev  * SUCH DAMAGE.
301ffa5c63SVladimir Kondratyev  *
311ffa5c63SVladimir Kondratyev  * This file contains replacements for broken HID report descriptors.
321ffa5c63SVladimir Kondratyev  */
331ffa5c63SVladimir Kondratyev 
3467de2db2SVladimir Kondratyev #define	HID_GRAPHIRE_REPORT_DESCR(...) \
351ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*  USAGE_PAGE (Digitizers)		*/\
361ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /*  USAGE (Digitizer)		*/\
371ffa5c63SVladimir Kondratyev     0xa1, 0x01,                    /*  COLLECTION (Application)		*/\
381ffa5c63SVladimir Kondratyev     0x85, 0x02,                    /*    REPORT_ID (2)			*/\
391ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*    USAGE_PAGE (Digitizers)	*/\
401ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /*    USAGE (Digitizer)		*/\
411ffa5c63SVladimir Kondratyev     0xa1, 0x00,                    /*    COLLECTION (Physical)		*/\
421ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*      LOGICAL_MINIMUM (0)		*/\
431ffa5c63SVladimir Kondratyev     0x25, 0x01,                    /*      LOGICAL_MAXIMUM (1)		*/\
441ffa5c63SVladimir Kondratyev     0x09, 0x33,                    /*      USAGE (Touch)		*/\
451ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
461ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
471ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
481ffa5c63SVladimir Kondratyev     0x09, 0x44,                    /*      USAGE (Barrel Switch)	*/\
491ffa5c63SVladimir Kondratyev     0x95, 0x02,                    /*      REPORT_COUNT (2)		*/\
501ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
511ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
521ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*      USAGE (Undefined)		*/\
531ffa5c63SVladimir Kondratyev     0x95, 0x02,                    /*      REPORT_COUNT (2)		*/\
541ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
551ffa5c63SVladimir Kondratyev     0x81, 0x03,                    /*      INPUT (Cnst,Var,Abs)		*/\
561ffa5c63SVladimir Kondratyev     0x09, 0x3c,                    /*      USAGE (Invert)		*/\
571ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
581ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
591ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
601ffa5c63SVladimir Kondratyev     0x09, 0x38,                    /*      USAGE (Transducer Index)	*/\
611ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
621ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
631ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
641ffa5c63SVladimir Kondratyev     0x09, 0x32,                    /*      USAGE (In Range)		*/\
651ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
661ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
671ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
681ffa5c63SVladimir Kondratyev     0x05, 0x01,                    /*      USAGE_PAGE (Generic Desktop)	*/\
691ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*      USAGE (X)			*/\
701ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*      LOGICAL_MINIMUM (0)		*/\
711ffa5c63SVladimir Kondratyev     0x26, 0xde, 0x27,              /*      LOGICAL_MAXIMUM (10206)	*/\
721ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
731ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*      REPORT_SIZE (16)		*/\
741ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
751ffa5c63SVladimir Kondratyev     0x09, 0x31,                    /*      USAGE (Y)			*/\
761ffa5c63SVladimir Kondratyev     0x26, 0xfe, 0x1c,              /*      LOGICAL_MAXIMUM (7422)	*/\
771ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
781ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*      REPORT_SIZE (16)		*/\
791ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
801ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*      USAGE_PAGE (Digitizers)	*/\
811ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*      USAGE (Tip Pressure)		*/\
821ffa5c63SVladimir Kondratyev     0x26, 0xff, 0x01,              /*      LOGICAL_MAXIMUM (511)	*/\
831ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
841ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*      REPORT_SIZE (16)		*/\
851ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
861ffa5c63SVladimir Kondratyev     0xc0,                          /*    END_COLLECTION			*/\
871ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*    USAGE_PAGE (Digitizers)	*/\
881ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*    USAGE (Undefined)		*/\
891ffa5c63SVladimir Kondratyev     0x85, 0x02,                    /*    REPORT_ID (2)			*/\
901ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*    REPORT_COUNT (1)		*/\
911ffa5c63SVladimir Kondratyev     0xb1, 0x02,                    /*    FEATURE (Data,Var,Abs)		*/\
921ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*    USAGE (Undefined)		*/\
931ffa5c63SVladimir Kondratyev     0x85, 0x03,                    /*    REPORT_ID (3)			*/\
941ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*    REPORT_COUNT (1)		*/\
951ffa5c63SVladimir Kondratyev     0xb1, 0x02,                    /*    FEATURE (Data,Var,Abs)		*/\
961ffa5c63SVladimir Kondratyev     0xc0,                          /*  END_COLLECTION			*/\
971ffa5c63SVladimir Kondratyev 
9867de2db2SVladimir Kondratyev #define	HID_GRAPHIRE3_4X5_REPORT_DESCR(...) \
991ffa5c63SVladimir Kondratyev     0x05, 0x01,                    /* USAGE_PAGE (Generic Desktop)	*/\
1001ffa5c63SVladimir Kondratyev     0x09, 0x02,                    /* USAGE (Mouse)			*/\
1011ffa5c63SVladimir Kondratyev     0xa1, 0x01,                    /* COLLECTION (Application)		*/\
1021ffa5c63SVladimir Kondratyev     0x85, 0x01,                    /*   REPORT_ID (1)			*/\
1031ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /*   USAGE (Pointer)			*/\
1041ffa5c63SVladimir Kondratyev     0xa1, 0x00,                    /*   COLLECTION (Physical)		*/\
1051ffa5c63SVladimir Kondratyev     0x05, 0x09,                    /*     USAGE_PAGE (Button)		*/\
1061ffa5c63SVladimir Kondratyev     0x19, 0x01,                    /*     USAGE_MINIMUM (Button 1)	*/\
1071ffa5c63SVladimir Kondratyev     0x29, 0x03,                    /*     USAGE_MAXIMUM (Button 3)	*/\
1081ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*     LOGICAL_MINIMUM (0)		*/\
1091ffa5c63SVladimir Kondratyev     0x25, 0x01,                    /*     LOGICAL_MAXIMUM (1)		*/\
1101ffa5c63SVladimir Kondratyev     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
1111ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
1121ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1131ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
1141ffa5c63SVladimir Kondratyev     0x75, 0x05,                    /*     REPORT_SIZE (5)		*/\
1151ffa5c63SVladimir Kondratyev     0x81, 0x01,                    /*     INPUT (Cnst,Ary,Abs)		*/\
1161ffa5c63SVladimir Kondratyev     0x05, 0x01,                    /*     USAGE_PAGE (Generic Desktop)	*/\
1171ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*     USAGE (X)			*/\
1181ffa5c63SVladimir Kondratyev     0x09, 0x31,                    /*     USAGE (Y)			*/\
1191ffa5c63SVladimir Kondratyev     0x09, 0x38,                    /*     USAGE (Wheel)			*/\
1201ffa5c63SVladimir Kondratyev     0x15, 0x81,                    /*     LOGICAL_MINIMUM (-127)	*/\
1211ffa5c63SVladimir Kondratyev     0x25, 0x7f,                    /*     LOGICAL_MAXIMUM (127)		*/\
1221ffa5c63SVladimir Kondratyev     0x75, 0x08,                    /*     REPORT_SIZE (8)		*/\
1231ffa5c63SVladimir Kondratyev     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
1241ffa5c63SVladimir Kondratyev     0x81, 0x06,                    /*     INPUT (Data,Var,Rel)		*/\
1251ffa5c63SVladimir Kondratyev     0xc0,                          /*   END_COLLECTION			*/\
1261ffa5c63SVladimir Kondratyev     0xc0,                          /* END_COLLECTION			*/\
1271ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /* USAGE_PAGE (Digitizers)		*/\
1281ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /* USAGE (Pointer)			*/\
1291ffa5c63SVladimir Kondratyev     0xa1, 0x01,                    /* COLLECTION (Applicaption)		*/\
1301ffa5c63SVladimir Kondratyev     0x85, 0x02,                    /*   REPORT_ID (2)			*/\
1311ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*   USAGE_PAGE (Digitizers)		*/\
1321ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /*   USAGE (Digitizer)		*/\
1331ffa5c63SVladimir Kondratyev     0xa1, 0x00,                    /*   COLLECTION (Physical)		*/\
1341ffa5c63SVladimir Kondratyev     0x09, 0x33,                    /*     USAGE (Touch)			*/\
1351ffa5c63SVladimir Kondratyev     0x09, 0x44,                    /*     USAGE (Barrel Switch)		*/\
1361ffa5c63SVladimir Kondratyev     0x09, 0x44,                    /*     USAGE (Barrel Switch)		*/\
1371ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*     LOGICAL_MINIMUM (0)		*/\
1381ffa5c63SVladimir Kondratyev     0x25, 0x01,                    /*     LOGICAL_MAXIMUM (1)		*/\
1391ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
1401ffa5c63SVladimir Kondratyev     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
1411ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1421ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
1431ffa5c63SVladimir Kondratyev     0x95, 0x02,                    /*     REPORT_COUNT (2)		*/\
1441ffa5c63SVladimir Kondratyev     0x81, 0x01,                    /*     INPUT (Cnst,Ary,Abs)		*/\
1451ffa5c63SVladimir Kondratyev     0x09, 0x3c,                    /*     USAGE (Invert)		*/\
1461ffa5c63SVladimir Kondratyev     0x09, 0x38,                    /*     USAGE (Transducer Index)	*/\
1471ffa5c63SVladimir Kondratyev     0x09, 0x32,                    /*     USAGE (In Range)		*/\
1481ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
1491ffa5c63SVladimir Kondratyev     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
1501ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1511ffa5c63SVladimir Kondratyev     0x05, 0x01,                    /*     USAGE_PAGE (Generic Desktop)	*/\
1521ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*     USAGE (X)			*/\
1531ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*     LOGICAL_MINIMUM (0)		*/\
1541ffa5c63SVladimir Kondratyev     0x26, 0xde, 0x27,              /*     LOGICAL_MAXIMUM (10206)	*/\
1551ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*     REPORT_SIZE (16)		*/\
1561ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
1571ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1581ffa5c63SVladimir Kondratyev     0x09, 0x31,                    /*     USAGE (Y)			*/\
1591ffa5c63SVladimir Kondratyev     0x26, 0xfe, 0x1c,              /*     LOGICAL_MAXIMUM (7422)	*/\
1601ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*     REPORT_SIZE (16)		*/\
1611ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
1621ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1631ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*     USAGE_PAGE (Digitizers)	*/\
1641ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*     USAGE (Tip Pressure)		*/\
1651ffa5c63SVladimir Kondratyev     0x26, 0xff, 0x01,              /*     LOGICAL_MAXIMUM (511)		*/\
1661ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*     REPORT_SIZE (16)		*/\
1671ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
1681ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1691ffa5c63SVladimir Kondratyev     0xc0,                          /*   END_COLLECTION			*/\
1701ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*   USAGE_PAGE (Digitizers)		*/\
1711ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*   USAGE (Undefined)		*/\
1721ffa5c63SVladimir Kondratyev     0x85, 0x02,                    /*   REPORT_ID (2)			*/\
1731ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*   REPORT_COUNT (1)		*/\
1741ffa5c63SVladimir Kondratyev     0xb1, 0x02,                    /*   FEATURE (Data,Var,Abs)		*/\
1751ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*   USAGE (Undefined)		*/\
1761ffa5c63SVladimir Kondratyev     0x85, 0x03,                    /*   REPORT_ID (3)			*/\
1771ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*   REPORT_COUNT (1)		*/\
1781ffa5c63SVladimir Kondratyev     0xb1, 0x02,                    /*   FEATURE (Data,Var,Abs)		*/\
1791ffa5c63SVladimir Kondratyev     0xc0                           /* END_COLLECTION			*/\
1801ffa5c63SVladimir Kondratyev 
1811ffa5c63SVladimir Kondratyev /*
1821ffa5c63SVladimir Kondratyev  * The descriptor has no output report format, thus preventing you from
1831ffa5c63SVladimir Kondratyev  * controlling the LEDs and the built-in rumblers.
1841ffa5c63SVladimir Kondratyev  */
18567de2db2SVladimir Kondratyev #define	HID_XB360GP_REPORT_DESCR(...) \
1861ffa5c63SVladimir Kondratyev     0x05, 0x01,		/* USAGE PAGE (Generic Desktop)		*/\
1871ffa5c63SVladimir Kondratyev     0x09, 0x05,		/* USAGE (Gamepad)			*/\
1881ffa5c63SVladimir Kondratyev     0xa1, 0x01,		/* COLLECTION (Application)		*/\
1891ffa5c63SVladimir Kondratyev     /* Unused */\
1901ffa5c63SVladimir Kondratyev     0x75, 0x08,		/*  REPORT SIZE (8)			*/\
1911ffa5c63SVladimir Kondratyev     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
1921ffa5c63SVladimir Kondratyev     0x81, 0x01,		/*  INPUT (Constant)			*/\
1931ffa5c63SVladimir Kondratyev     /* Byte count */\
1941ffa5c63SVladimir Kondratyev     0x75, 0x08,		/*  REPORT SIZE (8)			*/\
1951ffa5c63SVladimir Kondratyev     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
1961ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
1971ffa5c63SVladimir Kondratyev     0x09, 0x3b,		/*  USAGE (Byte Count)			*/\
1981ffa5c63SVladimir Kondratyev     0x81, 0x01,		/*  INPUT (Constant)			*/\
1991ffa5c63SVladimir Kondratyev     /* D-Pad */\
2001ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
2011ffa5c63SVladimir Kondratyev     0x09, 0x01,		/*  USAGE (Pointer)			*/\
2021ffa5c63SVladimir Kondratyev     0xa1, 0x00,		/*  COLLECTION (Physical)		*/\
2031ffa5c63SVladimir Kondratyev     0x75, 0x01,		/*   REPORT SIZE (1)			*/\
2041ffa5c63SVladimir Kondratyev     0x15, 0x00,		/*   LOGICAL MINIMUM (0)		*/\
2051ffa5c63SVladimir Kondratyev     0x25, 0x01,		/*   LOGICAL MAXIMUM (1)		*/\
2061ffa5c63SVladimir Kondratyev     0x35, 0x00,		/*   PHYSICAL MINIMUM (0)		*/\
2071ffa5c63SVladimir Kondratyev     0x45, 0x01,		/*   PHYSICAL MAXIMUM (1)		*/\
2081ffa5c63SVladimir Kondratyev     0x95, 0x04,		/*   REPORT COUNT (4)			*/\
2091ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*   USAGE PAGE (Generic Desktop)	*/\
2101ffa5c63SVladimir Kondratyev     0x09, 0x90,		/*   USAGE (D-Pad Up)			*/\
2111ffa5c63SVladimir Kondratyev     0x09, 0x91,		/*   USAGE (D-Pad Down)			*/\
2121ffa5c63SVladimir Kondratyev     0x09, 0x93,		/*   USAGE (D-Pad Left)			*/\
2131ffa5c63SVladimir Kondratyev     0x09, 0x92,		/*   USAGE (D-Pad Right)		*/\
2141ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*   INPUT (Data, Variable, Absolute)	*/\
2151ffa5c63SVladimir Kondratyev     0xc0,		/*  END COLLECTION			*/\
2161ffa5c63SVladimir Kondratyev     /* Buttons 5-11 */\
2171ffa5c63SVladimir Kondratyev     0x75, 0x01,		/*  REPORT SIZE (1)			*/\
2181ffa5c63SVladimir Kondratyev     0x15, 0x00,		/*  LOGICAL MINIMUM (0)			*/\
2191ffa5c63SVladimir Kondratyev     0x25, 0x01,		/*  LOGICAL MAXIMUM (1)			*/\
2201ffa5c63SVladimir Kondratyev     0x35, 0x00,		/*  PHYSICAL MINIMUM (0)		*/\
2211ffa5c63SVladimir Kondratyev     0x45, 0x01,		/*  PHYSICAL MAXIMUM (1)		*/\
2221ffa5c63SVladimir Kondratyev     0x95, 0x07,		/*  REPORT COUNT (7)			*/\
2231ffa5c63SVladimir Kondratyev     0x05, 0x09,		/*  USAGE PAGE (Button)			*/\
2241ffa5c63SVladimir Kondratyev     0x09, 0x08,		/*  USAGE (Button 8)			*/\
2251ffa5c63SVladimir Kondratyev     0x09, 0x07,		/*  USAGE (Button 7)			*/\
2261ffa5c63SVladimir Kondratyev     0x09, 0x09,		/*  USAGE (Button 9)			*/\
2271ffa5c63SVladimir Kondratyev     0x09, 0x0a,		/*  USAGE (Button 10)			*/\
2281ffa5c63SVladimir Kondratyev     0x09, 0x05,		/*  USAGE (Button 5)			*/\
2291ffa5c63SVladimir Kondratyev     0x09, 0x06,		/*  USAGE (Button 6)			*/\
2301ffa5c63SVladimir Kondratyev     0x09, 0x0b,		/*  USAGE (Button 11)			*/\
2311ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
2321ffa5c63SVladimir Kondratyev     /* Unused */\
2331ffa5c63SVladimir Kondratyev     0x75, 0x01,		/*  REPORT SIZE (1)			*/\
2341ffa5c63SVladimir Kondratyev     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
2351ffa5c63SVladimir Kondratyev     0x81, 0x01,		/*  INPUT (Constant)			*/\
2361ffa5c63SVladimir Kondratyev     /* Buttons 1-4 */\
2371ffa5c63SVladimir Kondratyev     0x75, 0x01,		/*  REPORT SIZE (1)			*/\
2381ffa5c63SVladimir Kondratyev     0x15, 0x00,		/*  LOGICAL MINIMUM (0)			*/\
2391ffa5c63SVladimir Kondratyev     0x25, 0x01,		/*  LOGICAL MAXIMUM (1)			*/\
2401ffa5c63SVladimir Kondratyev     0x35, 0x00,		/*  PHYSICAL MINIMUM (0)		*/\
2411ffa5c63SVladimir Kondratyev     0x45, 0x01,		/*  PHYSICAL MAXIMUM (1)		*/\
2421ffa5c63SVladimir Kondratyev     0x95, 0x04,		/*  REPORT COUNT (4)			*/\
2431ffa5c63SVladimir Kondratyev     0x05, 0x09,		/*  USAGE PAGE (Button)			*/\
2441ffa5c63SVladimir Kondratyev     0x19, 0x01,		/*  USAGE MINIMUM (Button 1)		*/\
2451ffa5c63SVladimir Kondratyev     0x29, 0x04,		/*  USAGE MAXIMUM (Button 4)		*/\
2461ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
2471ffa5c63SVladimir Kondratyev     /* Triggers */\
2481ffa5c63SVladimir Kondratyev     0x75, 0x08,		/*  REPORT SIZE (8)			*/\
2491ffa5c63SVladimir Kondratyev     0x15, 0x00,		/*  LOGICAL MINIMUM (0)			*/\
2501ffa5c63SVladimir Kondratyev     0x26, 0xff, 0x00,	/*  LOGICAL MAXIMUM (255)		*/\
2511ffa5c63SVladimir Kondratyev     0x35, 0x00,		/*  PHYSICAL MINIMUM (0)		*/\
2521ffa5c63SVladimir Kondratyev     0x46, 0xff, 0x00,	/*  PHYSICAL MAXIMUM (255)		*/\
2531ffa5c63SVladimir Kondratyev     0x95, 0x02,		/*  REPORT SIZE (2)			*/\
2541ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
2551ffa5c63SVladimir Kondratyev     0x09, 0x32,		/*  USAGE (Z)				*/\
2561ffa5c63SVladimir Kondratyev     0x09, 0x35,		/*  USAGE (Rz)				*/\
2571ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
2581ffa5c63SVladimir Kondratyev     /* Sticks */\
2591ffa5c63SVladimir Kondratyev     0x75, 0x10,		/*  REPORT SIZE (16)			*/\
2601ffa5c63SVladimir Kondratyev     0x16, 0x00, 0x80,	/*  LOGICAL MINIMUM (-32768)		*/\
2611ffa5c63SVladimir Kondratyev     0x26, 0xff, 0x7f,	/*  LOGICAL MAXIMUM (32767)		*/\
2621ffa5c63SVladimir Kondratyev     0x36, 0x00, 0x80,	/*  PHYSICAL MINIMUM (-32768)		*/\
2631ffa5c63SVladimir Kondratyev     0x46, 0xff, 0x7f,	/*  PHYSICAL MAXIMUM (32767)		*/\
2641ffa5c63SVladimir Kondratyev     0x95, 0x04,		/*  REPORT COUNT (4)			*/\
2651ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
2661ffa5c63SVladimir Kondratyev     0x09, 0x30,		/*  USAGE (X)				*/\
2671ffa5c63SVladimir Kondratyev     0x09, 0x31,		/*  USAGE (Y)				*/\
2681ffa5c63SVladimir Kondratyev     0x09, 0x33,		/*  USAGE (Rx)				*/\
2691ffa5c63SVladimir Kondratyev     0x09, 0x34,		/*  USAGE (Ry)				*/\
2701ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
2711ffa5c63SVladimir Kondratyev     /* Unused */\
2721ffa5c63SVladimir Kondratyev     0x75, 0x30,		/*  REPORT SIZE (48)			*/\
2731ffa5c63SVladimir Kondratyev     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
2741ffa5c63SVladimir Kondratyev     0x81, 0x01,		/*  INPUT (Constant)			*/\
2751ffa5c63SVladimir Kondratyev     0xc0		/* END COLLECTION			*/\
2761ffa5c63SVladimir Kondratyev 
2771ffa5c63SVladimir Kondratyev /* Fixed report descriptor for Super Nintendo gamepads */
27867de2db2SVladimir Kondratyev #define	HID_SNES_REPORT_DESCR(...) \
2791ffa5c63SVladimir Kondratyev     0x05, 0x01,         /*  Usage Page (Desktop),           */\
2801ffa5c63SVladimir Kondratyev     0x09, 0x04,         /*  Usage (Joystik),                */\
2811ffa5c63SVladimir Kondratyev     0xA1, 0x01,         /*  Collection (Application),       */\
2821ffa5c63SVladimir Kondratyev     0xA1, 0x02,         /*      Collection (Logical),       */\
2831ffa5c63SVladimir Kondratyev     0x14,               /*          Logical Minimum (0),    */\
2841ffa5c63SVladimir Kondratyev     0x75, 0x08,         /*          Report Size (8),        */\
2851ffa5c63SVladimir Kondratyev     0x95, 0x03,         /*          Report Count (3),       */\
2861ffa5c63SVladimir Kondratyev     0x81, 0x01,         /*          Input (Constant),       */\
2871ffa5c63SVladimir Kondratyev     0x26, 0xFF, 0x00,   /*          Logical Maximum (255),  */\
2881ffa5c63SVladimir Kondratyev     0x95, 0x02,         /*          Report Count (2),       */\
2891ffa5c63SVladimir Kondratyev     0x09, 0x30,         /*          Usage (X),              */\
2901ffa5c63SVladimir Kondratyev     0x09, 0x31,         /*          Usage (Y),              */\
2911ffa5c63SVladimir Kondratyev     0x81, 0x02,         /*          Input (Variable),       */\
2921ffa5c63SVladimir Kondratyev     0x75, 0x01,         /*          Report Size (1),        */\
2931ffa5c63SVladimir Kondratyev     0x95, 0x04,         /*          Report Count (4),       */\
2941ffa5c63SVladimir Kondratyev     0x81, 0x01,         /*          Input (Constant),       */\
2951ffa5c63SVladimir Kondratyev     0x25, 0x01,         /*          Logical Maximum (1),    */\
2961ffa5c63SVladimir Kondratyev     0x95, 0x0A,         /*          Report Count (10),      */\
2971ffa5c63SVladimir Kondratyev     0x05, 0x09,         /*          Usage Page (Button),    */\
2981ffa5c63SVladimir Kondratyev     0x19, 0x01,         /*          Usage Minimum (01h),    */\
2991ffa5c63SVladimir Kondratyev     0x29, 0x0A,         /*          Usage Maximum (0Ah),    */\
3001ffa5c63SVladimir Kondratyev     0x81, 0x02,         /*          Input (Variable),       */\
3011ffa5c63SVladimir Kondratyev     0x95, 0x0A,         /*          Report Count (10),      */\
3021ffa5c63SVladimir Kondratyev     0x81, 0x01,         /*          Input (Constant),       */\
3031ffa5c63SVladimir Kondratyev     0xC0,               /*      End Collection,             */\
3041ffa5c63SVladimir Kondratyev     0xC0                /*  End Collection                  */
30567de2db2SVladimir Kondratyev 
30667de2db2SVladimir Kondratyev /* HID mouse boot protocol descriptor */
30767de2db2SVladimir Kondratyev #define	HID_MOUSE_BOOTPROTO_DESCR(...) \
30867de2db2SVladimir Kondratyev     0x05, 0x01,		/* Usage Page (Generic Desktop Ctrls)	*/\
30967de2db2SVladimir Kondratyev     0x09, 0x02,		/* Usage (Mouse)			*/\
31067de2db2SVladimir Kondratyev     0xA1, 0x01,		/* Collection (Application)		*/\
31167de2db2SVladimir Kondratyev     0x09, 0x01,		/*   Usage (Pointer)			*/\
31267de2db2SVladimir Kondratyev     0xA1, 0x00,		/*   Collection (Physical)		*/\
31367de2db2SVladimir Kondratyev     0x95, 0x03,		/*     Report Count (3)			*/\
31467de2db2SVladimir Kondratyev     0x75, 0x01,		/*     Report Size (1)			*/\
31567de2db2SVladimir Kondratyev     0x05, 0x09,		/*     Usage Page (Button)		*/\
31667de2db2SVladimir Kondratyev     0x19, 0x01,		/*     Usage Minimum (0x01)		*/\
31767de2db2SVladimir Kondratyev     0x29, 0x03,		/*     Usage Maximum (0x03)		*/\
31867de2db2SVladimir Kondratyev     0x15, 0x00,		/*     Logical Minimum (0)		*/\
31967de2db2SVladimir Kondratyev     0x25, 0x01,		/*     Logical Maximum (1)		*/\
32067de2db2SVladimir Kondratyev     0x81, 0x02,		/*     Input (Data,Var,Abs)		*/\
32167de2db2SVladimir Kondratyev     0x95, 0x01,		/*     Report Count (1)			*/\
32267de2db2SVladimir Kondratyev     0x75, 0x05,		/*     Report Size (5)			*/\
32367de2db2SVladimir Kondratyev     0x81, 0x03,		/*     Input (Const)			*/\
32467de2db2SVladimir Kondratyev     0x75, 0x08,		/*     Report Size (8)			*/\
32567de2db2SVladimir Kondratyev     0x95, 0x02,		/*     Report Count (2)			*/\
32667de2db2SVladimir Kondratyev     0x05, 0x01,		/*     Usage Page (Generic Desktop Ctrls) */\
32767de2db2SVladimir Kondratyev     0x09, 0x30,		/*     Usage (X)			*/\
32867de2db2SVladimir Kondratyev     0x09, 0x31,		/*     Usage (Y)			*/\
32967de2db2SVladimir Kondratyev     0x15, 0x81,		/*     Logical Minimum (-127)		*/\
33067de2db2SVladimir Kondratyev     0x25, 0x7F,		/*     Logical Maximum (127)		*/\
33167de2db2SVladimir Kondratyev     0x81, 0x06,		/*     Input (Data,Var,Rel)		*/\
33267de2db2SVladimir Kondratyev     0xC0,      		/*   End Collection			*/\
33367de2db2SVladimir Kondratyev     0xC0,      		/* End Collection			*/
33467de2db2SVladimir Kondratyev 
33567de2db2SVladimir Kondratyev /* HID keyboard boot protocol descriptor */
33667de2db2SVladimir Kondratyev #define	HID_KBD_BOOTPROTO_DESCR(...) \
33767de2db2SVladimir Kondratyev     0x05, 0x01,		/* Usage Page (Generic Desktop Ctrls)	*/\
33867de2db2SVladimir Kondratyev     0x09, 0x06,		/* Usage (Keyboard)			*/\
33967de2db2SVladimir Kondratyev     0xA1, 0x01,		/* Collection (Application)		*/\
34067de2db2SVladimir Kondratyev     0x05, 0x07,		/*   Usage Page (Kbrd/Keypad)		*/\
34167de2db2SVladimir Kondratyev     0x19, 0xE0,		/*   Usage Minimum (0xE0)		*/\
34267de2db2SVladimir Kondratyev     0x29, 0xE7,		/*   Usage Maximum (0xE7)		*/\
34367de2db2SVladimir Kondratyev     0x15, 0x00,		/*   Logical Minimum (0)		*/\
34467de2db2SVladimir Kondratyev     0x25, 0x01,		/*   Logical Maximum (1)		*/\
34567de2db2SVladimir Kondratyev     0x75, 0x01,		/*   Report Size (1)			*/\
34667de2db2SVladimir Kondratyev     0x95, 0x08,		/*   Report Count (8)			*/\
34767de2db2SVladimir Kondratyev     0x81, 0x02,		/*   Input (Data,Var,Abs)		*/\
34867de2db2SVladimir Kondratyev     0x95, 0x01,		/*   Report Count (1)			*/\
34967de2db2SVladimir Kondratyev     0x75, 0x08,		/*   Report Size (8)			*/\
35067de2db2SVladimir Kondratyev     0x81, 0x01,		/*   Input (Const,Array,Abs)		*/\
35167de2db2SVladimir Kondratyev     0x95, 0x03,		/*   Report Count (3)			*/\
35267de2db2SVladimir Kondratyev     0x75, 0x01,		/*   Report Size (1)			*/\
35367de2db2SVladimir Kondratyev     0x05, 0x08,		/*   Usage Page (LEDs)			*/\
35467de2db2SVladimir Kondratyev     0x19, 0x01,		/*   Usage Minimum (Num Lock)		*/\
35567de2db2SVladimir Kondratyev     0x29, 0x03,		/*   Usage Maximum (Scroll Lock)	*/\
35667de2db2SVladimir Kondratyev     0x91, 0x02,		/*   Output (Data,Var,Abs)		*/\
35767de2db2SVladimir Kondratyev     0x95, 0x05,		/*   Report Count (5)			*/\
35867de2db2SVladimir Kondratyev     0x75, 0x01,		/*   Report Size (1)			*/\
35967de2db2SVladimir Kondratyev     0x91, 0x01,		/*   Output (Const,Array,Abs)		*/\
36067de2db2SVladimir Kondratyev     0x95, 0x06,		/*   Report Count (6)			*/\
36167de2db2SVladimir Kondratyev     0x75, 0x08,		/*   Report Size (8)			*/\
36267de2db2SVladimir Kondratyev     0x15, 0x00,		/*   Logical Minimum (0)		*/\
36367de2db2SVladimir Kondratyev     0x26, 0xFF, 0x00,	/*   Logical Maximum (255)		*/\
36467de2db2SVladimir Kondratyev     0x05, 0x07,		/*   Usage Page (Kbrd/Keypad)		*/\
36567de2db2SVladimir Kondratyev     0x19, 0x00,		/*   Usage Minimum (0x00)		*/\
36667de2db2SVladimir Kondratyev     0x2A, 0xFF, 0x00,	/*   Usage Maximum (0xFF)		*/\
36767de2db2SVladimir Kondratyev     0x81, 0x00,		/*   Input (Data,Array,Abs)		*/\
36867de2db2SVladimir Kondratyev     0xC0,		/* End Collection			*/
369