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.
This commit is contained in:
parent
14da080dcf
commit
9dcd146ab4
Notes:
sideshowbarker
2024-07-18 05:43:53 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/9dcd146ab4a Pull-request: https://github.com/SerenityOS/serenity/pull/9394 Reviewed-by: https://github.com/supercomputer7
1 changed files with 14 additions and 0 deletions
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue