Kernel: Allow USB devices to handle STALL conditions

This commit is contained in:
2024-11-22 22:15:22 +02:00
parent 8e624ca85a
commit e620068416
7 changed files with 29 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ namespace Kernel
virtual BAN::ErrorOr<void> initialize() { return {}; };
virtual void handle_stall(uint8_t endpoint_id) = 0;
virtual void handle_input_data(size_t byte_count, uint8_t endpoint_id) = 0;
};
@@ -71,6 +72,7 @@ namespace Kernel
static USB::SpeedClass determine_speed_class(uint64_t bits_per_second);
protected:
void handle_stall(uint8_t endpoint_id);
void handle_input_data(size_t byte_count, uint8_t endpoint_id);
virtual BAN::ErrorOr<void> initialize_control_endpoint() = 0;

View File

@@ -75,6 +75,7 @@ namespace Kernel
};
public:
void handle_stall(uint8_t endpoint_id) override;
void handle_input_data(size_t byte_count, uint8_t endpoint_id) override;
private:

View File

@@ -15,6 +15,7 @@ namespace Kernel
BAN_NON_MOVABLE(USBMassStorageDriver);
public:
void handle_stall(uint8_t endpoint_id) override;
void handle_input_data(size_t byte_count, uint8_t endpoint_id) override;
BAN::ErrorOr<size_t> send_bytes(paddr_t, size_t count);