mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
16244c490a
We used to allocate major numbers quite randomly, with no common place to look them up if needed. This commit is changing that by placing all major number allocations under a new C++ namespace, in the API/MajorNumberAllocation.h file. We also add the foundations of what is needed before we can publish this information (allocated numbers for block and char devices) to userspace.
30 lines
659 B
C++
30 lines
659 B
C++
/*
|
|
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Kernel/API/MajorNumberAllocation.h>
|
|
#include <Kernel/Devices/CharacterDevice.h>
|
|
#include <Kernel/Security/Random.h>
|
|
|
|
namespace Kernel {
|
|
|
|
class HIDManagement;
|
|
class HIDDevice : public CharacterDevice {
|
|
friend class HIDManagement;
|
|
|
|
protected:
|
|
HIDDevice(MajorAllocation::CharacterDeviceFamily character_device_family, MinorNumber minor)
|
|
: CharacterDevice(character_device_family, minor)
|
|
{
|
|
}
|
|
|
|
EntropySource m_entropy_source;
|
|
|
|
IntrusiveListNode<HIDDevice, NonnullRefPtr<HIDDevice>> m_list_node;
|
|
};
|
|
|
|
}
|