mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
Kernel/SysFS: Adapt USB plug code to work with SysFS patterns
This commit is contained in:
parent
70afa0b171
commit
cdab213750
6 changed files with 36 additions and 47 deletions
|
@ -6,7 +6,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <Kernel/Bus/USB/USBDevice.h>
|
||||
#include <Kernel/Bus/USB/USBHub.h>
|
||||
#include <Kernel/FileSystem/SysFS/Component.h>
|
||||
#include <Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.h>
|
||||
#include <Kernel/Locking/Spinlock.h>
|
||||
|
@ -20,15 +22,11 @@ public:
|
|||
|
||||
virtual StringView name() const override { return "usb"sv; }
|
||||
|
||||
void plug(USB::Device&);
|
||||
void unplug(USB::Device&);
|
||||
void plug(Badge<USB::Hub>, SysFSUSBDeviceInformation&);
|
||||
void unplug(Badge<USB::Hub>, SysFSUSBDeviceInformation&);
|
||||
|
||||
private:
|
||||
explicit SysFSUSBBusDirectory(SysFSBusDirectory&);
|
||||
|
||||
RefPtr<SysFSUSBDeviceInformation> device_node_for(USB::Device& device);
|
||||
|
||||
IntrusiveList<&SysFSUSBDeviceInformation::m_list_node> m_device_nodes;
|
||||
mutable Spinlock m_lock;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue