From 9dcd146ab4a30bf72439854568fc464afc63db01 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 10 Aug 2021 02:14:36 +0100 Subject: [PATCH] Kernel/USB: Add the USB 1.x/2.0 hub descriptor There is a different hub descriptor for USB 3.0, but this isn't included here. --- Kernel/Bus/USB/USBDescriptors.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Kernel/Bus/USB/USBDescriptors.h b/Kernel/Bus/USB/USBDescriptors.h index 0e8486bd8aa..b806bfa34d1 100644 --- a/Kernel/Bus/USB/USBDescriptors.h +++ b/Kernel/Bus/USB/USBDescriptors.h @@ -94,11 +94,25 @@ struct [[gnu::packed]] USBEndpointDescriptor { u8 poll_interval_in_frames; }; +// +// USB 1.1/2.0 Hub Descriptor +// ============== +// +struct [[gnu::packed]] USBHubDescriptor { + USBDescriptorCommon descriptor_header; + u8 number_of_downstream_ports; + u16 hub_characteristics; + u8 power_on_to_power_good_time; + u8 hub_controller_current; + // NOTE: This does not contain DeviceRemovable or PortPwrCtrlMask because a struct cannot have two VLAs in a row. +}; + static constexpr u8 DESCRIPTOR_TYPE_DEVICE = 0x01; static constexpr u8 DESCRIPTOR_TYPE_CONFIGURATION = 0x02; static constexpr u8 DESCRIPTOR_TYPE_STRING = 0x03; static constexpr u8 DESCRIPTOR_TYPE_INTERFACE = 0x04; static constexpr u8 DESCRIPTOR_TYPE_ENDPOINT = 0x05; static constexpr u8 DESCRIPTOR_TYPE_DEVICE_QUALIFIER = 0x06; +static constexpr u8 DESCRIPTOR_TYPE_HUB = 0x29; }