summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Buhagiar <jooster669@gmail.com>2022-04-18 22:41:47 +1000
committerAndreas Kling <kling@serenityos.org>2022-04-22 15:16:56 +0200
commitd313fa98ecd2ebd68c8c50bd803105de1517fcff (patch)
treeae73dc40406014c5e7e025aabc74db819aefa050
parenta1df8a1896db44472f6a92166dfc86bf7dbcd373 (diff)
downloadserenity-d313fa98ecd2ebd68c8c50bd803105de1517fcff.zip
Kernel/USB: Add new `USBHIDDescriptor` type
-rw-r--r--Kernel/Bus/USB/USBDescriptors.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Kernel/Bus/USB/USBDescriptors.h b/Kernel/Bus/USB/USBDescriptors.h
index b703261283..09d11af99c 100644
--- a/Kernel/Bus/USB/USBDescriptors.h
+++ b/Kernel/Bus/USB/USBDescriptors.h
@@ -108,6 +108,19 @@ struct [[gnu::packed]] USBHubDescriptor {
// NOTE: This does not contain DeviceRemovable or PortPwrCtrlMask because a struct cannot have two VLAs in a row.
};
+//
+// USB Human Interface Device (HID) Descriptor
+// ==============
+//
+struct [[gnu::packed]] USBHIDDescriptor {
+ USBDescriptorCommon descriptor_header;
+ u16 hid_bcd;
+ u8 country_code;
+ u8 number_of_report_descriptors;
+ u8 following_descriptor_type;
+ u16 hid_report_descriptor_size;
+};
+
static constexpr u8 DESCRIPTOR_TYPE_DEVICE = 0x01;
static constexpr u8 DESCRIPTOR_TYPE_CONFIGURATION = 0x02;
static constexpr u8 DESCRIPTOR_TYPE_STRING = 0x03;