1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:37:45 +00:00

Kernel/USB: Fetch configuration descriptors on enumeration

This also introduces a new class, `USBConfiguration` that stores a
configuration. The device, when instructed, sets this configuration and
holds a pointer to it so we have a record of what configuration is
currently active.
This commit is contained in:
Jesse Buhagiar 2022-04-11 20:18:31 +10:00 committed by Andreas Kling
parent 1409a48da6
commit dac26f89cb
3 changed files with 62 additions and 0 deletions

View file

@ -8,11 +8,14 @@
#include <AK/OwnPtr.h>
#include <AK/Types.h>
#include <AK/Vector.h>
#include <Kernel/Bus/USB/USBConfiguration.h>
#include <Kernel/Bus/USB/USBPipe.h>
namespace Kernel::USB {
class USBController;
class USBConfiguration;
//
// Some nice info from FTDI on device enumeration and how some of this
@ -55,6 +58,7 @@ protected:
u16 m_vendor_id { 0 }; // This device's vendor ID assigned by the USB group
u16 m_product_id { 0 }; // This device's product ID assigned by the USB group
USBDeviceDescriptor m_device_descriptor {}; // Device Descriptor obtained from USB Device
Vector<USBConfiguration> m_configurations; // Configurations for this device
NonnullRefPtr<USBController> m_controller;
NonnullOwnPtr<Pipe> m_default_pipe; // Default communication pipe (endpoint0) used during enumeration