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

Kernel/USB: Add support for async & interrupt transfers

Add support for async transfers by using a separate kernel task to poll
a list of active async transfers on a set time interval, and invoke
their user-provided callback function when they are complete. Also add
support for the interrupt class of transfers, building off of this async
functionality.
This commit is contained in:
b14ckcat 2022-10-17 01:22:54 -04:00 committed by Andrew Kaster
parent 1aa16b4dd4
commit 7400eb3640
8 changed files with 181 additions and 62 deletions

View file

@ -23,8 +23,10 @@ public:
virtual ErrorOr<void> stop() = 0;
virtual ErrorOr<void> start() = 0;
virtual void cancel_async_transfer(NonnullLockRefPtr<Transfer> transfer) = 0;
virtual ErrorOr<size_t> submit_control_transfer(Transfer&) = 0;
virtual ErrorOr<size_t> submit_bulk_transfer(Transfer& transfer) = 0;
virtual ErrorOr<void> submit_async_interrupt_transfer(NonnullLockRefPtr<Transfer> transfer, u16 ms_interval) = 0;
u8 allocate_address();