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

Kernel/USB: Make USBControllers pseudo StorageControllers

This will be needed in the next commit to generate valid LUNs
This commit is contained in:
Hendiadyoin1 2023-09-15 21:12:58 +02:00 committed by Andrew Kaster
parent 4b327bdc95
commit b857c6b92f
2 changed files with 15 additions and 0 deletions

View file

@ -28,9 +28,18 @@ public:
virtual ErrorOr<size_t> submit_bulk_transfer(Transfer& transfer) = 0;
virtual ErrorOr<void> submit_async_interrupt_transfer(NonnullLockRefPtr<Transfer> transfer, u16 ms_interval) = 0;
u32 storage_controller_id() const { return m_storage_controller_id; }
u8 allocate_address();
protected:
USBController();
private:
// Note: We are pseudo storage controller for the sake of generating LUNs
// And do not follow a hardware_relative_controller_id for the controller class "USB",
// as we also have to follow the device id and its internal LUN, leaving no room for that
u32 m_storage_controller_id { 0 };
u8 m_next_device_index { 1 };
IntrusiveListNode<USBController, NonnullLockRefPtr<USBController>> m_controller_list_node;