xref: /freebsd/sys/dev/hid/hidrdesc.h (revision 67de2db2623a10dc4edec1642b2f8685d5587d7f)
11ffa5c63SVladimir Kondratyev /*-
21ffa5c63SVladimir Kondratyev  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
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  * $FreeBSD$
321ffa5c63SVladimir Kondratyev  *
331ffa5c63SVladimir Kondratyev  * This file contains replacements for broken HID report descriptors.
341ffa5c63SVladimir Kondratyev  */
351ffa5c63SVladimir Kondratyev 
36*67de2db2SVladimir Kondratyev #define	HID_GRAPHIRE_REPORT_DESCR(...) \
371ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*  USAGE_PAGE (Digitizers)		*/\
381ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /*  USAGE (Digitizer)		*/\
391ffa5c63SVladimir Kondratyev     0xa1, 0x01,                    /*  COLLECTION (Application)		*/\
401ffa5c63SVladimir Kondratyev     0x85, 0x02,                    /*    REPORT_ID (2)			*/\
411ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*    USAGE_PAGE (Digitizers)	*/\
421ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /*    USAGE (Digitizer)		*/\
431ffa5c63SVladimir Kondratyev     0xa1, 0x00,                    /*    COLLECTION (Physical)		*/\
441ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*      LOGICAL_MINIMUM (0)		*/\
451ffa5c63SVladimir Kondratyev     0x25, 0x01,                    /*      LOGICAL_MAXIMUM (1)		*/\
461ffa5c63SVladimir Kondratyev     0x09, 0x33,                    /*      USAGE (Touch)		*/\
471ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
481ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
491ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
501ffa5c63SVladimir Kondratyev     0x09, 0x44,                    /*      USAGE (Barrel Switch)	*/\
511ffa5c63SVladimir Kondratyev     0x95, 0x02,                    /*      REPORT_COUNT (2)		*/\
521ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
531ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
541ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*      USAGE (Undefined)		*/\
551ffa5c63SVladimir Kondratyev     0x95, 0x02,                    /*      REPORT_COUNT (2)		*/\
561ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
571ffa5c63SVladimir Kondratyev     0x81, 0x03,                    /*      INPUT (Cnst,Var,Abs)		*/\
581ffa5c63SVladimir Kondratyev     0x09, 0x3c,                    /*      USAGE (Invert)		*/\
591ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
601ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
611ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
621ffa5c63SVladimir Kondratyev     0x09, 0x38,                    /*      USAGE (Transducer Index)	*/\
631ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
641ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
651ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
661ffa5c63SVladimir Kondratyev     0x09, 0x32,                    /*      USAGE (In Range)		*/\
671ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
681ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*      REPORT_SIZE (1)		*/\
691ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
701ffa5c63SVladimir Kondratyev     0x05, 0x01,                    /*      USAGE_PAGE (Generic Desktop)	*/\
711ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*      USAGE (X)			*/\
721ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*      LOGICAL_MINIMUM (0)		*/\
731ffa5c63SVladimir Kondratyev     0x26, 0xde, 0x27,              /*      LOGICAL_MAXIMUM (10206)	*/\
741ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
751ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*      REPORT_SIZE (16)		*/\
761ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
771ffa5c63SVladimir Kondratyev     0x09, 0x31,                    /*      USAGE (Y)			*/\
781ffa5c63SVladimir Kondratyev     0x26, 0xfe, 0x1c,              /*      LOGICAL_MAXIMUM (7422)	*/\
791ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
801ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*      REPORT_SIZE (16)		*/\
811ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
821ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*      USAGE_PAGE (Digitizers)	*/\
831ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*      USAGE (Tip Pressure)		*/\
841ffa5c63SVladimir Kondratyev     0x26, 0xff, 0x01,              /*      LOGICAL_MAXIMUM (511)	*/\
851ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*      REPORT_COUNT (1)		*/\
861ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*      REPORT_SIZE (16)		*/\
871ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*      INPUT (Data,Var,Abs)		*/\
881ffa5c63SVladimir Kondratyev     0xc0,                          /*    END_COLLECTION			*/\
891ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*    USAGE_PAGE (Digitizers)	*/\
901ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*    USAGE (Undefined)		*/\
911ffa5c63SVladimir Kondratyev     0x85, 0x02,                    /*    REPORT_ID (2)			*/\
921ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*    REPORT_COUNT (1)		*/\
931ffa5c63SVladimir Kondratyev     0xb1, 0x02,                    /*    FEATURE (Data,Var,Abs)		*/\
941ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*    USAGE (Undefined)		*/\
951ffa5c63SVladimir Kondratyev     0x85, 0x03,                    /*    REPORT_ID (3)			*/\
961ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*    REPORT_COUNT (1)		*/\
971ffa5c63SVladimir Kondratyev     0xb1, 0x02,                    /*    FEATURE (Data,Var,Abs)		*/\
981ffa5c63SVladimir Kondratyev     0xc0,                          /*  END_COLLECTION			*/\
991ffa5c63SVladimir Kondratyev 
100*67de2db2SVladimir Kondratyev #define	HID_GRAPHIRE3_4X5_REPORT_DESCR(...) \
1011ffa5c63SVladimir Kondratyev     0x05, 0x01,                    /* USAGE_PAGE (Generic Desktop)	*/\
1021ffa5c63SVladimir Kondratyev     0x09, 0x02,                    /* USAGE (Mouse)			*/\
1031ffa5c63SVladimir Kondratyev     0xa1, 0x01,                    /* COLLECTION (Application)		*/\
1041ffa5c63SVladimir Kondratyev     0x85, 0x01,                    /*   REPORT_ID (1)			*/\
1051ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /*   USAGE (Pointer)			*/\
1061ffa5c63SVladimir Kondratyev     0xa1, 0x00,                    /*   COLLECTION (Physical)		*/\
1071ffa5c63SVladimir Kondratyev     0x05, 0x09,                    /*     USAGE_PAGE (Button)		*/\
1081ffa5c63SVladimir Kondratyev     0x19, 0x01,                    /*     USAGE_MINIMUM (Button 1)	*/\
1091ffa5c63SVladimir Kondratyev     0x29, 0x03,                    /*     USAGE_MAXIMUM (Button 3)	*/\
1101ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*     LOGICAL_MINIMUM (0)		*/\
1111ffa5c63SVladimir Kondratyev     0x25, 0x01,                    /*     LOGICAL_MAXIMUM (1)		*/\
1121ffa5c63SVladimir Kondratyev     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
1131ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
1141ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1151ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
1161ffa5c63SVladimir Kondratyev     0x75, 0x05,                    /*     REPORT_SIZE (5)		*/\
1171ffa5c63SVladimir Kondratyev     0x81, 0x01,                    /*     INPUT (Cnst,Ary,Abs)		*/\
1181ffa5c63SVladimir Kondratyev     0x05, 0x01,                    /*     USAGE_PAGE (Generic Desktop)	*/\
1191ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*     USAGE (X)			*/\
1201ffa5c63SVladimir Kondratyev     0x09, 0x31,                    /*     USAGE (Y)			*/\
1211ffa5c63SVladimir Kondratyev     0x09, 0x38,                    /*     USAGE (Wheel)			*/\
1221ffa5c63SVladimir Kondratyev     0x15, 0x81,                    /*     LOGICAL_MINIMUM (-127)	*/\
1231ffa5c63SVladimir Kondratyev     0x25, 0x7f,                    /*     LOGICAL_MAXIMUM (127)		*/\
1241ffa5c63SVladimir Kondratyev     0x75, 0x08,                    /*     REPORT_SIZE (8)		*/\
1251ffa5c63SVladimir Kondratyev     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
1261ffa5c63SVladimir Kondratyev     0x81, 0x06,                    /*     INPUT (Data,Var,Rel)		*/\
1271ffa5c63SVladimir Kondratyev     0xc0,                          /*   END_COLLECTION			*/\
1281ffa5c63SVladimir Kondratyev     0xc0,                          /* END_COLLECTION			*/\
1291ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /* USAGE_PAGE (Digitizers)		*/\
1301ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /* USAGE (Pointer)			*/\
1311ffa5c63SVladimir Kondratyev     0xa1, 0x01,                    /* COLLECTION (Applicaption)		*/\
1321ffa5c63SVladimir Kondratyev     0x85, 0x02,                    /*   REPORT_ID (2)			*/\
1331ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*   USAGE_PAGE (Digitizers)		*/\
1341ffa5c63SVladimir Kondratyev     0x09, 0x01,                    /*   USAGE (Digitizer)		*/\
1351ffa5c63SVladimir Kondratyev     0xa1, 0x00,                    /*   COLLECTION (Physical)		*/\
1361ffa5c63SVladimir Kondratyev     0x09, 0x33,                    /*     USAGE (Touch)			*/\
1371ffa5c63SVladimir Kondratyev     0x09, 0x44,                    /*     USAGE (Barrel Switch)		*/\
1381ffa5c63SVladimir Kondratyev     0x09, 0x44,                    /*     USAGE (Barrel Switch)		*/\
1391ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*     LOGICAL_MINIMUM (0)		*/\
1401ffa5c63SVladimir Kondratyev     0x25, 0x01,                    /*     LOGICAL_MAXIMUM (1)		*/\
1411ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
1421ffa5c63SVladimir Kondratyev     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
1431ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1441ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
1451ffa5c63SVladimir Kondratyev     0x95, 0x02,                    /*     REPORT_COUNT (2)		*/\
1461ffa5c63SVladimir Kondratyev     0x81, 0x01,                    /*     INPUT (Cnst,Ary,Abs)		*/\
1471ffa5c63SVladimir Kondratyev     0x09, 0x3c,                    /*     USAGE (Invert)		*/\
1481ffa5c63SVladimir Kondratyev     0x09, 0x38,                    /*     USAGE (Transducer Index)	*/\
1491ffa5c63SVladimir Kondratyev     0x09, 0x32,                    /*     USAGE (In Range)		*/\
1501ffa5c63SVladimir Kondratyev     0x75, 0x01,                    /*     REPORT_SIZE (1)		*/\
1511ffa5c63SVladimir Kondratyev     0x95, 0x03,                    /*     REPORT_COUNT (3)		*/\
1521ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1531ffa5c63SVladimir Kondratyev     0x05, 0x01,                    /*     USAGE_PAGE (Generic Desktop)	*/\
1541ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*     USAGE (X)			*/\
1551ffa5c63SVladimir Kondratyev     0x15, 0x00,                    /*     LOGICAL_MINIMUM (0)		*/\
1561ffa5c63SVladimir Kondratyev     0x26, 0xde, 0x27,              /*     LOGICAL_MAXIMUM (10206)	*/\
1571ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*     REPORT_SIZE (16)		*/\
1581ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
1591ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1601ffa5c63SVladimir Kondratyev     0x09, 0x31,                    /*     USAGE (Y)			*/\
1611ffa5c63SVladimir Kondratyev     0x26, 0xfe, 0x1c,              /*     LOGICAL_MAXIMUM (7422)	*/\
1621ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*     REPORT_SIZE (16)		*/\
1631ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
1641ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1651ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*     USAGE_PAGE (Digitizers)	*/\
1661ffa5c63SVladimir Kondratyev     0x09, 0x30,                    /*     USAGE (Tip Pressure)		*/\
1671ffa5c63SVladimir Kondratyev     0x26, 0xff, 0x01,              /*     LOGICAL_MAXIMUM (511)		*/\
1681ffa5c63SVladimir Kondratyev     0x75, 0x10,                    /*     REPORT_SIZE (16)		*/\
1691ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*     REPORT_COUNT (1)		*/\
1701ffa5c63SVladimir Kondratyev     0x81, 0x02,                    /*     INPUT (Data,Var,Abs)		*/\
1711ffa5c63SVladimir Kondratyev     0xc0,                          /*   END_COLLECTION			*/\
1721ffa5c63SVladimir Kondratyev     0x05, 0x0d,                    /*   USAGE_PAGE (Digitizers)		*/\
1731ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*   USAGE (Undefined)		*/\
1741ffa5c63SVladimir Kondratyev     0x85, 0x02,                    /*   REPORT_ID (2)			*/\
1751ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*   REPORT_COUNT (1)		*/\
1761ffa5c63SVladimir Kondratyev     0xb1, 0x02,                    /*   FEATURE (Data,Var,Abs)		*/\
1771ffa5c63SVladimir Kondratyev     0x09, 0x00,                    /*   USAGE (Undefined)		*/\
1781ffa5c63SVladimir Kondratyev     0x85, 0x03,                    /*   REPORT_ID (3)			*/\
1791ffa5c63SVladimir Kondratyev     0x95, 0x01,                    /*   REPORT_COUNT (1)		*/\
1801ffa5c63SVladimir Kondratyev     0xb1, 0x02,                    /*   FEATURE (Data,Var,Abs)		*/\
1811ffa5c63SVladimir Kondratyev     0xc0                           /* END_COLLECTION			*/\
1821ffa5c63SVladimir Kondratyev 
1831ffa5c63SVladimir Kondratyev /*
1841ffa5c63SVladimir Kondratyev  * The descriptor has no output report format, thus preventing you from
1851ffa5c63SVladimir Kondratyev  * controlling the LEDs and the built-in rumblers.
1861ffa5c63SVladimir Kondratyev  */
187*67de2db2SVladimir Kondratyev #define	HID_XB360GP_REPORT_DESCR(...) \
1881ffa5c63SVladimir Kondratyev     0x05, 0x01,		/* USAGE PAGE (Generic Desktop)		*/\
1891ffa5c63SVladimir Kondratyev     0x09, 0x05,		/* USAGE (Gamepad)			*/\
1901ffa5c63SVladimir Kondratyev     0xa1, 0x01,		/* COLLECTION (Application)		*/\
1911ffa5c63SVladimir Kondratyev     /* Unused */\
1921ffa5c63SVladimir Kondratyev     0x75, 0x08,		/*  REPORT SIZE (8)			*/\
1931ffa5c63SVladimir Kondratyev     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
1941ffa5c63SVladimir Kondratyev     0x81, 0x01,		/*  INPUT (Constant)			*/\
1951ffa5c63SVladimir Kondratyev     /* Byte count */\
1961ffa5c63SVladimir Kondratyev     0x75, 0x08,		/*  REPORT SIZE (8)			*/\
1971ffa5c63SVladimir Kondratyev     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
1981ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
1991ffa5c63SVladimir Kondratyev     0x09, 0x3b,		/*  USAGE (Byte Count)			*/\
2001ffa5c63SVladimir Kondratyev     0x81, 0x01,		/*  INPUT (Constant)			*/\
2011ffa5c63SVladimir Kondratyev     /* D-Pad */\
2021ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
2031ffa5c63SVladimir Kondratyev     0x09, 0x01,		/*  USAGE (Pointer)			*/\
2041ffa5c63SVladimir Kondratyev     0xa1, 0x00,		/*  COLLECTION (Physical)		*/\
2051ffa5c63SVladimir Kondratyev     0x75, 0x01,		/*   REPORT SIZE (1)			*/\
2061ffa5c63SVladimir Kondratyev     0x15, 0x00,		/*   LOGICAL MINIMUM (0)		*/\
2071ffa5c63SVladimir Kondratyev     0x25, 0x01,		/*   LOGICAL MAXIMUM (1)		*/\
2081ffa5c63SVladimir Kondratyev     0x35, 0x00,		/*   PHYSICAL MINIMUM (0)		*/\
2091ffa5c63SVladimir Kondratyev     0x45, 0x01,		/*   PHYSICAL MAXIMUM (1)		*/\
2101ffa5c63SVladimir Kondratyev     0x95, 0x04,		/*   REPORT COUNT (4)			*/\
2111ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*   USAGE PAGE (Generic Desktop)	*/\
2121ffa5c63SVladimir Kondratyev     0x09, 0x90,		/*   USAGE (D-Pad Up)			*/\
2131ffa5c63SVladimir Kondratyev     0x09, 0x91,		/*   USAGE (D-Pad Down)			*/\
2141ffa5c63SVladimir Kondratyev     0x09, 0x93,		/*   USAGE (D-Pad Left)			*/\
2151ffa5c63SVladimir Kondratyev     0x09, 0x92,		/*   USAGE (D-Pad Right)		*/\
2161ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*   INPUT (Data, Variable, Absolute)	*/\
2171ffa5c63SVladimir Kondratyev     0xc0,		/*  END COLLECTION			*/\
2181ffa5c63SVladimir Kondratyev     /* Buttons 5-11 */\
2191ffa5c63SVladimir Kondratyev     0x75, 0x01,		/*  REPORT SIZE (1)			*/\
2201ffa5c63SVladimir Kondratyev     0x15, 0x00,		/*  LOGICAL MINIMUM (0)			*/\
2211ffa5c63SVladimir Kondratyev     0x25, 0x01,		/*  LOGICAL MAXIMUM (1)			*/\
2221ffa5c63SVladimir Kondratyev     0x35, 0x00,		/*  PHYSICAL MINIMUM (0)		*/\
2231ffa5c63SVladimir Kondratyev     0x45, 0x01,		/*  PHYSICAL MAXIMUM (1)		*/\
2241ffa5c63SVladimir Kondratyev     0x95, 0x07,		/*  REPORT COUNT (7)			*/\
2251ffa5c63SVladimir Kondratyev     0x05, 0x09,		/*  USAGE PAGE (Button)			*/\
2261ffa5c63SVladimir Kondratyev     0x09, 0x08,		/*  USAGE (Button 8)			*/\
2271ffa5c63SVladimir Kondratyev     0x09, 0x07,		/*  USAGE (Button 7)			*/\
2281ffa5c63SVladimir Kondratyev     0x09, 0x09,		/*  USAGE (Button 9)			*/\
2291ffa5c63SVladimir Kondratyev     0x09, 0x0a,		/*  USAGE (Button 10)			*/\
2301ffa5c63SVladimir Kondratyev     0x09, 0x05,		/*  USAGE (Button 5)			*/\
2311ffa5c63SVladimir Kondratyev     0x09, 0x06,		/*  USAGE (Button 6)			*/\
2321ffa5c63SVladimir Kondratyev     0x09, 0x0b,		/*  USAGE (Button 11)			*/\
2331ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
2341ffa5c63SVladimir Kondratyev     /* Unused */\
2351ffa5c63SVladimir Kondratyev     0x75, 0x01,		/*  REPORT SIZE (1)			*/\
2361ffa5c63SVladimir Kondratyev     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
2371ffa5c63SVladimir Kondratyev     0x81, 0x01,		/*  INPUT (Constant)			*/\
2381ffa5c63SVladimir Kondratyev     /* Buttons 1-4 */\
2391ffa5c63SVladimir Kondratyev     0x75, 0x01,		/*  REPORT SIZE (1)			*/\
2401ffa5c63SVladimir Kondratyev     0x15, 0x00,		/*  LOGICAL MINIMUM (0)			*/\
2411ffa5c63SVladimir Kondratyev     0x25, 0x01,		/*  LOGICAL MAXIMUM (1)			*/\
2421ffa5c63SVladimir Kondratyev     0x35, 0x00,		/*  PHYSICAL MINIMUM (0)		*/\
2431ffa5c63SVladimir Kondratyev     0x45, 0x01,		/*  PHYSICAL MAXIMUM (1)		*/\
2441ffa5c63SVladimir Kondratyev     0x95, 0x04,		/*  REPORT COUNT (4)			*/\
2451ffa5c63SVladimir Kondratyev     0x05, 0x09,		/*  USAGE PAGE (Button)			*/\
2461ffa5c63SVladimir Kondratyev     0x19, 0x01,		/*  USAGE MINIMUM (Button 1)		*/\
2471ffa5c63SVladimir Kondratyev     0x29, 0x04,		/*  USAGE MAXIMUM (Button 4)		*/\
2481ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
2491ffa5c63SVladimir Kondratyev     /* Triggers */\
2501ffa5c63SVladimir Kondratyev     0x75, 0x08,		/*  REPORT SIZE (8)			*/\
2511ffa5c63SVladimir Kondratyev     0x15, 0x00,		/*  LOGICAL MINIMUM (0)			*/\
2521ffa5c63SVladimir Kondratyev     0x26, 0xff, 0x00,	/*  LOGICAL MAXIMUM (255)		*/\
2531ffa5c63SVladimir Kondratyev     0x35, 0x00,		/*  PHYSICAL MINIMUM (0)		*/\
2541ffa5c63SVladimir Kondratyev     0x46, 0xff, 0x00,	/*  PHYSICAL MAXIMUM (255)		*/\
2551ffa5c63SVladimir Kondratyev     0x95, 0x02,		/*  REPORT SIZE (2)			*/\
2561ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
2571ffa5c63SVladimir Kondratyev     0x09, 0x32,		/*  USAGE (Z)				*/\
2581ffa5c63SVladimir Kondratyev     0x09, 0x35,		/*  USAGE (Rz)				*/\
2591ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
2601ffa5c63SVladimir Kondratyev     /* Sticks */\
2611ffa5c63SVladimir Kondratyev     0x75, 0x10,		/*  REPORT SIZE (16)			*/\
2621ffa5c63SVladimir Kondratyev     0x16, 0x00, 0x80,	/*  LOGICAL MINIMUM (-32768)		*/\
2631ffa5c63SVladimir Kondratyev     0x26, 0xff, 0x7f,	/*  LOGICAL MAXIMUM (32767)		*/\
2641ffa5c63SVladimir Kondratyev     0x36, 0x00, 0x80,	/*  PHYSICAL MINIMUM (-32768)		*/\
2651ffa5c63SVladimir Kondratyev     0x46, 0xff, 0x7f,	/*  PHYSICAL MAXIMUM (32767)		*/\
2661ffa5c63SVladimir Kondratyev     0x95, 0x04,		/*  REPORT COUNT (4)			*/\
2671ffa5c63SVladimir Kondratyev     0x05, 0x01,		/*  USAGE PAGE (Generic Desktop)	*/\
2681ffa5c63SVladimir Kondratyev     0x09, 0x30,		/*  USAGE (X)				*/\
2691ffa5c63SVladimir Kondratyev     0x09, 0x31,		/*  USAGE (Y)				*/\
2701ffa5c63SVladimir Kondratyev     0x09, 0x33,		/*  USAGE (Rx)				*/\
2711ffa5c63SVladimir Kondratyev     0x09, 0x34,		/*  USAGE (Ry)				*/\
2721ffa5c63SVladimir Kondratyev     0x81, 0x02,		/*  INPUT (Data, Variable, Absolute)	*/\
2731ffa5c63SVladimir Kondratyev     /* Unused */\
2741ffa5c63SVladimir Kondratyev     0x75, 0x30,		/*  REPORT SIZE (48)			*/\
2751ffa5c63SVladimir Kondratyev     0x95, 0x01,		/*  REPORT COUNT (1)			*/\
2761ffa5c63SVladimir Kondratyev     0x81, 0x01,		/*  INPUT (Constant)			*/\
2771ffa5c63SVladimir Kondratyev     0xc0		/* END COLLECTION			*/\
2781ffa5c63SVladimir Kondratyev 
2791ffa5c63SVladimir Kondratyev /* Fixed report descriptor for Super Nintendo gamepads */
280*67de2db2SVladimir Kondratyev #define	HID_SNES_REPORT_DESCR(...) \
2811ffa5c63SVladimir Kondratyev     0x05, 0x01,         /*  Usage Page (Desktop),           */\
2821ffa5c63SVladimir Kondratyev     0x09, 0x04,         /*  Usage (Joystik),                */\
2831ffa5c63SVladimir Kondratyev     0xA1, 0x01,         /*  Collection (Application),       */\
2841ffa5c63SVladimir Kondratyev     0xA1, 0x02,         /*      Collection (Logical),       */\
2851ffa5c63SVladimir Kondratyev     0x14,               /*          Logical Minimum (0),    */\
2861ffa5c63SVladimir Kondratyev     0x75, 0x08,         /*          Report Size (8),        */\
2871ffa5c63SVladimir Kondratyev     0x95, 0x03,         /*          Report Count (3),       */\
2881ffa5c63SVladimir Kondratyev     0x81, 0x01,         /*          Input (Constant),       */\
2891ffa5c63SVladimir Kondratyev     0x26, 0xFF, 0x00,   /*          Logical Maximum (255),  */\
2901ffa5c63SVladimir Kondratyev     0x95, 0x02,         /*          Report Count (2),       */\
2911ffa5c63SVladimir Kondratyev     0x09, 0x30,         /*          Usage (X),              */\
2921ffa5c63SVladimir Kondratyev     0x09, 0x31,         /*          Usage (Y),              */\
2931ffa5c63SVladimir Kondratyev     0x81, 0x02,         /*          Input (Variable),       */\
2941ffa5c63SVladimir Kondratyev     0x75, 0x01,         /*          Report Size (1),        */\
2951ffa5c63SVladimir Kondratyev     0x95, 0x04,         /*          Report Count (4),       */\
2961ffa5c63SVladimir Kondratyev     0x81, 0x01,         /*          Input (Constant),       */\
2971ffa5c63SVladimir Kondratyev     0x25, 0x01,         /*          Logical Maximum (1),    */\
2981ffa5c63SVladimir Kondratyev     0x95, 0x0A,         /*          Report Count (10),      */\
2991ffa5c63SVladimir Kondratyev     0x05, 0x09,         /*          Usage Page (Button),    */\
3001ffa5c63SVladimir Kondratyev     0x19, 0x01,         /*          Usage Minimum (01h),    */\
3011ffa5c63SVladimir Kondratyev     0x29, 0x0A,         /*          Usage Maximum (0Ah),    */\
3021ffa5c63SVladimir Kondratyev     0x81, 0x02,         /*          Input (Variable),       */\
3031ffa5c63SVladimir Kondratyev     0x95, 0x0A,         /*          Report Count (10),      */\
3041ffa5c63SVladimir Kondratyev     0x81, 0x01,         /*          Input (Constant),       */\
3051ffa5c63SVladimir Kondratyev     0xC0,               /*      End Collection,             */\
3061ffa5c63SVladimir Kondratyev     0xC0                /*  End Collection                  */
307*67de2db2SVladimir Kondratyev 
308*67de2db2SVladimir Kondratyev /* HID mouse boot protocol descriptor */
309*67de2db2SVladimir Kondratyev #define	HID_MOUSE_BOOTPROTO_DESCR(...) \
310*67de2db2SVladimir Kondratyev     0x05, 0x01,		/* Usage Page (Generic Desktop Ctrls)	*/\
311*67de2db2SVladimir Kondratyev     0x09, 0x02,		/* Usage (Mouse)			*/\
312*67de2db2SVladimir Kondratyev     0xA1, 0x01,		/* Collection (Application)		*/\
313*67de2db2SVladimir Kondratyev     0x09, 0x01,		/*   Usage (Pointer)			*/\
314*67de2db2SVladimir Kondratyev     0xA1, 0x00,		/*   Collection (Physical)		*/\
315*67de2db2SVladimir Kondratyev     0x95, 0x03,		/*     Report Count (3)			*/\
316*67de2db2SVladimir Kondratyev     0x75, 0x01,		/*     Report Size (1)			*/\
317*67de2db2SVladimir Kondratyev     0x05, 0x09,		/*     Usage Page (Button)		*/\
318*67de2db2SVladimir Kondratyev     0x19, 0x01,		/*     Usage Minimum (0x01)		*/\
319*67de2db2SVladimir Kondratyev     0x29, 0x03,		/*     Usage Maximum (0x03)		*/\
320*67de2db2SVladimir Kondratyev     0x15, 0x00,		/*     Logical Minimum (0)		*/\
321*67de2db2SVladimir Kondratyev     0x25, 0x01,		/*     Logical Maximum (1)		*/\
322*67de2db2SVladimir Kondratyev     0x81, 0x02,		/*     Input (Data,Var,Abs)		*/\
323*67de2db2SVladimir Kondratyev     0x95, 0x01,		/*     Report Count (1)			*/\
324*67de2db2SVladimir Kondratyev     0x75, 0x05,		/*     Report Size (5)			*/\
325*67de2db2SVladimir Kondratyev     0x81, 0x03,		/*     Input (Const)			*/\
326*67de2db2SVladimir Kondratyev     0x75, 0x08,		/*     Report Size (8)			*/\
327*67de2db2SVladimir Kondratyev     0x95, 0x02,		/*     Report Count (2)			*/\
328*67de2db2SVladimir Kondratyev     0x05, 0x01,		/*     Usage Page (Generic Desktop Ctrls) */\
329*67de2db2SVladimir Kondratyev     0x09, 0x30,		/*     Usage (X)			*/\
330*67de2db2SVladimir Kondratyev     0x09, 0x31,		/*     Usage (Y)			*/\
331*67de2db2SVladimir Kondratyev     0x15, 0x81,		/*     Logical Minimum (-127)		*/\
332*67de2db2SVladimir Kondratyev     0x25, 0x7F,		/*     Logical Maximum (127)		*/\
333*67de2db2SVladimir Kondratyev     0x81, 0x06,		/*     Input (Data,Var,Rel)		*/\
334*67de2db2SVladimir Kondratyev     0xC0,      		/*   End Collection			*/\
335*67de2db2SVladimir Kondratyev     0xC0,      		/* End Collection			*/
336*67de2db2SVladimir Kondratyev 
337*67de2db2SVladimir Kondratyev /* HID keyboard boot protocol descriptor */
338*67de2db2SVladimir Kondratyev #define	HID_KBD_BOOTPROTO_DESCR(...) \
339*67de2db2SVladimir Kondratyev     0x05, 0x01,		/* Usage Page (Generic Desktop Ctrls)	*/\
340*67de2db2SVladimir Kondratyev     0x09, 0x06,		/* Usage (Keyboard)			*/\
341*67de2db2SVladimir Kondratyev     0xA1, 0x01,		/* Collection (Application)		*/\
342*67de2db2SVladimir Kondratyev     0x05, 0x07,		/*   Usage Page (Kbrd/Keypad)		*/\
343*67de2db2SVladimir Kondratyev     0x19, 0xE0,		/*   Usage Minimum (0xE0)		*/\
344*67de2db2SVladimir Kondratyev     0x29, 0xE7,		/*   Usage Maximum (0xE7)		*/\
345*67de2db2SVladimir Kondratyev     0x15, 0x00,		/*   Logical Minimum (0)		*/\
346*67de2db2SVladimir Kondratyev     0x25, 0x01,		/*   Logical Maximum (1)		*/\
347*67de2db2SVladimir Kondratyev     0x75, 0x01,		/*   Report Size (1)			*/\
348*67de2db2SVladimir Kondratyev     0x95, 0x08,		/*   Report Count (8)			*/\
349*67de2db2SVladimir Kondratyev     0x81, 0x02,		/*   Input (Data,Var,Abs)		*/\
350*67de2db2SVladimir Kondratyev     0x95, 0x01,		/*   Report Count (1)			*/\
351*67de2db2SVladimir Kondratyev     0x75, 0x08,		/*   Report Size (8)			*/\
352*67de2db2SVladimir Kondratyev     0x81, 0x01,		/*   Input (Const,Array,Abs)		*/\
353*67de2db2SVladimir Kondratyev     0x95, 0x03,		/*   Report Count (3)			*/\
354*67de2db2SVladimir Kondratyev     0x75, 0x01,		/*   Report Size (1)			*/\
355*67de2db2SVladimir Kondratyev     0x05, 0x08,		/*   Usage Page (LEDs)			*/\
356*67de2db2SVladimir Kondratyev     0x19, 0x01,		/*   Usage Minimum (Num Lock)		*/\
357*67de2db2SVladimir Kondratyev     0x29, 0x03,		/*   Usage Maximum (Scroll Lock)	*/\
358*67de2db2SVladimir Kondratyev     0x91, 0x02,		/*   Output (Data,Var,Abs)		*/\
359*67de2db2SVladimir Kondratyev     0x95, 0x05,		/*   Report Count (5)			*/\
360*67de2db2SVladimir Kondratyev     0x75, 0x01,		/*   Report Size (1)			*/\
361*67de2db2SVladimir Kondratyev     0x91, 0x01,		/*   Output (Const,Array,Abs)		*/\
362*67de2db2SVladimir Kondratyev     0x95, 0x06,		/*   Report Count (6)			*/\
363*67de2db2SVladimir Kondratyev     0x75, 0x08,		/*   Report Size (8)			*/\
364*67de2db2SVladimir Kondratyev     0x15, 0x00,		/*   Logical Minimum (0)		*/\
365*67de2db2SVladimir Kondratyev     0x26, 0xFF, 0x00,	/*   Logical Maximum (255)		*/\
366*67de2db2SVladimir Kondratyev     0x05, 0x07,		/*   Usage Page (Kbrd/Keypad)		*/\
367*67de2db2SVladimir Kondratyev     0x19, 0x00,		/*   Usage Minimum (0x00)		*/\
368*67de2db2SVladimir Kondratyev     0x2A, 0xFF, 0x00,	/*   Usage Maximum (0xFF)		*/\
369*67de2db2SVladimir Kondratyev     0x81, 0x00,		/*   Input (Data,Array,Abs)		*/\
370*67de2db2SVladimir Kondratyev     0xC0,		/* End Collection			*/
371