feat: support for USB mass storage devices, hotplugging

This commit is contained in:
daniel committed 2026-05-18 17:47:12 +02:00
1 parent d340e01e56
commit c20579afd3
36 files changed
+1537 -130

No files matched your search

+7 -1
View File
@@ -238,6 +238,7 @@ namespace Drivers::USB::Xhci {
uint8_t InterfaceClass;
uint8_t InterfaceSubClass;
uint8_t InterfaceProtocol;
uint8_t InterfaceNumber;
uint8_t DeviceClass; // bDeviceClass from device descriptor
// Interrupt IN endpoint
@@ -295,7 +296,7 @@ namespace Drivers::USB::Xhci {
bool IsInitialized();
bool HasDeferredWork();
// Deferred hot-plug processing (call from timer tick, not interrupt context)
// Deferred hot-plug processing (call outside interrupt context)
void ProcessDeferredWork();
// Send a command on the command ring, wait for completion.
@@ -318,6 +319,11 @@ namespace Drivers::USB::Xhci {
void QueueBulkInTransfer(uint8_t slotId, uint8_t* data, uint64_t dataPhys, uint32_t length);
void QueueBulkOutTransfer(uint8_t slotId, uint8_t* data, uint64_t dataPhys, uint32_t length);
// Queue a bulk transfer and wait for its completion. Used by storage-style
// class drivers that need command/response ordering on bulk pipes.
uint32_t BulkTransfer(uint8_t slotId, bool dirIn, void* data, uint64_t dataPhys,
uint32_t length, uint32_t* actualLength = nullptr);
// Register a transfer callback for a specific slot (used by non-HID class drivers)
void RegisterTransferCallback(uint8_t slotId, TransferCallback cb);