mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:37:35 +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
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…
Add table
Add a link
Reference in a new issue