mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:37:36 +00:00
Kernel/USB: Add Hubs and the UHCI Root Hub
This commit is contained in:
parent
9dcd146ab4
commit
da0a1068e9
11 changed files with 1009 additions and 100 deletions
|
@ -35,9 +35,10 @@ public:
|
|||
static KResultOr<NonnullRefPtr<Device>> try_create(USBController const&, PortNumber, DeviceSpeed);
|
||||
|
||||
Device(USBController const&, PortNumber, DeviceSpeed, NonnullOwnPtr<Pipe> default_pipe);
|
||||
~Device();
|
||||
Device(Device const& device, NonnullOwnPtr<Pipe> default_pipe);
|
||||
virtual ~Device();
|
||||
|
||||
KResult enumerate();
|
||||
KResult enumerate_device();
|
||||
|
||||
PortNumber port() const { return m_device_port; }
|
||||
DeviceSpeed speed() const { return m_device_speed; }
|
||||
|
@ -46,7 +47,12 @@ public:
|
|||
|
||||
const USBDeviceDescriptor& device_descriptor() const { return m_device_descriptor; }
|
||||
|
||||
private:
|
||||
USBController& controller() { return *m_controller; }
|
||||
USBController const& controller() const { return *m_controller; }
|
||||
|
||||
protected:
|
||||
Device(NonnullRefPtr<USBController> controller, u8 address, PortNumber port, DeviceSpeed speed, NonnullOwnPtr<Pipe> default_pipe);
|
||||
|
||||
PortNumber m_device_port; // What port is this device attached to
|
||||
DeviceSpeed m_device_speed; // What speed is this device running at
|
||||
u8 m_address { 0 }; // USB address assigned to this device
|
||||
|
@ -58,5 +64,11 @@ private:
|
|||
|
||||
NonnullRefPtr<USBController> m_controller;
|
||||
NonnullOwnPtr<Pipe> m_default_pipe; // Default communication pipe (endpoint0) used during enumeration
|
||||
|
||||
private:
|
||||
IntrusiveListNode<Device, NonnullRefPtr<Device>> m_hub_child_node;
|
||||
|
||||
public:
|
||||
using List = IntrusiveList<Device, NonnullRefPtr<Device>, &Device::m_hub_child_node>;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue