mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel/USB: Add new Driver
base class
Co-Authored-By: Liav A <liavalb@gmail.com> Co-Authored-By: Leon Albrecht <leon2002.la@gmail.com>
This commit is contained in:
parent
9939b028c6
commit
8883da9586
Notes:
sideshowbarker
2024-07-17 02:38:39 +09:00
Author: https://github.com/Quaker762 Commit: https://github.com/SerenityOS/serenity/commit/8883da9586 Pull-request: https://github.com/SerenityOS/serenity/pull/21090 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/BertalanD Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/kleinesfilmroellchen ✅ Reviewed-by: https://github.com/supercomputer7 ✅
1 changed files with 35 additions and 0 deletions
35
Kernel/Bus/USB/Drivers/USBDriver.h
Normal file
35
Kernel/Bus/USB/Drivers/USBDriver.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Jesse Buhagiar <jesse.buhagiar@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/AtomicRefCounted.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
|
||||
namespace Kernel::USB {
|
||||
|
||||
class Device;
|
||||
struct USBDeviceDescriptor;
|
||||
class USBInterface;
|
||||
|
||||
class Driver : public AtomicRefCounted<Driver> {
|
||||
public:
|
||||
Driver(StringView name)
|
||||
: m_driver_name(name)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~Driver() = default;
|
||||
|
||||
virtual ErrorOr<void> probe(USB::Device&) = 0;
|
||||
virtual void detach(USB::Device&) = 0;
|
||||
StringView name() const { return m_driver_name; }
|
||||
|
||||
protected:
|
||||
StringView const m_driver_name;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue