sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}(hhparenthuba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget /translations/zh_CN/hid/hidintromodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}(hhhh2ubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/zh_TW/hid/hidintromodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}(hhhhFubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/it_IT/hid/hidintromodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}(hhhhZubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/ja_JP/hid/hidintromodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}(hhhhnubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/ko_KR/hid/hidintromodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}(hhhhubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/sp_SP/hid/hidintromodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}(hhhhubah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh:/var/lib/git/docbuild/linux/Documentation/hid/hidintro.rsthKubhsection)}(hhh](htitle)}(h&Introduction to HID report descriptorsh]h&Introduction to HID report descriptors}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hThis chapter is meant to give a broad overview of what HID report descriptors are, and of how a casual (non-kernel) programmer can deal with HID devices that are not working well with Linux.h]hThis chapter is meant to give a broad overview of what HID report descriptors are, and of how a casual (non-kernel) programmer can deal with HID devices that are not working well with Linux.}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhtopic)}(hhh]h bullet_list)}(hhh](h list_item)}(hhh]h)}(hhh]h reference)}(hhh]h Introduction}(h IntroductionhhhhhNhNubah}(h]id4ah ]h"]h$]h&]refid introductionuh1hhhubah}(h]h ]h"]h$]h&]uh1hhhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]hParsing HID report descriptors}(hParsing HID report descriptorshjhhhNhNubah}(h]id5ah ]h"]h$]h&]refidparsing-hid-report-descriptorsuh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh]h)}(hhh]h)}(hhh]h)}(hhh]h!Output, Input and Feature Reports}(h!Output, Input and Feature Reportshj0hhhNhNubah}(h]id6ah ]h"]h$]h&]refid output-input-and-feature-reportsuh1hhj-ubah}(h]h ]h"]h$]h&]uh1hhj*ubah}(h]h ]h"]h$]h&]uh1hhj'ubah}(h]h ]h"]h$]h&]uh1hhj ubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh]h)}(hhh]h)}(hhh]h(Collections, Report IDs and Evdev events}(h(Collections, Report IDs and Evdev eventshj_hhhNhNubah}(h]id7ah ]h"]h$]h&]refid'collections-report-ids-and-evdev-eventsuh1hhj\ubah}(h]h ]h"]h$]h&]uh1hhjYubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh]h)}(hhh]h)}(hhh]hEvents}(hEventshjhhhNhNubah}(h]id8ah ]h"]h$]h&]refideventsuh1hhjubah}(h]h ]h"]h$]h&]uh1hhj|ubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]hWhen something does not work}(hWhen something does not workhjhhhNhNubah}(h]id9ah ]h"]h$]h&]refidwhen-something-does-not-workuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]hQuirks}(hQuirkshjhhhNhNubah}(h]id10ah ]h"]h$]h&]refidquirksuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hFixing HID report descriptors}(hFixing HID report descriptorshjhhhNhNubah}(h]id11ah ]h"]h$]h&]refidfixing-hid-report-descriptorsuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]h)Modifying the transmitted data on the fly}(h)Modifying the transmitted data on the flyhj hhhNhNubah}(h]id12ah ]h"]h$]h&]refid)modifying-the-transmitted-data-on-the-flyuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hWriting a specialized driver}(hWriting a specialized driverhj.hhhNhNubah}(h]id13ah ]h"]h$]h&]refidwriting-a-specialized-driveruh1hhj+ubah}(h]h ]h"]h$]h&]uh1hhj(ubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhhhNhNubah}(h]contentsah ](contentslocaleh"]contentsah$]h&]uh1hhhhK hhhhubhcompound)}(hhh]htoctree)}(hhh]h}(h]h ]h"]h$]h&]h hid/hidintroentries]Nhid/hidreport-parsinga includefiles]jzamaxdepthKcaptionNglobhidden includehiddennumberedK titlesonly rawentries]uh1jlhhhKhjiubah}(h]h ]toctree-wrapperah"]h$]h&]uh1jghhhhhhhNubh)}(hhh](h)}(hhh]h Introduction}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]refidhuh1hhjhhhhhKubh)}(hHID stands for Human Interface Device, and can be whatever device you are using to interact with a computer, be it a mouse, a touchpad, a tablet, a microphone.h]hHID stands for Human Interface Device, and can be whatever device you are using to interact with a computer, be it a mouse, a touchpad, a tablet, a microphone.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXkMany HID devices work out the box, even if their hardware is different. For example, mice can have any number of buttons; they may have a wheel; movement sensitivity differs between different models, and so on. Nonetheless, most of the time everything just works, without the need to have specialized code in the kernel for every mouse model developed since 1970.h]hXkMany HID devices work out the box, even if their hardware is different. For example, mice can have any number of buttons; they may have a wheel; movement sensitivity differs between different models, and so on. Nonetheless, most of the time everything just works, without the need to have specialized code in the kernel for every mouse model developed since 1970.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThis is because modern HID devices do advertise their capabilities through the *HID report descriptor*, a fixed set of bytes describing exactly what *HID reports* may be sent between the device and the host and the meaning of each individual bit in those reports. For example, a HID Report Descriptor may specify that "in a report with ID 3 the bits from 8 to 15 is the delta x coordinate of a mouse".h](hOThis is because modern HID devices do advertise their capabilities through the }(hOThis is because modern HID devices do advertise their capabilities through the hjhhhNhNubhemphasis)}(h*HID report descriptor*h]hHID report descriptor}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh/, a fixed set of bytes describing exactly what }(h/, a fixed set of bytes describing exactly what hjhhhNhNubj)}(h *HID reports*h]h HID reports}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh may be sent between the device and the host and the meaning of each individual bit in those reports. For example, a HID Report Descriptor may specify that “in a report with ID 3 the bits from 8 to 15 is the delta x coordinate of a mouse”.}(h may be sent between the device and the host and the meaning of each individual bit in those reports. For example, a HID Report Descriptor may specify that "in a report with ID 3 the bits from 8 to 15 is the delta x coordinate of a mouse".hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK#hjhhubh)}(hXUThe HID report itself then merely carries the actual data values without any extra meta information. Note that HID reports may be sent from the device ("Input Reports", i.e. input events), to the device ("Output Reports" to e.g. change LEDs) or used for device configuration ("Feature reports"). A device may support one or more HID reports.h]hXaThe HID report itself then merely carries the actual data values without any extra meta information. Note that HID reports may be sent from the device (“Input Reports”, i.e. input events), to the device (“Output Reports” to e.g. change LEDs) or used for device configuration (“Feature reports”). A device may support one or more HID reports.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjhhubh)}(hXThe HID subsystem is in charge of parsing the HID report descriptors, and converts HID events into normal input device interfaces (see Documentation/hid/hid-transport.rst). Devices may misbehave because the HID report descriptor provided by the device is wrong, or because it needs to be dealt with in a special way, or because some special device or interaction mode is not handled by the default code.h]hXThe HID subsystem is in charge of parsing the HID report descriptors, and converts HID events into normal input device interfaces (see Documentation/hid/hid-transport.rst). Devices may misbehave because the HID report descriptor provided by the device is wrong, or because it needs to be dealt with in a special way, or because some special device or interaction mode is not handled by the default code.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hjhhubh)}(hThe format of HID report descriptors is described by two documents, available from the `USB Implementers Forum `_ `HID web page `_ address:h](hWThe format of HID report descriptors is described by two documents, available from the }(hWThe format of HID report descriptors is described by two documents, available from the hjhhhNhNubh)}(h0`USB Implementers Forum `_h]hUSB Implementers Forum}(hUSB Implementers ForumhjhhhNhNubah}(h]h ]h"]h$]h&]nameUSB Implementers Forumrefurihttps://www.usb.org/uh1hhjubhtarget)}(h h]h}(h]usb-implementers-forumah ]h"]usb implementers forumah$]h&]refurij)uh1j* referencedKhjubh }(h hjhhhNhNubh)}(h)`HID web page `_h]h HID web page}(h HID web pagehj?hhhNhNubah}(h]h ]h"]h$]h&]name HID web pagej(https://www.usb.org/hiduh1hhjubj+)}(h h]h}(h] hid-web-pageah ]h"] hid web pageah$]h&]refurijPuh1j*j9Khjubh address:}(h address:hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK7hjhhubh block_quote)}(hhh]h)}(hhh](h)}(hthe `HID USB Device Class Definition `_ (HID Spec from now on)h]h)}(hthe `HID USB Device Class Definition `_ (HID Spec from now on)h](hthe }(hthe hjuhhhNhNubh)}(hi`HID USB Device Class Definition `_h]hHID USB Device Class Definition}(hHID USB Device Class Definitionhj~hhhNhNubah}(h]h ]h"]h$]h&]nameHID USB Device Class Definitionj(Dhttps://www.usb.org/document-library/device-class-definition-hid-111uh1hhjuubj+)}(hG h]h}(h]hid-usb-device-class-definitionah ]h"]hid usb device class definitionah$]h&]refurijuh1j*j9Khjuubh (HID Spec from now on)}(h (HID Spec from now on)hjuhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK;hjqubah}(h]h ]h"]h$]h&]uh1hhjnubh)}(hathe `HID Usage Tables `_ (HUT from now on) h]h)}(h`the `HID Usage Tables `_ (HUT from now on)h](hthe }(hthe hjhhhNhNubh)}(hJ`HID Usage Tables `_h]hHID Usage Tables}(hHID Usage TableshjhhhNhNubah}(h]h ]h"]h$]h&]nameHID Usage Tablesj(4https://usb.org/document-library/hid-usage-tables-14uh1hhjubj+)}(h7 h]h}(h]hid-usage-tablesah ]h"]hid usage tablesah$]h&]refurijuh1j*j9Khjubh (HUT from now on)}(h (HUT from now on)hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK=hjubah}(h]h ]h"]h$]h&]uh1hhjnubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhK;hjkubah}(h]h ]h"]h$]h&]uh1jihjhhhNhNubh)}(hThe HID subsystem can deal with different transport drivers (USB, I2C, Bluetooth, etc.). See Documentation/hid/hid-transport.rst.h]hThe HID subsystem can deal with different transport drivers (USB, I2C, Bluetooth, etc.). See Documentation/hid/hid-transport.rst.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjhhubeh}(h]hah ]h"] introductionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hjh]hParsing HID report descriptors}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhKCubh)}(hThe current list of HID devices can be found at ``/sys/bus/hid/devices/``. For each device, say ``/sys/bus/hid/devices/0003\:093A\:2510.0002/``, one can read the corresponding report descriptor::h](h0The current list of HID devices can be found at }(h0The current list of HID devices can be found at hjhhhNhNubhliteral)}(h``/sys/bus/hid/devices/``h]h/sys/bus/hid/devices/}(hhhj)hhhNhNubah}(h]h ]h"]h$]h&]uh1j'hjubh. For each device, say }(h. For each device, say hjhhhNhNubj()}(h/``/sys/bus/hid/devices/0003\:093A\:2510.0002/``h]h+/sys/bus/hid/devices/0003\:093A\:2510.0002/}(hhhj<hhhNhNubah}(h]h ]h"]h$]h&]uh1j'hjubh3, one can read the corresponding report descriptor:}(h3, one can read the corresponding report descriptor:hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKEhjhhubh literal_block)}(hX$ hexdump -C /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor 00000000 05 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 03 |..............).| 00000010 15 00 25 01 75 01 95 03 81 02 75 05 95 01 81 01 |..%.u.....u.....| 00000020 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 |...0.1.8..%.u...| 00000030 81 06 c0 c0 |....| 00000034h]hX$ hexdump -C /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor 00000000 05 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 03 |..............).| 00000010 15 00 25 01 75 01 95 03 81 02 75 05 95 01 81 01 |..%.u.....u.....| 00000020 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 |...0.1.8..%.u...| 00000030 81 06 c0 c0 |....| 00000034}(hhhjWubah}(h]h ]h"]h$]h&]hhuh1jUhhhKIhjhhubh)}(hhOptional: the HID report descriptor can be read also by directly accessing the hidraw driver [#hidraw]_.h](h]Optional: the HID report descriptor can be read also by directly accessing the hidraw driver }(h]Optional: the HID report descriptor can be read also by directly accessing the hidraw driver hjehhhNhNubhfootnote_reference)}(h [#hidraw]_h]h1}(hhhjphhhNhNubah}(h]id1ah ]h"]h$]h&]autoKjhidrawdocnamejwuh1jnhjeresolvedKubh.}(h.hjehhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKPhjhhubh)}(hXThe basic structure of HID report descriptors is defined in the HID spec, while HUT "defines constants that can be interpreted by an application to identify the purpose and meaning of a data field in a HID report". Each entry is defined by at least two bytes, where the first one defines what type of value is following and is described in the HID spec, while the second one carries the actual value and is described in the HUT.h]hXThe basic structure of HID report descriptors is defined in the HID spec, while HUT “defines constants that can be interpreted by an application to identify the purpose and meaning of a data field in a HID report”. Each entry is defined by at least two bytes, where the first one defines what type of value is following and is described in the HID spec, while the second one carries the actual value and is described in the HUT.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKShjhhubh)}(hXHID report descriptors can, in principle, be painstakingly parsed by hand, byte by byte.h]hXHID report descriptors can, in principle, be painstakingly parsed by hand, byte by byte.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hjhhubh)}(hA short introduction on how to do this is sketched in Documentation/hid/hidreport-parsing.rst; you only need to understand it if you need to patch HID report descriptors.h]hA short introduction on how to do this is sketched in Documentation/hid/hidreport-parsing.rst; you only need to understand it if you need to patch HID report descriptors.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hjhhubh)}(hIn practice you should not parse HID report descriptors by hand; rather, you should use an existing parser. Among all the available onesh]hIn practice you should not parse HID report descriptors by hand; rather, you should use an existing parser. Among all the available ones}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjhhubjj)}(hhh]h)}(hhh](h)}(h]the online `USB Descriptor and Request Parser `_;h]h)}(h]the online `USB Descriptor and Request Parser `_;h](h the online }(h the online hjhhhNhNubh)}(hQ`USB Descriptor and Request Parser `_h]h!USB Descriptor and Request Parser}(h!USB Descriptor and Request ParserhjhhhNhNubah}(h]h ]h"]h$]h&]name!USB Descriptor and Request Parserj(*http://eleccelerator.com/usbdescreqparser/uh1hhjubj+)}(h- h]h}(h]!usb-descriptor-and-request-parserah ]h"]!usb descriptor and request parserah$]h&]refurijuh1j*j9Khjubh;}(h;hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h`hidrdd `_, that provides very detailed and somewhat verbose descriptions (verbosity can be useful if you are not familiar with HID report descriptors);h]h)}(h`hidrdd `_, that provides very detailed and somewhat verbose descriptions (verbosity can be useful if you are not familiar with HID report descriptors);h](h)}(h.`hidrdd `_h]hhidrdd}(hhidrddhjhhhNhNubah}(h]h ]h"]h$]h&]namejj("https://github.com/abend0c1/hidrdduh1hhj ubj+)}(h% h]h}(h]hidrddah ]h"]hidrddah$]h&]refurij!uh1j*j9Khj ubh, that provides very detailed and somewhat verbose descriptions (verbosity can be useful if you are not familiar with HID report descriptors);}(h, that provides very detailed and somewhat verbose descriptions (verbosity can be useful if you are not familiar with HID report descriptors);hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKghj ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hX`hid-tools `_, a complete utility set that allows, among other things, to record and replay the raw HID reports and to debug and replay HID devices. It is being actively developed by the Linux HID subsystem maintainers. h]h)}(hX`hid-tools `_, a complete utility set that allows, among other things, to record and replay the raw HID reports and to debug and replay HID devices. It is being actively developed by the Linux HID subsystem maintainers.h](h)}(h@`hid-tools `_h]h hid-tools}(h hid-toolshjHhhhNhNubah}(h]h ]h"]h$]h&]namejPj(1https://gitlab.freedesktop.org/libevdev/hid-toolsuh1hhjDubj+)}(h4 h]h}(h] hid-toolsah ]h"] hid-toolsah$]h&]refurijXuh1j*j9KhjDubh, a complete utility set that allows, among other things, to record and replay the raw HID reports and to debug and replay HID devices. It is being actively developed by the Linux HID subsystem maintainers.}(h, a complete utility set that allows, among other things, to record and replay the raw HID reports and to debug and replay HID devices. It is being actively developed by the Linux HID subsystem maintainers.hjDhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKkhj@ubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1jihjhhhNhNubh)}(hParsing the mouse HID report descriptor with `hid-tools `_ leads to (explanations interposed)::h](h-Parsing the mouse HID report descriptor with }(h-Parsing the mouse HID report descriptor with hjhhhNhNubh)}(h@`hid-tools `_h]h hid-tools}(h hid-toolshjhhhNhNubah}(h]h ]h"]h$]h&]namejj(1https://gitlab.freedesktop.org/libevdev/hid-toolsuh1hhjubj+)}(h4 h]h}(h]id2ah ]h"]h$] hid-toolsah&]refurijuh1j*j9Khjubh$ leads to (explanations interposed):}(h$ leads to (explanations interposed):hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKqhjhhubjV)}(hX$ ./hid-decode /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor # device 0:0 # 0x05, 0x01, // Usage Page (Generic Desktop) 0 # 0x09, 0x02, // Usage (Mouse) 2 # 0xa1, 0x01, // Collection (Application) 4 # 0x09, 0x01, // Usage (Pointer) 6 # 0xa1, 0x00, // Collection (Physical) 8 # 0x05, 0x09, // Usage Page (Button) 10h]hX$ ./hid-decode /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor # device 0:0 # 0x05, 0x01, // Usage Page (Generic Desktop) 0 # 0x09, 0x02, // Usage (Mouse) 2 # 0xa1, 0x01, // Collection (Application) 4 # 0x09, 0x01, // Usage (Pointer) 6 # 0xa1, 0x00, // Collection (Physical) 8 # 0x05, 0x09, // Usage Page (Button) 10}(hhhjubah}(h]h ]h"]h$]h&]hhuh1jUhhhKuhjhhubh)}(hwhat follows is a button ::h]hwhat follows is a button}(hwhat follows is a buttonhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjhhubjV)}(h# 0x19, 0x01, // Usage Minimum (1) 12 # 0x29, 0x03, // Usage Maximum (3) 14h]h# 0x19, 0x01, // Usage Minimum (1) 12 # 0x29, 0x03, // Usage Maximum (3) 14}(hhhjubah}(h]h ]h"]h$]h&]hhuh1jUhhhKhjhhubh)}(hBfirst button is button number 1, last button is button number 3 ::h]h?first button is button number 1, last button is button number 3}(h?first button is button number 1, last button is button number 3hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjV)}(h# 0x15, 0x00, // Logical Minimum (0) 16 # 0x25, 0x01, // Logical Maximum (1) 18h]h# 0x15, 0x00, // Logical Minimum (0) 16 # 0x25, 0x01, // Logical Maximum (1) 18}(hhhjubah}(h]h ]h"]h$]h&]hhuh1jUhhhKhjhhubh)}(hVeach button can send values from 0 up to including 1 (i.e. they are binary buttons) ::h]hSeach button can send values from 0 up to including 1 (i.e. they are binary buttons)}(hSeach button can send values from 0 up to including 1 (i.e. they are binary buttons)hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjV)}(hI# 0x75, 0x01, // Report Size (1) 20h]hI# 0x75, 0x01, // Report Size (1) 20}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1jUhhhKhjhhubh)}(h)each button is sent as exactly one bit ::h]h&each button is sent as exactly one bit}(h&each button is sent as exactly one bithjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjV)}(hI# 0x95, 0x03, // Report Count (3) 22h]hI# 0x95, 0x03, // Report Count (3) 22}(hhhj)ubah}(h]h ]h"]h$]h&]hhuh1jUhhhKhjhhubh)}(hAand there are three of those bits (matching the three buttons) ::h]h>and there are three of those bits (matching the three buttons)}(h>and there are three of those bits (matching the three buttons)hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjV)}(hI# 0x81, 0x02, // Input (Data,Var,Abs) 24h]hI# 0x81, 0x02, // Input (Data,Var,Abs) 24}(hhhjFubah}(h]h ]h"]h$]h&]hhuh1jUhhhKhjhhubh)}(hit's actual Data (not constant padding), they represent a single variable (Var) and their values are Absolute (not relative); See HID spec Sec. 6.2.2.5 "Input, Output, and Feature Items" ::h]hit’s actual Data (not constant padding), they represent a single variable (Var) and their values are Absolute (not relative); See HID spec Sec. 6.2.2.5 “Input, Output, and Feature Items”}(hit's actual Data (not constant padding), they represent a single variable (Var) and their values are Absolute (not relative); See HID spec Sec. 6.2.2.5 "Input, Output, and Feature Items"hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjV)}(hI# 0x75, 0x05, // Report Size (5) 26h]hI# 0x75, 0x05, // Report Size (5) 26}(hhhjcubah}(h]h ]h"]h$]h&]hhuh1jUhhhKhjhhubh)}(h7five additional padding bits, needed to reach a byte ::h]h4five additional padding bits, needed to reach a byte}(h4five additional padding bits, needed to reach a bytehjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjV)}(hI# 0x95, 0x01, // Report Count (1) 28h]hI# 0x95, 0x01, // Report Count (1) 28}(hhhjubah}(h]h ]h"]h$]h&]hhuh1jUhhhKhjhhubh)}(h)those five bits are repeated only once ::h]h&those five bits are repeated only once}(h&those five bits are repeated only oncehjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjV)}(hI# 0x81, 0x01, // Input (Cnst,Arr,Abs) 30h]hI# 0x81, 0x01, // Input (Cnst,Arr,Abs) 30}(hhhjubah}(h]h ]h"]h$]h&]hhuh1jUhhhKhjhhubh)}(h`_: The sequence of bytes sent by clicking and releasing button 1, then button 2, then button 3 is::h](h-Indeed, for any event, the mouse will send a }(h-Indeed, for any event, the mouse will send a hjghhhNhNubj)}(h*report*h]hreport}(hhhjphhhNhNubah}(h]h ]h"]h$]h&]uh1jhjgubhF of four bytes. We can check the values sent by resorting e.g. to the }(hF of four bytes. We can check the values sent by resorting e.g. to the hjghhhNhNubhtitle_reference)}(h`hid-recorder`h]h hid-recorder}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjgubh tool, from }(h tool, from hjghhhNhNubh)}(h@`hid-tools `_h]h hid-tools}(h hid-toolshjhhhNhNubah}(h]h ]h"]h$]h&]namejj(1https://gitlab.freedesktop.org/libevdev/hid-toolsuh1hhjgubj+)}(h4 h]h}(h]id3ah ]h"]h$] hid-toolsah&]refurijuh1j*j9Khjgubha: The sequence of bytes sent by clicking and releasing button 1, then button 2, then button 3 is:}(ha: The sequence of bytes sent by clicking and releasing button 1, then button 2, then button 3 is:hjghhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjV)}(hXS$ sudo ./hid-recorder /dev/hidraw1 .... output of hid-decode .... # Button: 1 0 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000000.000000 4 01 00 00 00 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000000.183949 4 00 00 00 00 # Button: 0 1 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000001.959698 4 02 00 00 00 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000002.103899 4 00 00 00 00 # Button: 0 0 1 | # | X: 0 | Y: 0 | Wheel: 0 E: 000004.855799 4 04 00 00 00 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000005.103864 4 00 00 00 00h]hXS$ sudo ./hid-recorder /dev/hidraw1 .... output of hid-decode .... # Button: 1 0 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000000.000000 4 01 00 00 00 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000000.183949 4 00 00 00 00 # Button: 0 1 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000001.959698 4 02 00 00 00 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000002.103899 4 00 00 00 00 # Button: 0 0 1 | # | X: 0 | Y: 0 | Wheel: 0 E: 000004.855799 4 04 00 00 00 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0 E: 000005.103864 4 00 00 00 00}(hhhjubah}(h]h ]h"]h$]h&]hhuh1jUhhhKhjhhubh)}(hThis example shows that when button 2 is clicked, the bytes ``02 00 00 00`` are sent, and the immediately subsequent event (``00 00 00 00``) is the release of button 2 (no buttons are pressed, remember that the data values are *absolute*).h](h hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj8 ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhj hhubh)}(hAs a consequence, a ``/dev/input/event*`` may not be created for each Application Collection, and/or the events there may not match what you would expect.h](hAs a consequence, a }(hAs a consequence, a hjV hhhNhNubj()}(h``/dev/input/event*``h]h/dev/input/event*}(hhhj_ hhhNhNubah}(h]h ]h"]h$]h&]uh1j'hjV ubhq may not be created for each Application Collection, and/or the events there may not match what you would expect.}(hq may not be created for each Application Collection, and/or the events there may not match what you would expect.VhjV hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hhh](h)}(hjh]hQuirks}(hjhj{ hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjx hhhhhMubh)}(hThere are some known peculiarities of HID devices that the kernel knows how to fix - these are called the HID quirks and a list of those is available in `include/linux/hid.h`.h](hThere are some known peculiarities of HID devices that the kernel knows how to fix - these are called the HID quirks and a list of those is available in }(hThere are some known peculiarities of HID devices that the kernel knows how to fix - these are called the HID quirks and a list of those is available in hj hhhNhNubj)}(h`include/linux/hid.h`h]hinclude/linux/hid.h}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hjhj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjx hhubh)}(hShould this be the case, it should be enough to add the required quirk in the kernel, for the HID device at hand. This can be done in the file `drivers/hid/hid-quirks.c`. How to do it should be relatively straightforward after looking into the file.h](hShould this be the case, it should be enough to add the required quirk in the kernel, for the HID device at hand. This can be done in the file }(hShould this be the case, it should be enough to add the required quirk in the kernel, for the HID device at hand. This can be done in the file hj hhhNhNubj)}(h`drivers/hid/hid-quirks.c`h]hdrivers/hid/hid-quirks.c}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhP. How to do it should be relatively straightforward after looking into the file.}(hP. How to do it should be relatively straightforward after looking into the file.hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjx hhubh)}(hDThe list of currently defined quirks, from `include/linux/hid.h`, ish](h+The list of currently defined quirks, from }(h+The list of currently defined quirks, from hj hhhNhNubj)}(h`include/linux/hid.h`h]hinclude/linux/hid.h}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, is}(h, ishj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjx hhubh line_block)}(hhh](hh)}(h**HID_QUIRK_NOTOUCH**:h](hstrong)}(h**HID_QUIRK_NOTOUCH**h]hHID_QUIRK_NOTOUCH}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(h:hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hindentKhj hQ/var/lib/git/docbuild/linux/Documentation/hid/hidintro:449: ./include/linux/hid.hhKubj )}(h(**HID_QUIRK_IGNORE**: ignore this deviceh](j )}(h**HID_QUIRK_IGNORE**h]hHID_QUIRK_IGNORE}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh: ignore this device}(h: ignore this devicehj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_NOGET**:h](j )}(h**HID_QUIRK_NOGET**h]hHID_QUIRK_NOGET}(hhhj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj1 ubh:}(hj hj1 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_HIDDEV_FORCE**:h](j )}(h**HID_QUIRK_HIDDEV_FORCE**h]hHID_QUIRK_HIDDEV_FORCE}(hhhjQ hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjM ubh:}(hj hjM hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_BADPAD**:h](j )}(h**HID_QUIRK_BADPAD**h]hHID_QUIRK_BADPAD}(hhhjm hhhNhNubah}(h]h ]h"]h$]h&]uh1j hji ubh:}(hj hji hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_MULTI_INPUT**:h](j )}(h**HID_QUIRK_MULTI_INPUT**h]hHID_QUIRK_MULTI_INPUT}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_HIDINPUT_FORCE**:h](j )}(h**HID_QUIRK_HIDINPUT_FORCE**h]hHID_QUIRK_HIDINPUT_FORCE}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_ALWAYS_POLL**:h](j )}(h**HID_QUIRK_ALWAYS_POLL**h]hHID_QUIRK_ALWAYS_POLL}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_INPUT_PER_APP**:h](j )}(h**HID_QUIRK_INPUT_PER_APP**h]hHID_QUIRK_INPUT_PER_APP}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_X_INVERT**:h](j )}(h**HID_QUIRK_X_INVERT**h]hHID_QUIRK_X_INVERT}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_Y_INVERT**:h](j )}(h**HID_QUIRK_Y_INVERT**h]hHID_QUIRK_Y_INVERT}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h"**HID_QUIRK_SKIP_OUTPUT_REPORTS**:h](j )}(h!**HID_QUIRK_SKIP_OUTPUT_REPORTS**h]hHID_QUIRK_SKIP_OUTPUT_REPORTS}(hhhj1 hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj- ubh:}(hj hj- hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h$**HID_QUIRK_SKIP_OUTPUT_REPORT_ID**:h](j )}(h#**HID_QUIRK_SKIP_OUTPUT_REPORT_ID**h]hHID_QUIRK_SKIP_OUTPUT_REPORT_ID}(hhhjM hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjI ubh:}(hj hjI hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h+**HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP**:h](j )}(h***HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP**h]h&HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP}(hhhji hhhNhNubah}(h]h ]h"]h$]h&]uh1j hje ubh:}(hj hje hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h"**HID_QUIRK_HAVE_SPECIAL_DRIVER**:h](j )}(h!**HID_QUIRK_HAVE_SPECIAL_DRIVER**h]hHID_QUIRK_HAVE_SPECIAL_DRIVER}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h+**HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE**:h](j )}(h***HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE**h]h&HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h!**HID_QUIRK_FULLSPEED_INTERVAL**:h](j )}(h **HID_QUIRK_FULLSPEED_INTERVAL**h]hHID_QUIRK_FULLSPEED_INTERVAL}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_NO_INIT_REPORTS**:h](j )}(h**HID_QUIRK_NO_INIT_REPORTS**h]hHID_QUIRK_NO_INIT_REPORTS}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_NO_IGNORE**:h](j )}(h**HID_QUIRK_NO_IGNORE**h]hHID_QUIRK_NO_IGNORE}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubj )}(h**HID_QUIRK_NO_INPUT_SYNC**:h](j )}(h**HID_QUIRK_NO_INPUT_SYNC**h]hHID_QUIRK_NO_INPUT_SYNC}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh:}(hj hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hj hKubeh}(h]h ]h"]h$]h&]uh1j hjx hhhj hNubh)}(hXCQuirks for USB devices can be specified while loading the usbhid module, see ``modinfo usbhid``, although the proper fix should go into hid-quirks.c and **be submitted upstream**. See Documentation/process/submitting-patches.rst for guidelines on how to submit a patch. Quirks for other busses need to go into hid-quirks.c.h](hMQuirks for USB devices can be specified while loading the usbhid module, see }(hMQuirks for USB devices can be specified while loading the usbhid module, see hj/hhhNhNubj()}(h``modinfo usbhid``h]hmodinfo usbhid}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1j'hj/ubh:, although the proper fix should go into hid-quirks.c and }(h:, although the proper fix should go into hid-quirks.c and hj/hhhNhNubj )}(h**be submitted upstream**h]hbe submitted upstream}(hhhjKhhhNhNubah}(h]h ]h"]h$]h&]uh1j hj/ubh. See Documentation/process/submitting-patches.rst for guidelines on how to submit a patch. Quirks for other busses need to go into hid-quirks.c.}(h. See Documentation/process/submitting-patches.rst for guidelines on how to submit a patch. Quirks for other busses need to go into hid-quirks.c.hj/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjx hhubeh}(h]jah ]h"]quirksah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(hjh]hFixing HID report descriptors}(hjhjnhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjkhhhhhMubh)}(hShould you need to patch HID report descriptors the easiest way is to resort to eBPF, as described in Documentation/hid/hid-bpf.rst.h]hShould you need to patch HID report descriptors the easiest way is to resort to eBPF, as described in Documentation/hid/hid-bpf.rst.}(hj}hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjkhhubh)}(hBasically, you can change any byte of the original HID report descriptor. The examples in samples/hid should be a good starting point for your code, see e.g. `samples/hid/hid_mouse.bpf.c`::h](hBasically, you can change any byte of the original HID report descriptor. The examples in samples/hid should be a good starting point for your code, see e.g. }(hBasically, you can change any byte of the original HID report descriptor. The examples in samples/hid should be a good starting point for your code, see e.g. hjhhhNhNubj)}(h`samples/hid/hid_mouse.bpf.c`h]hsamples/hid/hid_mouse.bpf.c}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh:}(hj hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjkhhubjV)}(hSEC("fmod_ret/hid_bpf_rdesc_fixup") int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx) { .... data[39] = 0x31; data[41] = 0x30; return 0; }h]hSEC("fmod_ret/hid_bpf_rdesc_fixup") int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx) { .... data[39] = 0x31; data[41] = 0x30; return 0; }}(hhhjubah}(h]h ]h"]h$]h&]hhuh1jUhhhMhjkhhubh)}(hOf course this can be also done within the kernel source code, see e.g. `drivers/hid/hid-aureal.c` or `drivers/hid/hid-samsung.c` for a slightly more complex file.h](hHOf course this can be also done within the kernel source code, see e.g. }(hHOf course this can be also done within the kernel source code, see e.g. hjhhhNhNubj)}(h`drivers/hid/hid-aureal.c`h]hdrivers/hid/hid-aureal.c}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or }(h or hjhhhNhNubj)}(h`drivers/hid/hid-samsung.c`h]hdrivers/hid/hid-samsung.c}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh" for a slightly more complex file.}(h" for a slightly more complex file.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjkhhubh)}(hCheck Documentation/hid/hidreport-parsing.rst if you need any help navigating the HID manuals and understanding the exact meaning of the HID report descriptor hex numbers.h]hCheck Documentation/hid/hidreport-parsing.rst if you need any help navigating the HID manuals and understanding the exact meaning of the HID report descriptor hex numbers.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjkhhubh)}(hX-Whatever solution you come up with, please remember to **submit the fix to the HID maintainers**, so that it can be directly integrated in the kernel and that particular HID device will start working for everyone else. See Documentation/process/submitting-patches.rst for guidelines on how to do this.h](h7Whatever solution you come up with, please remember to }(h7Whatever solution you come up with, please remember to hjhhhNhNubj )}(h)**submit the fix to the HID maintainers**h]h%submit the fix to the HID maintainers}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh, so that it can be directly integrated in the kernel and that particular HID device will start working for everyone else. See Documentation/process/submitting-patches.rst for guidelines on how to do this.}(h, so that it can be directly integrated in the kernel and that particular HID device will start working for everyone else. See Documentation/process/submitting-patches.rst for guidelines on how to do this.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjkhhubeh}(h]jah ]h"]fixing hid report descriptorsah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(hjh]h)Modifying the transmitted data on the fly}(hjhj'hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj$hhhhhMubh)}(huUsing eBPF it is also possible to modify the data exchanged with the device. See again the examples in `samples/hid`.h](hgUsing eBPF it is also possible to modify the data exchanged with the device. See again the examples in }(hgUsing eBPF it is also possible to modify the data exchanged with the device. See again the examples in hj4hhhNhNubj)}(h `samples/hid`h]h samples/hid}(hhhj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubh.}(hjhj4hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj$hhubh)}(hLAgain, **please post your fix**, so that it can be integrated in the kernel!h](hAgain, }(hAgain, hjUhhhNhNubj )}(h**please post your fix**h]hplease post your fix}(hhhj^hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjUubh-, so that it can be integrated in the kernel!}(h-, so that it can be integrated in the kernel!hjUhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj$hhubeh}(h]jah ]h"])modifying the transmitted data on the flyah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(hj5h]hWriting a specialized driver}(hj5hjhhhNhNubah}(h]h ]h"]h$]h&]jj8uh1hhj~hhhhhMubh)}(h'This should really be your last resort.h]h'This should really be your last resort.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj~hhubhrubric)}(h Footnotesh]h Footnotes}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj~hhhhhMubhfootnote)}(hXread hidraw: see Documentation/hid/hidraw.rst and file `samples/hidraw/hid-example.c` for an example. The output of ``hid-example`` would be, for the same mouse:: $ sudo ./hid-example Report Descriptor Size: 52 Report Descriptor: 5 1 9 2 a1 1 9 1 a1 0 5 9 19 1 29 3 15 0 25 1 75 1 95 3 81 2 75 5 95 1 81 1 5 1 9 30 9 31 9 38 15 81 25 7f 75 8 95 3 81 6 c0 c0 Raw Name: PixArt USB Optical Mouse Raw Phys: usb-0000:05:00.4-2.3/input0 Raw Info: bustype: 3 (USB) vendor: 0x093a product: 0x2510 ...h](hlabel)}(hhh]h1}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhhhNhNubh)}(hread hidraw: see Documentation/hid/hidraw.rst and file `samples/hidraw/hid-example.c` for an example. The output of ``hid-example`` would be, for the same mouse::h](h7read hidraw: see Documentation/hid/hidraw.rst and file }(h7read hidraw: see Documentation/hid/hidraw.rst and file hjhhhNhNubj)}(h`samples/hidraw/hid-example.c`h]hsamples/hidraw/hid-example.c}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh for an example. The output of }(h for an example. The output of hjhhhNhNubj()}(h``hid-example``h]h hid-example}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1j'hjubh would be, for the same mouse:}(h would be, for the same mouse:hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubjV)}(hXb$ sudo ./hid-example Report Descriptor Size: 52 Report Descriptor: 5 1 9 2 a1 1 9 1 a1 0 5 9 19 1 29 3 15 0 25 1 75 1 95 3 81 2 75 5 95 1 81 1 5 1 9 30 9 31 9 38 15 81 25 7f 75 8 95 3 81 6 c0 c0 Raw Name: PixArt USB Optical Mouse Raw Phys: usb-0000:05:00.4-2.3/input0 Raw Info: bustype: 3 (USB) vendor: 0x093a product: 0x2510 ...h]hXb$ sudo ./hid-example Report Descriptor Size: 52 Report Descriptor: 5 1 9 2 a1 1 9 1 a1 0 5 9 19 1 29 3 15 0 25 1 75 1 95 3 81 2 75 5 95 1 81 1 5 1 9 30 9 31 9 38 15 81 25 7f 75 8 95 3 81 6 c0 c0 Raw Name: PixArt USB Optical Mouse Raw Phys: usb-0000:05:00.4-2.3/input0 Raw Info: bustype: 3 (USB) vendor: 0x093a product: 0x2510 ...}(hhhjubah}(h]h ]h"]h$]h&]hhuh1jUhhhMhjubeh}(h]jah ]h"]hidrawah$]h&]jzajKjjwuh1jhhhMhj~hhubeh}(h]j>ah ]h"]writing a specialized driverah$]h&]uh1hhj hhhhhMubeh}(h]jah ]h"]when something does not workah$]h&]uh1hhhhhhhhMubeh}(h]&introduction-to-hid-report-descriptorsah ]h"]&introduction to hid report descriptorsah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjDerror_encodingUTF-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confapep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacefile_insertion_enabled raw_enabledKline_length_limitM'syntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_link embed_imagesenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}hidraw]jpasrefids}j]jpasnameids}(jjjdj_j hj5j2jZjWjjjjjj jjj+j(jbj_jj@j! joj jjjjhjj!jj{jjj>jju nametypes}(jNjdNj Nj5jZjjjNjj+jbjNj! Nj NjNjhNj!Nj{NjNjuh}(jhj_hhjj2j,jWjQjjjjj jjzjpjjj(j"j_jYjjjjj@jijojjj$ jj jjx jjkjj$j>j~jjhhjjj:j0jij_jjjjjjjjjj j8j.u footnote_refs}j]jpas citation_refs} autofootnotes]jaautofootnote_refs]jpasymbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jRK sRparse_messages](hsystem_message)}(hhh]h)}(h,Duplicate explicit target name: "hid-tools".h]h0Duplicate explicit target name: “hid-tools”.}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]jalevelKtypeINFOsourcehlineKuh1jhjhhhhhKsubj)}(hhh]h)}(h,Duplicate explicit target name: "hid-tools".h]h0Duplicate explicit target name: “hid-tools”.}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]jalevelKtypejsourcehlineKuh1jhjhhhhhKubetransform_messages] transformerN include_log] decorationNhhub.