Kernel/USB: Add control_transfer()
function USB::Device
Some other parts of the USB stack may require us to perform a control transfer. Instead of abusing `friend` to expose the default pipe, let's just expose it via a function.
This commit is contained in:
parent
dac26f89cb
commit
a1df8a1896
Notes:
sideshowbarker
2024-07-18 03:23:00 +09:00
Author: https://github.com/Quaker762 Commit: https://github.com/SerenityOS/serenity/commit/a1df8a1896 Pull-request: https://github.com/SerenityOS/serenity/pull/13688 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/supercomputer7
2 changed files with 7 additions and 0 deletions
|
@ -138,4 +138,9 @@ ErrorOr<void> Device::enumerate_device()
|
|||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<size_t> Device::control_transfer(u8 request_type, u8 request, u16 value, u16 index, u16 length, void* data)
|
||||
{
|
||||
return TRY(m_default_pipe->control_transfer(request_type, request, value, index, length, data));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,8 @@ public:
|
|||
USBController& controller() { return *m_controller; }
|
||||
USBController const& controller() const { return *m_controller; }
|
||||
|
||||
ErrorOr<size_t> control_transfer(u8 request_type, u8 request, u16 value, u16 index, u16 length, void* data);
|
||||
|
||||
protected:
|
||||
Device(NonnullRefPtr<USBController> controller, u8 address, u8 port, DeviceSpeed speed, NonnullOwnPtr<Pipe> default_pipe);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue