Kernel: Remove support for custom xHCI speed_ids

This gets really weird with hubs and I don't think even linux handles
them.
This commit is contained in:
2025-02-06 21:38:30 +02:00
parent f9b70d1b5b
commit 242ed4a3c2
6 changed files with 42 additions and 45 deletions

View File

@@ -4,8 +4,8 @@
#include <BAN/NoCopyMove.h>
#include <kernel/Memory/DMARegion.h>
#include <kernel/USB/USBManager.h>
#include <kernel/USB/Controller.h>
#include <kernel/USB/USBManager.h>
namespace Kernel
{
@@ -69,7 +69,8 @@ namespace Kernel
virtual BAN::ErrorOr<size_t> send_request(const USBDeviceRequest&, paddr_t buffer) = 0;
virtual void send_data_buffer(uint8_t endpoint_id, paddr_t buffer, size_t buffer_len) = 0;
static USB::SpeedClass determine_speed_class(uint64_t bits_per_second);
USB::SpeedClass speed_class() const { return m_speed_class; }
uint8_t depth() const { return m_depth; }
protected:
void handle_stall(uint8_t endpoint_id);

View File

@@ -5,6 +5,7 @@
#include <kernel/Lock/Mutex.h>
#include <kernel/Memory/DMARegion.h>
#include <kernel/ThreadBlocker.h>
#include <kernel/USB/Definitions.h>
#include <kernel/USB/USBManager.h>
#include <kernel/USB/XHCI/Definitions.h>
@@ -25,17 +26,6 @@ namespace Kernel
uint8_t revision_minor { 0 };
uint8_t slot_type { 0 };
uint8_t slot_id { 0 };
uint64_t speed_id_to_speed[0x10] {
0,
12'000'000,
1'500'000,
480'000'000,
5'000'000'000,
10'000'000'000,
5'000'000'000,
10'000'000'000,
};
};
public:
@@ -74,6 +64,9 @@ namespace Kernel
const volatile XHCI::TRB& current_event_trb();
uint8_t speed_class_to_id(USB::SpeedClass speed_class) const;
USB::SpeedClass speed_id_to_class(uint8_t) const;
private:
static constexpr uint32_t m_command_ring_trb_count = 256;
static constexpr uint32_t m_event_ring_trb_count = 252;

View File

@@ -51,8 +51,6 @@ namespace Kernel
void advance_endpoint_enqueue(Endpoint&, bool chain);
static uint64_t calculate_port_bits_per_second(XHCIController&, uint32_t port_id);
private:
static constexpr uint32_t m_transfer_ring_trb_count = PAGE_SIZE / sizeof(XHCI::TRB);