1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-08 20:17:34 +00:00
serenity/Kernel/Bus/USB/UHCI/UHCIRootHub.h
Jesse Buhagiar 4abf399a74 Kernel/USB: Move UHCI related structures to subdirectory
The number of UHCI related files is starting to expand to the point
where it's best if we move this into their own subdirectory. It'll
also make it easier to manage when we decide to add some more
controller types (whenever that may be)
2021-08-19 18:42:07 +02:00

39 lines
869 B
C++

/*
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/NonnullOwnPtr.h>
#include <AK/NonnullRefPtr.h>
#include <Kernel/Bus/USB/USBHub.h>
#include <Kernel/Bus/USB/USBTransfer.h>
#include <Kernel/KResult.h>
namespace Kernel::USB {
class UHCIController;
class UHCIRootHub {
public:
static KResultOr<NonnullOwnPtr<UHCIRootHub>> try_create(NonnullRefPtr<UHCIController>);
UHCIRootHub(NonnullRefPtr<UHCIController>);
~UHCIRootHub() = default;
KResult setup(Badge<UHCIController>);
u8 device_address() const { return m_hub->address(); }
KResultOr<size_t> handle_control_transfer(Transfer& transfer);
void check_for_port_updates() { m_hub->check_for_port_updates(); }
private:
NonnullRefPtr<UHCIController> m_uhci_controller;
RefPtr<Hub> m_hub;
};
}